@spiffcommerce/core 26.2.0 → 26.4.0

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/CHANGELOG.md CHANGED
@@ -14,6 +14,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
14
14
  - `Fixed` for any bug fixes.
15
15
  - `Security` in case of vulnerabilities.
16
16
 
17
+ ## [26.4.0] - 07-11-2024
18
+
19
+ ### Added
20
+
21
+ - The client now has a `placeOrder` function. This allows ordering any combination of transactions. Remember that this may require additional permissions on the application key.
22
+ - Bundle now has a `placeOrder` function that will place an order for the bundle. The will create an order containing all transactions in the bundle. Remember that this may require additional permissions on the application key.
23
+ - Interface `Order` and `OrderItem` have been added to the package. These interfaces can be used with the new placeOrder functions.
24
+
25
+ ## [26.3.0] - 04-11-2024
26
+
27
+ ### Changed
28
+
29
+ - IllustrationStepHandle now accepts providing PMS values when calling `setColor`
30
+ - IllustrationStepHandle's `getAvailableColors` function now returns the names of the variants as PMS values.
31
+
17
32
  ## [26.1.2] - 30-10-2024
18
33
 
19
34
  ### Fixed
package/dist/index.d.ts CHANGED
@@ -1826,6 +1826,10 @@ interface Bundle$1 {
1826
1826
  * @returns {BundleDesignCreationMessage} An object containing an array of design messages, along with the Bundle's Id and the event type.
1827
1827
  */
1828
1828
  finish(onProgressUpdate?: DesignCreationProgressUpdate, createPreviewImage?: (workflowExperience: WorkflowExperience) => Promise<string | undefined>): Promise<BundleDesignCreationMessage>;
1829
+ /**
1830
+ * A convenience function allowing you to place an order with all the items in the bundle.
1831
+ */
1832
+ placeOrder(): Promise<Order>;
1829
1833
  /**
1830
1834
  * Add an event listener to this bundle.
1831
1835
  * @param event The event to listen for. Currently only "conditional-global-properties-changed" is supported.
@@ -2333,6 +2337,7 @@ declare class SpiffCommerceClient {
2333
2337
  externalProductId: string;
2334
2338
  }>): Promise<IntegrationProduct>;
2335
2339
  getShareActionsForTransaction(transactionId: string): Promise<ShareAction[] | undefined>;
2340
+ placeOrder(orderItems: OrderItem[]): Promise<Order>;
2336
2341
  }
2337
2342
  declare const getIntegration: (applicationKey: string) => Promise<Integration>;
2338
2343
  declare const getTransaction: (transactionId: string) => Promise<Transaction | undefined>;
@@ -4496,6 +4501,14 @@ declare enum UnitOfMeasurement {
4496
4501
  }
4497
4502
  type PapyrusComponent<T = any> = FunctionComponent<T>;
4498
4503
  type PapyrusNode = ReactNode;
4504
+ interface Order {
4505
+ id: string;
4506
+ internalId: string;
4507
+ }
4508
+ interface OrderItem {
4509
+ transactionId: string;
4510
+ amountToOrder: number;
4511
+ }
4499
4512
 
4500
4513
  declare class OptionService {
4501
4514
  /**
@@ -4640,9 +4653,10 @@ declare class IllustrationStepService implements StepService<IllustrationStepDat
4640
4653
  fill: string | undefined;
4641
4654
  stroke: string | undefined;
4642
4655
  variant: VariantResource;
4656
+ pmsValue: string;
4643
4657
  }[] | undefined>;
4644
- changeColorsCommand(svg: string, illustrationWidth: number, illustrationHeight: number, elements: string[], newFills: Map<string, string>): Promise<CanvasCommand>;
4645
- changeColors(stepData: Step<IllustrationStepData>, elements: RegionElement[], workflowManager: WorkflowManager, getAllLayouts: () => LayoutData[], newFills: Map<string, string>): Promise<void>;
4658
+ changeColorsCommand(svg: string, illustrationWidth: number, illustrationHeight: number, elements: string[], newFills: Map<string, string | ColorDefinition>): Promise<CanvasCommand>;
4659
+ changeColors(stepData: Step<IllustrationStepData>, elements: RegionElement[], workflowManager: WorkflowManager, getAllLayouts: () => LayoutData[], newFills: Map<string, string | ColorDefinition>): Promise<void>;
4646
4660
  selectVariant(stepData: Step<IllustrationStepData>, variant: VariantResource, elements: RegionElement[], setIsUpdating: (isUpdating: boolean) => void, workflowManager: WorkflowManager): Promise<void>;
4647
4661
  private selectVariantCommand;
4648
4662
  }
@@ -4892,12 +4906,13 @@ declare class IllustrationStepHandle extends StepHandle<IllustrationStepData> {
4892
4906
  /**
4893
4907
  * Set color for the illustration.
4894
4908
  */
4895
- setColor(key: string, value: string): Promise<void>;
4909
+ setColor(key: string, value: string, pmsValue?: string): Promise<void>;
4896
4910
  getColorOption(): Promise<OptionResource | undefined>;
4897
4911
  getAvailableColors(): Promise<{
4898
4912
  fill: string | undefined;
4899
4913
  stroke: string | undefined;
4900
4914
  variant: VariantResource;
4915
+ pmsValue: string;
4901
4916
  }[] | undefined>;
4902
4917
  isColorPickerEnabled(): boolean;
4903
4918
  }
