@spiffcommerce/core 12.4.3 → 12.5.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
@@ -1,4 +1,4 @@
1
- import { Workflow as _Workflow1, StepAspect as _StepAspect1, Step as _Step1, AnyStepData as _AnyStepData1, Asset as _Asset1, Region, VariantResource as _VariantResource1, FrameOffsets, PatternImageData, DigitalContentStepData as _DigitalContentStepData1, LayoutsState as _LayoutsState1, CanvasCommand as _CanvasCommand1, FrameStepData as _FrameStepData1, ILayout as _ILayout1, CreateElementCommand as _CreateElementCommand1, FrameElement as _FrameElement1, ColorDefinition as _ColorDefinition1, IllustrationStepData as _IllustrationStepData1, IllustrationElement as _IllustrationElement1, LayoutData as _LayoutData1, MaterialStepData as _MaterialStepData1, ModelStepData as _ModelStepData1, ModuleStepData as _ModuleStepData1, PictureStepData as _PictureStepData1, QuestionStepData as _QuestionStepData1, ShapeStepData as _ShapeStepData1, FontData, GroupCommand as _GroupCommand1, OptionResource as _OptionResource1, TextboxElement as _TextboxElement1, TextFillImage, TextStepData as _TextStepData1, StepStorage as _StepStorage1, SerializableStep, CommandState as _CommandState1, CommandContext as _CommandContext1, LayoutState, MaterialResource, AssetType as _AssetType1, Point, ScaleAxis, UnitOfMeasurement as _UnitOfMeasurement1, StepType as _StepType1, BulkStepData as _BulkStepData1, Theme as _Theme1, FrameData as _FrameData1, Animatable, AnyStepData, Asset, AssetType, BringForwardCommand, BringToFrontCommand, BringToBackCommand, BulkStepData, CanvasCommand, ColorDefinition, CommandContext, CommandState, CreateElementCommand, DeleteElementCommand, DigitalContentStepData, FontAlignmentCommand, FontColorCommand, FontSizeCommand, FontSourceCommand, FrameElement, FrameStepData, GroupCommand, ILayout, IllustrationElement, IllustrationStepData, ImageElement, LayoutData, LayoutElement, LayoutElementFactory, LayoutElementType, LayoutsState, MaterialStepData, ModelStepData, ModuleStepData, MoveCommand, OptionResource, PictureStepData, QuestionStepData, ResizeCommand, RotateCommand, SendBackwardsCommand, ShapeStepData, Step, StepAspect, StepAspectType, StepStorage, StepType, TextChangeCommand, TextStepData, TextboxElement, UnitOfMeasurement, VariantResource, Workflow, dataUrlFromExternalUrl, findElement, frameDataCache, generate, generateSVGWithUnknownColors, getAttributesFromArrayBuffer, getFrameData, getSvgElement, loadFontFromDataUrl, loadFontFromExternalUrl, patternImageDataCache, CreateLayoutCommand, rehydrateSerializedLayout, ColorProfileProps, WorkflowPanel, determineCorrectFontSizeAndLines, registerJSDOM, getAxisAlignedBoundingBox, Theme } from "@spiffcommerce/papyrus";
1
+ import { Workflow as _Workflow1, StepAspect as _StepAspect1, Step as _Step1, AnyStepData as _AnyStepData1, Asset as _Asset1, Region, VariantResource as _VariantResource1, FrameOffsets, PatternImageData, DigitalContentStepData as _DigitalContentStepData1, LayoutsState as _LayoutsState1, CanvasCommand as _CanvasCommand1, FrameStepData as _FrameStepData1, ILayout as _ILayout1, CreateElementCommand as _CreateElementCommand1, FrameElement as _FrameElement1, ColorDefinition as _ColorDefinition1, IllustrationStepData as _IllustrationStepData1, IllustrationElement as _IllustrationElement1, LayoutData as _LayoutData1, MaterialStepData as _MaterialStepData1, ModelStepData as _ModelStepData1, ModuleStepData as _ModuleStepData1, PictureStepData as _PictureStepData1, QuestionStepData as _QuestionStepData1, ShapeStepData as _ShapeStepData1, FontData, GroupCommand as _GroupCommand1, OptionResource as _OptionResource1, TextboxElement as _TextboxElement1, TextFillImage, TextStepData as _TextStepData1, StepStorage as _StepStorage1, SerializableStep, CommandState as _CommandState1, CommandContext as _CommandContext1, LayoutState, MaterialResource, AssetType as _AssetType1, Point, ScaleAxis, UnitOfMeasurement as _UnitOfMeasurement1, StepType as _StepType1, BulkStepData as _BulkStepData1, FrameData as _FrameData1, AspectType, GlobalPropertyConfigurationAspect, Theme as _Theme1, Animatable, AnyStepData, Asset, AssetType, BringForwardCommand, BringToFrontCommand, BringToBackCommand, BulkStepData, CanvasCommand, ColorDefinition, CommandContext, CommandState, CreateElementCommand, DeleteElementCommand, DigitalContentStepData, FontAlignmentCommand, FontColorCommand, FontSizeCommand, FontSourceCommand, FrameElement, FrameStepData, GroupCommand, ILayout, IllustrationElement, IllustrationStepData, ImageElement, LayoutData, LayoutElement, LayoutElementFactory, LayoutElementType, LayoutsState, MaterialStepData, ModelStepData, ModuleStepData, MoveCommand, OptionResource, PictureStepData, QuestionStepData, ResizeCommand, RotateCommand, SendBackwardsCommand, ShapeStepData, Step, StepAspect, StepAspectType, StepStorage, StepType, TextChangeCommand, TextStepData, TextboxElement, UnitOfMeasurement, VariantResource, Workflow, dataUrlFromExternalUrl, findElement, frameDataCache, generate, generateSVGWithUnknownColors, getAttributesFromArrayBuffer, getFrameData, getSvgElement, loadFontFromDataUrl, loadFontFromExternalUrl, patternImageDataCache, CreateLayoutCommand, rehydrateSerializedLayout, ColorProfileProps, WorkflowPanel, determineCorrectFontSizeAndLines, registerJSDOM, getAxisAlignedBoundingBox, Theme } from "@spiffcommerce/papyrus";
2
2
  import { ApolloClient } from "@apollo/client";
