소스 검색

docs(core): Add lots of documentation to core sources

Michael Bromley 6 년 전
부모
커밋
18e842fd7d
49개의 변경된 파일513개의 추가작업 그리고 200개의 파일을 삭제
  1. 18 4
      packages/common/src/generated-shop-types.ts
  2. 18 4
      packages/common/src/generated-types.ts
  3. 9 5
      packages/common/src/shared-types.ts
  4. 18 4
      packages/core/e2e/graphql/generated-e2e-admin-types.ts
  5. 18 4
      packages/core/e2e/graphql/generated-e2e-shop-types.ts
  6. 8 4
      packages/core/src/api/decorators/allow.decorator.ts
  7. 15 0
      packages/core/src/api/decorators/api.decorator.ts
  8. 13 1
      packages/core/src/api/decorators/request-context.decorator.ts
  9. 6 1
      packages/core/src/api/schema/common/currency-code.graphql
  10. 6 1
      packages/core/src/api/schema/common/language-code.graphql
  11. 8 2
      packages/core/src/api/schema/common/permission.graphql
  12. 2 4
      packages/core/src/bootstrap.ts
  13. 46 0
      packages/core/src/common/configurable-operation.ts
  14. 116 6
      packages/core/src/common/error/errors.ts
  15. 1 1
      packages/core/src/config/asset-naming-strategy/asset-naming-strategy.ts
  16. 1 0
      packages/core/src/config/custom-field/custom-field-types.ts
  17. 3 2
      packages/core/src/config/entity-id-strategy/entity-id-strategy.ts
  18. 1 0
      packages/core/src/config/order-merge-strategy/merge-orders-strategy.ts
  19. 1 0
      packages/core/src/config/order-merge-strategy/use-existing-strategy.ts
  20. 1 0
      packages/core/src/config/order-merge-strategy/use-guest-if-existing-empty-strategy.ts
  21. 1 0
      packages/core/src/config/order-merge-strategy/use-guest-strategy.ts
  22. 27 5
      packages/core/src/config/payment-method/payment-method-handler.ts
  23. 1 1
      packages/core/src/config/shipping-method/shipping-calculator.ts
  24. 1 1
      packages/core/src/config/shipping-method/shipping-eligibility-checker.ts
  25. 11 10
      packages/core/src/config/tax/tax-calculation-strategy.ts
  26. 53 59
      packages/core/src/config/vendure-config.ts
  27. 1 2
      packages/core/src/event-bus/event-bus.ts
  28. 1 0
      packages/core/src/event-bus/events/account-registration-event.ts
  29. 1 0
      packages/core/src/event-bus/events/attempted-login-event.ts
  30. 1 0
      packages/core/src/event-bus/events/catalog-modification-event.ts
  31. 1 0
      packages/core/src/event-bus/events/collection-modification-event.ts
  32. 1 0
      packages/core/src/event-bus/events/identifier-change-event.ts
  33. 1 0
      packages/core/src/event-bus/events/identifier-change-request-event.ts
  34. 1 0
      packages/core/src/event-bus/events/login-event.ts
  35. 1 0
      packages/core/src/event-bus/events/logout-event.ts
  36. 1 0
      packages/core/src/event-bus/events/order-state-transition-event.ts
  37. 1 0
      packages/core/src/event-bus/events/password-reset-event.ts
  38. 1 0
      packages/core/src/event-bus/events/payment-state-transition-event.ts
  39. 1 0
      packages/core/src/event-bus/events/refund-state-transition-event.ts
  40. 1 0
      packages/core/src/event-bus/events/tax-rate-modification-event.ts
  41. 1 2
      packages/core/src/event-bus/vendure-event.ts
  42. 7 6
      packages/core/src/i18n/i18n-error.ts
  43. 1 1
      packages/core/src/plugin/default-search-plugin/default-search-plugin.ts
  44. 1 0
      packages/core/src/plugin/plugin-common.module.ts
  45. 34 32
      packages/core/src/plugin/plugin-utils.ts
  46. 45 38
      packages/core/src/plugin/vendure-plugin.ts
  47. 7 0
      packages/core/src/service/helpers/tax-calculator/tax-calculator.ts
  48. 0 0
      schema-admin.json
  49. 0 0
      schema-shop.json

+ 18 - 4
packages/common/src/generated-shop-types.ts

@@ -295,7 +295,11 @@ export type CreateCustomerInput = {
     customFields?: Maybe<Scalars['JSON']>;
 };
 
