Selaa lähdekoodia

docs: Regenerate docs

Michael Bromley 1 vuosi sitten
vanhempi
sitoutus
c005750b6a

+ 7 - 0
docs/docs/reference/core-plugins/payments-plugin/stripe-plugin.md

@@ -209,6 +209,7 @@ interface StripePluginOptions {
         ctx: RequestContext,
         order: Order,
     ) => AdditionalCustomerCreateParams | Promise<AdditionalCustomerCreateParams>;
+    skipPaymentIntentsWithoutExpectedMetadata?: boolean;
 }
 ```
 
@@ -347,6 +348,12 @@ export const config: VendureConfig = {
   ],
 };
 ```
+### skipPaymentIntentsWithoutExpectedMetadata
+
+<MemberInfo kind="property" type={`boolean`}   />
+
+If your Stripe account also generates payment intents which are independent of Vendure orders, you can set this
+to `true` to skip processing those payment intents.
 
 
 </div>

+ 1 - 1
docs/docs/reference/typescript-api/configuration/default-config.md

@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
 
 ## defaultConfig
 
-<GenerationInfo sourceFile="packages/core/src/config/default-config.ts" sourceLine="63" packageName="@vendure/core" />
+<GenerationInfo sourceFile="packages/core/src/config/default-config.ts" sourceLine="64" packageName="@vendure/core" />
 
 The default configuration settings which are used if not explicitly overridden in the bootstrap() call.
 

+ 28 - 0
docs/docs/reference/typescript-api/events/event-types.md

@@ -1483,6 +1483,34 @@ class ShippingMethodEvent extends VendureEntityEvent<ShippingMethod, ShippingMet
 
 
 
+</div>
+
+
+## StockLocationEvent
+
+<GenerationInfo sourceFile="packages/core/src/event-bus/events/stock-location-event.ts" sourceLine="18" packageName="@vendure/core" />
+
+This event is fired whenever a <a href='/reference/typescript-api/entities/stock-location#stocklocation'>StockLocation</a> is added, updated
+or deleted.
+
+```ts title="Signature"
+class StockLocationEvent extends VendureEntityEvent<StockLocation, StockLocationInputTypes> {
+    constructor(ctx: RequestContext, entity: StockLocation, type: 'created' | 'updated' | 'deleted', input?: StockLocationInputTypes)
+}
+```
+* Extends: <code><a href='/reference/typescript-api/events/vendure-entity-event#vendureentityevent'>VendureEntityEvent</a>&#60;<a href='/reference/typescript-api/entities/stock-location#stocklocation'>StockLocation</a>, StockLocationInputTypes&#62;</code>
+
+
+
+<div className="members-wrapper">
+
+### constructor
+
+<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, entity: <a href='/reference/typescript-api/entities/stock-location#stocklocation'>StockLocation</a>, type: 'created' | 'updated' | 'deleted', input?: StockLocationInputTypes) => StockLocationEvent`}   />
+
+
+
+
 </div>
 
 

+ 7 - 29
docs/docs/reference/typescript-api/products-stock/default-stock-location-strategy.md

@@ -11,33 +11,26 @@ import MemberDescription from '@site/src/components/MemberDescription';
 
 ## DefaultStockLocationStrategy
 
-<GenerationInfo sourceFile="packages/core/src/config/catalog/default-stock-location-strategy.ts" sourceLine="22" packageName="@vendure/core" since="2.0.0" />
+<GenerationInfo sourceFile="packages/core/src/config/catalog/default-stock-location-strategy.ts" sourceLine="105" packageName="@vendure/core" since="2.0.0" />
 
-The DefaultStockLocationStrategy is the default implementation of the <a href='/reference/typescript-api/products-stock/stock-location-strategy#stocklocationstrategy'>StockLocationStrategy</a>.
-It assumes only a single StockLocation and that all stock is allocated from that location.
+The DefaultStockLocationStrategy was the default implementation of the <a href='/reference/typescript-api/products-stock/stock-location-strategy#stocklocationstrategy'>StockLocationStrategy</a>
+prior to the introduction of the <a href='/reference/typescript-api/products-stock/multi-channel-stock-location-strategy#multichannelstocklocationstrategy'>MultiChannelStockLocationStrategy</a>.
+It assumes only a single StockLocation and that all stock is allocated from that location. When
+more than one StockLocation or Channel is used, it will not behave as expected.
 
 ```ts title="Signature"
