@spiffcommerce/core 29.2.0 → 29.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
+ ## [30.0.0] - 27-08-2025
18
+
19
+ ## Added
20
+
21
+ - The `updateRecipient` method now has extra arguments, primarily for custom fields.
22
+
23
+ ## [29.3.0] - 27-08-2025
24
+
25
+ ## Added
26
+
27
+ - Added new functionality regarding mandatory Global Property aspects:
28
+ - New function `GlobalPropertyHandle.isMandatory(): boolean`: returns a boolean indicating whether the aspect has been marked as required to be completed before the user can continue.
29
+ - New function `GlobalPropertyHandle.isMandatoryFulfilled(): boolean`: returns a boolean indicating whether the aspect has been marked as "completed" for mandatory checks. Note that this function always returns `true` if the aspect has not been marked as mandatory.
30
+ - New event on Bundle `global-properties-mandatory-changed`: Fires whenever any global property's mandatory states have changed. Provides an object with the following shape: `{ changed: GlobalPropertyHandle[]; completed: GlobalPropertyHandle[]; remaining: GlobalPropertyHandle[]; }`
31
+
17
32
  ## [29.2.0] - 25-08-2025
18
33
 
19
34
  ## Added
package/dist/index.d.ts CHANGED
@@ -1365,11 +1365,11 @@ declare abstract class GlobalPropertyHandle {
1365
1365
  */
1366
1366
  getName(): string;
1367
1367
  /**
1368
- * @returns A human friendly title.
1368
+ * @returns A human-friendly title.
1369
1369
  */
1370
1370
  getTitle(): string;
1371
1371
  /**
1372
- * @returns A human friendly description.
1372
+ * @returns A human-friendly description.
1373
1373
  */
1374
1374
  getDescription(): string;
1375
1375
  /**
@@ -1380,6 +1380,14 @@ declare abstract class GlobalPropertyHandle {
1380
1380
  * @returns The underlying property data object.
1381
1381
  */
1382
1382
  getRawProperty(): GlobalPropertyConfigurationAspect;
1383
+ /**
1384
+ * @returns Whether this aspect has been marked as required to be completed before the user can continue.
1385
+ */
1386
+ isMandatory(): boolean;
1387
+ /**
1388
+ * @returns Whether this aspect has been marked as `completed` for mandatory checks. Note that this function always returns `true` if the aspect has not been marked as mandatory.
1389
+ */
1390
+ isMandatoryFulfilled(): boolean;
1383
1391
  /**
1384
1392
  * Applies the global state to all shared steps, if the state is set.
1385
1393
  * @param targetExperiences Optionally filter the workflow experiences it should be applied to.
@@ -1531,12 +1539,14 @@ interface GlobalPropertyStateManager {
1531
1539
  setGlobalPropertyState(state: GlobalPropertyState): Promise<void>;
1532
1540
  getAspect(name: string, channel?: number): string | undefined;
1533
1541
  getAspectStorage<S extends GlobalPropertyStateAspectStorage>(name: string, channel?: number): S | undefined;
1542
+ getAspectMandatoryFulfilled(name: string): boolean | undefined;
1534
1543
  /**
1535
1544
  * Updates the value of a named aspect in the state.
1536
1545
  * @param name The name (key) of the aspect. This must match the key in the associated Global Property Config
1537
1546
  * @param value The value, represented as a string.
1538
1547
  * @param storage Optional: Additional data storage for the aspect. Not specifying this parameter, or providing `undefined`, will not update the
1539
1548
  * storage (if it already exists). Providing `null` will clear the existing storage.
1549
+ * @param channel Optional: Additional sub-identifier.
1540
1550
  */
1541
1551
  setAspect(name: string, value: string, storage?: GlobalPropertyStateAspectStorage | null, channel?: number): Promise<void>;
1542
1552
  setAspectStorage<S extends GlobalPropertyStateAspectStorage>(name: string, storage: S | null, channel?: number): Promise<void>;
@@ -1771,6 +1781,11 @@ declare const getProductCollections: (ids: string[]) => Promise<ProductCollectio
1771
1781
  interface ConditionalGlobalPropertiesChangedEventData {
1772
1782
  globalProperties: GlobalPropertyHandle[];
1773
1783
  }
1784
+ interface GlobalPropertiesMandatoryChangedEventData {
1785
+ changed: GlobalPropertyHandle[];
1786
+ completed: GlobalPropertyHandle[];
1787
+ remaining: GlobalPropertyHandle[];
1788
+ }
1774
1789
  interface WorkflowExperienceHoverEventData {
1775
1790
  workflowExperience: WorkflowExperience;
1776
1791
  }
@@ -1781,6 +1796,7 @@ interface WorkflowExperienceRemovedEventData extends WorkflowExperienceAddedEven
1781
1796
  }
