Michael Bromley преди 1 година
родител
ревизия
54acd4df47
променени са 41 файла, в които са добавени 259 реда и са изтрити 129 реда
  1. 13 13
      docs/docs/reference/admin-ui-api/alerts/alert-config.md
  2. 2 2
      docs/docs/reference/typescript-api/data-access/entity-hydrator.md
  3. 2 8
      docs/docs/reference/typescript-api/data-access/list-query-builder.md
  4. 5 5
      docs/docs/reference/typescript-api/data-access/transactional-connection.md
  5. 1 1
      docs/docs/reference/typescript-api/entities/authenticated-session.md
  6. 46 4
      docs/docs/reference/typescript-api/entities/channel.md
  7. 8 1
      docs/docs/reference/typescript-api/entities/customer-group.md
  8. 1 1
      docs/docs/reference/typescript-api/entities/customer.md
  9. 1 1
      docs/docs/reference/typescript-api/entities/facet.md
  10. 1 1
      docs/docs/reference/typescript-api/entities/order-line-reference.md
  11. 32 8
      docs/docs/reference/typescript-api/entities/order-line.md
  12. 1 1
      docs/docs/reference/typescript-api/entities/payment-method.md
  13. 8 1
      docs/docs/reference/typescript-api/entities/product-variant.md
  14. 1 1
      docs/docs/reference/typescript-api/entities/product.md
  15. 2 2
      docs/docs/reference/typescript-api/entities/promotion.md
  16. 1 1
      docs/docs/reference/typescript-api/entities/role.md
  17. 8 1
      docs/docs/reference/typescript-api/entities/seller.md
  18. 8 1
      docs/docs/reference/typescript-api/entities/shipping-line.md
  19. 1 1
      docs/docs/reference/typescript-api/entities/shipping-method.md
  20. 9 2
      docs/docs/reference/typescript-api/entities/stock-location.md
  21. 4 4
      docs/docs/reference/typescript-api/entities/stock-movement.md
  22. 8 1
      docs/docs/reference/typescript-api/entities/tax-category.md
  23. 3 3
      docs/docs/reference/typescript-api/entities/tax-rate.md
  24. 8 1
      docs/docs/reference/typescript-api/entities/user.md
  25. 22 1
      docs/docs/reference/typescript-api/entities/zone.md
  26. 2 2
      docs/docs/reference/typescript-api/job-queue/index.md
  27. 3 3
      docs/docs/reference/typescript-api/job-queue/job-queue-strategy.md
  28. 2 2
      docs/docs/reference/typescript-api/job-queue/sql-job-queue-strategy.md
  29. 3 3
      docs/docs/reference/typescript-api/job-queue/types.md
  30. 2 2
      docs/docs/reference/typescript-api/migration/generate-migration.md
  31. 1 1
      docs/docs/reference/typescript-api/migration/revert-last-migration.md
  32. 1 1
      docs/docs/reference/typescript-api/migration/run-migrations.md
  33. 1 1
      docs/docs/reference/typescript-api/orders/order-process.md
  34. 1 1
      docs/docs/reference/typescript-api/service-helpers/order-calculator.md
  35. 1 1
      docs/docs/reference/typescript-api/service-helpers/product-price-applicator.md
  36. 25 25
      docs/docs/reference/typescript-api/services/customer-service.md
  37. 11 11
      docs/docs/reference/typescript-api/services/fulfillment-service.md
  38. 1 1
      docs/docs/reference/typescript-api/services/global-settings-service.md
  39. 1 1
      docs/docs/reference/typescript-api/services/order-service.md
  40. 5 5
      docs/docs/reference/typescript-api/services/payment-method-service.md
  41. 3 3
      docs/docs/reference/typescript-api/services/tax-rate-service.md

+ 13 - 13
docs/docs/reference/admin-ui-api/alerts/alert-config.md