-class DefaultStockLocationStrategy implements StockLocationStrategy {
-    protected connection: TransactionalConnection;
+class DefaultStockLocationStrategy extends BaseStockLocationStrategy {
     init(injector: Injector) => ;
     getAvailableStock(ctx: RequestContext, productVariantId: ID, stockLevels: StockLevel[]) => AvailableStock;
     forAllocation(ctx: RequestContext, stockLocations: StockLocation[], orderLine: OrderLine, quantity: number) => LocationWithQuantity[] | Promise<LocationWithQuantity[]>;
-    forCancellation(ctx: RequestContext, stockLocations: StockLocation[], orderLine: OrderLine, quantity: number) => Promise<LocationWithQuantity[]>;
-    forRelease(ctx: RequestContext, stockLocations: StockLocation[], orderLine: OrderLine, quantity: number) => Promise<LocationWithQuantity[]>;
-    forSale(ctx: RequestContext, stockLocations: StockLocation[], orderLine: OrderLine, quantity: number) => Promise<LocationWithQuantity[]>;
 }
 ```
-* Implements: <code><a href='/reference/typescript-api/products-stock/stock-location-strategy#stocklocationstrategy'>StockLocationStrategy</a></code>
+* Extends: <code>BaseStockLocationStrategy</code>
 
 
 
 <div className="members-wrapper">
 
-### connection
-
-<MemberInfo kind="property" type={`<a href='/reference/typescript-api/data-access/transactional-connection#transactionalconnection'>TransactionalConnection</a>`}   />
-
-
 ### init
 
 <MemberInfo kind="method" type={`(injector: <a href='/reference/typescript-api/common/injector#injector'>Injector</a>) => `}   />
@@ -53,21 +46,6 @@ class DefaultStockLocationStrategy implements StockLocationStrategy {
 <MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, stockLocations: <a href='/reference/typescript-api/entities/stock-location#stocklocation'>StockLocation</a>[], orderLine: <a href='/reference/typescript-api/entities/order-line#orderline'>OrderLine</a>, quantity: number) => <a href='/reference/typescript-api/products-stock/stock-location-strategy#locationwithquantity'>LocationWithQuantity</a>[] | Promise&#60;<a href='/reference/typescript-api/products-stock/stock-location-strategy#locationwithquantity'>LocationWithQuantity</a>[]&#62;`}   />
 
 
-### forCancellation
-
-<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, stockLocations: <a href='/reference/typescript-api/entities/stock-location#stocklocation'>StockLocation</a>[], orderLine: <a href='/reference/typescript-api/entities/order-line#orderline'>OrderLine</a>, quantity: number) => Promise&#60;<a href='/reference/typescript-api/products-stock/stock-location-strategy#locationwithquantity'>LocationWithQuantity</a>[]&#62;`}   />
-
-
-### forRelease
-
-<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, stockLocations: <a href='/reference/typescript-api/entities/stock-location#stocklocation'>StockLocation</a>[], orderLine: <a href='/reference/typescript-api/entities/order-line#orderline'>OrderLine</a>, quantity: number) => Promise&#60;<a href='/reference/typescript-api/products-stock/stock-location-strategy#locationwithquantity'>LocationWithQuantity</a>[]&#62;`}   />
-
-
-### forSale
-
-<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, stockLocations: <a href='/reference/typescript-api/entities/stock-location#stocklocation'>StockLocation</a>[], orderLine: <a href='/reference/typescript-api/entities/order-line#orderline'>OrderLine</a>, quantity: number) => Promise&#60;<a href='/reference/typescript-api/products-stock/stock-location-strategy#locationwithquantity'>LocationWithQuantity</a>[]&#62;`}   />
-
-
 
 
 </div>

+ 81 - 0
docs/docs/reference/typescript-api/products-stock/multi-channel-stock-location-strategy.md

