types.ts 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import { PurgeRule } from './purge-rule';
  2. /**
  3. * @description
  4. * Configuration options for the StellatePlugin.
  5. *
  6. * @docsCategory core plugins/StellatePlugin
  7. */
  8. export interface StellatePluginOptions {
  9. /**
  10. * @description
  11. * The Stellate service name, i.e. `<service-name>.stellate.sh`
  12. */
  13. serviceName: string;
  14. /**
  15. * @description
  16. * The Stellate Purging API token. For instructions on how to generate the token,
  17. * see the [Stellate docs](https://docs.stellate.co/docs/purging-api#authentication)
  18. */
  19. apiToken: string;
  20. /**
  21. * @description
  22. * An array of {@link PurgeRule} instances which are used to define how the plugin will
  23. * respond to Vendure events in order to trigger calls to the Stellate Purging API.
  24. */
  25. purgeRules: PurgeRule[];
  26. /**
  27. * @description
  28. * When events are published, the PurgeRules will buffer those events in order to efficiently
  29. * batch requests to the Stellate Purging API. You may wish to change the default, e.g. if you are
  30. * running in a serverless environment and cannot introduce pauses after the main request has completed.
  31. *
  32. * @default 2000
  33. */
  34. defaultBufferTimeMs?: number;
  35. /**
  36. * @description
  37. * When set to `true`, calls will not be made to the Stellate Purge API.
  38. *
  39. * @default false
  40. */
  41. devMode?: boolean;
  42. /**
  43. * @description
  44. * If set to true, the plugin will log the calls that would be made
  45. * to the Stellate Purge API. Note, this generates a
  46. * lot of debug-level logging.
  47. *
  48. * @default false
  49. */
  50. debugLogging?: boolean;
  51. }