@@ -22,9 +22,9 @@ interface AlertConfig<T = any> {
     recheck?: (context: AlertContext) => Observable<any>;
     isAlert: (data: T, context: AlertContext) => boolean;
     action: (data: T, context: AlertContext) => void;
-    label: (
-        data: T,
-        context: AlertContext,
+    label: (
+        data: T,
+        context: AlertContext,
     ) => { text: string; translationVars?: { [key: string]: string | number } };
     requiredPermissions?: Permission[];
 }
@@ -41,18 +41,18 @@ A unique identifier for the alert.
 
 <MemberInfo kind="property" type={`(context: <a href='/reference/admin-ui-api/alerts/alert-context#alertcontext'>AlertContext</a>) =&#62; T | Promise&#60;T&#62; | Observable&#60;T&#62;`}   />
 
-A function which is gets the data used to determine whether the alert should be shown.
-Typically, this function will query the server or some other remote data source.
-
-This function will be called once when the Admin UI app bootstraps, and can be also
+A function which is gets the data used to determine whether the alert should be shown.
+Typically, this function will query the server or some other remote data source.
+
+This function will be called once when the Admin UI app bootstraps, and can be also
 set to run at regular intervals by setting the `recheckIntervalMs` property.
 ### recheck
 
 <MemberInfo kind="property" type={`(context: <a href='/reference/admin-ui-api/alerts/alert-context#alertcontext'>AlertContext</a>) =&#62; Observable&#60;any&#62;`} default="undefined"   />
 
-A function which returns an Observable which is used to determine when to re-run the `check`
-function. Whenever the observable emits, the `check` function will be called again.
-
+A function which returns an Observable which is used to determine when to re-run the `check`
+function. Whenever the observable emits, the `check` function will be called again.
+
 A basic time-interval-based recheck can be achieved by using the `interval` function from RxJS.
 
 *Example*
@@ -69,7 +69,7 @@ If this is not set, the `check` function will only be called once when the Admin
 
 <MemberInfo kind="property" type={`(data: T, context: <a href='/reference/admin-ui-api/alerts/alert-context#alertcontext'>AlertContext</a>) =&#62; boolean`}   />
 
-A function which determines whether the alert should be shown based on the data returned by the `check`
+A function which determines whether the alert should be shown based on the data returned by the `check`
 function.
 ### action
 
@@ -78,14 +78,14 @@ function.
 A function which is called when the alert is clicked in the Admin UI.
 ### label
 
-<MemberInfo kind="property" type={`(         data: T,         context: <a href='/reference/admin-ui-api/alerts/alert-context#alertcontext'>AlertContext</a>,     ) =&#62; { text: string; translationVars?: { [key: string]: string | number } }`}   />
+<MemberInfo kind="property" type={`(
         data: T,
         context: <a href='/reference/admin-ui-api/alerts/alert-context#alertcontext'>AlertContext</a>,
     ) =&#62; { text: string; translationVars?: { [key: string]: string | number } }`}   />
 
 A function which returns the text used in the UI to describe the alert.
 ### requiredPermissions
 
 <MemberInfo kind="property" type={`<a href='/reference/typescript-api/common/permission#permission'>Permission</a>[]`}   />
 
-A list of permissions which the current Administrator must have in order. If the current
+A list of permissions which the current Administrator must have in order. If the current
 Administrator does not have these permissions, none of the other alert functions will be called.
 
 

+ 2 - 2
docs/docs/reference/typescript-api/data-access/entity-hydrator.md

@@ -71,7 +71,7 @@ await this.entityHydrator
 
 ```ts title="Signature"
 class EntityHydrator {
-    constructor(connection: TransactionalConnection, productPriceApplicator: ProductPriceApplicator, translator: TranslatorService, listQueryBuilder: ListQueryBuilder)
+    constructor(connection: TransactionalConnection, productPriceApplicator: ProductPriceApplicator, translator: TranslatorService)
     hydrate(ctx: RequestContext, target: Entity, options: HydrateOptions<Entity>) => Promise<Entity>;
 }
 ```
@@ -80,7 +80,7 @@ class EntityHydrator {
 
 ### constructor
 
-<MemberInfo kind="method" type={`(connection: <a href='/reference/typescript-api/data-access/transactional-connection#transactionalconnection'>TransactionalConnection</a>, productPriceApplicator: <a href='/reference/typescript-api/service-helpers/product-price-applicator#productpriceapplicator'>ProductPriceApplicator</a>, translator: <a href='/reference/typescript-api/service-helpers/translator-service#translatorservice'>TranslatorService</a>, listQueryBuilder: <a href='/reference/typescript-api/data-access/list-query-builder#listquerybuilder'>ListQueryBuilder</a>) => EntityHydrator`}   />
+<MemberInfo kind="method" type={`(connection: <a href='/reference/typescript-api/data-access/transactional-connection#transactionalconnection'>TransactionalConnection</a>, productPriceApplicator: <a href='/reference/typescript-api/service-helpers/product-price-applicator#productpriceapplicator'>ProductPriceApplicator</a>, translator: <a href='/reference/typescript-api/service-helpers/translator-service#translatorservice'>TranslatorService</a>) => EntityHydrator`}   />
 
 
 ### hydrate

+ 2 - 8
docs/docs/reference/typescript-api/data-access/list-query-builder.md

@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
 
 ## ListQueryBuilder
 
-<GenerationInfo sourceFile="packages/core/src/service/helpers/list-query-builder/list-query-builder.ts" sourceLine="201" packageName="@vendure/core" />
+<GenerationInfo sourceFile="packages/core/src/service/helpers/list-query-builder/list-query-builder.ts" sourceLine="200" packageName="@vendure/core" />
 
 This helper class is used when fetching entities the database from queries which return a <a href='/reference/typescript-api/common/paginated-list#paginatedlist'>PaginatedList</a> type.
 These queries all follow the same format:
@@ -84,7 +84,6 @@ class ListQueryBuilder implements OnApplicationBootstrap {
     constructor(connection: TransactionalConnection, configService: ConfigService)
     filterObjectHasProperty(filterObject: FP | NullOptionals<FP> | null | undefined, property: keyof FP) => boolean;
     build(entity: Type<T>, options: ListQueryOptions<T> = {}, extendedOptions: ExtendedListQueryOptions<T> = {}) => SelectQueryBuilder<T>;
-    joinTreeRelationsDynamically(qb: SelectQueryBuilder<T>, entity: EntityTarget<T>, requestedRelations: string[] = []) => Set<string>;
 }
 ```
 * Implements: <code>OnApplicationBootstrap</code>
@@ -115,11 +114,6 @@ to join that relation.
 <MemberInfo kind="method" type={`(entity: Type&#60;T&#62;, options: ListQueryOptions&#60;T&#62; = {}, extendedOptions: <a href='/reference/typescript-api/data-access/list-query-builder#extendedlistqueryoptions'>ExtendedListQueryOptions</a>&#60;T&#62; = {}) => SelectQueryBuilder&#60;T&#62;`}   />
 
 
-### joinTreeRelationsDynamically
-
-<MemberInfo kind="method" type={`(qb: SelectQueryBuilder&#60;T&#62;, entity: EntityTarget&#60;T&#62;, requestedRelations: string[] = []) => Set&#60;string&#62;`}   />
-
-
 
 
 </div>
@@ -127,7 +121,7 @@ to join that relation.
 
 ## ExtendedListQueryOptions
 
-<GenerationInfo sourceFile="packages/core/src/service/helpers/list-query-builder/list-query-builder.ts" sourceLine="42" packageName="@vendure/core" />
+<GenerationInfo sourceFile="packages/core/src/service/helpers/list-query-builder/list-query-builder.ts" sourceLine="41" packageName="@vendure/core" />
 
 Options which can be passed to the ListQueryBuilder's `build()` method.
 

+ 5 - 5
docs/docs/reference/typescript-api/data-access/transactional-connection.md

@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
 
 ## TransactionalConnection
 
-<GenerationInfo sourceFile="packages/core/src/connection/transactional-connection.ts" sourceLine="38" packageName="@vendure/core" />
+<GenerationInfo sourceFile="packages/core/src/connection/transactional-connection.ts" sourceLine="39" packageName="@vendure/core" />
 
 The TransactionalConnection is a wrapper around the TypeORM `Connection` object which works in conjunction
 with the <a href='/reference/typescript-api/request/transaction-decorator#transaction'>Transaction</a> decorator to implement per-request transactions. All services which access the
@@ -23,8 +23,8 @@ API by the use of the `Transaction` decorator.
 
 ```ts title="Signature"
 class TransactionalConnection {
-    constructor(connection: Connection, transactionWrapper: TransactionWrapper)
-    rawConnection: Connection
+    constructor(dataSource: DataSource, transactionWrapper: TransactionWrapper)
+    rawConnection: DataSource
     getRepository(target: ObjectType<Entity> | EntitySchema<Entity> | string) => Repository<Entity>;
     getRepository(ctx: RequestContext | undefined, target: ObjectType<Entity> | EntitySchema<Entity> | string) => Repository<Entity>;
     getRepository(ctxOrTarget: RequestContext | ObjectType<Entity> | EntitySchema<Entity> | string | undefined, maybeTarget?: ObjectType<Entity> | EntitySchema<Entity> | string) => Repository<Entity>;
@@ -44,12 +44,12 @@ class TransactionalConnection {
 
 ### constructor
 
-<MemberInfo kind="method" type={`(connection: Connection, transactionWrapper: TransactionWrapper) => TransactionalConnection`}   />
+<MemberInfo kind="method" type={`(dataSource: DataSource, transactionWrapper: TransactionWrapper) => TransactionalConnection`}   />
 
 
 ### rawConnection
 
-<MemberInfo kind="property" type={`Connection`}   />
+<MemberInfo kind="property" type={`DataSource`}   />
 
 The plain TypeORM Connection object. Should be used carefully as any operations
 performed with this connection will not be performed within any outer

+ 1 - 1
docs/docs/reference/typescript-api/entities/authenticated-session.md

@@ -19,7 +19,7 @@ An AuthenticatedSession is created upon successful authentication.
 class AuthenticatedSession extends Session {
     constructor(input: DeepPartial<AuthenticatedSession>)
     @Index()
-    @ManyToOne(type => User)
+    @ManyToOne(type => User, user => user.sessions)
     user: User;
     @Column()
     authenticationStrategy: string;

+ 46 - 4
docs/docs/reference/typescript-api/entities/channel.md

@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
 
 ## Channel
 
-<GenerationInfo sourceFile="packages/core/src/entity/channel/channel.entity.ts" sourceLine="36" packageName="@vendure/core" />
+<GenerationInfo sourceFile="packages/core/src/entity/channel/channel.entity.ts" sourceLine="37" packageName="@vendure/core" />
 
 A Channel represents a distinct sales channel and configures defaults for that
 channel.
@@ -39,7 +39,7 @@ class Channel extends VendureEntity {
     @Column({ default: '', nullable: true })
     description: string;
     @Index()
-    @ManyToOne(type => Seller)
+    @ManyToOne(type => Seller, seller => seller.channels)
     seller?: Seller;
     @EntityId({ nullable: true })
     sellerId?: ID;
@@ -47,10 +47,10 @@ class Channel extends VendureEntity {
     @Column({ type: 'simple-array', nullable: true })
     availableLanguageCodes: LanguageCode[];
     @Index()
-    @ManyToOne(type => Zone)
+    @ManyToOne(type => Zone, zone => zone.defaultTaxZoneChannels)
     defaultTaxZone: Zone;
     @Index()
-    @ManyToOne(type => Zone)
+    @ManyToOne(type => Zone, zone => zone.defaultShippingZoneChannels)
     defaultShippingZone: Zone;
     @Column('varchar')
     defaultCurrencyCode: CurrencyCode;
@@ -73,6 +73,18 @@ class Channel extends VendureEntity {
     facets: Facet[];
     @ManyToMany(type => Collection, collection => collection.channels, { onDelete: 'CASCADE' })
     collections: Collection[];
+    @ManyToMany(type => Promotion, promotion => promotion.channels, { onDelete: 'CASCADE' })
+    promotions: Promotion[];
+    @ManyToMany(type => PaymentMethod, paymentMethod => paymentMethod.channels, { onDelete: 'CASCADE' })
+    paymentMethods: PaymentMethod[];
+    @ManyToMany(type => ShippingMethod, shippingMethod => shippingMethod.channels, { onDelete: 'CASCADE' })
+    shippingMethods: ShippingMethod[];
+    @ManyToMany(type => Customer, customer => customer.channels, { onDelete: 'CASCADE' })
+    customers: Customer[];
+    @ManyToMany(type => Role, role => role.channels, { onDelete: 'CASCADE' })
+    roles: Role[];
+    @ManyToMany(type => StockLocation, stockLocation => stockLocation.channels, { onDelete: 'CASCADE' })
+    stockLocations: StockLocation[];
 }
 ```
 * Extends: <code><a href='/reference/typescript-api/entities/vendure-entity#vendureentity'>VendureEntity</a></code>
@@ -190,6 +202,36 @@ out of stock.
 <MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/collection#collection'>Collection</a>[]`}   />
 
 
+### promotions
+
+<MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/promotion#promotion'>Promotion</a>[]`}   />
+
+
+### paymentMethods
+
+<MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/payment-method#paymentmethod'>PaymentMethod</a>[]`}   />
+
+
+### shippingMethods
+
+<MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/shipping-method#shippingmethod'>ShippingMethod</a>[]`}   />
+
+
+### customers
+
+<MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/customer#customer'>Customer</a>[]`}   />
+
+
+### roles
+
+<MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/role#role'>Role</a>[]`}   />
+
+
+### stockLocations
+
+<MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/stock-location#stocklocation'>StockLocation</a>[]`}   />
+
+
 
 
 </div>

+ 8 - 1
docs/docs/reference/typescript-api/entities/customer-group.md

@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
 
 ## CustomerGroup
 
-<GenerationInfo sourceFile="packages/core/src/entity/customer-group/customer-group.entity.ts" sourceLine="16" packageName="@vendure/core" />
+<GenerationInfo sourceFile="packages/core/src/entity/customer-group/customer-group.entity.ts" sourceLine="17" packageName="@vendure/core" />
 
 A grouping of <a href='/reference/typescript-api/entities/customer#customer'>Customer</a>s which enables features such as group-based promotions
 or tax rules.
@@ -24,6 +24,8 @@ class CustomerGroup extends VendureEntity implements HasCustomFields {
     customers: Customer[];
     @Column(type => CustomCustomerGroupFields)
     customFields: CustomCustomerGroupFields;
+    @OneToMany(type => TaxRate, taxRate => taxRate.zone)
+    taxRates: TaxRate[];
 }
 ```
 * Extends: <code><a href='/reference/typescript-api/entities/vendure-entity#vendureentity'>VendureEntity</a></code>
@@ -55,6 +57,11 @@ class CustomerGroup extends VendureEntity implements HasCustomFields {
 <MemberInfo kind="property" type={`CustomCustomerGroupFields`}   />
 
 
+### taxRates
+
+<MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/tax-rate#taxrate'>TaxRate</a>[]`}   />
+
+
 
 
 </div>

+ 1 - 1
docs/docs/reference/typescript-api/entities/customer.md

@@ -42,7 +42,7 @@ class Customer extends VendureEntity implements ChannelAware, HasCustomFields, S
     user?: User;
     @Column(type => CustomCustomerFields)
     customFields: CustomCustomerFields;
-    @ManyToMany(type => Channel)
+    @ManyToMany(type => Channel, channel => channel.customers)
     @JoinTable()
     channels: Channel[];
 }

+ 1 - 1
docs/docs/reference/typescript-api/entities/facet.md

@@ -34,7 +34,7 @@ class Facet extends VendureEntity implements Translatable, HasCustomFields, Chan
     values: FacetValue[];
     @Column(type => CustomFacetFields)
     customFields: CustomFacetFields;
-    @ManyToMany(type => Channel)
+    @ManyToMany(type => Channel, channel => channel.facets)
     @JoinTable()
     channels: Channel[];
 }