-/** ISO 4217 currency code */
+/** @description
+ * ISO 4217 currency code
+ *
+ * @docsCategory common
+ */
 export enum CurrencyCode {
     /** United Arab Emirates dirham */
     AED = 'AED',
@@ -878,7 +882,11 @@ export type IntCustomFieldConfig = CustomField & {
     step?: Maybe<Scalars['Int']>;
 };
 
-/** ISO 639-1 language code */
+/** @description
+ * ISO 639-1 language code
+ *
+ * @docsCategory common
+ */
 export enum LanguageCode {
     /** Afar */
     aa = 'aa',
@@ -1588,11 +1596,17 @@ export type PaymentMethod = Node & {
     configArgs: Array<ConfigArg>;
 };
 
-/**  Permissions for administrators and customers  */
+/** "
+ * @description
+ * Permissions for administrators and customers. Used to control access to
+ * GraphQL resolvers via the {@link Allow} decorator.
+ *
+ * @docsCategory common
+ */
 export enum Permission {
     /**  The Authenticated role means simply that the user is logged in  */
     Authenticated = 'Authenticated',
-    /**  SuperAdmin can perform the most sensitive tasks  */
+    /**  SuperAdmin can perform the most sensitive tasks */
     SuperAdmin = 'SuperAdmin',
     /**  Owner means the user owns this entity, e.g. a Customer's own Order */
     Owner = 'Owner',

+ 18 - 4
packages/common/src/generated-types.ts

@@ -546,7 +546,11 @@ export type CreateZoneInput = {
   memberIds?: Maybe<Array<Scalars['ID']>>,
 };
 
-/** ISO 4217 currency code */
+/** @description
+ * ISO 4217 currency code
+ * 
+ * @docsCategory common
+ */
 export enum CurrencyCode {
   /** United Arab Emirates dirham */
   AED = 'AED',
@@ -1223,7 +1227,11 @@ export enum JobState {
 }
 
 
-/** ISO 639-1 language code */
+/** @description
+ * ISO 639-1 language code
+ * 
+ * @docsCategory common
+ */
 export enum LanguageCode {
   /** Afar */
   aa = 'aa',
@@ -2297,11 +2305,17 @@ export type PaymentMethodSortParameter = {
   code?: Maybe<SortOrder>,
 };
 
-/**  Permissions for administrators and customers  */
+/** "
+ * @description
+ * Permissions for administrators and customers. Used to control access to
+ * GraphQL resolvers via the {@link Allow} decorator.
+ * 
+ * @docsCategory common
+ */
 export enum Permission {
   /**  The Authenticated role means simply that the user is logged in  */
   Authenticated = 'Authenticated',
-  /**  SuperAdmin can perform the most sensitive tasks  */
+  /**  SuperAdmin can perform the most sensitive tasks */
   SuperAdmin = 'SuperAdmin',
   /**  Owner means the user owns this entity, e.g. a Customer's own Order */
   Owner = 'Owner',

+ 9 - 5
packages/common/src/shared-types.ts

@@ -34,8 +34,7 @@ export type PaginatedList<T> = {
  * An entity ID. Depending on the configured {@link EntityIdStrategy}, it will be either
  * a `string` or a `number`;
  *
- * @docsCategory entities
- * @docsWeight 0
+ * @docsCategory common
  */
 export type ID = string | number;
 
@@ -48,12 +47,17 @@ export type ID = string | number;
 export type CustomFieldType = 'string' | 'localeString' | 'int' | 'float' | 'boolean' | 'datetime';
 
 /**
- * Certain entities allow arbitrary configuration arguments to be specified which can then
- * be set in the admin-ui and used in the business logic of the app. These are the valid
- * data types of such arguments. The data type influences:
+ * @description
+ * Certain entities (those which implement {@link ConfigurableOperationDef}) allow arbitrary
+ * configuration arguments to be specified which can then be set in the admin-ui and used in
+ * the business logic of the app. These are the valid data types of such arguments.
+ * The data type influences:
  *
  * 1. How the argument form field is rendered in the admin-ui
  * 2. The JavaScript type into which the value is coerced before being passed to the business logic.
+ *
+ * @docsCategory common
+ * @docsPage Configurable Operations
  */
 export type ConfigArgType = 'string' | 'int' | 'float' | 'boolean' | 'datetime' | 'facetValueIds';
 

+ 18 - 4
packages/core/e2e/graphql/generated-e2e-admin-types.ts

@@ -546,7 +546,11 @@ export type CreateZoneInput = {
     memberIds?: Maybe<Array<Scalars['ID']>>;
 };
 
-/** ISO 4217 currency code */
+/** @description
+ * ISO 4217 currency code
+ *
+ * @docsCategory common
+ */
 export enum CurrencyCode {
     /** United Arab Emirates dirham */
     AED = 'AED',
@@ -1226,7 +1230,11 @@ export enum JobState {
     FAILED = 'FAILED',
 }
 
-/** ISO 639-1 language code */
+/** @description
+ * ISO 639-1 language code
+ *
+ * @docsCategory common
+ */
 export enum LanguageCode {
     /** Afar */
     aa = 'aa',
@@ -2232,11 +2240,17 @@ export type PaymentMethodSortParameter = {
     code?: Maybe<SortOrder>;
 };
 
-/**  Permissions for administrators and customers  */
+/** "
+ * @description
+ * Permissions for administrators and customers. Used to control access to
+ * GraphQL resolvers via the {@link Allow} decorator.
+ *
+ * @docsCategory common
+ */
 export enum Permission {
     /**  The Authenticated role means simply that the user is logged in  */
     Authenticated = 'Authenticated',
-    /**  SuperAdmin can perform the most sensitive tasks  */
+    /**  SuperAdmin can perform the most sensitive tasks */
     SuperAdmin = 'SuperAdmin',
     /**  Owner means the user owns this entity, e.g. a Customer's own Order */
     Owner = 'Owner',

+ 18 - 4
packages/core/e2e/graphql/generated-e2e-shop-types.ts

@@ -295,7 +295,11 @@ export type CreateCustomerInput = {
     customFields?: Maybe<Scalars['JSON']>;
 };
 
-/** ISO 4217 currency code */
+/** @description
+ * ISO 4217 currency code
+ *
+ * @docsCategory common
+ */
 export enum CurrencyCode {
     /** United Arab Emirates dirham */
     AED = 'AED',
@@ -878,7 +882,11 @@ export type IntCustomFieldConfig = CustomField & {
     step?: Maybe<Scalars['Int']>;
 };
 
-/** ISO 639-1 language code */
+/** @description
+ * ISO 639-1 language code
+ *
+ * @docsCategory common
+ */
 export enum LanguageCode {
     /** Afar */
     aa = 'aa',
@@ -1588,11 +1596,17 @@ export type PaymentMethod = Node & {
     configArgs: Array<ConfigArg>;
 };
 
-/**  Permissions for administrators and customers  */
+/** "
+ * @description
+ * Permissions for administrators and customers. Used to control access to
+ * GraphQL resolvers via the {@link Allow} decorator.
+ *
+ * @docsCategory common
+ */
 export enum Permission {
     /**  The Authenticated role means simply that the user is logged in  */
     Authenticated = 'Authenticated',
-    /**  SuperAdmin can perform the most sensitive tasks  */
+    /**  SuperAdmin can perform the most sensitive tasks */
     SuperAdmin = 'SuperAdmin',
     /**  Owner means the user owns this entity, e.g. a Customer's own Order */
     Owner = 'Owner',

+ 8 - 4
packages/core/src/api/decorators/allow.decorator.ts

@@ -4,16 +4,20 @@ import { Permission } from '@vendure/common/lib/generated-types';
 export const PERMISSIONS_METADATA_KEY = '__permissions__';
 
 /**
+ * @description
  * Attatches metadata to the resolver defining which permissions are required to execute the
- * operation.
+ * operation, using one or more {@link Permission} values.
  *
  * @example
- * ```
- *  @Allow(Permission.SuperAdmin)
- *  @Query()
+ * ```TypeScript
+ *  \@Allow(Permission.SuperAdmin)
+ *  \@Query()
  *  getAdministrators() {
  *      // ...
  *  }
  * ```
+ *
+ * @docsCategory request
+ * @docsPage Decorators
  */
 export const Allow = (...permissions: Permission[]) => SetMetadata(PERMISSIONS_METADATA_KEY, permissions);

+ 15 - 0
packages/core/src/api/decorators/api.decorator.ts

@@ -4,9 +4,24 @@ import { GraphQLResolveInfo } from 'graphql';
 import { getApiType } from '../common/get-api-type';
 
 /**
+ * @description
  * Resolver param decorator which returns which Api the request came though.
  * This is useful because sometimes the same resolver will have different behaviour
  * depending whether it is being called from the shop API or the admin API.
+ *
+ * Returns a string of type {@link ApiType}.
+ *
+ * @example
+ * ```TypeScript
+ *  \@Query()
+ *  getAdministrators(\@Api() apiType: ApiType) {
+ *      if (apiType === 'admin') {
+ *          // ...
+ *      }
+ *  }
+ * ```
+ * @docsCategory request
+ * @docsPage Decorators
  */
 export const Api = createParamDecorator((data, [root, args, ctx, info]) => {
     return getApiType(info);

+ 13 - 1
packages/core/src/api/decorators/request-context.decorator.ts

@@ -3,8 +3,20 @@ import { createParamDecorator } from '@nestjs/common';
 import { REQUEST_CONTEXT_KEY } from '../common/request-context.service';
 
 /**
- * Resolver param decorator which extracts the RequestContext from the incoming
+ * @description
+ * Resolver param decorator which extracts the {@link RequestContext} from the incoming
  * request object.
+ *
+ * @example
+ * ```TypeScript
+ *  \@Query()
+ *  getAdministrators(\@Ctx() ctx: RequestContext) {
+ *      // ...
+ *  }
+ * ```
+ *
+ * @docsCategory request
+ * @docsPage Decorators
  */
 export const Ctx = createParamDecorator((data, arg) => {
     if (Array.isArray(arg)) {

+ 6 - 1
packages/core/src/api/schema/common/currency-code.graphql

@@ -1,4 +1,9 @@
-"ISO 4217 currency code"
+"""
+@description
+ISO 4217 currency code
+
+@docsCategory common
+"""
 enum CurrencyCode {
     "United Arab Emirates dirham"
     AED

+ 6 - 1
packages/core/src/api/schema/common/language-code.graphql

@@ -1,4 +1,9 @@
-"ISO 639-1 language code"
+"""
+@description
+ISO 639-1 language code
+
+@docsCategory common
+"""
 enum LanguageCode {
     "Afar"
     aa

+ 8 - 2
packages/core/src/api/schema/common/permission.graphql

@@ -1,8 +1,14 @@
-" Permissions for administrators and customers "
+""""
+@description
+Permissions for administrators and customers. Used to control access to
+GraphQL resolvers via the {@link Allow} decorator.
+
+@docsCategory common
+"""
 enum Permission {
     " The Authenticated role means simply that the user is logged in "
     Authenticated
-    " SuperAdmin can perform the most sensitive tasks "
+    " SuperAdmin can perform the most sensitive tasks"
     SuperAdmin
     " Owner means the user owns this entity, e.g. a Customer's own Order"
     Owner

+ 2 - 4
packages/core/src/bootstrap.ts

@@ -36,8 +36,7 @@ export type VendureBootstrapFunction = (config: VendureConfig) => Promise<INestA
  * });
  * ```
  * @docsCategory
- * @docsWeight 0
- */
+ * */
 export async function bootstrap(userConfig: Partial<VendureConfig>): Promise<INestApplication> {
     const config = await preBootstrapConfig(userConfig);
     Logger.useLogger(config.logger);
@@ -81,8 +80,7 @@ export async function bootstrap(userConfig: Partial<VendureConfig>): Promise<INe
  * });
  * ```
  * @docsCategory worker
- * @docsWeight 0
- */
+ * */
 export async function bootstrapWorker(userConfig: Partial<VendureConfig>): Promise<INestMicroservice> {
     if (userConfig.workerOptions && userConfig.workerOptions.runInMainProcess === true) {
         Logger.useLogger(userConfig.logger || new DefaultLogger());

+ 46 - 0
packages/core/src/common/configurable-operation.ts

@@ -16,6 +16,22 @@ import { RequestContext } from '../api/common/request-context';
 import { DEFAULT_LANGUAGE_CODE } from './constants';
 import { InternalServerError } from './error/errors';
 
+/**
+ * @description
+ * An array of string values in a given {@link LanguageCode}, used to define human-readable string values.
+ *
+ * @example
+ * ```TypeScript
+ * const title: LocalizedStringArray = [
+ *   { languageCode: LanguageCode.en, value: 'English Title' },
+ *   { languageCode: LanguageCode.de, value: 'German Title' },
+ *   { languageCode: LanguageCode.zh, value: 'Chinese Title' },
+ * ]
+ * ```
+ *
+ * @docsCategory common
+ * @docsPage Configurable Operations
+ */
 export type LocalizedStringArray = Array<Omit<LocalizedString, '__typename'>>;
 
 export interface ConfigArgCommonDef<T extends ConfigArgType> {
@@ -41,6 +57,32 @@ export type ConfigArgDef<T extends ConfigArgType> = T extends 'string'
     ? ConfigArgCommonDef<'int'> & IntArgConfig
     : ConfigArgCommonDef<T> & WithArgConfig<never>;
 
+/**
+ * @description
+ * A object which defines the configurable arguments which may be passed to
+ * functions in those classes which implement the {@link ConfigurableOperationDef} interface.
+ *
+ * @example
+ * ```TypeScript
+ * {
+ *   operator: {
+ *     type: 'string',
+ *     config: {
+ *       options: [
+ *         { value: 'startsWith' },
+ *         { value: 'endsWith' },
+ *         { value: 'contains' },
+ *         { value: 'doesNotContain' },
+ *       ],
+ *     },
+ *   },
+ *   term: { type: 'string' },
+ * }
+ * ```
+ *
+ * @docsCategory common
+ * @docsPage Configurable Operations
+ */
 export type ConfigArgs<T extends ConfigArgType> = {
     [name: string]: ConfigArgDef<T>;
 };
@@ -63,8 +105,12 @@ export type ConfigArgValues<T extends ConfigArgs<any>> = {
 };
 
 /**
+ * @description
  * Defines a ConfigurableOperation, which is a method which can be configured
  * by the Administrator via the Admin API.
+ *
+ * @docsCategory common
+ * @docsPage Configurable Operations
  */
 export interface ConfigurableOperationDef {
     code: string;

+ 116 - 6
packages/core/src/common/error/errors.ts

@@ -3,96 +3,206 @@ import { ID } from '@vendure/common/lib/shared-types';
 import { coreEntitiesMap } from '../../entity/entities';
 import { I18nError } from '../../i18n/i18n-error';
 
+/**
+ * @description
+ * This error should be thrown when some unexpected and exceptional case is encountered.
+ *
+ * @docsCategory errors
+ * @docsPage Error Types
+ */
 export class InternalServerError extends I18nError {
     constructor(message: string, variables: { [key: string]: string | number } = {}) {
         super(message, variables, 'INTERNAL_SERVER_ERROR');
     }
 }
 
+/**
+ * @description
+ * This error should be thrown when user input is not as expected.
+ *
+ * @docsCategory errors
+ * @docsPage Error Types
+ */
 export class UserInputError extends I18nError {
     constructor(message: string, variables: { [key: string]: string | number } = {}) {
         super(message, variables, 'USER_INPUT_ERROR');
     }
 }
 
+/**
+ * @description
+ * This error should be thrown when an operation is attempted which is not allowed.
+ *
+ * @docsCategory errors
+ * @docsPage Error Types
+ */
 export class IllegalOperationError extends I18nError {
     constructor(message: string, variables: { [key: string]: string | number } = {}) {
         super(message, variables, 'ILLEGAL_OPERATION');
     }
 }
 
+/**
+ * @description
+ * This error should be thrown when the user's authentication credentials do not match.
+ *
+ * @docsCategory errors
+ * @docsPage Error Types
+ */
 export class UnauthorizedError extends I18nError {
     constructor() {
         super('error.unauthorized', {}, 'UNAUTHORIZED');
     }
 }
 
+/**
+ * @description
+ * This error should be thrown when a user attempts to access a resource which is outside of
+ * his or her privileges.
+ *
+ * @docsCategory errors
+ * @docsPage Error Types
+ */
 export class ForbiddenError extends I18nError {
     constructor() {
         super('error.forbidden', {}, 'FORBIDDEN');
     }
 }
 
-export class NoValidChannelError extends I18nError {
-    constructor() {
-        super('error.no-valid-channel-specified', {}, 'NO_VALID_CHANNEL');
-    }
-}
-
+/**
+ * @description
+ * This error should be thrown when a {@link Channel} cannot be found based on the provided
+ * channel token.
+ *
+ * @docsCategory errors
+ * @docsPage Error Types
+ */
 export class ChannelNotFoundError extends I18nError {
     constructor(token: string) {
         super('error.channel-not-found', { token }, 'CHANNEL_NOT_FOUND');
     }
 }
 
+/**
+ * @description
+ * This error should be thrown when an entity cannot be found in the database, i.e. no entity of
+ * the given entityName (Product, User etc.) exists with the provided id.
+ *
+ * @docsCategory errors
+ * @docsPage Error Types
+ */
 export class EntityNotFoundError extends I18nError {
     constructor(entityName: keyof typeof coreEntitiesMap, id: ID) {
         super('error.entity-with-id-not-found', { entityName, id }, 'ENTITY_NOT_FOUND');
     }
 }
 
+/**
+ * @description
+ * This error should be thrown when the verification token (used to verify a Customer's email
+ * address) is either invalid or does not match any expected tokens.
+ *
+ * @docsCategory errors
+ * @docsPage Error Types
+ */
 export class VerificationTokenError extends I18nError {
     constructor() {
         super('error.verification-token-not-recognized', {}, 'BAD_VERIFICATION_TOKEN');
     }
 }
 
+/**
+ * @description
+ * This error should be thrown when the verification token (used to verify a Customer's email
+ * address) is valid, but has expired according to the `verificationTokenDuration` setting
+ * in {@link AuthOptions}.
+ *
+ * @docsCategory errors
+ * @docsPage Error Types
+ */
 export class VerificationTokenExpiredError extends I18nError {
     constructor() {
         super('error.verification-token-has-expired', {}, 'EXPIRED_VERIFICATION_TOKEN');
     }
 }
 
+/**
+ * @description
+ * This error should be thrown when an error occurs trying to reset a Customer's password.
+ *
+ * @docsCategory errors
+ * @docsPage Error Types
+ */
 export class PasswordResetTokenError extends I18nError {
     constructor() {
         super('error.password-reset-token-not-recognized', {}, 'BAD_PASSWORD_RESET_TOKEN');
     }
 }
 
+/**
+ * @description
+ * This error should be thrown when an error occurs trying to reset a Customer's password
+ * by reason of the token having expired.
+ *
+ * @docsCategory errors
+ * @docsPage Error Types
+ */
 export class PasswordResetTokenExpiredError extends I18nError {
     constructor() {
         super('error.password-reset-token-has-expired', {}, 'EXPIRED_PASSWORD_RESET_TOKEN');
     }
 }
 
+/**
+ * @description
+ * This error should be thrown when an error occurs when attempting to update a User's identifier
+ * (e.g. change email address).
+ *
+ * @docsCategory errors
+ * @docsPage Error Types
+ */
 export class IdentifierChangeTokenError extends I18nError {
     constructor() {
         super('error.identifier-change-token-not-recognized', {}, 'EXPIRED_IDENTIFIER_CHANGE_TOKEN');
     }
 }
 
+/**
+ * @description
+ * This error should be thrown when an error occurs when attempting to update a User's identifier
+ * (e.g. change email address) by reason of the token having expired.
+ *
+ * @docsCategory errors
+ * @docsPage Error Types
+ */
 export class IdentifierChangeTokenExpiredError extends I18nError {
     constructor() {
         super('error.identifier-change-token-has-expired', {}, 'EXPIRED_IDENTIFIER_CHANGE_TOKEN');
     }
 }
 
+/**
+ * @description
+ * This error should be thrown when the `requireVerification` in {@link AuthOptions} is set to
+ * `true` and an unverified user attempts to authenticate.
+ *
+ * @docsCategory errors
+ * @docsPage Error Types
+ */
 export class NotVerifiedError extends I18nError {
     constructor() {
         super('error.email-address-not-verified', {}, 'NOT_VERIFIED');
     }
 }
 
+/**
+ * @description
+ * This error should be thrown when the number or OrderItems in an Order exceeds the limit
+ * specified by the `orderItemsLimit` setting in {@link OrderOptions}.
+ *
+ * @docsCategory errors
+ * @docsPage Error Types
+ */
 export class OrderItemsLimitError extends I18nError {
     constructor(maxItems: number) {
         super('error.order-items-limit-exceeded', { maxItems }, 'ORDER_ITEMS_LIMIT_EXCEEDED');

+ 1 - 1
packages/core/src/config/asset-naming-strategy/asset-naming-strategy.ts

@@ -21,7 +21,7 @@ export interface AssetNamingStrategy {
 
     /**
      * @description
-     * Given the source file name generated in the {@link generateSourceFileName} method, this method
+     * Given the source file name generated in the `generateSourceFileName` method, this method
      * should generate the file name of the preview image.
      *
      * The same mechanism of checking for conflicts is used as described above.

+ 1 - 0
packages/core/src/config/custom-field/custom-field-types.ts

@@ -50,6 +50,7 @@ export type DateTimeCustomFieldConfig = TypedCustomFieldConfig<'datetime', Graph
 /**
  * @description
  * An object used to configure a custom field.
+ *
  * @docsCategory custom-fields
  */
 export type CustomFieldConfig =

+ 3 - 2
packages/core/src/config/entity-id-strategy/entity-id-strategy.ts

@@ -7,6 +7,7 @@ import { ID } from '@vendure/common/lib/shared-types';
  * uuid string.
  *
  * @docsCategory entities
+ * @docsPage Entity Configuration
  */
 export type PrimaryKeyType = 'increment' | 'uuid';
 
@@ -17,8 +18,8 @@ export type PrimaryKeyType = 'increment' | 'uuid';
  * service layer.
  *
  * @docsCategory entities
- * @docsWeight 1
- */
+ * @docsPage Entity Configuration
+ * */
 export interface EntityIdStrategy<T extends ID = ID> {
     readonly primaryKeyType: PrimaryKeyType;
     encodeId: (primaryKey: T) => string;

+ 1 - 0
packages/core/src/config/order-merge-strategy/merge-orders-strategy.ts

@@ -9,6 +9,7 @@ import { OrderMergeStrategy } from './order-merge-strategy';
  * existing Order, the guest Order quantity will replace that of the existing Order.
  *
  * @docsCategory orders
+ * @docsPage Merge Strategies
  */
 export class MergeOrdersStrategy implements OrderMergeStrategy {
     merge(guestOrder: Order, existingOrder: Order): OrderLine[] {

+ 1 - 0
packages/core/src/config/order-merge-strategy/use-existing-strategy.ts

@@ -8,6 +8,7 @@ import { OrderMergeStrategy } from './order-merge-strategy';
  * The guest order is discarded and the existing order is used as the active order.
  *
  * @docsCategory orders
+ * @docsPage Merge Strategies
  */
 export class UseExistingStrategy implements OrderMergeStrategy {
     merge(guestOrder: Order, existingOrder: Order): OrderLine[] {

+ 1 - 0
packages/core/src/config/order-merge-strategy/use-guest-if-existing-empty-strategy.ts

@@ -8,6 +8,7 @@ import { OrderMergeStrategy } from './order-merge-strategy';
  * If the existing order is empty, then the guest order is used. Otherwise the existing order is used.
  *
  * @docsCategory orders
+ * @docsPage Merge Strategies
  */
 export class UseGuestIfExistingEmptyStrategy implements OrderMergeStrategy {
     merge(guestOrder: Order, existingOrder: Order): OrderLine[] {

+ 1 - 0
packages/core/src/config/order-merge-strategy/use-guest-strategy.ts

@@ -8,6 +8,7 @@ import { OrderMergeStrategy } from './order-merge-strategy';
  * Any existing order is discarded and the guest order is set as the active order.
  *
  * @docsCategory orders
+ * @docsPage Merge Strategies
  */
 export class UseGuestStrategy implements OrderMergeStrategy {
     merge(guestOrder: Order, existingOrder: Order): OrderLine[] {

+ 27 - 5
packages/core/src/config/payment-method/payment-method-handler.ts

@@ -29,6 +29,7 @@ export type OnTransitionStartReturnType = ReturnType<Required<StateMachineConfig
  * return value used to determine whether the transition can occur.
  *
  * @docsCategory payment
+ * @docsPage Payment Method Types
  */
 export type OnTransitionStartFn<T extends PaymentMethodArgs> = (
     fromState: PaymentState,
@@ -42,6 +43,7 @@ export type OnTransitionStartFn<T extends PaymentMethodArgs> = (
  * This object is the return value of the {@link CreatePaymentFn}.
  *
  * @docsCategory payment
+ * @docsPage Payment Method Types
  */
 export interface CreatePaymentResult {
     amount: number;
@@ -56,6 +58,7 @@ export interface CreatePaymentResult {
  * This object is the return value of the {@link CreatePaymentFn} when there has been an error.
  *
  * @docsCategory payment
+ * @docsPage Payment Method Types
  */
 export interface CreatePaymentErrorResult {
     amount: number;
@@ -70,6 +73,7 @@ export interface CreatePaymentErrorResult {
  * This object is the return value of the {@link CreateRefundFn}.
  *
  * @docsCategory payment
+ * @docsPage Payment Method Types
  */
 export interface CreateRefundResult {
     state: RefundState;
@@ -77,6 +81,13 @@ export interface CreateRefundResult {
     metadata?: PaymentMetadata;
 }
 
+/**
+ * @description
+ * This object is the return value of the {@link SettlePaymentFn}
+ *
+ * @docsCategory payment
+ * @docsPage Payment Method Types
+ */
 export interface SettlePaymentResult {
     success: boolean;
     errorMessage?: string;
@@ -88,6 +99,7 @@ export interface SettlePaymentResult {
  * This function contains the logic for creating a payment. See {@link PaymentMethodHandler} for an example.
  *
  * @docsCategory payment
+ * @docsPage Payment Method Types
  */
 export type CreatePaymentFn<T extends PaymentMethodArgs> = (
     order: Order,
@@ -100,6 +112,7 @@ export type CreatePaymentFn<T extends PaymentMethodArgs> = (
  * This function contains the logic for settling a payment. See {@link PaymentMethodHandler} for an example.
  *
  * @docsCategory payment
+ * @docsPage Payment Method Types
  */
 export type SettlePaymentFn<T extends PaymentMethodArgs> = (
     order: Order,
@@ -109,9 +122,10 @@ export type SettlePaymentFn<T extends PaymentMethodArgs> = (
 
 /**
  * @description
- * This function contains the logic for creating a payment. See {@link PaymentMethodHandler} for an example.
+ * This function contains the logic for creating a refund. See {@link PaymentMethodHandler} for an example.
  *
  * @docsCategory payment
+ * @docsPage Payment Method Types
  */
 export type CreateRefundFn<T extends PaymentMethodArgs> = (
     input: RefundOrderInput,
@@ -147,7 +161,10 @@ export interface PaymentMethodConfigOptions<T extends PaymentMethodArgs = Paymen
     createPayment: CreatePaymentFn<T>;
     /**
      * @description
-     * This function provides the logic for settling a payment.
+     * This function provides the logic for settling a payment, also known as "capturing".
+     * For payment integrations that settle/capture the payment on creation (i.e. the
+     * `createPayment()` method returns with a state of `'Settled'`) this method
+     * need only return `{ success: true }`.
      */
     settlePayment: SettlePaymentFn<T>;
     /**
@@ -161,15 +178,17 @@ export interface PaymentMethodConfigOptions<T extends PaymentMethodArgs = Paymen
     /**
      * @description
      * Optional provider-specific arguments which, when specified, are
-     * editable in the admin-ui. Typically args could be used to store an API key
+     * editable in the admin-ui. For example, args could be used to store an API key
      * for a payment provider service.
      *
      * @example
      * ```ts
      * args: {
-     *   apiKey: 'string',
+     *   apiKey: { type: 'string' },
      * }
      * ```
+     *
+     * See {@link ConfigArgs} for available configuration options.
      */
     args: T;
     /**
@@ -196,7 +215,7 @@ export interface PaymentMethodConfigOptions<T extends PaymentMethodArgs = Paymen
  *     code: 'example-payment-provider',
  *     description: 'Example Payment Provider',
  *     args: {
- *         apiKey: 'string',
+ *         apiKey: { type: 'string' },
  *     },
  *     createPayment: async (order, args, metadata): Promise<PaymentConfig> => {
  *         try {
@@ -221,6 +240,9 @@ export interface PaymentMethodConfigOptions<T extends PaymentMethodArgs = Paymen
  *             };
  *         }
  *     },
+ *     settlePayment: async (order, payment, args): Promise<SettlePaymentResult> {
+ *         return { success: true };
+ *     }
  * });
  * ```
  *

+ 1 - 1
packages/core/src/config/shipping-method/shipping-calculator.ts

@@ -40,7 +40,7 @@ export type CalculateShippingFn<T extends ShippingCalculatorArgs> = (
  *     code: 'flat-rate-calculator',
  *     description: 'Default Flat-Rate Shipping Calculator',
  *     args: {
- *         rate: ConfigArgType.MONEY,
+ *         rate: { type: 'int', config: { inputType: 'money' } },
  *     },
  *     calculate: (order, args) => {
  *         return args.rate;

+ 1 - 1
packages/core/src/config/shipping-method/shipping-eligibility-checker.ts

@@ -35,7 +35,7 @@ export type CheckShippingEligibilityCheckerFn<T extends ShippingEligibilityCheck
  *     code: 'min-order-total-eligibility-checker',
  *     description: 'Checks that the order total is above some minimum value',
  *     args: {
- *         orderMinimum: ConfigArgType.MONEY,
+ *         orderMinimum: { type: 'int', config: { inputType: 'money' } },
  *     },
  *     check: (order, args) => {
  *         return order.total >= args.orderMinimum;

+ 11 - 10
packages/core/src/config/tax/tax-calculation-strategy.ts

@@ -5,24 +5,25 @@ import { TaxRateService } from '../../service/services/tax-rate.service';
 
 /**
  * @description
- * The arguments passed the the `calculate` method of the configured {@link TaxCalculationStrategy}.
+ * Defines how taxes are calculated based on the input price, tax zone and current request context.
  *
  * @docsCategory tax
  */
-export interface TaxCalculationArgs {
-    inputPrice: number;
-    taxCategory: TaxCategory;
-    activeTaxZone: Zone;
-    ctx: RequestContext;
-    taxRateService: TaxRateService;
+export interface TaxCalculationStrategy {
+    calculate(args: TaxCalculationArgs): TaxCalculationResult;
 }
 
 /**
  * @description
- * Defines how taxes are calculated based on the input price, tax zone and current request context.
+ * The arguments passed the the `calculate` method of the configured {@link TaxCalculationStrategy}.
  *
  * @docsCategory tax
+ * @docsPage Tax Types
  */
-export interface TaxCalculationStrategy {
-    calculate(args: TaxCalculationArgs): TaxCalculationResult;
+export interface TaxCalculationArgs {
+    inputPrice: number;
+    taxCategory: TaxCategory;
+    activeTaxZone: Zone;
+    ctx: RequestContext;
+    taxRateService: TaxRateService;
 }

+ 53 - 59
packages/core/src/config/vendure-config.ts

@@ -30,8 +30,7 @@ import { TaxZoneStrategy } from './tax/tax-zone-strategy';
  * The AuthOptions define how authentication is managed.
  *
  * @docsCategory auth
- * @docsWeight 0
- */
+ * */
 export interface AuthOptions {
     /**
      * @description
@@ -109,46 +108,9 @@ export interface AuthOptions {
 }
 
 /**
- * @description
- * Defines custom states and transition logic for the order process state machine.
- *
  * @docsCategory orders
- */
-export interface OrderProcessOptions<T extends string> {
-    /**
-     * @description
-     * Define how the custom states fit in with the default order
-     * state transitions.
-     *
-     */
-    transtitions?: Partial<Transitions<T | OrderState>>;
-    /**
-     * @description
-     * Define logic to run before a state tranition takes place. Returning
-     * false will prevent the transition from going ahead.
-     */
-    onTransitionStart?(
-        fromState: T,
-        toState: T,
-        data: { order: Order },
-    ): boolean | Promise<boolean> | Observable<boolean> | void;
-    /**
-     * @description
-     * Define logic to run after a state transition has taken place.
-     */
-    onTransitionEnd?(fromState: T, toState: T, data: { order: Order }): void;
-    /**
-     * @description
-     * Define a custom error handler function for transition errors.
-     */
-    onTransitionError?(fromState: T, toState: T, message?: string): void;
-}
-
-/**
- * @docsCategory orders
- *
- * @docsWeight 0
- */
+ * @docsPage OrderOptions
+ * */
 export interface OrderOptions {
     /**
      * @description
@@ -159,6 +121,8 @@ export interface OrderOptions {
      * to perform price calculations against active promotions and taxes. This can have a significant
      * performance impact for very large values.
      *
+     * Attempting to exceed this limit will cause Vendure to throw a {@link OrderItemsLimitError}.
+     *
      * @default 999
      */
     orderItemsLimit?: number;
@@ -185,18 +149,51 @@ export interface OrderOptions {
     checkoutMergeStrategy?: OrderMergeStrategy;
 }
 
+/**
+ * @description
+ * Defines custom states and transition logic for the order process state machine.
+ *
+ * @docsCategory orders
+ * @docsPage OrderOptions
+ */
+export interface OrderProcessOptions<T extends string> {
+    /**
+     * @description
+     * Define how the custom states fit in with the default order
+     * state transitions.
+     *
+     */
+    transtitions?: Partial<Transitions<T | OrderState>>;
+    /**
+     * @description
+     * Define logic to run before a state tranition takes place. Returning
+     * false will prevent the transition from going ahead.
+     */
+    onTransitionStart?(
+        fromState: T,
+        toState: T,
+        data: { order: Order },
+    ): boolean | Promise<boolean> | Observable<boolean> | void;
+    /**
+     * @description
+     * Define logic to run after a state transition has taken place.
+     */
+    onTransitionEnd?(fromState: T, toState: T, data: { order: Order }): void;
+    /**
+     * @description
+     * Define a custom error handler function for transition errors.
+     */
+    onTransitionError?(fromState: T, toState: T, message?: string): void;
+}
+
 /**
  * @description
  * The AssetOptions define how assets (images and other files) are named and stored, and how preview images are generated.
  *
- * {{% alert %}}
- * If you are using the `AssetServerPlugin`,
- * it is not necessary to configure these options.
- * {{% /alert %}}
+ * **Note**: If you are using the `AssetServerPlugin`, it is not necessary to configure these options.
  *
  * @docsCategory assets
- * @docsWeight 0
- */
+ * */
 export interface AssetOptions {
     /**
      * @description
@@ -231,8 +228,7 @@ export interface AssetOptions {
 /**
  * @docsCategory promotions
  *
- * @docsWeight 0
- */
+ * */
 export interface PromotionOptions {
     /**
      * @description
@@ -248,8 +244,7 @@ export interface PromotionOptions {
 
 /**
  * @docsCategory shipping
- * @docsWeight 0
- */
+ * */
 export interface ShippingOptions {
     /**
      * @description
@@ -264,14 +259,15 @@ export interface ShippingOptions {
 }
 
 /**
- * @docsCategory payment
+ * @description
+ * Defines payment-related options in the {@link VendureConfig}.
  *
- * @docsWeight 0
- */
+ * @docsCategory payment
+ * */
 export interface PaymentOptions {
     /**
      * @description
-     * An array of payment methods with which to process payments.
+     * An array of {@link PaymentMethodHandler}s with which to process payments.
      */
     paymentMethodHandlers: Array<PaymentMethodHandler<any>>;
 }
@@ -279,8 +275,7 @@ export interface PaymentOptions {
 /**
  * @docsCategory tax
  *
- * @docsWeight 0
- */
+ * */
 export interface TaxOptions {
     /**
      * @description
@@ -374,8 +369,7 @@ export interface WorkerOptions {
  * [`VendureConfig`](https://github.com/vendure-ecommerce/vendure/blob/master/server/src/config/vendure-config.ts) interface.
  *
  * @docsCategory
- * @docsWeight 1
- */
+ * */
 export interface VendureConfig {
     /**
      * @description

+ 1 - 2
packages/core/src/event-bus/event-bus.ts

@@ -11,8 +11,7 @@ export type UnsubscribeFn = () => void;
  * The EventBus is used to globally publish events which can then be subscribed to.
  *
  * @docsCategory events
- * @docsWeight 0
- */
+ * */
 @Injectable()
 export class EventBus {
     private subscriberMap = new Map<Type<VendureEvent>, Array<EventHandler<any>>>();

+ 1 - 0
packages/core/src/event-bus/events/account-registration-event.ts

@@ -8,6 +8,7 @@ import { VendureEvent } from '../vendure-event';
  * placing an order.
  *
  * @docsCategory events
+ * @docsPage Event Types
  */
 export class AccountRegistrationEvent extends VendureEvent {
     constructor(public ctx: RequestContext, public user: User) {

+ 1 - 0
packages/core/src/event-bus/events/attempted-login-event.ts

@@ -7,6 +7,7 @@ import { VendureEvent } from '../vendure-event';
  * This event is fired when an attempt is made to log in via the shop or admin API `login` mutation.
  *
  * @docsCategory events
+ * @docsPage Event Types
  */
 export class AttemptedLoginEvent extends VendureEvent {
     constructor(public ctx: RequestContext, public identifier: string) {

+ 1 - 0
packages/core/src/event-bus/events/catalog-modification-event.ts

@@ -9,6 +9,7 @@ import { VendureEvent } from '../vendure-event';
  * deleted.
  *
  * @docsCategory events
+ * @docsPage Event Types
  */
 export class CatalogModificationEvent extends VendureEvent {
     constructor(public ctx: RequestContext, public entity: Product | ProductVariant) {

+ 1 - 0
packages/core/src/event-bus/events/collection-modification-event.ts

@@ -13,6 +13,7 @@ import { VendureEvent } from '../vendure-event';
  * 2. are now part of this collection after modification but were not before
  *
  * @docsCategory events
+ * @docsPage Event Types
  */
 export class CollectionModificationEvent extends VendureEvent {
     constructor(public ctx: RequestContext, public collection: Collection, public productVariantIds: ID[]) {

+ 1 - 0
packages/core/src/event-bus/events/identifier-change-event.ts

@@ -8,6 +8,7 @@ import { VendureEvent } from '../vendure-event';
  * associated with their account.
  *
  * @docsCategory events
+ * @docsPage Event Types
  */
 export class IdentifierChangeEvent extends VendureEvent {
     constructor(public ctx: RequestContext, public user: User, public oldIdentifier: string) {

+ 1 - 0
packages/core/src/event-bus/events/identifier-change-request-event.ts

@@ -8,6 +8,7 @@ import { VendureEvent } from '../vendure-event';
  * associated with the account.
  *
  * @docsCategory events
+ * @docsPage Event Types
  */
 export class IdentifierChangeRequestEvent extends VendureEvent {
     constructor(public ctx: RequestContext, public user: User) {

+ 1 - 0
packages/core/src/event-bus/events/login-event.ts

@@ -7,6 +7,7 @@ import { VendureEvent } from '../vendure-event';
  * This event is fired when a user successfully logs in via the shop or admin API `login` mutation.
  *
  * @docsCategory events
+ * @docsPage Event Types
  */
 export class LoginEvent extends VendureEvent {
     constructor(public ctx: RequestContext, public user: User) {

+ 1 - 0
packages/core/src/event-bus/events/logout-event.ts

@@ -7,6 +7,7 @@ import { VendureEvent } from '../vendure-event';
  * This event is fired when a user logs out via the shop or admin API `logout` mutation.
  *
  * @docsCategory events
+ * @docsPage Event Types
  */
 export class LogoutEvent extends VendureEvent {
     constructor(public ctx: RequestContext) {

+ 1 - 0
packages/core/src/event-bus/events/order-state-transition-event.ts

@@ -9,6 +9,7 @@ import { VendureEvent } from '../vendure-event';
  * This event is fired whenever an {@link Order} transitions from one {@link OrderState} to another.
  *
  * @docsCategory events
+ * @docsPage Event Types
  */
 export class OrderStateTransitionEvent extends VendureEvent {
     constructor(

+ 1 - 0
packages/core/src/event-bus/events/password-reset-event.ts

@@ -7,6 +7,7 @@ import { VendureEvent } from '../vendure-event';
  * This event is fired when a Customer requests a password reset email.
  *
  * @docsCategory events
+ * @docsPage Event Types
  */
 export class PasswordResetEvent extends VendureEvent {
     constructor(public ctx: RequestContext, public user: User) {

+ 1 - 0
packages/core/src/event-bus/events/payment-state-transition-event.ts

@@ -10,6 +10,7 @@ import { VendureEvent } from '../vendure-event';
  * a Payment is authorized by the payment provider.
  *
  * @docsCategory events
+ * @docsPage Event Types
  */
 export class PaymentStateTransitionEvent extends VendureEvent {
     constructor(

+ 1 - 0
packages/core/src/event-bus/events/refund-state-transition-event.ts

@@ -9,6 +9,7 @@ import { VendureEvent } from '../vendure-event';
  * This event is fired whenever a {@link Refund} transitions from one {@link RefundState} to another.
  *
  * @docsCategory events
+ * @docsPage Event Types
  */
 export class RefundStateTransitionEvent extends VendureEvent {
     constructor(

+ 1 - 0
packages/core/src/event-bus/events/tax-rate-modification-event.ts

@@ -7,6 +7,7 @@ import { VendureEvent } from '../vendure-event';
  * This event is fired whenever a TaxRate is changed
  *
  * @docsCategory events
+ * @docsPage Event Types
  */
 export class TaxRateModificationEvent extends VendureEvent {
     constructor(public ctx: RequestContext, public taxRate: TaxRate) {

+ 1 - 2
packages/core/src/event-bus/vendure-event.ts

@@ -3,8 +3,7 @@
  * The base class for all events used by the EventBus system.
  *
  * @docsCategory events
- * @docsWeight 1
- */
+ * */
 export abstract class VendureEvent {
     public readonly createdAt: Date;
     protected constructor() {

+ 7 - 6
packages/core/src/i18n/i18n-error.ts

@@ -1,16 +1,17 @@
 import { ApolloError } from 'apollo-server-core';
 
 /**
+ * @description
  * All errors thrown in the Vendure server must use or extend this error class. This allows the
  * error message to be translated before being served to the client.
  *
- * The message should be of the form `Could not find user {{ id }}`, with the variables argument
- * being used to provide interpolation values.
+ * The error messages should be provided in the form of a string key which corresponds to
+ * a key defined in the `i18n/messages/<languageCode>.json` files.
  *
- * @example
- * ```
- * throw new I18nError(`Could not find user {{ id }}`, { id });
- * ```
+ * Note that this class should not be directly used in code, but should be extended by
+ * a more specific Error class.
+ *
+ * @docsCategory errors
  */
 export abstract class I18nError extends ApolloError {
     protected constructor(

+ 1 - 1
packages/core/src/plugin/default-search-plugin/default-search-plugin.ts

@@ -43,7 +43,7 @@ export interface DefaultSearchReindexResponse extends SearchReindexResponse {
  * const config: VendureConfig = {
  *   // Add an instance of the plugin to the plugins array
  *   plugins: [
- *     new DefaultSearchPlugin(),
+ *     DefaultSearchPlugin,
  *   ],
  * };
  * ```

+ 1 - 0
packages/core/src/plugin/plugin-common.module.ts

@@ -19,6 +19,7 @@ import { VENDURE_WORKER_CLIENT } from '../worker/constants';
  * * ServiceModule allowing the injection of any of the various entity services such as ProductService, OrderService etc.
  * * ConfigModule, allowing the injection of the ConfigService.
  * * The `VENDURE_WORKER_CLIENT` token, allowing the injection of the Nest microservice ClientProxy.
+ *
  * @docsCategory plugin
  */
 @Module({

+ 34 - 32
packages/core/src/plugin/plugin-utils.ts

@@ -3,38 +3,6 @@ import proxy from 'http-proxy-middleware';
 
 import { Logger, VendureConfig } from '../config';
 
-/**
- * @description
- * Options to configure proxy middleware via {@link createProxyHandler}.
- *
- * @docsCategory Plugin
- */
-export interface ProxyOptions {
-    /**
-     * @description
-     * A human-readable label for the service which is being proxied. Used to
-     * generate more informative logs.
-     */
-    label: string;
-    /**
-     * @description
-     * The route of the Vendure server which will act as the proxy url.
-     */
-    route: string;
-    /**
-     * @description
-     * The port on which the service being proxied is running.
-     */
-    port: number;
-    /**
-     * @description
-     * The hostname of the server on which the service being proxied is running.
-     *
-     * @default 'localhost'
-     */
-    hostname?: string;
-}
-
 /**
  * @description
  * Creates a proxy middleware which proxies the given route to the given port.
@@ -64,6 +32,7 @@ export interface ProxyOptions {
  * ```
  *
  * @docsCategory Plugin
+ * @docsPage Plugin Utilities
  */
 export function createProxyHandler(options: ProxyOptions): RequestHandler {
     const route = options.route.charAt(0) === '/' ? options.route : '/' + options.route;
@@ -100,6 +69,39 @@ export function createProxyHandler(options: ProxyOptions): RequestHandler {
     return middleware;
 }
 
+/**
+ * @description
+ * Options to configure proxy middleware via {@link createProxyHandler}.
+ *
+ * @docsCategory Plugin
+ * @docsPage Plugin Utilities
+ */
+export interface ProxyOptions {
+    /**
+     * @description
+     * A human-readable label for the service which is being proxied. Used to
+     * generate more informative logs.
+     */
+    label: string;
+    /**
+     * @description
+     * The route of the Vendure server which will act as the proxy url.
+     */
+    route: string;
+    /**
+     * @description
+     * The port on which the service being proxied is running.
+     */
+    port: number;
+    /**
+     * @description
+     * The hostname of the server on which the service being proxied is running.
+     *
+     * @default 'localhost'
+     */
+    hostname?: string;
+}
+
 /**
  * If any proxy middleware has been set up using the createProxyHandler function, log this information.
  */

+ 45 - 38
packages/core/src/plugin/vendure-plugin.ts

@@ -9,44 +9,6 @@ import { VendureConfig } from '../config/vendure-config';
 
 import { PLUGIN_METADATA } from './plugin-metadata';
 
-/**
- * @description
- * An object which allows a plugin to extend the Vendure GraphQL API.
- *
- * @docsCategory plugin
- * */
-export interface APIExtensionDefinition {
-    /**
-     * @description
-     * Extensions to the schema.
-     *
-     * @example
-     * ```TypeScript
-     * const schema = gql`extend type SearchReindexResponse {
-     *     timeTaken: Int!
-     *     indexedItemCount: Int!
-     * }`;
-     * ```
-     */
-    schema?: DocumentNode;
-    /**
-     * @description
-     * An array of resolvers for the schema extensions. Should be defined as [Nestjs GraphQL resolver](https://docs.nestjs.com/graphql/resolvers-map)
-     * classes, i.e. using the Nest `\@Resolver()` decorator etc.
-     */
-    resolvers: Array<Type<any>>;
-}
-
-/**
- * @description
- * This method is called before the app bootstraps and should be used to perform any needed modifications to the {@link VendureConfig}.
- *
- * @docsCategory plugin
- */
-export type PluginConfigurationFn = (
-    config: Required<VendureConfig>,
-) => Required<VendureConfig> | Promise<Required<VendureConfig>>;
-
 /**
  * @description
  * Defines the metadata of a Vendure plugin. This interface is an superset of the [Nestjs ModuleMetadata](https://docs.nestjs.com/modules)
@@ -55,6 +17,7 @@ export type PluginConfigurationFn = (
  * extra properties specific to Vendure.
  *
  * @docsCategory plugin
+ * @docsPage VendurePluginMetadata
  */
 export interface VendurePluginMetadata extends ModuleMetadata {
     /**
@@ -86,6 +49,46 @@ export interface VendurePluginMetadata extends ModuleMetadata {
      */
     entities?: Array<Type<any>>;
 }
+/**
+ * @description
+ * An object which allows a plugin to extend the Vendure GraphQL API.
+ *
+ * @docsCategory plugin
+ * @docsPage VendurePluginMetadata
+ * */
+
+export interface APIExtensionDefinition {
+    /**
+     * @description
+     * Extensions to the schema.
+     *
+     * @example
+     * ```TypeScript
+     * const schema = gql`extend type SearchReindexResponse {
+     *     timeTaken: Int!
+     *     indexedItemCount: Int!
+     * }`;
+     * ```
+     */
+    schema?: DocumentNode;
+    /**
+     * @description
+     * An array of resolvers for the schema extensions. Should be defined as [Nestjs GraphQL resolver](https://docs.nestjs.com/graphql/resolvers-map)
+     * classes, i.e. using the Nest `\@Resolver()` decorator etc.
+     */
+    resolvers: Array<Type<any>>;
+}
+
+/**
+ * @description
+ * This method is called before the app bootstraps and should be used to perform any needed modifications to the {@link VendureConfig}.
+ *
+ * @docsCategory plugin
+ * @docsPage VendurePluginMetadata
+ */
+export type PluginConfigurationFn = (
+    config: Required<VendureConfig>,
+) => Required<VendureConfig> | Promise<Required<VendureConfig>>;
 
 /**
  * @description
@@ -143,6 +146,7 @@ export function VendurePlugin(pluginMetadata: VendurePluginMetadata): ClassDecor
  * For example, this could be used to call out to an external API or to set up {@link EventBus} listeners.
  *
  * @docsCategory plugin
+ * @docsPage Plugin Lifecycle Methods
  */
 export interface OnVendureBootstrap {
     onVendureBootstrap(): void | Promise<void>;
@@ -155,6 +159,7 @@ export interface OnVendureBootstrap {
  * For example, this could be used to start or connect to a server or databased used by the worker.
  *
  * @docsCategory plugin
+ * @docsPage Plugin Lifecycle Methods
  */
 export interface OnVendureWorkerBootstrap {
     onVendureWorkerBootstrap(): void | Promise<void>;
@@ -167,6 +172,7 @@ export interface OnVendureWorkerBootstrap {
  * For example, this could be used to clean up any processes started by the {@link OnVendureBootstrap} method.
  *
  * @docsCategory plugin
+ * @docsPage Plugin Lifecycle Methods
  */
 export interface OnVendureClose {
     onVendureClose(): void | Promise<void>;
@@ -179,6 +185,7 @@ export interface OnVendureClose {
  * For example, this could be used to close any open connections to external services.
  *
  * @docsCategory plugin
+ * @docsPage Plugin Lifecycle Methods
  */
 export interface OnVendureWorkerClose {
     onVendureWorkerClose(): void | Promise<void>;

+ 7 - 0
packages/core/src/service/helpers/tax-calculator/tax-calculator.ts

@@ -9,6 +9,13 @@ import { TaxRate } from '../../../entity/tax-rate/tax-rate.entity';
 import { Zone } from '../../../entity/zone/zone.entity';
 import { TaxRateService } from '../../services/tax-rate.service';
 
+/**
+ * @description
+ * The result of the {@link TaxCalculationStrategy}.calculate() method.
+ *
+ * @docsCategory tax
+ * @docsPage Tax Types
+ */
 export interface TaxCalculationResult {
     price: number;
     priceIncludesTax: boolean;

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
schema-admin.json


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
schema-shop.json


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.