@@ -5493,4 +5508,4 @@ declare const getOrderedTransactions: (customerId: string, limit: number, offset
5493
5508
  declare const getTemplateTransactions: (customerId: string, limit: number, offset: number) => Promise<Transaction[]>;
5494
5509
  declare const getTemplateBundles: (customerId: string, limit: number, offset: number) => Promise<Bundle[]>;
5495
5510
 
5496
- export { AddonHandle, Animatable, AnyStepData, ArrayInput, AspectType, Asset, AssetNotFoundError, AssetObjectVersion, AssetType, BringForwardCommand, BringToBackCommand, BringToFrontCommand, Bundle$1 as Bundle, BundleDesignCreationMessage, BundleEvent, BundleEventData, BundleEventType, BundleStakeholder, CanvasCommand, CollectionProduct, ColorDefinition, ColorOption, ColorOptionGlobalPropertyHandle, ColorProfileProps, CommandContext, CommandState, Condition, ConditionalGlobalPropertiesChangedEventData, ConversionConfiguration, ConversionData, ConversionDataType, ConversionLocation, CreateElementCommand, CreateLayoutCommand, Customer, CustomerDetailsInput, DeleteElementCommand, DesignCreationMessage, DesignCreationProgressUpdate, DesignInputStep, DigitalContentStepData, DigitalContentStepHandle, EditedSteps, FileUploadGlobalPropertyHandle, FlowExecutionNodeResult, FlowExecutionResult, FlowService, FontAlignmentCommand, FontColorCommand, FontSizeCommand, FontSourceCommand, FrameElement, FrameService, FrameStep, FrameStepData, FrameStepHandle, FrameThresholdSettings, GetNewWorkflowOptions, GetWorkflowOptions, GlobalPropertyConfiguration, GlobalPropertyHandle, GroupCommand, ILayout, IllustrationElement, IllustrationStepData, IllustrationStepHandle, ImageElement, InformationMessageType, InformationResult, InformationStepData, InformationStepHandle, Integration, IntegrationOptionResource, IntegrationProduct, IntegrationType, LayoutData, LayoutElement, LayoutElementFactory, LayoutElementType, LayoutNotFoundError, LayoutRenderingPurpose, LayoutState, LayoutsState, MandatorySteps, MaterialEffectMode, MaterialStepData, MaterialStepHandle, MisconfigurationError, MockWorkflowManager, ModelStepData, ModelStepHandle, ModuleStepData, ModuleStepHandle, MoveCommand, NodeType, ObjectInput, ObjectInputType, OptionGlobalPropertyHandle, OptionNotFoundError, OptionResource, PapyrusComponent, ParseError, PictureStepData, PictureStepHandle, Placeable, PmsSearchResult, Point, Product, ProductCameraRig, ProductCollection, ProductWorkflow$1 as ProductWorkflow, promiseCache as PromiseCache, PromiseQueue, QuestionStepData, QuestionStepHandle, QueueablePromise, Region, RegionElement, RenderableScene, ResizeCommand, ResourceNotFoundError, RotateCommand, SavedDesign, ScaleAxis, SelectionStorage, SendBackwardsCommand, ShapeStepData, ShapeStepHandle, ShareAction, ShareActionType, SilentIllustrationStepData, SpiffCommerceClient, Stakeholder, StakeholderType, StateMutationFunc, Step, StepAspect, StepAspectType, StepElements, StepGroup, StepHandle, StepStorage, StepType, TextAlgorithm, TextChangeCommand, TextChangeResult, TextGlobalPropertyHandle, TextInput, TextStepData, TextStepHandle, TextStepStorage, TextboxElement, Theme, ToastCallback, Transaction, Transform, TransformCollection$1 as TransformCollection, UnhandledBehaviorError, UnitOfMeasurement, UpdateImageSourceCommand, Variant, VariantResource, Vector3, Workflow, WorkflowExperience, WorkflowExperienceEventType, WorkflowExperienceHoverEventData, WorkflowExperienceImpl, WorkflowManager, WorkflowMetadata, WorkflowPanel, WorkflowScene, WorkflowSelections, WorkflowStorage, assetService, browserColorToHex, cmPerPixel, createDesign, currentDirection, dataUrlFromExternalUrl, designService, determineCorrectFontSizeAndLines, digitalContentStepService, domParser, duplicateBundle, duplicateTransaction, fetchAsString, findAngle, findElement, findPmsColors, frameDataCache, frameStepService, generate, generateCommands, generateSVGWithUnknownColors, generateStateFromDesignInputSteps, getAttributesFromArrayBuffer, getAxisAlignedBoundingBox, getBoundedOffsets, getBundleThemeConfiguration, getCustomer, getCustomerBundles, getElementVertices, getFrameData, getIntegration, getNEPoint, getNWPoint, getOrderedTransactions, getOverrideThemeConfiguration, getPointOfRotation, getSEPoint, getSvgElement, getTemplateBundles, getTemplateTransactions, getTransaction, getTransactionThemeConfiguration, getTransactionsForBundle, getTrueCoordinates, getUnorderedTransactions, getWorkflow, getWorkflows, graphQlManager, illustrationStepService, isCloseToValue, loadFont, matchHexToPms, materialStepService, mmPerPixel, modelStepService, moduleStepService, nameBundle, nameTransaction, optionService, outlineFontsInSvg, patternImageDataCache, persistenceService, pictureStepService, pmsToRgb, questionStepService, registerFetchImplementation, registerWindowImplementation, rehydrateSerializedLayout, rgbToPms, rotateAroundPoint, sanitizeSvgTree, setBearerAuthenticationToken, setCanvasModule, shapeStepService, shortenUrl, spiffCoreConfiguration, stepAspectValuesToDesignInputSteps, svgColorValueToDefinition, svgStringDimensions, svgToDataUrl, textStepService, toast, xmlSerializer };
5511
+ export { AddonHandle, Animatable, AnyStepData, ArrayInput, AspectType, Asset, AssetNotFoundError, AssetObjectVersion, AssetType, BringForwardCommand, BringToBackCommand, BringToFrontCommand, Bundle$1 as Bundle, BundleDesignCreationMessage, BundleEvent, BundleEventData, BundleEventType, BundleStakeholder, CanvasCommand, CollectionProduct, ColorDefinition, ColorOption, ColorOptionGlobalPropertyHandle, ColorProfileProps, CommandContext, CommandState, Condition, ConditionalGlobalPropertiesChangedEventData, ConversionConfiguration, ConversionData, ConversionDataType, ConversionLocation, CreateElementCommand, CreateLayoutCommand, Customer, CustomerDetailsInput, DeleteElementCommand, DesignCreationMessage, DesignCreationProgressUpdate, DesignInputStep, DigitalContentStepData, DigitalContentStepHandle, EditedSteps, FileUploadGlobalPropertyHandle, FlowExecutionNodeResult, FlowExecutionResult, FlowService, FontAlignmentCommand, FontColorCommand, FontSizeCommand, FontSourceCommand, FrameElement, FrameService, FrameStep, FrameStepData, FrameStepHandle, FrameThresholdSettings, GetNewWorkflowOptions, GetWorkflowOptions, GlobalPropertyConfiguration, GlobalPropertyHandle, GroupCommand, ILayout, IllustrationElement, IllustrationStepData, IllustrationStepHandle, ImageElement, InformationMessageType, InformationResult, InformationStepData, InformationStepHandle, Integration, IntegrationOptionResource, IntegrationProduct, IntegrationType, LayoutData, LayoutElement, LayoutElementFactory, LayoutElementType, LayoutNotFoundError, LayoutRenderingPurpose, LayoutState, LayoutsState, MandatorySteps, MaterialEffectMode, MaterialStepData, MaterialStepHandle, MisconfigurationError, MockWorkflowManager, ModelStepData, ModelStepHandle, ModuleStepData, ModuleStepHandle, MoveCommand, NodeType, ObjectInput, ObjectInputType, OptionGlobalPropertyHandle, OptionNotFoundError, OptionResource, Order, OrderItem, PapyrusComponent, ParseError, PictureStepData, PictureStepHandle, Placeable, PmsSearchResult, Point, Product, ProductCameraRig, ProductCollection, ProductWorkflow$1 as ProductWorkflow, promiseCache as PromiseCache, PromiseQueue, QuestionStepData, QuestionStepHandle, QueueablePromise, Region, RegionElement, RenderableScene, ResizeCommand, ResourceNotFoundError, RotateCommand, SavedDesign, ScaleAxis, SelectionStorage, SendBackwardsCommand, ShapeStepData, ShapeStepHandle, ShareAction, ShareActionType, SilentIllustrationStepData, SpiffCommerceClient, Stakeholder, StakeholderType, StateMutationFunc, Step, StepAspect, StepAspectType, StepElements, StepGroup, StepHandle, StepStorage, StepType, TextAlgorithm, TextChangeCommand, TextChangeResult, TextGlobalPropertyHandle, TextInput, TextStepData, TextStepHandle, TextStepStorage, TextboxElement, Theme, ToastCallback, Transaction, Transform, TransformCollection$1 as TransformCollection, UnhandledBehaviorError, UnitOfMeasurement, UpdateImageSourceCommand, Variant, VariantResource, Vector3, Workflow, WorkflowExperience, WorkflowExperienceEventType, WorkflowExperienceHoverEventData, WorkflowExperienceImpl, WorkflowManager, WorkflowMetadata, WorkflowPanel, WorkflowScene, WorkflowSelections, WorkflowStorage, assetService, browserColorToHex, cmPerPixel, createDesign, currentDirection, dataUrlFromExternalUrl, designService, determineCorrectFontSizeAndLines, digitalContentStepService, domParser, duplicateBundle, duplicateTransaction, fetchAsString, findAngle, findElement, findPmsColors, frameDataCache, frameStepService, generate, generateCommands, generateSVGWithUnknownColors, generateStateFromDesignInputSteps, getAttributesFromArrayBuffer, getAxisAlignedBoundingBox, getBoundedOffsets, getBundleThemeConfiguration, getCustomer, getCustomerBundles, getElementVertices, getFrameData, getIntegration, getNEPoint, getNWPoint, getOrderedTransactions, getOverrideThemeConfiguration, getPointOfRotation, getSEPoint, getSvgElement, getTemplateBundles, getTemplateTransactions, getTransaction, getTransactionThemeConfiguration, getTransactionsForBundle, getTrueCoordinates, getUnorderedTransactions, getWorkflow, getWorkflows, graphQlManager, illustrationStepService, isCloseToValue, loadFont, matchHexToPms, materialStepService, mmPerPixel, modelStepService, moduleStepService, nameBundle, nameTransaction, optionService, outlineFontsInSvg, patternImageDataCache, persistenceService, pictureStepService, pmsToRgb, questionStepService, registerFetchImplementation, registerWindowImplementation, rehydrateSerializedLayout, rgbToPms, rotateAroundPoint, sanitizeSvgTree, setBearerAuthenticationToken, setCanvasModule, shapeStepService, shortenUrl, spiffCoreConfiguration, stepAspectValuesToDesignInputSteps, svgColorValueToDefinition, svgStringDimensions, svgToDataUrl, textStepService, toast, xmlSerializer };