+ 1 - 1
docs/docs/reference/typescript-api/entities/order-line-reference.md

@@ -62,7 +62,7 @@ class OrderLineReference extends VendureEntity {
     @Column()
     quantity: number;
     @Index()
-    @ManyToOne(type => OrderLine, { onDelete: 'CASCADE' })
+    @ManyToOne(type => OrderLine, line => line.linesReferences, { onDelete: 'CASCADE' })
     orderLine: OrderLine;
     @EntityId()
     orderLineId: ID;

+ 32 - 8
docs/docs/reference/typescript-api/entities/order-line.md

@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
 
 ## OrderLine
 
-<GenerationInfo sourceFile="packages/core/src/entity/order-line/order-line.entity.ts" sourceLine="29" packageName="@vendure/core" />
+<GenerationInfo sourceFile="packages/core/src/entity/order-line/order-line.entity.ts" sourceLine="32" packageName="@vendure/core" />
 
 A single line on an <a href='/reference/typescript-api/entities/order#order'>Order</a> which contains information about the <a href='/reference/typescript-api/entities/product-variant#productvariant'>ProductVariant</a> and
 quantity ordered, as well as the price and tax information.
@@ -25,12 +25,15 @@ class OrderLine extends VendureEntity implements HasCustomFields {
     @EntityId({ nullable: true })
     sellerChannelId?: ID;
     @Index()
-    @ManyToOne(type => ShippingLine, { nullable: true, onDelete: 'SET NULL' })
+    @ManyToOne(type => ShippingLine, shippingLine => shippingLine.orderLines, {
+        nullable: true,
+        onDelete: 'SET NULL',
+    })
     shippingLine?: ShippingLine;
     @EntityId({ nullable: true })
     shippingLineId?: ID;
     @Index()
-    @ManyToOne(type => ProductVariant)
+    @ManyToOne(type => ProductVariant, productVariant => productVariant.lines, { onDelete: 'CASCADE' })
     productVariant: ProductVariant;
     @EntityId()
     productVariantId: ID;
@@ -38,11 +41,15 @@ class OrderLine extends VendureEntity implements HasCustomFields {
     @ManyToOne(type => TaxCategory)
     taxCategory: TaxCategory;
     @Index()
-    @ManyToOne(type => Asset)
+    @ManyToOne(type => Asset, asset => asset.featuredInVariants, { onDelete: 'SET NULL' })
     featuredAsset: Asset;
     @Index()
     @ManyToOne(type => Order, order => order.lines, { onDelete: 'CASCADE' })
     order: Order;
+    @OneToMany(type => OrderLineReference, lineRef => lineRef.orderLine)
+    linesReferences: OrderLineReference[];
+    @OneToMany(type => Sale, sale => sale.orderLine)
+    sales: Sale[];
     @Column()
     quantity: number;
     @Column({ default: 0 })
@@ -57,8 +64,10 @@ class OrderLine extends VendureEntity implements HasCustomFields {
     adjustments: Adjustment[];
     @Column('simple-json')
     taxLines: TaxLine[];
-    @OneToOne(type => Cancellation, cancellation => cancellation.orderLine)
-    cancellation: Cancellation;
+    @OneToMany(type => Cancellation, cancellation => cancellation.orderLine)
+    cancellations: Cancellation[];
+    @OneToMany(type => Allocation, allocation => allocation.orderLine)
+    allocations: Allocation[];
     @Column(type => CustomOrderLineFields)
     customFields: CustomOrderLineFields;
     unitPrice: number
@@ -145,6 +154,16 @@ The <a href='/reference/typescript-api/entities/product-variant#productvariant'>
 <MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/order#order'>Order</a>`}   />
 
 
+### linesReferences
+
+<MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/order-line-reference#orderlinereference'>OrderLineReference</a>[]`}   />
+
+
+### sales
+
+<MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/stock-movement#sale'>Sale</a>[]`}   />
+
+
 ### quantity
 
 <MemberInfo kind="property" type={`number`}   />
@@ -183,9 +202,14 @@ Whether the listPrice includes tax, which depends on the settings of the current
 <MemberInfo kind="property" type={`TaxLine[]`}   />
 
 
-### cancellation
+### cancellations
+
+<MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/stock-movement#cancellation'>Cancellation</a>[]`}   />
+
+
+### allocations
 
-<MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/stock-movement#cancellation'>Cancellation</a>`}   />
+<MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/stock-movement#allocation'>Allocation</a>[]`}   />
 
 
 ### customFields

+ 1 - 1
docs/docs/reference/typescript-api/entities/payment-method.md

@@ -27,7 +27,7 @@ class PaymentMethod extends VendureEntity implements Translatable, ChannelAware,
     @Column() enabled: boolean;
     @Column('simple-json', { nullable: true }) checker: ConfigurableOperation | null;
     @Column('simple-json') handler: ConfigurableOperation;
-    @ManyToMany(type => Channel)
+    @ManyToMany(type => Channel, channel => channel.paymentMethods)
     @JoinTable()
     channels: Channel[];
     @Column(type => CustomPaymentMethodFields)

+ 8 - 1
docs/docs/reference/typescript-api/entities/product-variant.md

@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
 
 ## ProductVariant
 
-<GenerationInfo sourceFile="packages/core/src/entity/product-variant/product-variant.entity.ts" sourceLine="37" packageName="@vendure/core" />
+<GenerationInfo sourceFile="packages/core/src/entity/product-variant/product-variant.entity.ts" sourceLine="38" packageName="@vendure/core" />
 
 A ProductVariant represents a single stock keeping unit (SKU) in the store's inventory.
 Whereas a <a href='/reference/typescript-api/entities/product#product'>Product</a> is a "container" of variants, the variant itself holds the
@@ -76,6 +76,8 @@ class ProductVariant extends VendureEntity implements Translatable, HasCustomFie
     @ManyToMany(type => Channel, channel => channel.productVariants)
     @JoinTable()
     channels: Channel[];
+    @OneToMany(type => OrderLine, orderLine => orderLine.productVariant)
+    lines: OrderLine[];
 }
 ```
 * Extends: <code><a href='/reference/typescript-api/entities/vendure-entity#vendureentity'>VendureEntity</a></code>
@@ -229,6 +231,11 @@ value set on this ProductVariant will be ignored.
 <MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/channel#channel'>Channel</a>[]`}   />
 
 
+### lines
+
+<MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/order-line#orderline'>OrderLine</a>[]`}   />
+
+
 
 
 </div>

+ 1 - 1
docs/docs/reference/typescript-api/entities/product.md

@@ -40,7 +40,7 @@ class Product extends VendureEntity implements Translatable, HasCustomFields, Ch
     @ManyToMany(type => FacetValue, facetValue => facetValue.products)
     @JoinTable()
     facetValues: FacetValue[];
-    @ManyToMany(type => Channel)
+    @ManyToMany(type => Channel, channel => channel.products)
     @JoinTable()
     channels: Channel[];
     @Column(type => CustomProductFields)

+ 2 - 2
docs/docs/reference/typescript-api/entities/promotion.md

@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
 
 ## Promotion
 
-<GenerationInfo sourceFile="packages/core/src/entity/promotion/promotion.entity.ts" sourceLine="57" packageName="@vendure/core" />
+<GenerationInfo sourceFile="packages/core/src/entity/promotion/promotion.entity.ts" sourceLine="56" packageName="@vendure/core" />
 
 A Promotion is used to define a set of conditions under which promotions actions (typically discounts)
 will be applied to an Order.
@@ -43,7 +43,7 @@ class Promotion extends AdjustmentSource implements ChannelAware, SoftDeletable,
     @OneToMany(type => PromotionTranslation, translation => translation.base, { eager: true })
     translations: Array<Translation<Promotion>>;
     @Column() enabled: boolean;
-    @ManyToMany(type => Channel)
+    @ManyToMany(type => Channel, channel => channel.promotions)
     @JoinTable()
     channels: Channel[];
     @ManyToMany(type => Order, order => order.promotions)

+ 1 - 1
docs/docs/reference/typescript-api/entities/role.md

@@ -22,7 +22,7 @@ class Role extends VendureEntity implements ChannelAware {
     @Column() code: string;
     @Column() description: string;
     @Column('simple-array') permissions: Permission[];
-    @ManyToMany(type => Channel)
+    @ManyToMany(type => Channel, channel => channel.roles)
     @JoinTable()
     channels: Channel[];
 }

+ 8 - 1
docs/docs/reference/typescript-api/entities/seller.md

@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
 
 ## Seller
 
-<GenerationInfo sourceFile="packages/core/src/entity/seller/seller.entity.ts" sourceLine="16" packageName="@vendure/core" />
+<GenerationInfo sourceFile="packages/core/src/entity/seller/seller.entity.ts" sourceLine="17" packageName="@vendure/core" />
 
 A Seller represents the person or organization who is selling the goods on a given <a href='/reference/typescript-api/entities/channel#channel'>Channel</a>.
 By default, a single-channel Vendure installation will have a single default Seller.
@@ -24,6 +24,8 @@ class Seller extends VendureEntity implements SoftDeletable, HasCustomFields {
     @Column() name: string;
     @Column(type => CustomSellerFields)
     customFields: CustomSellerFields;
+    @OneToMany(type => Channel, channel => channel.seller)
+    channels: Channel[];
 }
 ```
 * Extends: <code><a href='/reference/typescript-api/entities/vendure-entity#vendureentity'>VendureEntity</a></code>
@@ -55,6 +57,11 @@ class Seller extends VendureEntity implements SoftDeletable, HasCustomFields {
 <MemberInfo kind="property" type={`CustomSellerFields`}   />
 
 
+### channels
+
+<MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/channel#channel'>Channel</a>[]`}   />
+
+
 
 
 </div>

+ 8 - 1
docs/docs/reference/typescript-api/entities/shipping-line.md

@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
 
 ## ShippingLine
 
-<GenerationInfo sourceFile="packages/core/src/entity/shipping-line/shipping-line.entity.ts" sourceLine="23" packageName="@vendure/core" />
+<GenerationInfo sourceFile="packages/core/src/entity/shipping-line/shipping-line.entity.ts" sourceLine="24" packageName="@vendure/core" />
 
 A ShippingLine is created when a <a href='/reference/typescript-api/entities/shipping-method#shippingmethod'>ShippingMethod</a> is applied to an <a href='/reference/typescript-api/entities/order#order'>Order</a>.
 It contains information about the price of the shipping method, any discounts that were
@@ -36,6 +36,8 @@ class ShippingLine extends VendureEntity {
     adjustments: Adjustment[];
     @Column('simple-json')
     taxLines: TaxLine[];
+    @OneToMany(type => OrderLine, orderLine => orderLine.shippingLine)
+    orderLines: OrderLine[];
     price: number
     priceWithTax: number
     discountedPrice: number
@@ -92,6 +94,11 @@ class ShippingLine extends VendureEntity {
 <MemberInfo kind="property" type={`TaxLine[]`}   />
 
 
+### orderLines
+
+<MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/order-line#orderline'>OrderLine</a>[]`}   />
+
+
 ### price
 
 <MemberInfo kind="property" type={`number`}   />

+ 1 - 1
docs/docs/reference/typescript-api/entities/shipping-method.md

@@ -31,7 +31,7 @@ class ShippingMethod extends VendureEntity implements ChannelAware, SoftDeletabl
     @Column('simple-json') calculator: ConfigurableOperation;
     @Column()
     fulfillmentHandlerCode: string;
-    @ManyToMany(type => Channel)
+    @ManyToMany(type => Channel, channel => channel.shippingMethods)
     @JoinTable()
     channels: Channel[];
     @OneToMany(type => ShippingMethodTranslation, translation => translation.base, { eager: true })

+ 9 - 2
docs/docs/reference/typescript-api/entities/stock-location.md

@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
 
 ## StockLocation
 
-<GenerationInfo sourceFile="packages/core/src/entity/stock-location/stock-location.entity.ts" sourceLine="21" packageName="@vendure/core" />
+<GenerationInfo sourceFile="packages/core/src/entity/stock-location/stock-location.entity.ts" sourceLine="22" packageName="@vendure/core" />
 
 A StockLocation represents a physical location where stock is held. For example, a warehouse or a shop.
 
@@ -29,9 +29,11 @@ class StockLocation extends VendureEntity implements HasCustomFields, ChannelAwa
     description: string;
     @Column(type => CustomStockLocationFields)
     customFields: CustomStockLocationFields;
-    @ManyToMany(type => Channel)
+    @ManyToMany(type => Channel, channel => channel.stockLocations)
     @JoinTable()
     channels: Channel[];
+    @OneToMany(type => StockMovement, movement => movement.stockLocation)
+    stockMovements: StockMovement[];
 }
 ```
 * Extends: <code><a href='/reference/typescript-api/entities/vendure-entity#vendureentity'>VendureEntity</a></code>
@@ -68,6 +70,11 @@ class StockLocation extends VendureEntity implements HasCustomFields, ChannelAwa
 <MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/channel#channel'>Channel</a>[]`}   />
 
 
+### stockMovements
+
+<MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/stock-movement#stockmovement'>StockMovement</a>[]`}   />
+
+
 
 
 </div>

+ 4 - 4
docs/docs/reference/typescript-api/entities/stock-movement.md

@@ -24,7 +24,7 @@ class StockMovement extends VendureEntity {
     @ManyToOne(type => ProductVariant, variant => variant.stockMovements)
     productVariant: ProductVariant;
     @Index()
-    @ManyToOne(type => StockLocation, { onDelete: 'CASCADE' })
+    @ManyToOne(type => StockLocation, stockLocation => stockLocation.stockMovements, { onDelete: 'CASCADE' })
     stockLocation: StockLocation;
     @EntityId()
     stockLocationId: ID;
@@ -80,7 +80,7 @@ class Allocation extends StockMovement {
     readonly type = StockMovementType.ALLOCATION;
     constructor(input: DeepPartial<Allocation>)
     @Index()
-    @ManyToOne(type => OrderLine)
+    @ManyToOne(type => OrderLine, orderLine => orderLine.allocations)
     orderLine: OrderLine;
 }
 ```
@@ -120,7 +120,7 @@ A Cancellation is created when OrderItems from a fulfilled Order are cancelled.
 class Cancellation extends StockMovement {
     readonly type = StockMovementType.CANCELLATION;
     constructor(input: DeepPartial<Cancellation>)
-    @ManyToOne(type => OrderLine)
+    @ManyToOne(type => OrderLine, orderLine => orderLine.cancellations)
     orderLine: OrderLine;
 }
 ```
@@ -201,7 +201,7 @@ A Sale is created when OrderItems are fulfilled.
 class Sale extends StockMovement {
     readonly type = StockMovementType.SALE;
     constructor(input: DeepPartial<Sale>)
-    @ManyToOne(type => OrderLine)
+    @ManyToOne(type => OrderLine, line => line.sales)
     orderLine: OrderLine;
 }
 ```

+ 8 - 1
docs/docs/reference/typescript-api/entities/tax-category.md

@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
 
 ## TaxCategory
 
-<GenerationInfo sourceFile="packages/core/src/entity/tax-category/tax-category.entity.ts" sourceLine="15" packageName="@vendure/core" />
+<GenerationInfo sourceFile="packages/core/src/entity/tax-category/tax-category.entity.ts" sourceLine="16" packageName="@vendure/core" />
 
 A TaxCategory defines what type of taxes to apply to a <a href='/reference/typescript-api/entities/product-variant#productvariant'>ProductVariant</a>.
 
@@ -24,6 +24,8 @@ class TaxCategory extends VendureEntity implements HasCustomFields {
     customFields: CustomTaxCategoryFields;
     @OneToMany(type => ProductVariant, productVariant => productVariant.taxCategory)
     productVariants: ProductVariant[];
+    @OneToMany(type => TaxRate, taxRate => taxRate.category)
+    taxRates: TaxRate[];
 }
 ```
 * Extends: <code><a href='/reference/typescript-api/entities/vendure-entity#vendureentity'>VendureEntity</a></code>
@@ -60,6 +62,11 @@ class TaxCategory extends VendureEntity implements HasCustomFields {
 <MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/product-variant#productvariant'>ProductVariant</a>[]`}   />
 
 
+### taxRates
+
+<MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/tax-rate#taxrate'>TaxRate</a>[]`}   />
+
+
 
 
 </div>

+ 3 - 3
docs/docs/reference/typescript-api/entities/tax-rate.md

@@ -26,13 +26,13 @@ class TaxRate extends VendureEntity implements HasCustomFields {
     @Column() enabled: boolean;
     @Column({ type: 'decimal', precision: 5, scale: 2, transformer: new DecimalTransformer() }) value: number;
     @Index()
-    @ManyToOne(type => TaxCategory)
+    @ManyToOne(type => TaxCategory, taxCategory => taxCategory.taxRates)
     category: TaxCategory;
     @Index()
-    @ManyToOne(type => Zone)
+    @ManyToOne(type => Zone, zone => zone.taxRates)
     zone: Zone;
     @Index()
-    @ManyToOne(type => CustomerGroup, { nullable: true })
+    @ManyToOne(type => CustomerGroup, customerGroup => customerGroup.taxRates, { nullable: true })
     customerGroup?: CustomerGroup;
     @Column(type => CustomTaxRateFields)
     customFields: CustomTaxRateFields;

+ 8 - 1
docs/docs/reference/typescript-api/entities/user.md

@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
 
 ## User
 
-<GenerationInfo sourceFile="packages/core/src/entity/user/user.entity.ts" sourceLine="20" packageName="@vendure/core" />
+<GenerationInfo sourceFile="packages/core/src/entity/user/user.entity.ts" sourceLine="21" packageName="@vendure/core" />
 
 A User represents any authenticated user of the Vendure API. This includes both
 <a href='/reference/typescript-api/entities/administrator#administrator'>Administrator</a>s as well as registered <a href='/reference/typescript-api/entities/customer#customer'>Customer</a>s.
@@ -34,6 +34,8 @@ class User extends VendureEntity implements HasCustomFields, SoftDeletable {
     lastLogin: Date | null;
     @Column(type => CustomUserFields)
     customFields: CustomUserFields;
+    @OneToMany(type => AuthenticatedSession, session => session.user)
+    sessions: AuthenticatedSession[];
     getNativeAuthenticationMethod() => NativeAuthenticationMethod;
     getNativeAuthenticationMethod(strict?: boolean) => NativeAuthenticationMethod | undefined;
     getNativeAuthenticationMethod(strict?: boolean) => NativeAuthenticationMethod | undefined;
@@ -88,6 +90,11 @@ class User extends VendureEntity implements HasCustomFields, SoftDeletable {
 <MemberInfo kind="property" type={`CustomUserFields`}   />
 
 
+### sessions
+
+<MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/authenticated-session#authenticatedsession'>AuthenticatedSession</a>[]`}   />
+
+
 ### getNativeAuthenticationMethod
 
 <MemberInfo kind="method" type={`() => <a href='/reference/typescript-api/entities/authentication-method#nativeauthenticationmethod'>NativeAuthenticationMethod</a>`}   />

+ 22 - 1
docs/docs/reference/typescript-api/entities/zone.md

@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
 
 ## Zone
 
-<GenerationInfo sourceFile="packages/core/src/entity/zone/zone.entity.ts" sourceLine="17" packageName="@vendure/core" />
+<GenerationInfo sourceFile="packages/core/src/entity/zone/zone.entity.ts" sourceLine="19" packageName="@vendure/core" />
 
 A Zone is a grouping of one or more <a href='/reference/typescript-api/entities/country#country'>Country</a> entities. It is used for
 calculating applicable shipping and taxes.
@@ -25,6 +25,12 @@ class Zone extends VendureEntity implements HasCustomFields {
     members: Region[];
     @Column(type => CustomZoneFields)
     customFields: CustomZoneFields;
+    @OneToMany(type => Channel, country => country.defaultShippingZone)
+    defaultShippingZoneChannels: Channel[];
+    @OneToMany(type => Channel, country => country.defaultTaxZone)
+    defaultTaxZoneChannels: Channel[];
+    @OneToMany(type => TaxRate, taxRate => taxRate.zone)
+    taxRates: TaxRate[];
 }
 ```
 * Extends: <code><a href='/reference/typescript-api/entities/vendure-entity#vendureentity'>VendureEntity</a></code>
@@ -56,6 +62,21 @@ class Zone extends VendureEntity implements HasCustomFields {
 <MemberInfo kind="property" type={`CustomZoneFields`}   />
 
 
+### defaultShippingZoneChannels
+
+<MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/channel#channel'>Channel</a>[]`}   />
+
+
+### defaultTaxZoneChannels
+
+<MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/channel#channel'>Channel</a>[]`}   />
+
+
+### taxRates
+
+<MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/tax-rate#taxrate'>TaxRate</a>[]`}   />
+
+
 
 
 </div>

+ 2 - 2
docs/docs/reference/typescript-api/job-queue/index.md

@@ -26,7 +26,7 @@ class JobQueue<Data extends JobData<Data> = object> {
     name: string
     started: boolean
     constructor(options: CreateQueueOptions<Data>, jobQueueStrategy: JobQueueStrategy, jobBufferService: JobBufferService)
-    add(data: Data, options?: JobOptions) => Promise<SubscribableJob<Data>>;
+    add(data: Data, options?: JobOptions<Data>) => Promise<SubscribableJob<Data>>;
 }
 ```
 
@@ -49,7 +49,7 @@ class JobQueue<Data extends JobData<Data> = object> {
 
 ### add
 
-<MemberInfo kind="method" type={`(data: Data, options?: Pick&#60;<a href='/reference/typescript-api/job-queue/types#jobconfig'>JobConfig</a>&#60;Data&#62;, 'retries'&#62;) => Promise&#60;<a href='/reference/typescript-api/job-queue/subscribable-job#subscribablejob'>SubscribableJob</a>&#60;Data&#62;&#62;`}   />
+<MemberInfo kind="method" type={`(data: Data, options?: JobOptions&#60;Data&#62;) => Promise&#60;<a href='/reference/typescript-api/job-queue/subscribable-job#subscribablejob'>SubscribableJob</a>&#60;Data&#62;&#62;`}   />
 
 Adds a new <a href='/reference/typescript-api/job-queue/job#job'>Job</a> to the queue. The resolved <a href='/reference/typescript-api/job-queue/subscribable-job#subscribablejob'>SubscribableJob</a> allows the
 calling code to subscribe to updates to the Job:

+ 3 - 3
docs/docs/reference/typescript-api/job-queue/job-queue-strategy.md

@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
 
 ## JobQueueStrategy
 
-<GenerationInfo sourceFile="packages/core/src/config/job-queue/job-queue-strategy.ts" sourceLine="23" packageName="@vendure/core" />
+<GenerationInfo sourceFile="packages/core/src/config/job-queue/job-queue-strategy.ts" sourceLine="24" packageName="@vendure/core" />
 
 Defines how the jobs in the <a href='/reference/typescript-api/job-queue/job-queue-service#jobqueueservice'>JobQueueService</a> are persisted and
 accessed. Custom strategies can be defined to make use of external
@@ -26,7 +26,7 @@ your VendureConfig.
 
 ```ts title="Signature"
 interface JobQueueStrategy extends InjectableStrategy {
-    add<Data extends JobData<Data> = object>(job: Job<Data>): Promise<Job<Data>>;
+    add<Data extends JobData<Data> = object>(job: Job<Data>, jobOptions?: JobQueueStrategyJobOptions<Data>): Promise<Job<Data>>;
     start<Data extends JobData<Data> = object>(
         queueName: string,
         process: (job: Job<Data>) => Promise<any>,
@@ -45,7 +45,7 @@ interface JobQueueStrategy extends InjectableStrategy {
 
 ### add
 
-<MemberInfo kind="method" type={`(job: <a href='/reference/typescript-api/job-queue/job#job'>Job</a>&#60;Data&#62;) => Promise&#60;<a href='/reference/typescript-api/job-queue/job#job'>Job</a>&#60;Data&#62;&#62;`}   />
+<MemberInfo kind="method" type={`(job: <a href='/reference/typescript-api/job-queue/job#job'>Job</a>&#60;Data&#62;, jobOptions?: JobQueueStrategyJobOptions&#60;Data&#62;) => Promise&#60;<a href='/reference/typescript-api/job-queue/job#job'>Job</a>&#60;Data&#62;&#62;`}   />
 
 Add a new job to the queue.
 ### start

+ 2 - 2
docs/docs/reference/typescript-api/job-queue/sql-job-queue-strategy.md

@@ -20,7 +20,7 @@ This strategy is used by the <a href='/reference/typescript-api/job-queue/defaul
 class SqlJobQueueStrategy extends PollingJobQueueStrategy implements InspectableJobQueueStrategy {
     init(injector: Injector) => ;
     destroy() => ;
-    add(job: Job<Data>) => Promise<Job<Data>>;
+    add(job: Job<Data>, jobOptions?: JobQueueStrategyJobOptions<Data>) => Promise<Job<Data>>;
     next(queueName: string) => Promise<Job | undefined>;
     update(job: Job<any>) => Promise<void>;
     findMany(options?: JobListOptions) => Promise<PaginatedList<Job>>;
@@ -50,7 +50,7 @@ class SqlJobQueueStrategy extends PollingJobQueueStrategy implements Inspectable
 
 ### add
 
-<MemberInfo kind="method" type={`(job: <a href='/reference/typescript-api/job-queue/job#job'>Job</a>&#60;Data&#62;) => Promise&#60;<a href='/reference/typescript-api/job-queue/job#job'>Job</a>&#60;Data&#62;&#62;`}   />
+<MemberInfo kind="method" type={`(job: <a href='/reference/typescript-api/job-queue/job#job'>Job</a>&#60;Data&#62;, jobOptions?: JobQueueStrategyJobOptions&#60;Data&#62;) => Promise&#60;<a href='/reference/typescript-api/job-queue/job#job'>Job</a>&#60;Data&#62;&#62;`}   />
 
 
 ### next

+ 3 - 3
docs/docs/reference/typescript-api/job-queue/types.md

@@ -73,7 +73,7 @@ type JobUpdateOptions = {
 
 ## CreateQueueOptions
 
-<GenerationInfo sourceFile="packages/core/src/job-queue/types.ts" sourceLine="13" packageName="@vendure/core" />
+<GenerationInfo sourceFile="packages/core/src/job-queue/types.ts" sourceLine="15" packageName="@vendure/core" />
 
 Used to configure a new <a href='/reference/typescript-api/job-queue/#jobqueue'>JobQueue</a> instance.
 
@@ -104,7 +104,7 @@ should resolve when the job is complete, or be rejected in case of an error.
 
 ## JobData
 
-<GenerationInfo sourceFile="packages/core/src/job-queue/types.ts" sourceLine="35" packageName="@vendure/core" />
+<GenerationInfo sourceFile="packages/core/src/job-queue/types.ts" sourceLine="37" packageName="@vendure/core" />
 
 A JSON-serializable data type which provides a <a href='/reference/typescript-api/job-queue/job#job'>Job</a>
 with the data it needs to be processed.
@@ -116,7 +116,7 @@ type JobData<T> = JsonCompatible<T>
 
 ## JobConfig
 
-<GenerationInfo sourceFile="packages/core/src/job-queue/types.ts" sourceLine="44" packageName="@vendure/core" />
+<GenerationInfo sourceFile="packages/core/src/job-queue/types.ts" sourceLine="46" packageName="@vendure/core" />
 
 Used to instantiate a new <a href='/reference/typescript-api/job-queue/job#job'>Job</a>
 

+ 2 - 2
docs/docs/reference/typescript-api/migration/generate-migration.md

@@ -11,14 +11,14 @@ import MemberDescription from '@site/src/components/MemberDescription';
 
 ## generateMigration
 
-<GenerationInfo sourceFile="packages/core/src/migrate.ts" sourceLine="107" packageName="@vendure/core" />
+<GenerationInfo sourceFile="packages/core/src/migrate.ts" sourceLine="118" packageName="@vendure/core" />
 
 Generates a new migration file based on any schema changes (e.g. adding or removing CustomFields).
 See [TypeORM migration docs](https://typeorm.io/#/migrations) for more information about the
 underlying migration mechanism.
 
 ```ts title="Signature"
-function generateMigration(userConfig: Partial<VendureConfig>, options: MigrationOptions): void
+function generateMigration(userConfig: Partial<VendureConfig>, options: MigrationOptions): Promise<string | undefined>
 ```
 Parameters
 

+ 1 - 1
docs/docs/reference/typescript-api/migration/revert-last-migration.md

@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
 
 ## revertLastMigration
 
-<GenerationInfo sourceFile="packages/core/src/migrate.ts" sourceLine="82" packageName="@vendure/core" />
+<GenerationInfo sourceFile="packages/core/src/migrate.ts" sourceLine="89" packageName="@vendure/core" />
 
 Reverts the last applied database migration. See [TypeORM migration docs](https://typeorm.io/#/migrations)
 for more information about the underlying migration mechanism.

+ 1 - 1
docs/docs/reference/typescript-api/migration/run-migrations.md

@@ -17,7 +17,7 @@ Runs any pending database migrations. See [TypeORM migration docs](https://typeo
 for more information about the underlying migration mechanism.
 
 ```ts title="Signature"
-function runMigrations(userConfig: Partial<VendureConfig>): void
+function runMigrations(userConfig: Partial<VendureConfig>): Promise<string[]>
 ```
 Parameters
 

+ 1 - 1
docs/docs/reference/typescript-api/orders/order-process.md

@@ -196,7 +196,7 @@ Parameters
 
 ## defaultOrderProcess
 
-<GenerationInfo sourceFile="packages/core/src/config/order/default-order-process.ts" sourceLine="476" packageName="@vendure/core" since="2.0.0" />
+<GenerationInfo sourceFile="packages/core/src/config/order/default-order-process.ts" sourceLine="475" packageName="@vendure/core" since="2.0.0" />
 
 This is the built-in <a href='/reference/typescript-api/orders/order-process#orderprocess'>OrderProcess</a> that ships with Vendure. A customized version of this process
 can be created using the <a href='/reference/typescript-api/orders/order-process#configuredefaultorderprocess'>configureDefaultOrderProcess</a> function, which allows you to pass in an object

+ 1 - 1
docs/docs/reference/typescript-api/service-helpers/order-calculator.md

@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
 
 ## OrderCalculator
 
-<GenerationInfo sourceFile="packages/core/src/service/helpers/order-calculator/order-calculator.ts" sourceLine="32" packageName="@vendure/core" />
+<GenerationInfo sourceFile="packages/core/src/service/helpers/order-calculator/order-calculator.ts" sourceLine="33" packageName="@vendure/core" />
 
 This helper is used when making changes to an Order, to apply all applicable price adjustments to that Order,
 including:

+ 1 - 1
docs/docs/reference/typescript-api/service-helpers/product-price-applicator.md

@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
 
 ## ProductPriceApplicator
 
-<GenerationInfo sourceFile="packages/core/src/service/helpers/product-price-applicator/product-price-applicator.ts" sourceLine="40" packageName="@vendure/core" />
+<GenerationInfo sourceFile="packages/core/src/service/helpers/product-price-applicator/product-price-applicator.ts" sourceLine="41" packageName="@vendure/core" />
 
 This helper is used to apply the correct price to a ProductVariant based on the current context
 including active Channel, any current Order, etc. If you use the <a href='/reference/typescript-api/data-access/transactional-connection#transactionalconnection'>TransactionalConnection</a> to

+ 25 - 25
docs/docs/reference/typescript-api/services/customer-service.md

@@ -31,8 +31,8 @@ class CustomerService {
     refreshVerificationToken(ctx: RequestContext, emailAddress: string) => Promise<void>;
     verifyCustomerEmailAddress(ctx: RequestContext, verificationToken: string, password?: string) => Promise<ErrorResultUnion<VerifyCustomerAccountResult, Customer>>;
     requestPasswordReset(ctx: RequestContext, emailAddress: string) => Promise<void>;
-    resetPassword(ctx: RequestContext, passwordResetToken: string, password: string) => Promise<
-        User | PasswordResetTokenExpiredError | PasswordResetTokenInvalidError | PasswordValidationError
+    resetPassword(ctx: RequestContext, passwordResetToken: string, password: string) => Promise<
+        User | PasswordResetTokenExpiredError | PasswordResetTokenInvalidError | PasswordValidationError
     >;
     requestUpdateEmailAddress(ctx: RequestContext, userId: ID, newEmailAddress: string) => Promise<boolean | EmailAddressConflictError>;
     updateEmailAddress(ctx: RequestContext, token: string) => Promise<boolean | IdentifierChangeTokenInvalidError | IdentifierChangeTokenExpiredError>;
@@ -69,8 +69,8 @@ class CustomerService {
 
 <MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, userId: <a href='/reference/typescript-api/common/id#id'>ID</a>, filterOnChannel:  = true) => Promise&#60;<a href='/reference/typescript-api/entities/customer#customer'>Customer</a> | undefined&#62;`}   />
 
-Returns the Customer entity associated with the given userId, if one exists.
-Setting `filterOnChannel` to `true` will limit the results to Customers which are assigned
+Returns the Customer entity associated with the given userId, if one exists.
+Setting `filterOnChannel` to `true` will limit the results to Customers which are assigned
 to the current active Channel only.
 ### findAddressesByCustomerId
 
@@ -86,13 +86,13 @@ Returns a list of all <a href='/reference/typescript-api/entities/customer-group
 
 <MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, input: CreateCustomerInput, password?: string) => Promise&#60;<a href='/reference/typescript-api/errors/error-result-union#errorresultunion'>ErrorResultUnion</a>&#60;CreateCustomerResult, <a href='/reference/typescript-api/entities/customer#customer'>Customer</a>&#62;&#62;`}   />
 
-Creates a new Customer, including creation of a new User with the special `customer` Role.
-
-If the `password` argument is specified, the Customer will be immediately verified. If not,
-then an <a href='/reference/typescript-api/events/event-types#accountregistrationevent'>AccountRegistrationEvent</a> is published, so that the customer can have their
-email address verified and set their password in a later step using the `verifyCustomerEmailAddress()`
-method.
-
+Creates a new Customer, including creation of a new User with the special `customer` Role.
+
+If the `password` argument is specified, the Customer will be immediately verified. If not,
+then an <a href='/reference/typescript-api/events/event-types#accountregistrationevent'>AccountRegistrationEvent</a> is published, so that the customer can have their
+email address verified and set their password in a later step using the `verifyCustomerEmailAddress()`
+method.
+
 This method is intended to be used in admin-created Customer flows.
 ### update
 
@@ -113,47 +113,47 @@ This method is intended to be used in admin-created Customer flows.
 
 <MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, input: RegisterCustomerInput) => Promise&#60;RegisterCustomerAccountResult | EmailAddressConflictError | PasswordValidationError&#62;`}   />
 
-Registers a new Customer account with the <a href='/reference/typescript-api/auth/native-authentication-strategy#nativeauthenticationstrategy'>NativeAuthenticationStrategy</a> and starts
-the email verification flow (unless <a href='/reference/typescript-api/auth/auth-options#authoptions'>AuthOptions</a> `requireVerification` is set to `false`)
-by publishing an <a href='/reference/typescript-api/events/event-types#accountregistrationevent'>AccountRegistrationEvent</a>.
-
+Registers a new Customer account with the <a href='/reference/typescript-api/auth/native-authentication-strategy#nativeauthenticationstrategy'>NativeAuthenticationStrategy</a> and starts
+the email verification flow (unless <a href='/reference/typescript-api/auth/auth-options#authoptions'>AuthOptions</a> `requireVerification` is set to `false`)
+by publishing an <a href='/reference/typescript-api/events/event-types#accountregistrationevent'>AccountRegistrationEvent</a>.
+
 This method is intended to be used in storefront Customer-creation flows.
 ### refreshVerificationToken
 
 <MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, emailAddress: string) => Promise&#60;void&#62;`}   />
 
-Refreshes a stale email address verification token by generating a new one and
+Refreshes a stale email address verification token by generating a new one and
 publishing a <a href='/reference/typescript-api/events/event-types#accountregistrationevent'>AccountRegistrationEvent</a>.
 ### verifyCustomerEmailAddress
 
 <MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, verificationToken: string, password?: string) => Promise&#60;<a href='/reference/typescript-api/errors/error-result-union#errorresultunion'>ErrorResultUnion</a>&#60;VerifyCustomerAccountResult, <a href='/reference/typescript-api/entities/customer#customer'>Customer</a>&#62;&#62;`}   />
 
-Given a valid verification token which has been published in an <a href='/reference/typescript-api/events/event-types#accountregistrationevent'>AccountRegistrationEvent</a>, this
+Given a valid verification token which has been published in an <a href='/reference/typescript-api/events/event-types#accountregistrationevent'>AccountRegistrationEvent</a>, this
 method is used to set the Customer as `verified` as part of the account registration flow.
 ### requestPasswordReset
 
 <MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, emailAddress: string) => Promise&#60;void&#62;`}   />
 
-Publishes a new <a href='/reference/typescript-api/events/event-types#passwordresetevent'>PasswordResetEvent</a> for the given email address. This event creates
+Publishes a new <a href='/reference/typescript-api/events/event-types#passwordresetevent'>PasswordResetEvent</a> for the given email address. This event creates
 a token which can be used in the `resetPassword()` method.
 ### resetPassword
 
-<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, passwordResetToken: string, password: string) => Promise&#60;         <a href='/reference/typescript-api/entities/user#user'>User</a> | PasswordResetTokenExpiredError | PasswordResetTokenInvalidError | PasswordValidationError     &#62;`}   />
+<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, passwordResetToken: string, password: string) => Promise&#60;
         <a href='/reference/typescript-api/entities/user#user'>User</a> | PasswordResetTokenExpiredError | PasswordResetTokenInvalidError | PasswordValidationError
     &#62;`}   />
 
-Given a valid password reset token created by a call to the `requestPasswordReset()` method,
+Given a valid password reset token created by a call to the `requestPasswordReset()` method,
 this method will change the Customer's password to that given as the `password` argument.
 ### requestUpdateEmailAddress
 
 <MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, userId: <a href='/reference/typescript-api/common/id#id'>ID</a>, newEmailAddress: string) => Promise&#60;boolean | EmailAddressConflictError&#62;`}   />
 
-Publishes a <a href='/reference/typescript-api/events/event-types#identifierchangerequestevent'>IdentifierChangeRequestEvent</a> for the given User. This event contains a token
-which is then used in the `updateEmailAddress()` method to change the email address of the User &
+Publishes a <a href='/reference/typescript-api/events/event-types#identifierchangerequestevent'>IdentifierChangeRequestEvent</a> for the given User. This event contains a token
+which is then used in the `updateEmailAddress()` method to change the email address of the User &
 Customer.
 ### updateEmailAddress
 
 <MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, token: string) => Promise&#60;boolean | IdentifierChangeTokenInvalidError | IdentifierChangeTokenExpiredError&#62;`}   />
 
-Given a valid email update token published in a <a href='/reference/typescript-api/events/event-types#identifierchangerequestevent'>IdentifierChangeRequestEvent</a>, this method
+Given a valid email update token published in a <a href='/reference/typescript-api/events/event-types#identifierchangerequestevent'>IdentifierChangeRequestEvent</a>, this method
 will update the Customer & User email address.
 ### createOrUpdate
 
@@ -184,8 +184,8 @@ Creates a new <a href='/reference/typescript-api/entities/address#address'>Addre
 
 <MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, order: <a href='/reference/typescript-api/entities/order#order'>Order</a>) => `}   />
 
-If the Customer associated with the given Order does not yet have any Addresses,
-this method will create new Address(es) based on the Order's shipping & billing
+If the Customer associated with the given Order does not yet have any Addresses,
+this method will create new Address(es) based on the Order's shipping & billing
 addresses.
 ### addNoteToCustomer
 

+ 11 - 11
docs/docs/reference/typescript-api/services/fulfillment-service.md

@@ -21,14 +21,14 @@ class FulfillmentService {
     create(ctx: RequestContext, orders: Order[], lines: OrderLineInput[], handler: ConfigurableOperationInput) => Promise<Fulfillment | InvalidFulfillmentHandlerError | CreateFulfillmentError>;
     getFulfillmentLines(ctx: RequestContext, id: ID) => Promise<FulfillmentLine[]>;
     getFulfillmentsLinesForOrderLine(ctx: RequestContext, orderLineId: ID, relations: RelationPaths<FulfillmentLine> = []) => Promise<FulfillmentLine[]>;
-    transitionToState(ctx: RequestContext, fulfillmentId: ID, state: FulfillmentState) => Promise<
-        | {
-              fulfillment: Fulfillment;
-              orders: Order[];
-              fromState: FulfillmentState;
-              toState: FulfillmentState;
-          }
-        | FulfillmentStateTransitionError
+    transitionToState(ctx: RequestContext, fulfillmentId: ID, state: FulfillmentState) => Promise<
+        | {
+              fulfillment: Fulfillment;
+              orders: Order[];
+              fromState: FulfillmentState;
+              toState: FulfillmentState;
+          }
+        | FulfillmentStateTransitionError
     >;
     getNextStates(fulfillment: Fulfillment) => readonly FulfillmentState[];
 }
@@ -45,7 +45,7 @@ class FulfillmentService {
 
 <MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, orders: <a href='/reference/typescript-api/entities/order#order'>Order</a>[], lines: OrderLineInput[], handler: ConfigurableOperationInput) => Promise&#60;<a href='/reference/typescript-api/entities/fulfillment#fulfillment'>Fulfillment</a> | InvalidFulfillmentHandlerError | CreateFulfillmentError&#62;`}   />
 
-Creates a new Fulfillment for the given Orders and OrderItems, using the specified
+Creates a new Fulfillment for the given Orders and OrderItems, using the specified
 <a href='/reference/typescript-api/fulfillment/fulfillment-handler#fulfillmenthandler'>FulfillmentHandler</a>.
 ### getFulfillmentLines
 
@@ -59,9 +59,9 @@ Creates a new Fulfillment for the given Orders and OrderItems, using the specifi
 
 ### transitionToState
 
-<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, fulfillmentId: <a href='/reference/typescript-api/common/id#id'>ID</a>, state: <a href='/reference/typescript-api/fulfillment/fulfillment-state#fulfillmentstate'>FulfillmentState</a>) => Promise&#60;         | {               fulfillment: <a href='/reference/typescript-api/entities/fulfillment#fulfillment'>Fulfillment</a>;               orders: <a href='/reference/typescript-api/entities/order#order'>Order</a>[];               fromState: <a href='/reference/typescript-api/fulfillment/fulfillment-state#fulfillmentstate'>FulfillmentState</a>;               toState: <a href='/reference/typescript-api/fulfillment/fulfillment-state#fulfillmentstate'>FulfillmentState</a>;           }         | FulfillmentStateTransitionError     &#62;`}   />
+<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, fulfillmentId: <a href='/reference/typescript-api/common/id#id'>ID</a>, state: <a href='/reference/typescript-api/fulfillment/fulfillment-state#fulfillmentstate'>FulfillmentState</a>) => Promise&#60;
         | {
               fulfillment: <a href='/reference/typescript-api/entities/fulfillment#fulfillment'>Fulfillment</a>;
               orders: <a href='/reference/typescript-api/entities/order#order'>Order</a>[];
               fromState: <a href='/reference/typescript-api/fulfillment/fulfillment-state#fulfillmentstate'>FulfillmentState</a>;
               toState: <a href='/reference/typescript-api/fulfillment/fulfillment-state#fulfillmentstate'>FulfillmentState</a>;
           }
         | FulfillmentStateTransitionError
     &#62;`}   />
 
