diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index e72141f2b3..d9af20bc4e 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -12,11 +12,11 @@ You can add screenshots here if applicable.
# Checklist
-:pushpin: Always:
+📌 Always:
- [ ] I have set a clear title
- [ ] My PR is small and contains a single feature
- [ ] I have [checked my own PR](## "Fix typo's and remove unused or commented out code")
-:zap: Most of the time:
+👍 Most of the time:
- [ ] I have added or updated test cases
-- [ ] I have updated the README if needed
\ No newline at end of file
+- [ ] I have updated the README if needed
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 94035f362b..ca9c9a6f64 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,20 @@
+## 2.1.5 (2023-12-14)
+
+
+#### Fixes
+
+* **admin-ui** Fix display of asset detail focal point buttons ([1b58aa7](https://github.com/vendure-ecommerce/vendure/commit/1b58aa7))
+* **core** Export VendureEntityEvent abstract class from index (#2556) ([c46cf74](https://github.com/vendure-ecommerce/vendure/commit/c46cf74)), closes [#2556](https://github.com/vendure-ecommerce/vendure/issues/2556)
+* **core** Fix bug when instantiating entity from object with getter ([d09452e](https://github.com/vendure-ecommerce/vendure/commit/d09452e)), closes [#2574](https://github.com/vendure-ecommerce/vendure/issues/2574)
+* **core** Fix loading multiple customField relations (#2566) ([99e04d1](https://github.com/vendure-ecommerce/vendure/commit/99e04d1)), closes [#2566](https://github.com/vendure-ecommerce/vendure/issues/2566) [#2555](https://github.com/vendure-ecommerce/vendure/issues/2555)
+* **core** OrderLineEvent includes ID of deleted OrderLine ([ee04032](https://github.com/vendure-ecommerce/vendure/commit/ee04032)), closes [#2574](https://github.com/vendure-ecommerce/vendure/issues/2574)
+* **core** Remove redundant constraint when creating allocations ([52c0841](https://github.com/vendure-ecommerce/vendure/commit/52c0841)), closes [#2563](https://github.com/vendure-ecommerce/vendure/issues/2563)
+* **core** Send the correct amount to `refundOrder` (#2559) ([b5a265f](https://github.com/vendure-ecommerce/vendure/commit/b5a265f)), closes [#2559](https://github.com/vendure-ecommerce/vendure/issues/2559)
+* **elasticsearch-plugin** Fix type to allow the promise on custom mapping definition (#2562) ([8e9ee07](https://github.com/vendure-ecommerce/vendure/commit/8e9ee07)), closes [#2562](https://github.com/vendure-ecommerce/vendure/issues/2562)
+* **payments-plugin** Fix Mollie channel awareness (#2575) ([cc4826d](https://github.com/vendure-ecommerce/vendure/commit/cc4826d)), closes [#2575](https://github.com/vendure-ecommerce/vendure/issues/2575)
+* **payments-plugin** Mollie - ignore completed state to prevent unneccesary error throwing (#2569) ([ed80c68](https://github.com/vendure-ecommerce/vendure/commit/ed80c68)), closes [#2569](https://github.com/vendure-ecommerce/vendure/issues/2569)
+* **stellate-plugin** Add stellate plugin ([2254576](https://github.com/vendure-ecommerce/vendure/commit/2254576))
+
## 2.1.4 (2023-11-24)
diff --git a/README.md b/README.md
index df96e100e4..bdff435dea 100644
--- a/README.md
+++ b/README.md
@@ -48,9 +48,6 @@ The root directory has a `package.json` which contains build-related dependencie
* Generating TypeScript types from the GraphQL schema
* Linting, formatting & testing tasks to run on git commit & push
-> Note:
-> When you do `yarn` for the first time, you will need to manually create the `package` folder under [/packages/admin-ui](/packages/admin-ui).
-
### 2. Build all packages
`yarn build`
diff --git a/docs/docs/guides/developer-guide/custom-fields/index.md b/docs/docs/guides/developer-guide/custom-fields/index.md
index 8d69678353..10589226a2 100644
--- a/docs/docs/guides/developer-guide/custom-fields/index.md
+++ b/docs/docs/guides/developer-guide/custom-fields/index.md
@@ -141,7 +141,7 @@ The following types are available for custom fields:
| `string` | Short string data | url, label |
| `localeString` | Localized short strings | localized url |
| `text` | Long text data | extended product info, json config object |
-| `localText` | Localized long text | localized extended product info |
+| `localeText` | Localized long text | localized extended product info |
| `int` | Integer | product weight, customer loyalty points, monetary values |
| `float` | Floating point number | product review rating |
| `boolean` | Boolean | isDownloadable flag on product |
diff --git a/docs/docs/guides/developer-guide/error-handling/index.mdx b/docs/docs/guides/developer-guide/error-handling/index.mdx
index 34e3434b25..2e23b73f00 100644
--- a/docs/docs/guides/developer-guide/error-handling/index.mdx
+++ b/docs/docs/guides/developer-guide/error-handling/index.mdx
@@ -231,6 +231,33 @@ Here's how a response would look in both the success and error result cases:
+### Handling ErrorResults in plugin code
+
+If you are writing a plugin which deals with internal Vendure service methods that may return ErrorResults,
+then you can use the `isGraphQlErrorResult()` function to check whether the result is an ErrorResult:
+
+```ts
+import { Injectable} from '@nestjs/common';
+import { isGraphQlErrorResult, Order, OrderService, OrderState, RequestContext } from '@vendure/core';
+
+@Injectable()
+export class MyService {
+
+ constructor(private orderService: OrderService) {}
+
+ async myMethod(ctx: RequestContext, order: Order, newState: OrderState) {
+ const transitionResult = await this.orderService.transitionToState(ctx, order.id, newState);
+ if (isGraphQlErrorResult(transitionResult)) {
+ // The transition failed with an ErrorResult
+ throw transitionResult;
+ } else {
+ // TypeScript will correctly infer the type of `transitionResult` to be `Order`
+ return transitionResult;
+ }
+ }
+}
+```
+
### Handling ErrorResults in client code
Because we know all possible ErrorResult that may occur for a given mutation, we can handle them in an exhaustive manner. In other
diff --git a/docs/docs/guides/developer-guide/plugins/index.mdx b/docs/docs/guides/developer-guide/plugins/index.mdx
index 3d74a45738..d50a50ea65 100644
--- a/docs/docs/guides/developer-guide/plugins/index.mdx
+++ b/docs/docs/guides/developer-guide/plugins/index.mdx
@@ -138,7 +138,7 @@ export class MyPlugin implements NestModule {
In Vendure **plugins** are used to extend the core functionality of the server. Plugins can be pre-made functionality that you can install via npm, or they can be custom plugins that you write yourself.
-For any unit of functionality that you need to add to your project, you'll be writing creating a Vendure plugin. By convention, plugins are stored in the `plugins` directory of your project. However, this is not a requirement, and you are free to arrange your plugin files in any way you like.
+For any unit of functionality that you need to add to your project, you'll be creating a Vendure plugin. By convention, plugins are stored in the `plugins` directory of your project. However, this is not a requirement, and you are free to arrange your plugin files in any way you like.
```txt
├──src
@@ -281,7 +281,6 @@ In order to make use of this custom field in a type-safe way, we can tell TypeSc
```
```ts title="src/plugins/wishlist-plugin/types.ts"
-import { CustomCustomerFields } from '@vendure/core/dist/entity/custom-entity-fields';
import { WishlistItem } from './entities/wishlist-item.entity';
declare module '@vendure/core/dist/entity/custom-entity-fields' {
@@ -312,7 +311,7 @@ Let's create a service to handle the wishlist functionality:
├── wishlist.service.ts
```
-```ts title="src/plugins/wishlist-plugin/wishlist.service.ts"
+```ts title="src/plugins/wishlist-plugin/services/wishlist.service.ts"
import { Injectable } from '@nestjs/common';
import {
Customer,
diff --git a/docs/docs/guides/extending-the-admin-ui/creating-list-views/index.md b/docs/docs/guides/extending-the-admin-ui/creating-list-views/index.md
index 32226b43a5..d4138134a1 100644
--- a/docs/docs/guides/extending-the-admin-ui/creating-list-views/index.md
+++ b/docs/docs/guides/extending-the-admin-ui/creating-list-views/index.md
@@ -185,12 +185,13 @@ This is the standard layout for any list view. The main functionality is provide
/>
-
+
{{ review.id }}
-
+ {{ review.title }}
@@ -216,10 +218,10 @@ This is the standard layout for any list view. The main functionality is provide
-
+
-
+ {{ review.authorName }}
diff --git a/docs/docs/reference/admin-ui-api/action-bar/action-bar-context.md b/docs/docs/reference/admin-ui-api/action-bar/action-bar-context.md
index 61c0884fc2..851e11bd73 100644
--- a/docs/docs/reference/admin-ui-api/action-bar/action-bar-context.md
+++ b/docs/docs/reference/admin-ui-api/action-bar/action-bar-context.md
@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
## ActionBarContext
-
+
Providers available to the onClick handler of an ActionBarItem or NavMenuItem.
diff --git a/docs/docs/reference/admin-ui-api/action-bar/action-bar-item.md b/docs/docs/reference/admin-ui-api/action-bar/action-bar-item.md
index a438a00ae5..f336cc625e 100644
--- a/docs/docs/reference/admin-ui-api/action-bar/action-bar-item.md
+++ b/docs/docs/reference/admin-ui-api/action-bar/action-bar-item.md
@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
## ActionBarItem
-
+
A button in the ActionBar area at the top of one of the list or detail views.
@@ -88,7 +88,18 @@ dynamically enable/disable or show/hide the button.
+Control the display of this item based on the user permissions. Note: if you attempt to pass a
+PermissionDefinition object, you will get a compilation error. Instead, pass the plain
+string version. For example, if the permission is defined as:
+```ts
+export const MyPermission = new PermissionDefinition('ProductReview');
+```
+then the generated permission strings will be:
+- `CreateProductReview`
+- `ReadProductReview`
+- `UpdateProductReview`
+- `DeleteProductReview`
diff --git a/docs/docs/reference/admin-ui-api/action-bar/router-link-definition.md b/docs/docs/reference/admin-ui-api/action-bar/router-link-definition.md
index a74b3d7fae..01f05498be 100644
--- a/docs/docs/reference/admin-ui-api/action-bar/router-link-definition.md
+++ b/docs/docs/reference/admin-ui-api/action-bar/router-link-definition.md
@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
## RouterLinkDefinition
-
+
A function which returns the router link for an ActionBarItem or NavMenuItem.
diff --git a/docs/docs/reference/admin-ui-api/nav-menu/add-nav-menu-item.md b/docs/docs/reference/admin-ui-api/nav-menu/add-nav-menu-item.md
index 1b8dd70e05..2023342de2 100644
--- a/docs/docs/reference/admin-ui-api/nav-menu/add-nav-menu-item.md
+++ b/docs/docs/reference/admin-ui-api/nav-menu/add-nav-menu-item.md
@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
## addNavMenuItem
-
+
Add a menu item to an existing section specified by `sectionId`. The id of the section
can be found by inspecting the DOM and finding the `data-section-id` attribute.
@@ -24,6 +24,8 @@ This should be used in the NgModule `providers` array of your ui extension modul
*Example*
```ts title="providers.ts"
+import { addNavMenuItem } from '@vendure/admin-ui/core';
+
export default [
addNavMenuItem({
id: 'reviews',
@@ -33,7 +35,7 @@ export default [
},
'marketing'),
];
-``
+```
```ts title="Signature"
function addNavMenuItem(config: NavMenuItem, sectionId: string, before?: string): Provider
diff --git a/docs/docs/reference/admin-ui-api/nav-menu/add-nav-menu-section.md b/docs/docs/reference/admin-ui-api/nav-menu/add-nav-menu-section.md
index 83096dc86a..991d106de6 100644
--- a/docs/docs/reference/admin-ui-api/nav-menu/add-nav-menu-section.md
+++ b/docs/docs/reference/admin-ui-api/nav-menu/add-nav-menu-section.md
@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
## addNavMenuSection
-
+
Add a section to the main nav menu. Providing the `before` argument will
move the section before any existing section with the specified id. If
@@ -22,6 +22,8 @@ This should be used in the NgModule `providers` array of your ui extension modul
*Example*
```ts title="providers.ts"
+import { addNavMenuSection } from '@vendure/admin-ui/core';
+
export default [
addNavMenuSection({
id: 'reports',
diff --git a/docs/docs/reference/admin-ui-api/nav-menu/nav-menu-section.md b/docs/docs/reference/admin-ui-api/nav-menu/nav-menu-section.md
index 7dec9d293d..b584212335 100644
--- a/docs/docs/reference/admin-ui-api/nav-menu/nav-menu-section.md
+++ b/docs/docs/reference/admin-ui-api/nav-menu/nav-menu-section.md
@@ -60,7 +60,18 @@ interface NavMenuSection {
-Control the display of this item based on the user permissions.
+Control the display of this item based on the user permissions. Note: if you attempt to pass a
+PermissionDefinition object, you will get a compilation error. Instead, pass the plain
+string version. For example, if the permission is defined as:
+```ts
+export const MyPermission = new PermissionDefinition('ProductReview');
+```
+then the generated permission strings will be:
+
+- `CreateProductReview`
+- `ReadProductReview`
+- `UpdateProductReview`
+- `DeleteProductReview`
### collapsible
diff --git a/docs/docs/reference/admin-ui-api/react-extensions/register-react-data-table-component.md b/docs/docs/reference/admin-ui-api/react-extensions/register-react-data-table-component.md
index a948d9de99..60ac5217ed 100644
--- a/docs/docs/reference/admin-ui-api/react-extensions/register-react-data-table-component.md
+++ b/docs/docs/reference/admin-ui-api/react-extensions/register-react-data-table-component.md
@@ -42,7 +42,7 @@ export default [
tableId: 'product-list',
columnId: 'slug',
props: {
- foo: 'bar',
+ foo: 'bar',
},
}),
];
diff --git a/docs/docs/reference/core-plugins/job-queue-plugin/bull-mqjob-queue-plugin.md b/docs/docs/reference/core-plugins/job-queue-plugin/bull-mqjob-queue-plugin.md
index 4929843471..cb1ab57c83 100644
--- a/docs/docs/reference/core-plugins/job-queue-plugin/bull-mqjob-queue-plugin.md
+++ b/docs/docs/reference/core-plugins/job-queue-plugin/bull-mqjob-queue-plugin.md
@@ -32,13 +32,13 @@ in processing jobs.
## Installation
-`yarn add @vendure/job-queue-plugin bullmq@1`
+`yarn add @vendure/job-queue-plugin bullmq`
or
-`npm install @vendure/job-queue-plugin bullmq@1`
+`npm install @vendure/job-queue-plugin bullmq`
-**Note:** The v1.x version of this plugin is designed to work with bullmq v1.x.
+**Note:** The v1.x version of this plugin is designed to work with bullmq v1.x, etc.
*Example*
diff --git a/docs/docs/reference/core-plugins/sentry-plugin/index.md b/docs/docs/reference/core-plugins/sentry-plugin/index.md
new file mode 100644
index 0000000000..f981d629ba
--- /dev/null
+++ b/docs/docs/reference/core-plugins/sentry-plugin/index.md
@@ -0,0 +1,131 @@
+---
+title: "SentryPlugin"
+isDefaultIndex: false
+generated: true
+---
+
+import MemberInfo from '@site/src/components/MemberInfo';
+import GenerationInfo from '@site/src/components/GenerationInfo';
+import MemberDescription from '@site/src/components/MemberDescription';
+
+
+## SentryPlugin
+
+
+
+This plugin integrates the [Sentry](https://sentry.io) error tracking & performance monitoring
+service with your Vendure server. In addition to capturing errors, it also provides built-in
+support for [tracing](https://docs.sentry.io/product/sentry-basics/concepts/tracing/) as well as
+enriching your Sentry events with additional context about the request.
+
+## Pre-requisites
+
+This plugin depends on access to Sentry, which can be self-hosted or used as a cloud service.
+
+If using the hosted SaaS option, you must have a Sentry account and a project set up ([sign up here](https://sentry.io/signup/)). When setting up your project,
+select the "Node.js" platform and no framework.
+
+Once set up, you will be given a [Data Source Name (DSN)](https://docs.sentry.io/product/sentry-basics/concepts/dsn-explainer/)
+which you will need to provide to the plugin.
+
+## Installation
+
+Install this plugin as well as the `@sentry/node` package:
+
+```sh
+npm install --save @vendure/sentry-plugin @sentry/node
+```
+
+## Configuration
+
+Before using the plugin, you must configure it with the DSN provided by Sentry:
+
+```ts
+import { VendureConfig } from '@vendure/core';
+import { SentryPlugin } from '@vendure/sentry-plugin';
+
+export const config: VendureConfig = {
+ // ...
+ plugins: [
+ // ...
+ // highlight-start
+ SentryPlugin.init({
+ dsn: process.env.SENTRY_DSN,
+ // Optional configuration
+ includeErrorTestMutation: true,
+ enableTracing: true,
+ // you can also pass in any of the options from @sentry/node
+ // for instance:
+ tracesSampleRate: 1.0,
+ }),
+ // highlight-end
+ ],
+};
+```
+
+## Tracing
+
+This plugin includes built-in support for [tracing](https://docs.sentry.io/product/sentry-basics/concepts/tracing/), which allows you to see the performance of your
+GraphQL resolvers in the Sentry dashboard. To enable tracing, set the `enableTracing` option to `true` as shown above.
+
+## Instrumenting your own code
+
+You may want to add your own custom spans to your code. To do so, you can use the `Sentry` object
+just as you would in any Node application. For example:
+
+```ts
+import * as Sentry from "@sentry/node";
+
+export class MyService {
+ async myMethod() {
+ Sentry.setContext('My Custom Context,{
+ key: 'value',
+ });
+ }
+}
+```
+
+## Error test mutation
+
+To test whether your Sentry configuration is working correctly, you can set the `includeErrorTestMutation` option to `true`. This will add a mutation to the Admin API
+which will throw an error of the type specified in the `errorType` argument. For example:
+
+```graphql
+mutation CreateTestError {
+ createTestError(errorType: DATABASE_ERROR)
+}
+```
+
+You should then be able to see the error in your Sentry dashboard (it may take a couple of minutes to appear).
+
+```ts title="Signature"
+class SentryPlugin implements NestModule {
+ static options: SentryPluginOptions = {} as any;
+ configure(consumer: MiddlewareConsumer) => any;
+ init(options: SentryPluginOptions) => ;
+}
+```
+* Implements: NestModule
+
+
+
+
diff --git a/docs/docs/reference/core-plugins/stellate-plugin/index.md b/docs/docs/reference/core-plugins/stellate-plugin/index.md
new file mode 100644
index 0000000000..1908682c18
--- /dev/null
+++ b/docs/docs/reference/core-plugins/stellate-plugin/index.md
@@ -0,0 +1,281 @@
+---
+title: "StellatePlugin"
+isDefaultIndex: false
+generated: true
+---
+
+import MemberInfo from '@site/src/components/MemberInfo';
+import GenerationInfo from '@site/src/components/GenerationInfo';
+import MemberDescription from '@site/src/components/MemberDescription';
+
+
+## StellatePlugin
+
+
+
+A plugin to integrate the [Stellate](https://stellate.co/) GraphQL caching service with your Vendure server.
+The main purpose of this plugin is to ensure that cached data gets correctly purged in
+response to events inside Vendure. For example, changes to a Product's description should
+purge any associated record for that Product in Stellate's cache.
+
+## Pre-requisites
+
+You will first need to [set up a free Stellate account](https://stellate.co/signup).
+
+You will also need to generate an **API token** for the Stellate Purging API. For instructions on how to generate the token,
+see the [Stellate Purging API docs](https://docs.stellate.co/docs/purging-api#authentication).
+
+## Installation
+
+```
+npm install @vendure/stellate-plugin
+```
+
+## Configuration
+
+The plugin is configured via the `StellatePlugin.init()` method. This method accepts an options object
+which defines the Stellate service name and API token, as well as an array of PurgeRules which
+define how the plugin will respond to Vendure events in order to trigger calls to the
+Stellate [Purging API](https://stellate.co/docs/graphql-edge-cache/purging-api).
+
+*Example*
+
+```ts
+import { StellatePlugin, defaultPurgeRules } from '@vendure/stellate-plugin';
+import { VendureConfig } from '@vendure/core';
+
+export const config: VendureConfig = {
+ // ...
+ plugins: [
+ StellatePlugin.init({
+ // The Stellate service name, i.e. `.stellate.sh`
+ serviceName: 'my-service',
+ // The API token for the Stellate Purging API. See the "pre-requisites" section above.
+ apiToken: process.env.STELLATE_PURGE_API_TOKEN,
+ debugMode: !isProd || process.env.STELLATE_DEBUG_MODE ? true : false,
+ debugLogging: process.env.STELLATE_DEBUG_MODE ? true : false,
+ purgeRules: [
+ ...defaultPurgeRules,
+ // custom purge rules can be added here
+ ],
+ }),
+ ],
+};
+```
+
+In your Stellate dashboard, you can use the following configuration example as a sensible default for a
+Vendure application:
+
+*Example*
+
+```ts
+import { Config } from "stellate";
+
+const config: Config = {
+ config: {
+ name: "my-vendure-server",
+ originUrl: "https://my-vendure-server.com/shop-api",
+ ignoreOriginCacheControl: true,
+ passThroughOnly: false,
+ scopes: {
+ SESSION_BOUND: "header:authorization|cookie:session",
+ },
+ headers: {
+ "access-control-expose-headers": "vendure-auth-token",
+ },
+ rootTypeNames: {
+ query: "Query",
+ mutation: "Mutation",
+ },
+ keyFields: {
+ types: {
+ SearchResult: ["productId"],
+ SearchResponseCacheIdentifier: ["collectionSlug"],
+ },
+ },
+ rules: [
+ {
+ types: [
+ "Product",
+ "Collection",
+ "ProductVariant",
+ "SearchResponse",
+ ],
+ maxAge: 900,
+ swr: 900,
+ description: "Cache Products & Collections",
+ },
+ {
+ types: ["Channel"],
+ maxAge: 9000,
+ swr: 9000,
+ description: "Cache active channel",
+ },
+ {
+ types: ["Order", "Customer", "User"],
+ maxAge: 0,
+ swr: 0,
+ description: "Do not cache user data",
+ },
+ ],
+ },
+};
+export default config;
+```
+
+## Storefront setup
+
+In your storefront, you should point your GraphQL client to the Stellate GraphQL API endpoint, which is
+`https://.stellate.sh`.
+
+Wherever you are using the `search` query (typically in product listing & search pages), you should also add the
+`cacheIdentifier` field to the query. This will ensure that the Stellate cache is correctly purged when
+a Product or Collection is updated.
+
+*Example*
+
+```ts
+import { graphql } from '../generated/gql';
+
+export const searchProductsDocument = graphql(`
+ query SearchProducts($input: SearchInput!) {
+ search(input: $input) {
+ // highlight-start
+ cacheIdentifier {
+ collectionSlug
+ }
+ // highlight-end
+ items {
+ # ...
+ }
+ }
+ }
+}`);
+```
+
+## Custom PurgeRules
+
+The configuration above only accounts for caching of some of the built-in Vendure entity types. If you have
+custom entity types, you may well want to add them to the Stellate cache. In this case, you'll also need a way to
+purge those entities from the cache when they are updated. This is where the PurgeRule comes in.
+
+Let's imagine that you have built a simple CMS plugin for Vendure which exposes an `Article` entity in your Shop API, and
+you have added this to your Stellate configuration:
+
+*Example*
+
+```ts
+import { Config } from "stellate";
+
+const config: Config = {
+ config: {
+ // ...
+ rules: [
+ // ...
+ {
+ types: ["Article"],
+ maxAge: 900,
+ swr: 900,
+ description: "Cache Articles",
+ },
+ ],
+ },
+ // ...
+};
+export default config;
+```
+
+You can then add a custom PurgeRule to the StellatePlugin configuration:
+
+*Example*
+
+```ts
+import { StellatePlugin, defaultPurgeRules } from "@vendure/stellate-plugin";
+import { VendureConfig } from "@vendure/core";
+import { ArticleEvent } from "./plugins/cms/events/article-event";
+
+export const config: VendureConfig = {
+ // ...
+ plugins: [
+ StellatePlugin.init({
+ // ...
+ purgeRules: [
+ ...defaultPurgeRules,
+ new PurgeRule({
+ eventType: ArticleEvent,
+ handler: async ({ events, stellateService }) => {
+ const articleIds = events.map((e) => e.article.id);
+ stellateService.purge("Article", articleIds);
+ },
+ }),
+ ],
+ }),
+ ],
+};
+```
+
+## DevMode & Debug Logging
+
+In development, you can set `devMode: true`, which will prevent any calls being made to the Stellate Purging API.
+
+If you want to log the calls that _would_ be made to the Stellate Purge API when in devMode, you can set `debugLogging: true`.
+Note that debugLogging generates a lot of debug-level logging, so it is recommended to only enable this when needed.
+
+*Example*
+
+```ts
+import { StellatePlugin, defaultPurgeRules } from '@vendure/stellate-plugin';
+import { VendureConfig } from '@vendure/core';
+
+export const config: VendureConfig = {
+ // ...
+ plugins: [
+ StellatePlugin.init({
+ // ...
+ devMode: !process.env.PRODUCTION,
+ debugLogging: process.env.STELLATE_DEBUG_MODE ? true : false,
+ purgeRules: [
+ ...defaultPurgeRules,
+ ],
+ }),
+ ],
+};
+```
+
+```ts title="Signature"
+class StellatePlugin implements OnApplicationBootstrap {
+ static options: StellatePluginOptions;
+ init(options: StellatePluginOptions) => ;
+ constructor(options: StellatePluginOptions, eventBus: EventBus, stellateService: StellateService, moduleRef: ModuleRef)
+ onApplicationBootstrap() => ;
+}
+```
+* Implements: OnApplicationBootstrap
+
+
+
+
+
+### eventType
+
+
+
+Specifies which VendureEvent will trigger this purge rule.
+### bufferTime
+
+
+
+How long to buffer events for in milliseconds before executing the handler. This allows
+us to efficiently batch calls to the Stellate Purge API.
+### handler
+
+StellateService;
injector: Injector;
}) => void | Promise<void>`} />
+
+The function to invoke when the specified event is published. This function should use the
+StellateService instance to call the Stellate Purge API.
+
+
+
+
+### serviceName
+
+
+
+The Stellate service name, i.e. `.stellate.sh`
+### apiToken
+
+
+
+The Stellate Purging API token. For instructions on how to generate the token,
+see the [Stellate docs](https://docs.stellate.co/docs/purging-api#authentication)
+### purgeRules
+
+PurgeRule[]`} />
+
+An array of PurgeRule instances which are used to define how the plugin will
+respond to Vendure events in order to trigger calls to the Stellate Purging API.
+### defaultBufferTimeMs
+
+
+
+When events are published, the PurgeRules will buffer those events in order to efficiently
+batch requests to the Stellate Purging API. You may wish to change the default, e.g. if you are
+running in a serverless environment and cannot introduce pauses after the main request has completed.
+### devMode
+
+
+
+When set to `true`, calls will not be made to the Stellate Purge API.
+### debugLogging
+
+
+
+If set to true, the plugin will log the calls that would be made
+to the Stellate Purge API. Note, this generates a
+lot of debug-level logging.
+
+
+
+
+### constructor
+
+StellatePluginOptions) => StellateService`} />
+
+
+### purgeProducts
+
+Product[]) => `} />
+
+Purges the cache for the given Products.
+### purgeProductVariants
+
+ProductVariant[]) => `} />
+
+Purges the cache for the given ProductVariants.
+### purgeSearchResults
+
+ProductVariant | Product>) => `} />
+
+Purges the cache for SearchResults which contain the given Products or ProductVariants.
+### purgeAllOfType
+
+ `} />
+
+Purges the entire cache for the given type.
+### purgeCollections
+
+Collection[]) => `} />
+
+Purges the cache for the given Collections.
+### purgeSearchResponseCacheIdentifiers
+
+Collection[]) => `} />
+
+Purges the cache of SearchResults for the given Collections based on slug.
+### purge
+
+ID[], keyName: = 'id') => `} />
+
+Purges the cache for the given type and keys.
+
+
+
diff --git a/docs/docs/reference/graphql-api/shop/queries.md b/docs/docs/reference/graphql-api/shop/queries.md
index c5d3d803b6..fc6d494a36 100644
--- a/docs/docs/reference/graphql-api/shop/queries.md
+++ b/docs/docs/reference/graphql-api/shop/queries.md
@@ -1,8 +1,6 @@
---
title: "Queries"
-weight: 1
-date: 2023-07-21T15:33:42.677Z
-showtoc: true
+isDefaultIndex: false
generated: true
---
diff --git a/docs/docs/reference/typescript-api/common/permission.md b/docs/docs/reference/typescript-api/common/permission.md
index 1b1aaa9024..36e0ec9366 100644
--- a/docs/docs/reference/typescript-api/common/permission.md
+++ b/docs/docs/reference/typescript-api/common/permission.md
@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
## Permission
-
+
Permissions for administrators and customers. Used to control access to
GraphQL resolvers via the Allow decorator.
diff --git a/docs/docs/reference/typescript-api/configurable-operation-def/default-form-config-hash.md b/docs/docs/reference/typescript-api/configurable-operation-def/default-form-config-hash.md
index 501b33dbe0..abed9b463d 100644
--- a/docs/docs/reference/typescript-api/configurable-operation-def/default-form-config-hash.md
+++ b/docs/docs/reference/typescript-api/configurable-operation-def/default-form-config-hash.md
@@ -29,15 +29,15 @@ type DefaultFormConfigHash = {
'product-selector-form-input': Record;
'relation-form-input': Record;
'rich-text-form-input': Record;
- 'select-form-input': {
- options?: Array<{ value: string; label?: Array> }>;
+ 'select-form-input': {
+ options?: Array<{ value: string; label?: Array> }>;
};
'text-form-input': { prefix?: string; suffix?: string };
- 'textarea-form-input': {
- spellcheck?: boolean;
+ 'textarea-form-input': {
+ spellcheck?: boolean;
};
- 'product-multi-form-input': {
- selectionMode?: 'product' | 'variant';
+ 'product-multi-form-input': {
+ selectionMode?: 'product' | 'variant';
};
'combination-mode-form-input': Record;
}
@@ -107,7 +107,7 @@ type DefaultFormConfigHash = {
### 'select-form-input'
-
+
### 'text-form-input'
@@ -117,12 +117,12 @@ type DefaultFormConfigHash = {
### 'textarea-form-input'
-
+
### 'product-multi-form-input'
-
+
### 'combination-mode-form-input'
diff --git a/docs/docs/reference/typescript-api/custom-fields/custom-field-type.md b/docs/docs/reference/typescript-api/custom-fields/custom-field-type.md
index c3c0bf531a..4ab1958a77 100644
--- a/docs/docs/reference/typescript-api/custom-fields/custom-field-type.md
+++ b/docs/docs/reference/typescript-api/custom-fields/custom-field-type.md
@@ -21,7 +21,7 @@ Type | DB type | GraphQL type
string | varchar | String
localeString | varchar | String
text | longtext(m), text(p,s) | String
-localText | longtext(m), text(p,s) | String
+localeText | longtext(m), text(p,s) | String
int | int | Int
float | double precision | Float
boolean | tinyint (m), bool (p), boolean (s) | Boolean
diff --git a/docs/docs/reference/typescript-api/errors/error-result-union.md b/docs/docs/reference/typescript-api/errors/error-result-union.md
new file mode 100644
index 0000000000..1169cdc1b2
--- /dev/null
+++ b/docs/docs/reference/typescript-api/errors/error-result-union.md
@@ -0,0 +1,34 @@
+---
+title: "ErrorResultUnion"
+isDefaultIndex: false
+generated: true
+---
+
+import MemberInfo from '@site/src/components/MemberInfo';
+import GenerationInfo from '@site/src/components/GenerationInfo';
+import MemberDescription from '@site/src/components/MemberDescription';
+
+
+## ErrorResultUnion
+
+
+
+Used to construct a TypeScript return type for a query or mutation which, in the GraphQL schema,
+returns a union type composed of a success result (e.g. Order) plus one or more ErrorResult
+types.
+
+Since the TypeScript entities do not correspond 1-to-1 with their GraphQL type counterparts,
+we use this type to substitute them.
+
+*Example*
+
+```ts
+type UpdateOrderItemsResult = Order | OrderModificationError | OrderLimitError | NegativeQuantityError;
+type T1 = ErrorResultUnion;
+// T1 = VendureEntityOrder | OrderModificationError | OrderLimitError | NegativeQuantityError;
+```
+
+```ts title="Signature"
+type ErrorResultUnion = | JustErrorResults
+ | E
+```
diff --git a/docs/docs/reference/typescript-api/errors/is-graph-ql-error-result.md b/docs/docs/reference/typescript-api/errors/is-graph-ql-error-result.md
new file mode 100644
index 0000000000..2aa117ad05
--- /dev/null
+++ b/docs/docs/reference/typescript-api/errors/is-graph-ql-error-result.md
@@ -0,0 +1,44 @@
+---
+title: "IsGraphQlErrorResult"
+isDefaultIndex: false
+generated: true
+---
+
+import MemberInfo from '@site/src/components/MemberInfo';
+import GenerationInfo from '@site/src/components/GenerationInfo';
+import MemberDescription from '@site/src/components/MemberDescription';
+
+
+## isGraphQlErrorResult
+
+
+
+Returns true if the ErrorResultUnion is actually an ErrorResult type. This is useful when dealing with
+certain internal service method that return an ErrorResultUnion.
+
+*Example*
+
+```ts
+import { isGraphQlErrorResult } from '@vendure/core';
+
+// ...
+
+const transitionResult = await this.orderService.transitionToState(ctx, order.id, newState);
+if (isGraphQlErrorResult(transitionResult)) {
+ // The transition failed with an ErrorResult
+ throw transitionResult;
+} else {
+ // TypeScript will correctly infer the type of `transitionResult` to be `Order`
+ return transitionResult;
+}
+```
+
+```ts title="Signature"
+function isGraphQlErrorResult(input: T): input is JustErrorResults
+```
+Parameters
+
+### input
+
+
+
diff --git a/docs/docs/reference/typescript-api/events/vendure-entity-event.md b/docs/docs/reference/typescript-api/events/vendure-entity-event.md
index 790f830596..a5d825a3c4 100644
--- a/docs/docs/reference/typescript-api/events/vendure-entity-event.md
+++ b/docs/docs/reference/typescript-api/events/vendure-entity-event.md
@@ -11,10 +11,9 @@ import MemberDescription from '@site/src/components/MemberDescription';
## VendureEntityEvent
-
+
The base class for all entity events used by the EventBus system.
-* For event type `'updated'` the entity is the one before applying the patch (if not documented otherwise).
* For event type `'deleted'` the input will most likely be an `id: ID`
```ts title="Signature"
diff --git a/docs/docs/reference/typescript-api/orders/default-guest-checkout-strategy.md b/docs/docs/reference/typescript-api/orders/default-guest-checkout-strategy.md
index 58a2fd8ddb..9e87458b56 100644
--- a/docs/docs/reference/typescript-api/orders/default-guest-checkout-strategy.md
+++ b/docs/docs/reference/typescript-api/orders/default-guest-checkout-strategy.md
@@ -57,7 +57,7 @@ class DefaultGuestCheckoutStrategy implements GuestCheckoutStrategy {
### setCustomerForOrder
-RequestContext, order: Order, input: CreateCustomerInput) => Promise<ErrorResultUnion<SetCustomerForOrderResult, Customer>>`} />
+RequestContext, order: Order, input: CreateCustomerInput) => Promise<ErrorResultUnion<SetCustomerForOrderResult, Customer>>`} />
diff --git a/docs/docs/reference/typescript-api/orders/guest-checkout-strategy.md b/docs/docs/reference/typescript-api/orders/guest-checkout-strategy.md
index b2f28b3579..523fd7f3db 100644
--- a/docs/docs/reference/typescript-api/orders/guest-checkout-strategy.md
+++ b/docs/docs/reference/typescript-api/orders/guest-checkout-strategy.md
@@ -51,7 +51,7 @@ interface GuestCheckoutStrategy extends InjectableStrategy {
### setCustomerForOrder
-RequestContext, order: Order, input: CreateCustomerInput) => | ErrorResultUnion<SetCustomerForOrderResult, Customer>
| Promise<ErrorResultUnion<SetCustomerForOrderResult, Customer>>`} />
+RequestContext, order: Order, input: CreateCustomerInput) => | ErrorResultUnion<SetCustomerForOrderResult, Customer>
| Promise<ErrorResultUnion<SetCustomerForOrderResult, Customer>>`} />
This method is called when the `setCustomerForOrder` mutation is executed.
It should return either a Customer object or an ErrorResult.
diff --git a/docs/docs/reference/typescript-api/orders/order-process.md b/docs/docs/reference/typescript-api/orders/order-process.md
index 6e5676e178..2371270df0 100644
--- a/docs/docs/reference/typescript-api/orders/order-process.md
+++ b/docs/docs/reference/typescript-api/orders/order-process.md
@@ -196,7 +196,7 @@ Parameters
## defaultOrderProcess
-
+
This is the built-in OrderProcess that ships with Vendure. A customized version of this process
can be created using the configureDefaultOrderProcess function, which allows you to pass in an object
diff --git a/docs/docs/reference/typescript-api/request/request-context-service.md b/docs/docs/reference/typescript-api/request/request-context-service.md
index e9f33a9df9..7263b1a7cf 100644
--- a/docs/docs/reference/typescript-api/request/request-context-service.md
+++ b/docs/docs/reference/typescript-api/request/request-context-service.md
@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
## RequestContextService
-
+
Creates new RequestContext instances.
diff --git a/docs/docs/reference/typescript-api/services/channel-service.md b/docs/docs/reference/typescript-api/services/channel-service.md
index d7b05aa64a..e3f07cc147 100644
--- a/docs/docs/reference/typescript-api/services/channel-service.md
+++ b/docs/docs/reference/typescript-api/services/channel-service.md
@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
## ChannelService
-
+
Contains methods relating to Channel entities.
@@ -90,12 +90,12 @@ Returns the default Channel.
### create
-RequestContext, input: CreateChannelInput) => Promise<ErrorResultUnion<CreateChannelResult, Channel>>`} />
+RequestContext, input: CreateChannelInput) => Promise<ErrorResultUnion<CreateChannelResult, Channel>>`} />
### update
-RequestContext, input: UpdateChannelInput) => Promise<ErrorResultUnion<UpdateChannelResult, Channel>>`} />
+RequestContext, input: UpdateChannelInput) => Promise<ErrorResultUnion<UpdateChannelResult, Channel>>`} />
### delete
diff --git a/docs/docs/reference/typescript-api/services/collection-service.md b/docs/docs/reference/typescript-api/services/collection-service.md
index 28af8bb05b..9171ae4a1b 100644
--- a/docs/docs/reference/typescript-api/services/collection-service.md
+++ b/docs/docs/reference/typescript-api/services/collection-service.md
@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
## CollectionService
-
+
Contains methods relating to Collection entities.
diff --git a/docs/docs/reference/typescript-api/services/customer-service.md b/docs/docs/reference/typescript-api/services/customer-service.md
index 2e91471aa6..44884e197f 100644
--- a/docs/docs/reference/typescript-api/services/customer-service.md
+++ b/docs/docs/reference/typescript-api/services/customer-service.md
@@ -31,8 +31,8 @@ class CustomerService {
refreshVerificationToken(ctx: RequestContext, emailAddress: string) => Promise;
verifyCustomerEmailAddress(ctx: RequestContext, verificationToken: string, password?: string) => Promise>;
requestPasswordReset(ctx: RequestContext, emailAddress: string) => Promise;
- 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;
updateEmailAddress(ctx: RequestContext, token: string) => Promise;
@@ -69,8 +69,8 @@ class CustomerService {
RequestContext, userId: ID, filterOnChannel: = true) => Promise<Customer | undefined>`} />
-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
@@ -84,15 +84,15 @@ Returns all Address
Returns a list of all CustomerGroup entities.
### create
-RequestContext, input: CreateCustomerInput, password?: string) => Promise<ErrorResultUnion<CreateCustomerResult, Customer>>`} />
-
-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 AccountRegistrationEvent is published, so that the customer can have their
-email address verified and set their password in a later step using the `verifyCustomerEmailAddress()`
-method.
+RequestContext, input: CreateCustomerInput, password?: string) => Promise<ErrorResultUnion<CreateCustomerResult, Customer>>`} />
+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 AccountRegistrationEvent 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
@@ -101,59 +101,59 @@ This method is intended to be used in admin-created Customer flows.
### update
-RequestContext, input: UpdateCustomerInput) => Promise<ErrorResultUnion<UpdateCustomerResult, Customer>>`} />
+RequestContext, input: UpdateCustomerInput) => Promise<ErrorResultUnion<UpdateCustomerResult, Customer>>`} />
### update
-RequestContext, input: UpdateCustomerInput | (UpdateCustomerShopInput & { id: ID })) => Promise<ErrorResultUnion<UpdateCustomerResult, Customer>>`} />
+RequestContext, input: UpdateCustomerInput | (UpdateCustomerShopInput & { id: ID })) => Promise<ErrorResultUnion<UpdateCustomerResult, Customer>>`} />
### registerCustomerAccount
RequestContext, input: RegisterCustomerInput) => Promise<RegisterCustomerAccountResult | EmailAddressConflictError | PasswordValidationError>`} />
-Registers a new Customer account with the NativeAuthenticationStrategy and starts
-the email verification flow (unless AuthOptions `requireVerification` is set to `false`)
-by publishing an AccountRegistrationEvent.
-
+Registers a new Customer account with the NativeAuthenticationStrategy and starts
+the email verification flow (unless AuthOptions `requireVerification` is set to `false`)
+by publishing an AccountRegistrationEvent.
+
This method is intended to be used in storefront Customer-creation flows.
### refreshVerificationToken
RequestContext, emailAddress: string) => Promise<void>`} />
-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 AccountRegistrationEvent.
### verifyCustomerEmailAddress
-RequestContext, verificationToken: string, password?: string) => Promise<ErrorResultUnion<VerifyCustomerAccountResult, Customer>>`} />
+RequestContext, verificationToken: string, password?: string) => Promise<ErrorResultUnion<VerifyCustomerAccountResult, Customer>>`} />
-Given a valid verification token which has been published in an AccountRegistrationEvent, this
+Given a valid verification token which has been published in an AccountRegistrationEvent, this
method is used to set the Customer as `verified` as part of the account registration flow.
### requestPasswordReset
RequestContext, emailAddress: string) => Promise<void>`} />
-Publishes a new PasswordResetEvent for the given email address. This event creates
+Publishes a new PasswordResetEvent for the given email address. This event creates
a token which can be used in the `resetPassword()` method.
### resetPassword
-RequestContext, passwordResetToken: string, password: string) => Promise< User | PasswordResetTokenExpiredError | PasswordResetTokenInvalidError | PasswordValidationError >`} />
+RequestContext, passwordResetToken: string, password: string) => Promise<
User | PasswordResetTokenExpiredError | PasswordResetTokenInvalidError | PasswordValidationError
>`} />
-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
RequestContext, userId: ID, newEmailAddress: string) => Promise<boolean | EmailAddressConflictError>`} />
-Publishes a IdentifierChangeRequestEvent 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 IdentifierChangeRequestEvent 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
RequestContext, token: string) => Promise<boolean | IdentifierChangeTokenInvalidError | IdentifierChangeTokenExpiredError>`} />
-Given a valid email update token published in a IdentifierChangeRequestEvent, this method
+Given a valid email update token published in a IdentifierChangeRequestEvent, this method
will update the Customer & User email address.
### createOrUpdate
@@ -184,8 +184,8 @@ Creates a new Addre
RequestContext, order: Order) => `} />
-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
diff --git a/docs/docs/reference/typescript-api/services/facet-service.md b/docs/docs/reference/typescript-api/services/facet-service.md
index 2ec7eff90a..274e80e484 100644
--- a/docs/docs/reference/typescript-api/services/facet-service.md
+++ b/docs/docs/reference/typescript-api/services/facet-service.md
@@ -91,7 +91,7 @@ Returns the Facet which contains the given FacetValue id.
Assigns Facets to the specified Channel
### removeFacetsFromChannel
-RequestContext, input: RemoveFacetsFromChannelInput) => Promise<Array<ErrorResultUnion<RemoveFacetFromChannelResult, Facet>>>`} />
+RequestContext, input: RemoveFacetsFromChannelInput) => Promise<Array<ErrorResultUnion<RemoveFacetFromChannelResult, Facet>>>`} />
Remove Facets from the specified Channel
diff --git a/docs/docs/reference/typescript-api/services/order-service.md b/docs/docs/reference/typescript-api/services/order-service.md
index 70f0024405..aa70fae38b 100644
--- a/docs/docs/reference/typescript-api/services/order-service.md
+++ b/docs/docs/reference/typescript-api/services/order-service.md
@@ -166,23 +166,23 @@ User's Customer account.
Updates the custom fields of an Order.
### addItemToOrder
-RequestContext, orderId: ID, productVariantId: ID, quantity: number, customFields?: { [key: string]: any }) => Promise<ErrorResultUnion<UpdateOrderItemsResult, Order>>`} />
+RequestContext, orderId: ID, productVariantId: ID, quantity: number, customFields?: { [key: string]: any }) => Promise<ErrorResultUnion<UpdateOrderItemsResult, Order>>`} />
Adds an item to the Order, either creating a new OrderLine or
incrementing an existing one.
### adjustOrderLine
-RequestContext, orderId: ID, orderLineId: ID, quantity: number, customFields?: { [key: string]: any }) => Promise<ErrorResultUnion<UpdateOrderItemsResult, Order>>`} />
+RequestContext, orderId: ID, orderLineId: ID, quantity: number, customFields?: { [key: string]: any }) => Promise<ErrorResultUnion<UpdateOrderItemsResult, Order>>`} />
Adjusts the quantity and/or custom field values of an existing OrderLine.
### removeItemFromOrder
-RequestContext, orderId: ID, orderLineId: ID) => Promise<ErrorResultUnion<RemoveOrderItemsResult, Order>>`} />
+RequestContext, orderId: ID, orderLineId: ID) => Promise<ErrorResultUnion<RemoveOrderItemsResult, Order>>`} />
Removes the specified OrderLine from the Order.
### removeAllItemsFromOrder
-RequestContext, orderId: ID) => Promise<ErrorResultUnion<RemoveOrderItemsResult, Order>>`} />
+RequestContext, orderId: ID) => Promise<ErrorResultUnion<RemoveOrderItemsResult, Order>>`} />
Removes all OrderLines from the Order.
### addSurchargeToOrder
@@ -197,7 +197,7 @@ Adds a Surcharg
Removes a Surcharge from the Order.
### applyCouponCode
-RequestContext, orderId: ID, couponCode: string) => Promise<ErrorResultUnion<ApplyCouponCodeResult, Order>>`} />
+RequestContext, orderId: ID, couponCode: string) => Promise<ErrorResultUnion<ApplyCouponCodeResult, Order>>`} />
Applies a coupon code to the Order, which should be a valid coupon code as specified in the configuration
of an active Promotion.
@@ -242,7 +242,7 @@ The quote also includes a price for each method, as determined by the configured
Returns an array of quotes stating which PaymentMethods may be used on this Order.
### setShippingMethod
-RequestContext, orderId: ID, shippingMethodIds: ID[]) => Promise<ErrorResultUnion<SetOrderShippingMethodResult, Order>>`} />
+RequestContext, orderId: ID, shippingMethodIds: ID[]) => Promise<ErrorResultUnion<SetOrderShippingMethodResult, Order>>`} />
Sets the ShippingMethod to be used on this Order.
### transitionToState
@@ -258,7 +258,7 @@ Transitions a Fulfillment to the given state and then transitions the Order stat
whether all Fulfillments of the Order are shipped or delivered.
### modifyOrder
-RequestContext, input: ModifyOrderInput) => Promise<ErrorResultUnion<ModifyOrderResult, Order>>`} />
+RequestContext, input: ModifyOrderInput) => Promise<ErrorResultUnion<ModifyOrderResult, Order>>`} />
Allows the Order to be modified, which allows several aspects of the Order to be changed:
@@ -273,20 +273,20 @@ Order, except history entry and additional payment actions.
__Using dryRun option, you must wrap function call in transaction manually.__
### transitionPaymentToState
-RequestContext, paymentId: ID, state: PaymentState) => Promise<ErrorResultUnion<TransitionPaymentToStateResult, Payment>>`} />
+RequestContext, paymentId: ID, state: PaymentState) => Promise<ErrorResultUnion<TransitionPaymentToStateResult, Payment>>`} />
Transitions the given Payment to a new state. If the order totalWithTax price is then
covered by Payments, the Order state will be automatically transitioned to `PaymentSettled`
or `PaymentAuthorized`.
### addPaymentToOrder
-RequestContext, orderId: ID, input: PaymentInput) => Promise<ErrorResultUnion<AddPaymentToOrderResult, Order>>`} />
+RequestContext, orderId: ID, input: PaymentInput) => Promise<ErrorResultUnion<AddPaymentToOrderResult, Order>>`} />
Adds a new Payment to the Order. If the Order totalWithTax is covered by Payments, then the Order
state will get automatically transitioned to the `PaymentSettled` or `PaymentAuthorized` state.
### addManualPaymentToOrder
-RequestContext, input: ManualPaymentInput) => Promise<ErrorResultUnion<AddManualPaymentToOrderResult, Order>>`} />
+RequestContext, input: ManualPaymentInput) => Promise<ErrorResultUnion<AddManualPaymentToOrderResult, Order>>`} />
This method is used after modifying an existing completed order using the `modifyOrder()` method. If the modifications
cause the order total to increase (such as when adding a new OrderLine), then there will be an outstanding charge to
@@ -296,19 +296,19 @@ This method allows you to add a new Payment and assumes the actual processing ha
dashboard of your payment provider.
### settlePayment
-RequestContext, paymentId: ID) => Promise<ErrorResultUnion<SettlePaymentResult, Payment>>`} />
+RequestContext, paymentId: ID) => Promise<ErrorResultUnion<SettlePaymentResult, Payment>>`} />
Settles a payment by invoking the PaymentMethodHandler's `settlePayment()` method. Automatically
transitions the Order state if all Payments are settled.
### cancelPayment
-RequestContext, paymentId: ID) => Promise<ErrorResultUnion<CancelPaymentResult, Payment>>`} />
+RequestContext, paymentId: ID) => Promise<ErrorResultUnion<CancelPaymentResult, Payment>>`} />
Cancels a payment by invoking the PaymentMethodHandler's `cancelPayment()` method (if defined), and transitions the Payment to
the `Cancelled` state.
### createFulfillment
-RequestContext, input: FulfillOrderInput) => Promise<ErrorResultUnion<AddFulfillmentToOrderResult, Fulfillment>>`} />
+RequestContext, input: FulfillOrderInput) => Promise<ErrorResultUnion<AddFulfillmentToOrderResult, Fulfillment>>`} />
Creates a new Fulfillment associated with the given Order and OrderItems.
### getOrderFulfillments
@@ -323,13 +323,13 @@ Returns an array of all Fulfillments associated with the Order.
Returns an array of all Surcharges associated with the Order.
### cancelOrder
-RequestContext, input: CancelOrderInput) => Promise<ErrorResultUnion<CancelOrderResult, Order>>`} />
+RequestContext, input: CancelOrderInput) => Promise<ErrorResultUnion<CancelOrderResult, Order>>`} />
Cancels an Order by transitioning it to the `Cancelled` state. If stock is being tracked for the ProductVariants
in the Order, then new StockMovements will be created to correct the stock levels.
### refundOrder
-RequestContext, input: RefundOrderInput) => Promise<ErrorResultUnion<RefundOrderResult, Refund>>`} />
+RequestContext, input: RefundOrderInput) => Promise<ErrorResultUnion<RefundOrderResult, Refund>>`} />
Creates a {@link Refund} against the order and in doing so invokes the `createRefund()` method of the
PaymentMethodHandler.
diff --git a/docs/docs/reference/typescript-api/services/product-service.md b/docs/docs/reference/typescript-api/services/product-service.md
index 4eb644aebf..0b2191b854 100644
--- a/docs/docs/reference/typescript-api/services/product-service.md
+++ b/docs/docs/reference/typescript-api/services/product-service.md
@@ -11,13 +11,13 @@ import MemberDescription from '@site/src/components/MemberDescription';
## ProductService
-
+
Contains methods relating to Product entities.
```ts title="Signature"
class ProductService {
- constructor(connection: TransactionalConnection, channelService: ChannelService, roleService: RoleService, assetService: AssetService, productVariantService: ProductVariantService, facetValueService: FacetValueService, taxRateService: TaxRateService, collectionService: CollectionService, listQueryBuilder: ListQueryBuilder, translatableSaver: TranslatableSaver, eventBus: EventBus, slugValidator: SlugValidator, customFieldRelationService: CustomFieldRelationService, translator: TranslatorService, productOptionGroupService: ProductOptionGroupService)
+ constructor(connection: TransactionalConnection, channelService: ChannelService, assetService: AssetService, productVariantService: ProductVariantService, facetValueService: FacetValueService, listQueryBuilder: ListQueryBuilder, translatableSaver: TranslatableSaver, eventBus: EventBus, slugValidator: SlugValidator, customFieldRelationService: CustomFieldRelationService, translator: TranslatorService, productOptionGroupService: ProductOptionGroupService)
findAll(ctx: RequestContext, options?: ListQueryOptions, relations?: RelationPaths) => Promise>>;
findOne(ctx: RequestContext, productId: ID, relations?: RelationPaths) => Promise | undefined>;
findByIds(ctx: RequestContext, productIds: ID[], relations?: RelationPaths) => Promise>>;
@@ -38,7 +38,7 @@ class ProductService {
### constructor
-TransactionalConnection, channelService: ChannelService, roleService: RoleService, assetService: AssetService, productVariantService: ProductVariantService, facetValueService: FacetValueService, taxRateService: TaxRateService, collectionService: CollectionService, listQueryBuilder: ListQueryBuilder, translatableSaver: TranslatableSaver, eventBus: EventBus, slugValidator: SlugValidator, customFieldRelationService: CustomFieldRelationService, translator: TranslatorService, productOptionGroupService: ProductOptionGroupService) => ProductService`} />
+TransactionalConnection, channelService: ChannelService, assetService: AssetService, productVariantService: ProductVariantService, facetValueService: FacetValueService, listQueryBuilder: ListQueryBuilder, translatableSaver: TranslatableSaver, eventBus: EventBus, slugValidator: SlugValidator, customFieldRelationService: CustomFieldRelationService, translator: TranslatorService, productOptionGroupService: ProductOptionGroupService) => ProductService`} />
### findAll
@@ -107,7 +107,7 @@ each of the Product's variants, and will assign the Product's Assets to the Chan
### removeOptionGroupFromProduct
-RequestContext, productId: ID, optionGroupId: ID, force?: boolean) => Promise<ErrorResultUnion<RemoveOptionGroupFromProductResult, Translated<Product>>>`} />
+RequestContext, productId: ID, optionGroupId: ID, force?: boolean) => Promise<ErrorResultUnion<RemoveOptionGroupFromProductResult, Translated<Product>>>`} />
diff --git a/docs/docs/reference/typescript-api/services/promotion-service.md b/docs/docs/reference/typescript-api/services/promotion-service.md
index 1e622413bf..4bc9b09a93 100644
--- a/docs/docs/reference/typescript-api/services/promotion-service.md
+++ b/docs/docs/reference/typescript-api/services/promotion-service.md
@@ -76,12 +76,12 @@ class PromotionService {
### createPromotion
-RequestContext, input: CreatePromotionInput) => Promise<ErrorResultUnion<CreatePromotionResult, Promotion>>`} />
+RequestContext, input: CreatePromotionInput) => Promise<ErrorResultUnion<CreatePromotionResult, Promotion>>`} />
### updatePromotion
-RequestContext, input: UpdatePromotionInput) => Promise<ErrorResultUnion<UpdatePromotionResult, Promotion>>`} />
+RequestContext, input: UpdatePromotionInput) => Promise<ErrorResultUnion<UpdatePromotionResult, Promotion>>`} />
### softDeletePromotion
diff --git a/docs/docs/reference/typescript-api/services/user-service.md b/docs/docs/reference/typescript-api/services/user-service.md
index b75a446f5f..f239636cef 100644
--- a/docs/docs/reference/typescript-api/services/user-service.md
+++ b/docs/docs/reference/typescript-api/services/user-service.md
@@ -88,7 +88,7 @@ Sets the RequestContext, verificationToken: string, password?: string) => Promise<ErrorResultUnion<VerifyCustomerAccountResult, User>>`} />
+RequestContext, verificationToken: string, password?: string) => Promise<ErrorResultUnion<VerifyCustomerAccountResult, User>>`} />
Verifies a verificationToken by looking for a User which has previously had it set using the
`setVerificationToken()` method, and checks that the token is valid and has not expired.
diff --git a/docs/sidebars.js b/docs/sidebars.js
index 5a83793616..4ee5440c58 100644
--- a/docs/sidebars.js
+++ b/docs/sidebars.js
@@ -267,6 +267,18 @@ const sidebars = {
link: { type: 'doc', id: 'reference/core-plugins/payments-plugin/index' },
items: [{ type: 'autogenerated', dirName: 'reference/core-plugins/payments-plugin' }],
},
+ {
+ type: 'category',
+ label: 'SentryPlugin',
+ link: { type: 'doc', id: 'reference/core-plugins/sentry-plugin/index' },
+ items: [{ type: 'autogenerated', dirName: 'reference/core-plugins/sentry-plugin' }],
+ },
+ {
+ type: 'category',
+ label: 'StellatePlugin',
+ link: { type: 'doc', id: 'reference/core-plugins/stellate-plugin/index' },
+ items: [{ type: 'autogenerated', dirName: 'reference/core-plugins/stellate-plugin' }],
+ },
],
},
{
diff --git a/lerna.json b/lerna.json
index 41a9399532..79a432f809 100644
--- a/lerna.json
+++ b/lerna.json
@@ -1,6 +1,6 @@
{
"packages": ["packages/*"],
- "version": "2.1.4",
+ "version": "2.1.5",
"npmClient": "yarn",
"command": {
"version": {
diff --git a/package.json b/package.json
index 08099b82bd..cf10865561 100644
--- a/package.json
+++ b/package.json
@@ -12,8 +12,7 @@
"format": "prettier --write --html-whitespace-sensitivity ignore",
"docs:generate-typescript-docs": "ts-node scripts/docs/generate-typescript-docs.ts",
"docs:generate-graphql-docs": "ts-node scripts/docs/generate-graphql-docs.ts --api=shop && ts-node scripts/docs/generate-graphql-docs.ts --api=admin",
- "docs:update-build-info": "ts-node scripts/docs/update-build-info.ts",
- "docs:build": "yarn docs:generate-graphql-docs && yarn docs:generate-typescript-docs && yarn docs:update-build-info",
+ "docs:build": "yarn docs:generate-graphql-docs && yarn docs:generate-typescript-docs",
"codegen": "tsc -p scripts/codegen/plugins && ts-node scripts/codegen/generate-graphql-types.ts",
"version": "yarn check-imports && yarn check-angular-versions && yarn build && yarn check-core-type-defs && yarn generate-changelog && git add CHANGELOG* && git add */version.ts",
"dev-server:start": "cd packages/dev-server && yarn start",
diff --git a/packages/admin-ui-plugin/package.json b/packages/admin-ui-plugin/package.json
index 5b9d054f11..56ee123946 100644
--- a/packages/admin-ui-plugin/package.json
+++ b/packages/admin-ui-plugin/package.json
@@ -1,6 +1,6 @@
{
"name": "@vendure/admin-ui-plugin",
- "version": "2.1.4",
+ "version": "2.1.5",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"files": [
@@ -21,8 +21,8 @@
"devDependencies": {
"@types/express": "^4.17.8",
"@types/fs-extra": "^9.0.1",
- "@vendure/common": "^2.1.4",
- "@vendure/core": "^2.1.4",
+ "@vendure/common": "^2.1.5",
+ "@vendure/core": "^2.1.5",
"express": "^4.17.1",
"rimraf": "^3.0.2",
"typescript": "4.9.5"
diff --git a/packages/admin-ui/package-lock.json b/packages/admin-ui/package-lock.json
index 2bf866d7b9..986e9c5834 100644
--- a/packages/admin-ui/package-lock.json
+++ b/packages/admin-ui/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "@vendure/admin-ui",
- "version": "2.1.4",
+ "version": "2.1.5",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/packages/admin-ui/package.json b/packages/admin-ui/package.json
index b269ac3729..4e7558c0c5 100644
--- a/packages/admin-ui/package.json
+++ b/packages/admin-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "@vendure/admin-ui",
- "version": "2.1.4",
+ "version": "2.1.5",
"license": "MIT",
"scripts": {
"ng": "ng",
@@ -49,7 +49,7 @@
"@ng-select/ng-select": "^11.1.1",
"@ngx-translate/core": "^15.0.0",
"@ngx-translate/http-loader": "^8.0.0",
- "@vendure/common": "^2.1.4",
+ "@vendure/common": "^2.1.5",
"@webcomponents/custom-elements": "^1.6.0",
"apollo-angular": "^5.0.0",
"apollo-upload-client": "^17.0.0",
diff --git a/packages/admin-ui/src/lib/core/src/common/version.ts b/packages/admin-ui/src/lib/core/src/common/version.ts
index 07b9507588..b6022f583c 100644
--- a/packages/admin-ui/src/lib/core/src/common/version.ts
+++ b/packages/admin-ui/src/lib/core/src/common/version.ts
@@ -1,2 +1,2 @@
// Auto-generated by the set-version.js script.
-export const ADMIN_UI_VERSION = '2.1.4';
+export const ADMIN_UI_VERSION = '2.1.5';
diff --git a/packages/admin-ui/src/lib/core/src/shared/components/asset-preview/asset-preview.component.html b/packages/admin-ui/src/lib/core/src/shared/components/asset-preview/asset-preview.component.html
index 71ce78d359..e371f46735 100644
--- a/packages/admin-ui/src/lib/core/src/shared/components/asset-preview/asset-preview.component.html
+++ b/packages/admin-ui/src/lib/core/src/shared/components/asset-preview/asset-preview.component.html
@@ -107,42 +107,44 @@