@@ -0,0 +1,81 @@
+---
+title: "MultiChannelStockLocationStrategy"
+isDefaultIndex: false
+generated: true
+---
+<!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script -->
+import MemberInfo from '@site/src/components/MemberInfo';
+import GenerationInfo from '@site/src/components/GenerationInfo';
+import MemberDescription from '@site/src/components/MemberDescription';
+
+
+## MultiChannelStockLocationStrategy
+
+<GenerationInfo sourceFile="packages/core/src/config/catalog/multi-channel-stock-location-strategy.ts" sourceLine="32" packageName="@vendure/core" since="3.1.0" />
+
+The MultiChannelStockLocationStrategy is an implementation of the <a href='/reference/typescript-api/products-stock/stock-location-strategy#stocklocationstrategy'>StockLocationStrategy</a>.
+which is suitable for both single- and multichannel setups. It takes into account the active
+channel when determining stock levels, and also ensures that allocations are made only against
+stock locations which are associated with the active channel.
+
+This strategy became the default in Vendure 3.1.0. If you want to use the previous strategy which
+does not take channels into account, update your VendureConfig to use to <a href='/reference/typescript-api/products-stock/default-stock-location-strategy#defaultstocklocationstrategy'>DefaultStockLocationStrategy</a>.
+
+```ts title="Signature"
+class MultiChannelStockLocationStrategy extends BaseStockLocationStrategy {
+    protected cacheService: CacheService;
+    protected channelIdCache: Cache;
+    protected eventBus: EventBus;
+    protected globalSettingsService: GlobalSettingsService;
+    protected requestContextCache: RequestContextCacheService;
+    getAvailableStock(ctx: RequestContext, productVariantId: ID, stockLevels: StockLevel[]) => Promise<AvailableStock>;
+    forAllocation(ctx: RequestContext, stockLocations: StockLocation[], orderLine: OrderLine, quantity: number) => Promise<LocationWithQuantity[]>;
+}
+```
+* Extends: <code>BaseStockLocationStrategy</code>
+
+
+
+<div className="members-wrapper">
+
+### cacheService
+
+<MemberInfo kind="property" type={`<a href='/reference/typescript-api/cache/cache-service#cacheservice'>CacheService</a>`}   />
+
+
+### channelIdCache
+
+<MemberInfo kind="property" type={`<a href='/reference/typescript-api/cache/#cache'>Cache</a>`}   />
+
+
+### eventBus
+
+<MemberInfo kind="property" type={`<a href='/reference/typescript-api/events/event-bus#eventbus'>EventBus</a>`}   />
+
+
+### globalSettingsService
+
+<MemberInfo kind="property" type={`<a href='/reference/typescript-api/services/global-settings-service#globalsettingsservice'>GlobalSettingsService</a>`}   />
+
+
+### requestContextCache
+
+<MemberInfo kind="property" type={`<a href='/reference/typescript-api/cache/request-context-cache-service#requestcontextcacheservice'>RequestContextCacheService</a>`}   />
+
+
+### getAvailableStock
+
+<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, productVariantId: <a href='/reference/typescript-api/common/id#id'>ID</a>, stockLevels: <a href='/reference/typescript-api/entities/stock-level#stocklevel'>StockLevel</a>[]) => Promise&#60;<a href='/reference/typescript-api/products-stock/stock-location-strategy#availablestock'>AvailableStock</a>&#62;`}   />
+
+Returns the available stock for the given ProductVariant, taking into account the active Channel.
+### forAllocation
+
+<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, stockLocations: <a href='/reference/typescript-api/entities/stock-location#stocklocation'>StockLocation</a>[], orderLine: <a href='/reference/typescript-api/entities/order-line#orderline'>OrderLine</a>, quantity: number) => Promise&#60;<a href='/reference/typescript-api/products-stock/stock-location-strategy#locationwithquantity'>LocationWithQuantity</a>[]&#62;`}   />
+
+This method takes into account whether the stock location is applicable to the active channel.
+It furthermore respects the `trackInventory` and `outOfStockThreshold` settings of the ProductVariant,
+in order to allocate stock only from locations which are relevant to the active channel and which
+have sufficient stock available.
+
+
+</div>