-Transitions the specified Fulfillment to a new state and upon successful transition
+Transitions the specified Fulfillment to a new state and upon successful transition
 publishes a <a href='/reference/typescript-api/events/event-types#fulfillmentstatetransitionevent'>FulfillmentStateTransitionEvent</a>.
 ### getNextStates
 

+ 1 - 1
docs/docs/reference/typescript-api/services/global-settings-service.md

@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
 
 ## GlobalSettingsService
 
-<GenerationInfo sourceFile="packages/core/src/service/services/global-settings.service.ts" sourceLine="21" packageName="@vendure/core" />
+<GenerationInfo sourceFile="packages/core/src/service/services/global-settings.service.ts" sourceLine="22" packageName="@vendure/core" />
 
 Contains methods relating to the {@link GlobalSettings} entity.
 

+ 1 - 1
docs/docs/reference/typescript-api/services/order-service.md

@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
 
 ## OrderService
 
-<GenerationInfo sourceFile="packages/core/src/service/services/order.service.ts" sourceLine="133" packageName="@vendure/core" />
+<GenerationInfo sourceFile="packages/core/src/service/services/order.service.ts" sourceLine="134" packageName="@vendure/core" />
 
 Contains methods relating to <a href='/reference/typescript-api/entities/order#order'>Order</a> entities.
 

