@spiffcommerce/core 12.9.9 → 12.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/types.d.ts CHANGED
@@ -540,6 +540,16 @@ export interface WorkflowManager {
540
540
  updateStorage: (stepName: string, update: _StepStorage1) => Promise<void>;
541
541
  getModelContainer: () => any | undefined;
542
542
  setModelContainer: (container: any) => void;
543
+ /**
544
+ * Injects the model of this product into the preview service.
545
+ * This also overwrites the internal preview service.
546
+ * @param previewService The preview service to inject into.
547
+ */
548
+ injectIntoPreviewService(previewService: any): Promise<void>;
549
+ /**
550
+ * Ejects the model of this product from the preview service.
551
+ */
552
+ ejectFromPreviewService(): void;
543
553
  }
544
554
  interface StepService<T extends _AnyStepData1> {
545
555
  /**
@@ -2051,7 +2061,13 @@ interface ClientOptions {
2051
2061
  */
2052
2062
  applicationKey?: string;
2053
2063
  }
2054
- interface GetWorkflowFromTransactionOptions {
2064
+ interface GetWorkflowOptionsBase {
2065
+ /**
2066
+ * An existing preview service to use, instead of creating a new one.
2067
+ */
2068
+ previewService?: any;
2069
+ }
2070
+ interface GetWorkflowFromTransactionOptions extends GetWorkflowOptionsBase {
2055
2071
  /** The existing Transaction to use. */
2056
2072
  transactionId: string;
2057
2073
  /** If set to true, the workflow will display in a read-only mode. */
@@ -2060,7 +2076,7 @@ interface GetWorkflowFromTransactionOptions {
2060
2076
  workflowState?: string;
2061
2077
  type: "transaction";
2062
2078
  }
2063
- interface GetWorkflowFromIntegrationProductOptions {
2079
+ interface GetWorkflowFromIntegrationProductOptions extends GetWorkflowOptionsBase {
2064
2080
  /** The workflow to load. */
2065
2081
  workflowId: string;
2066
2082
  integrationProductId: string;
@@ -2069,7 +2085,7 @@ interface GetWorkflowFromIntegrationProductOptions {
2069
2085
  bulk?: boolean;
2070
2086
  type: "integration";
2071
2087
  }
2072
- interface GetWorkflowFromExternalProductOptions {
2088
+ interface GetWorkflowFromExternalProductOptions extends GetWorkflowOptionsBase {
2073
2089
  /** The workflow to load. */
2074
2090
  workflowId: string;
2075
2091
  /** The external ID associated with an integration. */
@@ -2266,6 +2282,8 @@ export class MockWorkflowManager implements WorkflowManager {
2266
2282
  toggleDesignConfirmed(): void;
2267
2283
  updateMetadata(_stepName: string, _update: any): void;
2268
2284
  updateStorage(_stepName: string, _update: _StepStorage1): Promise<void>;
2285
+ injectIntoPreviewService(_previewService: any): Promise<void>;
2286
+ ejectFromPreviewService(): void;
2269
2287
  }
2270
2288
  export const TransformWrapper: React.FunctionComponent;
2271
2289
  export { CommandContext };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spiffcommerce/core",
3
- "version": "12.9.9",
3
+ "version": "12.10.1",
4
4
  "description": "Core client API for interacting with the Spiff Commerce backend.",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/main.js",
@@ -45,7 +45,7 @@
45
45
  "@parcel/transformer-typescript-tsc": "^2.8.0",
46
46
  "@parcel/transformer-typescript-types": "2.8.0",
47
47
  "@parcel/validator-typescript": "^2.8.0",
48
- "@spiffcommerce/preview": "^3.1.5",
48
+ "@spiffcommerce/preview": "^3.2.0",
49
49
  "@types/enzyme": "^3.10.12",
50
50
  "@types/jest": "^29.0.3",
51
51
  "@types/lodash.clonedeep": "^4.5.7",