1782
1797
  type BundleEventMap = {
1783
1798
  "conditional-global-properties-changed": ConditionalGlobalPropertiesChangedEventData;
1799
+ "global-properties-mandatory-changed": GlobalPropertiesMandatoryChangedEventData;
1784
1800
  "workflow-experience-hover-enter": WorkflowExperienceHoverEventData;
1785
1801
  "workflow-experience-hover-exit": WorkflowExperienceHoverEventData;
1786
1802
  "workflow-experience-added": WorkflowExperienceAddedEventData;
@@ -2727,11 +2743,13 @@ interface WorkflowManager {
2727
2743
  /**
2728
2744
  * Create or amend the recipient fo the transaction.
2729
2745
  */
2730
- updateRecipient(firstName?: string, lastName?: string, address?: string, suburb?: string, state?: string, email?: string, postalCode?: string, country?: string, mobile?: string, company?: string): Promise<void>;
2746
+ updateRecipient(firstName?: string, lastName?: string, address?: string, suburb?: string, state?: string, email?: string, postalCode?: string, country?: string, mobile?: string, company?: string, apartment?: string, customField1?: string, customField2?: string, customField3?: string, customField4?: string, customField5?: string, conversionConfigurationId?: string): Promise<void>;
2731
2747
  /**
2732
2748
  * Returns the context object used for text templating.
2733
2749
  */
2734
- getTemplatingContext(): any;
2750
+ getTemplatingContext(): Promise<{
2751
+ [key: string]: any;
2752
+ }>;
2735
2753
  }
2736
2754
 
2737
2755
  declare enum AssetType {
@@ -2900,6 +2918,7 @@ interface GlobalPropertyConfigurationAspect {
2900
2918
  entityId?: string;
2901
2919
  conditions?: GlobalPropertyConfigurationAspectCondition[];
2902
2920
  data?: GlobalPropertyConfigurationAspectData;
2921
+ mandatory?: boolean;
2903
2922
  }
2904
2923
  interface GlobalPropertyConfigurationAspectData {
2905
2924
  fileUpload?: GlobalPropertyConfigurationAspectFileUploadData;
@@ -3478,7 +3497,9 @@ interface RenderingConfiguration {
3478
3497
  /**
3479
3498
  * Contents variables for templating text.
3480
3499
  */
3481
- templatingContext?: any;
3500
+ templatingContext?: {
3501
+ [key: string]: any;
3502
+ };
3482
3503
  }
3483
3504
  interface ColorProfileProps {
3484
3505
  name: string;
@@ -3762,6 +3783,13 @@ interface Recipient {
3762
3783
  country?: string;
3763
3784
  mobile?: string;
3764
3785
  company?: string;
3786
+ apartment?: string;
3787
+ customField1?: string;
3788
+ customField2?: string;
3789
+ customField3?: string;
3790
+ customField4?: string;
3791
+ customField5?: string;
3792
+ conversionConfigurationId?: string;
3765
3793
  createdAt?: string;
3766
3794
  updatedAt?: string;
3767
3795
  deletedAt?: string;
@@ -5072,10 +5100,12 @@ declare class DigitalContentStepService implements StepService<DigitalContentSte
5072
5100
  declare const digitalContentStepService: DigitalContentStepService;
5073
5101
 
5074
5102
  declare class MockWorkflowManager implements WorkflowManager {
5075
- getTemplatingContext: () => void;
5103
+ getTemplatingContext: () => Promise<{
5104
+ [key: string]: any;
5105
+ }>;
5076
5106
  removeRecipientCallback: (callback: RecipientCallback) => void;
5077
5107
  addRecipientCallback: (callback: RecipientCallback) => void;
5078
- updateRecipient(_firstName?: string, _lastName?: string, _address?: string, _suburb?: string, _state?: string, _email?: string, _postalCode?: string, _country?: string, _mobile?: string, _company?: string): Promise<void>;
5108
+ updateRecipient(_firstName?: string, _lastName?: string, _address?: string, _suburb?: string, _state?: string, _email?: string, _postalCode?: string, _country?: string, _mobile?: string, _company?: string, _apartment?: string, _customField1?: string, _customField2?: string, _customField3?: string, _customField4?: string, _customField5?: string, _conversionConfigurationId?: string): Promise<void>;
5079
5109
  approveTransaction(_note?: string): Promise<void>;
5080
5110
  rejectTransaction(_note?: string): Promise<void>;
5081
5111
  private client;
@@ -5934,4 +5964,4 @@ declare const validateWorkflowExperienceRecipients: (workflowExperiences: Workfl
5934
5964
  */
5935
5965
  declare const getGlobalPropertyStateForBundle: (bundleId: string) => Promise<GlobalPropertyState | undefined>;
5936
5966
 
5937
- export { AddonHandle, AddressComponent, AddressValidationJob, AddressValidationJobStatus, AddressValidationResult, AddressValidationResultConfirmationLevel, Animatable, AnyStepData, ArrayInput, AspectType, Asset, AssetConfiguration, AssetNotFoundError, AssetObjectVersion, AssetType, BringForwardCommand, BringToBackCommand, BringToFrontCommand, Bundle$1 as Bundle, BundleDesignCreationCartAddMode, BundleDesignCreationMessage, BundleEvent, BundleEventData, BundleEventType, Bundle as BundleRaw, BundleStakeholder, CanvasCommand, CollectionProduct, ColorDefinition, ColorOption, ColorOptionGlobalPropertyHandle, ColorProfileProps, CommandContext, CommandState, Condition, ConditionalGlobalPropertiesChangedEventData, CreateElementCommand, CreateLayoutCommand, CurrencyContext, CurrencyService, Customer, CustomerDetailsInput, DeleteElementCommand, DesignCreationMessage, DesignCreationProgressUpdate, DesignInputStep, DigitalContentStepData, DigitalContentStepHandle, EditedSteps, ExportedStepData, ExportedStepDataProperty, ExportedStepDataPropertyType, 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, LayoutComponentConfiguration, 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, ProductCollectionProductSortKey, ProductWorkflow$1 as ProductWorkflow, promiseCache as PromiseCache, PromiseQueue, QuestionStepData, QuestionStepHandle, QueueablePromise, Recipient, 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, getAddressValidationJobs, getAttributesFromArrayBuffer, getAxisAlignedBoundingBox, getBoundedOffsets, getBundleThemeConfiguration, getCustomer, getCustomerBundles, getElementVertices, getFrameData, getGlobalPropertyStateForBundle, getIntegration, getNEPoint, getNWPoint, getOrderedTransactions, getOverrideThemeConfiguration, getPointOfRotation, getProductCollections, getSEPoint, getSvgElement, getTemplateBundles, getTemplateTransactions, getTransaction, getTransactionThemeConfiguration, getTransactionsForBundle, getTrueCoordinates, getUnorderedTransactions, getValidationJobsForWorkflowExperiences, getWorkflow, getWorkflows, graphQlManager, illustrationStepService, isCloseToValue, loadFont, matchHexToPms, materialStepService, metafieldManager, mmPerPixel, modelStepService, modifySVGColors, 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, validateWorkflowExperienceRecipient, validateWorkflowExperienceRecipients, xmlSerializer };
5967
+ export { AddonHandle, AddressComponent, AddressValidationJob, AddressValidationJobStatus, AddressValidationResult, AddressValidationResultConfirmationLevel, Animatable, AnyStepData, ArrayInput, AspectType, Asset, AssetConfiguration, AssetNotFoundError, AssetObjectVersion, AssetType, BringForwardCommand, BringToBackCommand, BringToFrontCommand, Bundle$1 as Bundle, BundleDesignCreationCartAddMode, BundleDesignCreationMessage, BundleEvent, BundleEventData, BundleEventType, Bundle as BundleRaw, BundleStakeholder, CanvasCommand, CollectionProduct, ColorDefinition, ColorOption, ColorOptionGlobalPropertyHandle, ColorProfileProps, CommandContext, CommandState, Condition, ConditionalGlobalPropertiesChangedEventData, CreateElementCommand, CreateLayoutCommand, CurrencyContext, CurrencyService, Customer, CustomerDetailsInput, DeleteElementCommand, DesignCreationMessage, DesignCreationProgressUpdate, DesignInputStep, DigitalContentStepData, DigitalContentStepHandle, EditedSteps, ExportedStepData, ExportedStepDataProperty, ExportedStepDataPropertyType, FileUploadGlobalPropertyHandle, FlowExecutionNodeResult, FlowExecutionResult, FlowService, FontAlignmentCommand, FontColorCommand, FontSizeCommand, FontSourceCommand, FrameElement, FrameService, FrameStep, FrameStepData, FrameStepHandle, FrameThresholdSettings, GetNewWorkflowOptions, GetWorkflowOptions, GlobalPropertiesMandatoryChangedEventData, GlobalPropertyConfiguration, GlobalPropertyHandle, GroupCommand, ILayout, IllustrationElement, IllustrationStepData, IllustrationStepHandle, ImageElement, InformationMessageType, InformationResult, InformationStepData, InformationStepHandle, Integration, IntegrationOptionResource, IntegrationProduct, IntegrationType, LayoutComponentConfiguration, 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, ProductCollectionProductSortKey, ProductWorkflow$1 as ProductWorkflow, promiseCache as PromiseCache, PromiseQueue, QuestionStepData, QuestionStepHandle, QueueablePromise, Recipient, 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, getAddressValidationJobs, getAttributesFromArrayBuffer, getAxisAlignedBoundingBox, getBoundedOffsets, getBundleThemeConfiguration, getCustomer, getCustomerBundles, getElementVertices, getFrameData, getGlobalPropertyStateForBundle, getIntegration, getNEPoint, getNWPoint, getOrderedTransactions, getOverrideThemeConfiguration, getPointOfRotation, getProductCollections, getSEPoint, getSvgElement, getTemplateBundles, getTemplateTransactions, getTransaction, getTransactionThemeConfiguration, getTransactionsForBundle, getTrueCoordinates, getUnorderedTransactions, getValidationJobsForWorkflowExperiences, getWorkflow, getWorkflows, graphQlManager, illustrationStepService, isCloseToValue, loadFont, matchHexToPms, materialStepService, metafieldManager, mmPerPixel, modelStepService, modifySVGColors, 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, validateWorkflowExperienceRecipient, validateWorkflowExperienceRecipients, xmlSerializer };