3
3
  import React, { ReactNode, Dispatch, FunctionComponent, RefObject, PointerEvent, KeyboardEvent } from "react";
4
4
  export const gatherVaryingStepAspects: (workflow: _Workflow1) => _StepAspect1[];
@@ -710,6 +710,13 @@ export interface Transaction {
710
710
  }
711
711
  interface IntegrationProduct {
712
712
  id: string;
713
+ externalProductId?: string;
714
+ integration?: Integration;
715
+ }
716
+ interface Integration {
717
+ id: string;
718
+ enabled: boolean;
719
+ externalIntegrationId?: string;
713
720
  }
714
721
  /**
715
722
  * Fields found in a variant within a line item resource.
@@ -838,6 +845,7 @@ interface Product {
838
845
  * Configuration for conversion. Optional.
839
846
  */
840
847
  conversionConfiguration?: ConversionConfiguration;
848
+ integrationProducts?: IntegrationProduct[];
841
849
  }
842
850
  export interface ColorOption {
843
851
  id?: string;
@@ -1468,6 +1476,10 @@ export abstract class StepHandle<T extends _AnyStepData1> {
1468
1476
  * @returns The type of the step handle.
1469
1477
  */
1470
1478
  getType(): _StepType1;
1479
+ /**
1480
+ * @returns The underlying data for this step. Favor using the step handle methods instead of this.
1481
+ */
1482
+ getRaw(): _Step1<T>;
1471
1483
  /**
1472
1484
  * Fires any configured animations on the 3D preview for this step.
1473
1485
  * This includes camera & model animations. If the preview is unavailable
@@ -1854,6 +1866,53 @@ export interface WorkflowExperience {
1854
1866
  [key: string]: string;
1855
1867
  }>;
1856
1868
  }
1869
+ export enum FrameStep {
1870
+ SelectFrame = "SelectFrame",
1871
+ SelectImage = "SelectImage",
1872
+ Position = "Position"
1873
+ }
1874
+ export class FrameStepHandle extends StepHandle<_FrameStepData1> {
1875
+ constructor(manager: WorkflowManager, step: _Step1<_FrameStepData1>);
1876
+ selectVariant(variant: Variant): Promise<void>;
1877
+ onFrameDataChanged(callback: (frameData: _FrameData1) => void): void;
1878
+ selectImage(asset: _Asset1): void;
1879
+ getImageData(): PatternImageData | undefined;
1880
+ getCurrentFrameStep(frameData: _FrameData1, uploading?: any, imageUploadComplete?: any, variants?: _VariantResource1[]): FrameStep;
1881
+ getFrameService(): FrameService | undefined;
1882
+ hasOverlayImageKey(): string | undefined;
1883
+ hasOverlayImageUrl(): any;
1884
+ hasVaryingUpload(): boolean | undefined;
1885
+ hasVaryingSelection(): boolean | undefined;
1886
+ }
1887
+ /**
1888
+ * TODO: Add GlobalPropertyState mutation & queries to bundle.
1889
+ * TODO: Optimize workflow experience state updates.
1890
+ */
1891
+ /**
1892
+ * A GlobalPropertyHandle acts as an interface to global properties on our platform. Currently
1893
+ * bundles can return a handle for any global properties associated to the collection.
1894
+ */
1895
+ declare abstract class GlobalPropertyHandle {
1896
+ protected readonly bundle: _Bundle1;
1897
+ protected readonly property: GlobalPropertyConfigurationAspect;
1898
+ constructor(bundle: _Bundle1, property: GlobalPropertyConfigurationAspect);
1899
+ /**
1900
+ * @returns The human friendly name of the property.
1901
+ */
1902
+ getName(): string;
1903
+ /**
1904
+ * @returns A human friendly description.
1905
+ */
1906
+ getDescription(): string;
1907
+ /**
1908
+ * @returns The type of the global property. Use this to determine how to render the property.
1909
+ */
1910
+ getType(): AspectType;
1911
+ /**
1912
+ * Returns all steps that share this property.
1913
+ */
1914
+ protected getSharedSteps(): import("stepHandles").StepHandle<import("@spiffcommerce/papyrus").AnyStepData>[];
1915
+ }
1857
1916
  /**
1858
1917
  * A bundle serves as a container for a set of workflow experience.
1859
1918
  */
@@ -1887,14 +1946,14 @@ interface _Bundle1 {
1887
1946
  */
1888
1947
  setMetadata(metadata: Map<string, string>): Promise<void>;
1889
1948
  /**
1890
- * Returns true when the bundle contains transactions with shared properties.
1949
+ * Returns true when the bundle contains products that share global properties.
1891
1950
  */
1892
- hasGlobalProperties(): boolean;
1951
+ hasGlobalProperties(): Promise<boolean>;
1893
1952
  /**
1894
1953
  * Get a handle to the global properties available within this bundle. Setting values
1895
1954
  * via this method will make selections on all bundles that share the property.
1896
1955
  */
1897
- getGlobalProperties(): any;
1956
+ getGlobalProperties(): Promise<GlobalPropertyHandle[]>;
1898
1957
  /**
1899
1958
  * Return the total in subunits for this bundle. This is the sum of the total for all individual transactions.
1900
1959
  */
@@ -1914,6 +1973,10 @@ interface _Bundle1 {
1914
1973
  * @param experience The workflow experience to remove from this bundle.
1915
1974
  */
1916
1975
  removeWorkflowExperience(experience: WorkflowExperience): Promise<void>;
1976
+ /**
1977
+ * Returns all workflow experiences currently added to this bundle.
1978
+ */
1979
+ getWorkflowExperiences(): WorkflowExperience[];
1917
1980
  /**
1918
1981
  * Sort the list of workflow experiences.
1919
1982
  */
@@ -2169,24 +2232,6 @@ export class MockWorkflowManager implements WorkflowManager {
2169
2232
  updateMetadata(_stepName: string, _update: any): void;
2170
2233
  updateStorage(_stepName: string, _update: _StepStorage1): Promise<void>;
2171
2234
  }
2172
- export enum FrameStep {
2173
- SelectFrame = "SelectFrame",
2174
- SelectImage = "SelectImage",
2175
- Position = "Position"
2176
- }
2177
- export class FrameStepHandle extends StepHandle<_FrameStepData1> {
2178
- constructor(manager: WorkflowManager, step: _Step1<_FrameStepData1>);
2179
- selectVariant(variant: Variant): Promise<void>;
2180
- onFrameDataChanged(callback: (frameData: _FrameData1) => void): void;
2181
- selectImage(asset: _Asset1): void;
2182
- getImageData(): PatternImageData | undefined;
2183
- getCurrentFrameStep(frameData: _FrameData1, uploading?: any, imageUploadComplete?: any, variants?: _VariantResource1[]): FrameStep;
2184
- getFrameService(): FrameService | undefined;
2185
- hasOverlayImageKey(): string | undefined;
2186
- hasOverlayImageUrl(): any;
2187
- hasVaryingUpload(): boolean | undefined;
2188
- hasVaryingSelection(): boolean | undefined;
2189
- }
2190
2235
  export const TransformWrapper: React.FunctionComponent;
2191
2236
  export { CommandContext };
2192
2237
  export { AssetType, BringForwardCommand, BringToFrontCommand, BringToBackCommand, CanvasCommand, CreateElementCommand, CreateLayoutCommand, DeleteElementCommand, FontAlignmentCommand, FontColorCommand, FontSizeCommand, FontSourceCommand, GroupCommand, LayoutElementFactory, LayoutElementType, MoveCommand, ResizeCommand, RotateCommand, SendBackwardsCommand, StepAspectType, StepType, TextChangeCommand, UnitOfMeasurement, dataUrlFromExternalUrl, findElement, frameDataCache, generate, getAxisAlignedBoundingBox, generateSVGWithUnknownColors, getAttributesFromArrayBuffer, rehydrateSerializedLayout, getFrameData, getSvgElement, loadFontFromDataUrl, loadFontFromExternalUrl, determineCorrectFontSizeAndLines, patternImageDataCache, registerJSDOM };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spiffcommerce/core",
3
- "version": "12.4.3",
3
+ "version": "12.5.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",
@@ -87,7 +87,7 @@
87
87
  },
88
88
  "dependencies": {
89
89
  "@apollo/client": "^3.7.0",
90
- "@spiffcommerce/papyrus": "^2.0.5",
90
+ "@spiffcommerce/papyrus": "^2.0.9",
91
91
  "cross-fetch": "^3.1.5",
92
92
  "graphql": "^16.6.0",
93
93
  "lodash.clonedeep": "^4.5.0",