+ 5 - 5
docs/docs/reference/typescript-api/services/payment-method-service.md

@@ -28,10 +28,10 @@ class PaymentMethodService {
     getPaymentMethodEligibilityCheckers(ctx: RequestContext) => ConfigurableOperationDefinition[];
     getPaymentMethodHandlers(ctx: RequestContext) => ConfigurableOperationDefinition[];
     getEligiblePaymentMethods(ctx: RequestContext, order: Order) => Promise<PaymentMethodQuote[]>;
-    getMethodAndOperations(ctx: RequestContext, method: string) => Promise<{
-        paymentMethod: PaymentMethod;
-        handler: PaymentMethodHandler;
-        checker: PaymentMethodEligibilityChecker | null;
+    getMethodAndOperations(ctx: RequestContext, method: string) => Promise<{
+        paymentMethod: PaymentMethod;
+        handler: PaymentMethodHandler;
+        checker: PaymentMethodEligibilityChecker | null;
     }>;
 }
 ```
@@ -95,7 +95,7 @@ class PaymentMethodService {
 
 ### getMethodAndOperations
 
-<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, method: string) => Promise&#60;{         paymentMethod: <a href='/reference/typescript-api/entities/payment-method#paymentmethod'>PaymentMethod</a>;         handler: <a href='/reference/typescript-api/payment/payment-method-handler#paymentmethodhandler'>PaymentMethodHandler</a>;         checker: <a href='/reference/typescript-api/payment/payment-method-eligibility-checker#paymentmethodeligibilitychecker'>PaymentMethodEligibilityChecker</a> | null;     }&#62;`}   />
+<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, method: string) => Promise&#60;{
         paymentMethod: <a href='/reference/typescript-api/entities/payment-method#paymentmethod'>PaymentMethod</a>;
         handler: <a href='/reference/typescript-api/payment/payment-method-handler#paymentmethodhandler'>PaymentMethodHandler</a>;
         checker: <a href='/reference/typescript-api/payment/payment-method-eligibility-checker#paymentmethodeligibilitychecker'>PaymentMethodEligibilityChecker</a> | null;
     }&#62;`}   />
 
 
 

