|
|
@@ -29,6 +29,78 @@ import { ShippingEligibilityChecker } from './shipping-method/shipping-eligibili
|
|
|
import { TaxCalculationStrategy } from './tax/tax-calculation-strategy';
|
|
|
import { TaxZoneStrategy } from './tax/tax-zone-strategy';
|
|
|
|
|
|
+/**
|
|
|
+ * @description
|
|
|
+ * The ApiOptions define how the Vendure GraphQL APIs are exposed, as well as allowing the API layer
|
|
|
+ * to be extended with middleware.
|
|
|
+ *
|
|
|
+ * @docsCategory configuration
|
|
|
+ */
|
|
|
+export interface ApiOptions {
|
|
|
+ /**
|
|
|
+ * @description
|
|
|
+ * Set the hostname of the server. If not set, the server will be available on localhost.
|
|
|
+ *
|
|
|
+ * @default ''
|
|
|
+ */
|
|
|
+ hostname?: string;
|
|
|
+ /**
|
|
|
+ * @description
|
|
|
+ * Which port the Vendure server should listen on.
|
|
|
+ *
|
|
|
+ * @default 3000
|
|
|
+ */
|
|
|
+ port: number;
|
|
|
+ /**
|
|
|
+ * @description
|
|
|
+ * The path to the admin GraphQL API.
|
|
|
+ *
|
|
|
+ * @default 'admin-api'
|
|
|
+ */
|
|
|
+ adminApiPath?: string;
|
|
|
+ /**
|
|
|
+ * @description
|
|
|
+ * The path to the admin GraphQL API.
|
|
|
+ *
|
|
|
+ * @default 'shop-api'
|
|
|
+ */
|
|
|
+ shopApiPath?: string;
|
|
|
+ /**
|
|
|
+ * @description
|
|
|
+ * The name of the property which contains the token of the
|
|
|
+ * active channel. This property can be included either in
|
|
|
+ * the request header or as a query string.
|
|
|
+ *
|
|
|
+ * @default 'vendure-token'
|
|
|
+ */
|
|
|
+ channelTokenKey?: string;
|
|
|
+ /**
|
|
|
+ * @description
|
|
|
+ * Set the CORS handling for the server. See the [express CORS docs](https://github.com/expressjs/cors#configuration-options).
|
|
|
+ *
|
|
|
+ * @default { origin: true, credentials: true }
|
|
|
+ */
|
|
|
+ cors?: boolean | CorsOptions;
|
|
|
+ /**
|
|
|
+ * @description
|
|
|
+ * Custom Express middleware for the server.
|
|
|
+ *
|
|
|
+ * @default []
|
|
|
+ */
|
|
|
+ middleware?: Array<{ handler: RequestHandler; route: string }>;
|
|
|
+ /**
|
|
|
+ * @description
|
|
|
+ * Custom [ApolloServerPlugins](https://www.apollographql.com/docs/apollo-server/integrations/plugins/) which
|
|
|
+ * allow the extension of the Apollo Server, which is the underlying GraphQL server used by Vendure.
|
|
|
+ *
|
|
|
+ * Apollo plugins can be used e.g. to perform custom data transformations on incoming operations or outgoing
|
|
|
+ * data.
|
|
|
+ *
|
|
|
+ * @default []
|
|
|
+ */
|
|
|
+ apolloServerPlugins?: PluginDefinition[];
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* @description
|
|
|
* The AuthOptions define how authentication is managed.
|
|
|
@@ -431,18 +503,9 @@ export interface JobQueueOptions {
|
|
|
export interface VendureConfig {
|
|
|
/**
|
|
|
* @description
|
|
|
- * The path to the admin GraphQL API.
|
|
|
- *
|
|
|
- * @default 'admin-api'
|
|
|
- */
|
|
|
- adminApiPath?: string;
|
|
|
- /**
|
|
|
- * @description
|
|
|
- * The path to the admin GraphQL API.
|
|
|
*
|
|
|
- * @default 'shop-api'
|
|
|
*/
|
|
|
- shopApiPath?: string;
|
|
|
+ apiOptions: ApiOptions;
|
|
|
/**
|
|
|
* @description
|
|
|
* Configuration for the handling of Assets.
|
|
|
@@ -458,22 +521,6 @@ export interface VendureConfig {
|
|
|
* Configuration for Products and Collections.
|
|
|
*/
|
|
|
catalogOptions?: CatalogOptions;
|
|
|
- /**
|
|
|
- * @description
|
|
|
- * The name of the property which contains the token of the
|
|
|
- * active channel. This property can be included either in
|
|
|
- * the request header or as a query string.
|
|
|
- *
|
|
|
- * @default 'vendure-token'
|
|
|
- */
|
|
|
- channelTokenKey?: string;
|
|
|
- /**
|
|
|
- * @description
|
|
|
- * Set the CORS handling for the server. See the [express CORS docs](https://github.com/expressjs/cors#configuration-options).
|
|
|
- *
|
|
|
- * @default { origin: true, credentials: true }
|
|
|
- */
|
|
|
- cors?: boolean | CorsOptions;
|
|
|
/**
|
|
|
* @description
|
|
|
* Defines custom fields which can be used to extend the built-in entities.
|
|
|
@@ -511,13 +558,6 @@ export interface VendureConfig {
|
|
|
* @default new AutoIncrementIdStrategy()
|
|
|
*/
|
|
|
entityIdStrategy?: EntityIdStrategy<any>;
|
|
|
- /**
|
|
|
- * @description
|
|
|
- * Set the hostname of the server. If not set, the server will be available on localhost.
|
|
|
- *
|
|
|
- * @default ''
|
|
|
- */
|
|
|
- hostname?: string;
|
|
|
/**
|
|
|
* @description
|
|
|
* Configuration settings for data import and export.
|
|
|
@@ -528,24 +568,6 @@ export interface VendureConfig {
|
|
|
* Configuration settings governing how orders are handled.
|
|
|
*/
|
|
|
orderOptions?: OrderOptions;
|
|
|
- /**
|
|
|
- * @description
|
|
|
- * Custom Express middleware for the server.
|
|
|
- *
|
|
|
- * @default []
|
|
|
- */
|
|
|
- middleware?: Array<{ handler: RequestHandler; route: string }>;
|
|
|
- /**
|
|
|
- * @description
|
|
|
- * Custom [ApolloServerPlugins](https://www.apollographql.com/docs/apollo-server/integrations/plugins/) which
|
|
|
- * allow the extension of the Apollo Server, which is the underlying GraphQL server used by Vendure.
|
|
|
- *
|
|
|
- * Apollo plugins can be used e.g. to perform custom data transformations on incoming operations or outgoing
|
|
|
- * data.
|
|
|
- *
|
|
|
- * @default []
|
|
|
- */
|
|
|
- apolloServerPlugins?: PluginDefinition[];
|
|
|
/**
|
|
|
* @description
|
|
|
* Configures available payment processing methods.
|
|
|
@@ -558,13 +580,6 @@ export interface VendureConfig {
|
|
|
* @default []
|
|
|
*/
|
|
|
plugins?: Array<DynamicModule | Type<any>>;
|
|
|
- /**
|
|
|
- * @description
|
|
|
- * Which port the Vendure server should listen on.
|
|
|
- *
|
|
|
- * @default 3000
|
|
|
- */
|
|
|
- port: number;
|
|
|
/**
|
|
|
* @description
|
|
|
* Configures the Conditions and Actions available when creating Promotions.
|
|
|
@@ -607,6 +622,7 @@ export interface VendureConfig {
|
|
|
* @docsCategory configuration
|
|
|
*/
|
|
|
export interface RuntimeVendureConfig extends Required<VendureConfig> {
|
|
|
+ apiOptions: Required<ApiOptions>;
|
|
|
assetOptions: Required<AssetOptions>;
|
|
|
authOptions: Required<AuthOptions>;
|
|
|
customFields: Required<CustomFields>;
|