+ 3 - 3
docs/docs/reference/typescript-api/services/tax-rate-service.md

@@ -11,13 +11,13 @@ import MemberDescription from '@site/src/components/MemberDescription';
 
 ## TaxRateService
 
-<GenerationInfo sourceFile="packages/core/src/service/services/tax-rate.service.ts" sourceLine="34" packageName="@vendure/core" />
+<GenerationInfo sourceFile="packages/core/src/service/services/tax-rate.service.ts" sourceLine="35" packageName="@vendure/core" />
 
 Contains methods relating to <a href='/reference/typescript-api/entities/tax-rate#taxrate'>TaxRate</a> entities.
 
 ```ts title="Signature"
 class TaxRateService {
-    constructor(connection: TransactionalConnection, eventBus: EventBus, listQueryBuilder: ListQueryBuilder, configService: ConfigService)
+    constructor(connection: TransactionalConnection, eventBus: EventBus, listQueryBuilder: ListQueryBuilder, configService: ConfigService, customFieldRelationService: CustomFieldRelationService)
     findAll(ctx: RequestContext, options?: ListQueryOptions<TaxRate>, relations?: RelationPaths<TaxRate>) => Promise<PaginatedList<TaxRate>>;
     findOne(ctx: RequestContext, taxRateId: ID, relations?: RelationPaths<TaxRate>) => Promise<TaxRate | undefined>;
     create(ctx: RequestContext, input: CreateTaxRateInput) => Promise<TaxRate>;
@@ -31,7 +31,7 @@ class TaxRateService {
 
 ### constructor
 
-<MemberInfo kind="method" type={`(connection: <a href='/reference/typescript-api/data-access/transactional-connection#transactionalconnection'>TransactionalConnection</a>, eventBus: <a href='/reference/typescript-api/events/event-bus#eventbus'>EventBus</a>, listQueryBuilder: <a href='/reference/typescript-api/data-access/list-query-builder#listquerybuilder'>ListQueryBuilder</a>, configService: ConfigService) => TaxRateService`}   />
+<MemberInfo kind="method" type={`(connection: <a href='/reference/typescript-api/data-access/transactional-connection#transactionalconnection'>TransactionalConnection</a>, eventBus: <a href='/reference/typescript-api/events/event-bus#eventbus'>EventBus</a>, listQueryBuilder: <a href='/reference/typescript-api/data-access/list-query-builder#listquerybuilder'>ListQueryBuilder</a>, configService: ConfigService, customFieldRelationService: CustomFieldRelationService) => TaxRateService`}   />
 
 
 ### findAll