@spiffcommerce/core 32.3.1-beta.fb24b784-d4cb-5c48-bf28-41a506fc3cc8 → 32.4.0-beta.065b6cdb-4851-5795-9952-4ff909f9c771
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 +2 -9
- package/dist/index.d.ts +18 -60
- package/dist/index.js +170 -262
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2593 -2715
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -14,18 +14,11 @@ 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
|
-
## [
|
18
|
-
|
19
|
-
## Changed
|
20
|
-
|
21
|
-
- Updated `WorkflowExperience` to store `transaction`, `product`, `profanityList`, and `workflow` as direct properties, initialized in the constructor for improved encapsulation and performance.
|
17
|
+
## [32.4.0] - 16-10-2025
|
22
18
|
|
23
19
|
## Added
|
24
20
|
|
25
|
-
-
|
26
|
-
- Introduced `getIntegrationProductIds()` and `addIntegrationProductId(id: string)` methods to `Bundle` and `BundleImpl` for tracking associated integration product IDs.
|
27
|
-
- Added GraphQL mutation for updating a transaction's integration product, enabling backend synchronization of integration product changes.
|
28
|
-
- Added `getState()` method to `BundleStateManager` for easier external access to the current bundle state.
|
21
|
+
- The interface `GetWorkflowFromIntegrationProductOptions` now has optional `quantity` and `recipient` arguments.
|
29
22
|
|
30
23
|
## [32.3.1] - 09-10-2025
|
31
24
|
|
package/dist/index.d.ts
CHANGED
@@ -1049,6 +1049,7 @@ interface Scene {
|
|
1049
1049
|
* State related to a workflow experience.
|
1050
1050
|
*/
|
1051
1051
|
interface ExperienceOptions {
|
1052
|
+
product: Product;
|
1052
1053
|
transaction: Transaction;
|
1053
1054
|
workflow?: Workflow;
|
1054
1055
|
/**
|
@@ -1093,10 +1094,6 @@ interface ExperienceOptions {
|
|
1093
1094
|
* should get an instance of this class from a Client you have constructed previously.
|
1094
1095
|
*/
|
1095
1096
|
interface WorkflowExperience {
|
1096
|
-
/**
|
1097
|
-
* Get the current transaction for this experience.
|
1098
|
-
*/
|
1099
|
-
getTransaction(): Transaction;
|
1100
1097
|
/**
|
1101
1098
|
* Get the bundle this experience is part of. May be undefined.
|
1102
1099
|
*/
|
@@ -1105,28 +1102,6 @@ interface WorkflowExperience {
|
|
1105
1102
|
* Set the bundle this experience is part of. Can be cleared using undefined.
|
1106
1103
|
*/
|
1107
1104
|
setBundle(bundle: Bundle$1 | undefined): any;
|
1108
|
-
/**
|
1109
|
-
* Get the current product for this experience. May be undefined.
|
1110
|
-
*/
|
1111
|
-
getProduct(): Product | undefined;
|
1112
|
-
/**
|
1113
|
-
* Get the current profanity list for this experience. May be empty.
|
1114
|
-
*/
|
1115
|
-
getProfanityList(): string[];
|
1116
|
-
/**
|
1117
|
-
* Set the current product for this experience.
|
1118
|
-
* @param product The new product to set.
|
1119
|
-
*/
|
1120
|
-
setProduct(integrationProductId: string): Promise<void>;
|
1121
|
-
/**
|
1122
|
-
* Get the current workflow for this experience. May be undefined.
|
1123
|
-
*/
|
1124
|
-
getWorkflow(): Workflow | undefined;
|
1125
|
-
/**
|
1126
|
-
* Set the current workflow for this experience.
|
1127
|
-
* @param workflow The new workflow to set.
|
1128
|
-
*/
|
1129
|
-
setWorkflow(workflow: Workflow): Promise<void>;
|
1130
1105
|
/**
|
1131
1106
|
* Returns the client that was responsible for spawning this experience.
|
1132
1107
|
*/
|
@@ -1315,7 +1290,6 @@ declare enum WorkflowExperienceEventType {
|
|
1315
1290
|
}
|
1316
1291
|
declare class WorkflowExperienceImpl implements WorkflowExperience {
|
1317
1292
|
readonly client: SpiffCommerceClient;
|
1318
|
-
readonly transaction: Transaction;
|
1319
1293
|
readonly commandContext: CommandContext;
|
1320
1294
|
readonly graphQlClient: GraphQlClientFunc;
|
1321
1295
|
readonly workflowManager: WorkflowManager;
|
@@ -1325,20 +1299,11 @@ declare class WorkflowExperienceImpl implements WorkflowExperience {
|
|
1325
1299
|
* Bundle this experience has been added to.
|
1326
1300
|
*/
|
1327
1301
|
private bundle?;
|
1328
|
-
private product?;
|
1329
|
-
private profanityList;
|
1330
|
-
private workflow?;
|
1331
1302
|
private currentPriceBreak;
|
1332
1303
|
private renderableScenes;
|
1333
1304
|
private renderableSceneCallbacks;
|
1334
1305
|
private eventCallbacks;
|
1335
1306
|
constructor(client: SpiffCommerceClient, experienceOptions: ExperienceOptions);
|
1336
|
-
getTransaction(): Transaction;
|
1337
|
-
getProduct(): Product | undefined;
|
1338
|
-
getProfanityList(): string[];
|
1339
|
-
setProduct(integrationProductId: string): Promise<void>;
|
1340
|
-
getWorkflow(): Workflow | undefined;
|
1341
|
-
setWorkflow(workflow: Workflow): Promise<void>;
|
1342
1307
|
attachAddress(streetAddress?: string, apartment?: string, city?: string, country?: string, state?: string, postCode?: string): Promise<void>;
|
1343
1308
|
attachOrganization(name: string): Promise<void>;
|
1344
1309
|
getBundle(): Bundle$1 | undefined;
|
@@ -1425,6 +1390,7 @@ declare abstract class GlobalPropertyHandle {
|
|
1425
1390
|
* @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.
|
1426
1391
|
*/
|
1427
1392
|
isMandatoryFulfilled(): boolean;
|
1393
|
+
clear(): void;
|
1428
1394
|
/**
|
1429
1395
|
* Applies the global state to all shared steps, if the state is set.
|
1430
1396
|
* @param targetExperiences Optionally filter the workflow experiences it should be applied to.
|
@@ -1590,6 +1556,7 @@ interface GlobalPropertyStateManager {
|
|
1590
1556
|
setBundleOptions(bundleOptions?: BundleOptions): void;
|
1591
1557
|
getBundleOptions(): BundleOptions | undefined;
|
1592
1558
|
setConfiguration(configuration: GlobalPropertyConfiguration | undefined): void;
|
1559
|
+
clearAspect(name: string): Promise<void>;
|
1593
1560
|
}
|
1594
1561
|
interface BundleOptions {
|
1595
1562
|
additionalHeaders?: {
|
@@ -1819,9 +1786,6 @@ declare class Transform {
|
|
1819
1786
|
}
|
1820
1787
|
declare const getProductCollections: (ids: string[]) => Promise<ProductCollection[] | undefined>;
|
1821
1788
|
|
1822
|
-
interface BundleIntegrationProductsAddedEventData {
|
1823
|
-
integrationProductIds: string[];
|
1824
|
-
}
|
1825
1789
|
interface ConditionalGlobalPropertiesChangedEventData {
|
1826
1790
|
globalProperties: GlobalPropertyHandle[];
|
1827
1791
|
}
|
@@ -1839,7 +1803,6 @@ interface WorkflowExperienceAddedEventData {
|
|
1839
1803
|
interface WorkflowExperienceRemovedEventData extends WorkflowExperienceAddedEventData {
|
1840
1804
|
}
|
1841
1805
|
type BundleEventMap = {
|
1842
|
-
"bundle-integration-products-added": BundleIntegrationProductsAddedEventData;
|
1843
1806
|
"conditional-global-properties-changed": ConditionalGlobalPropertiesChangedEventData;
|
1844
1807
|
"global-properties-mandatory-changed": GlobalPropertiesMandatoryChangedEventData;
|
1845
1808
|
"workflow-experience-hover-enter": WorkflowExperienceHoverEventData;
|
@@ -1848,7 +1811,7 @@ type BundleEventMap = {
|
|
1848
1811
|
"workflow-experience-removed": WorkflowExperienceRemovedEventData;
|
1849
1812
|
};
|
1850
1813
|
type BundleEventType = keyof BundleEventMap;
|
1851
|
-
type BundleEventData =
|
1814
|
+
type BundleEventData = WorkflowExperienceHoverEventData | ConditionalGlobalPropertiesChangedEventData | WorkflowExperienceAddedEventData;
|
1852
1815
|
type BundleEvent<K extends BundleEventType = BundleEventType> = BundleEventMap[K];
|
1853
1816
|
|
1854
1817
|
/**
|
@@ -2092,8 +2055,6 @@ interface Bundle$1 {
|
|
2092
2055
|
generateQuoteId(): Promise<string>;
|
2093
2056
|
getQuoteCompleteMessage(): CompleteQuoteMessage;
|
2094
2057
|
applyGlobalPropertyState(state: GlobalPropertyState): Promise<void>;
|
2095
|
-
getIntegrationProductIds(): undefined | string[];
|
2096
|
-
addIntegrationProductId(id: string): void;
|
2097
2058
|
}
|
2098
2059
|
|
2099
2060
|
/**
|
@@ -2398,30 +2359,29 @@ interface GetWorkflowFromTransactionOptions extends GetWorkflowOptionsBase {
|
|
2398
2359
|
workflowState?: string;
|
2399
2360
|
type: "transaction";
|
2400
2361
|
}
|
2401
|
-
interface
|
2362
|
+
interface GetNewWorkflowOptionsBase extends GetWorkflowOptionsBase {
|
2402
2363
|
/** A name for the new transaction. */
|
2403
2364
|
designName?: string;
|
2404
2365
|
/** The workflow to load. */
|
2405
|
-
workflowId
|
2366
|
+
workflowId: string;
|
2406
2367
|
/** An existing workflow state, if available. */
|
2407
2368
|
workflowState?: string;
|
2408
2369
|
}
|
2409
|
-
interface
|
2410
|
-
type: "blank";
|
2411
|
-
}
|
2412
|
-
interface GetWorkflowExperienceFromIntegrationProductOptions extends GetNewWorkflowExperienceOptionsBase {
|
2370
|
+
interface GetWorkflowFromIntegrationProductOptions extends GetNewWorkflowOptionsBase {
|
2413
2371
|
integrationProductId: string;
|
2372
|
+
quantity?: number;
|
2373
|
+
recipient?: any;
|
2414
2374
|
type: "integration";
|
2415
2375
|
}
|
2416
|
-
interface
|
2376
|
+
interface GetWorkflowFromExternalProductOptions extends GetNewWorkflowOptionsBase {
|
2417
2377
|
/** The external ID associated with an integration. */
|
2418
2378
|
externalIntegrationId: string;
|
2419
2379
|
/** The ID of the product from the external system. */
|
2420
2380
|
externalProductId: string;
|
2421
2381
|
type: "external";
|
2422
2382
|
}
|
2423
|
-
type
|
2424
|
-
type GetWorkflowOptions = GetWorkflowFromTransactionOptions |
|
2383
|
+
type GetNewWorkflowOptions = GetWorkflowFromIntegrationProductOptions | GetWorkflowFromExternalProductOptions;
|
2384
|
+
type GetWorkflowOptions = GetWorkflowFromTransactionOptions | GetNewWorkflowOptions;
|
2425
2385
|
interface ClientConfiguration {
|
2426
2386
|
hubUrl: string;
|
2427
2387
|
serverUrl: string;
|
@@ -2701,6 +2661,7 @@ interface WorkflowManager {
|
|
2701
2661
|
getAllLayoutData: () => LayoutState[];
|
2702
2662
|
getLayoutPreviewService: () => LayoutPreviewService | undefined;
|
2703
2663
|
getPreviewService: () => ThreeDPreviewService | undefined;
|
2664
|
+
getProfanities: () => string[];
|
2704
2665
|
getRegionElements: (stepName: string) => RegionElement[];
|
2705
2666
|
getSerializedStep: (stepName: string, serializedSteps: SerializableStep[]) => SerializableStep | undefined;
|
2706
2667
|
getStepSpecificServices: (stepName: string) => StepSpecificServices | undefined;
|
@@ -2708,22 +2669,19 @@ interface WorkflowManager {
|
|
2708
2669
|
getMetadata: (stepName: string) => StepMetadata | undefined;
|
2709
2670
|
getWorkflowMetadata: () => WorkflowMetadata;
|
2710
2671
|
getInformationResults(): InformationResult[];
|
2672
|
+
getTransaction: () => Transaction;
|
2711
2673
|
getTransactionCustomer: () => Customer | undefined;
|
2712
2674
|
setTransactionCustomer: (customer: Customer) => void;
|
2713
|
-
/**
|
2714
|
-
* Sets the current workflow for this experience.
|
2715
|
-
* @param workflow The new workflow to set.
|
2716
|
-
* @returns A promise that resolves when the workflow has been set.
|
2717
|
-
*/
|
2718
|
-
setWorkflow: (workflow: Workflow) => Promise<void>;
|
2719
2675
|
/**
|
2720
2676
|
* @deprecated Use setTransactionCustomer instead.
|
2721
2677
|
*/
|
2722
2678
|
setTransactionCustomerDetails: (details: {
|
2723
2679
|
email: string;
|
2724
2680
|
}) => void;
|
2681
|
+
getWorkflow: () => Workflow;
|
2725
2682
|
getWorkflowSelections: () => WorkflowSelections;
|
2726
2683
|
getStepSelections: () => StepSelections;
|
2684
|
+
getProduct: () => Product;
|
2727
2685
|
/**
|
2728
2686
|
* A promise resolving when the initial state of the workflow has completed loading.
|
2729
2687
|
*/
|
@@ -5222,7 +5180,6 @@ declare class MockWorkflowManager implements WorkflowManager {
|
|
5222
5180
|
getWorkflowExperience(): WorkflowExperience;
|
5223
5181
|
setClient(client: SpiffCommerceClient): void;
|
5224
5182
|
getInitializationPromise(): Promise<void>;
|
5225
|
-
setWorkflow: (workflow: Workflow) => Promise<void>;
|
5226
5183
|
getProduct: () => Product;
|
5227
5184
|
isInitialized(): boolean;
|
5228
5185
|
getCommandContext: () => CommandContext;
|
@@ -5253,6 +5210,7 @@ declare class MockWorkflowManager implements WorkflowManager {
|
|
5253
5210
|
getPreviewService(): undefined;
|
5254
5211
|
setModelContainer: (container: any) => void;
|
5255
5212
|
getModelContainer(): undefined;
|
5213
|
+
getProfanities(): never[];
|
5256
5214
|
getRegionElements(_stepName: string): never[];
|
5257
5215
|
getSerializedStep(_stepName: string, _serializedSteps: SerializableStep[]): undefined;
|
5258
5216
|
getStepSpecificServices(_stepName: string): undefined;
|
@@ -6078,4 +6036,4 @@ declare const overrideWorkflowExperienceRecipientAddress: (workflowExperience: W
|
|
6078
6036
|
*/
|
6079
6037
|
declare const getGlobalPropertyStateForBundle: (bundleId: string) => Promise<GlobalPropertyState | undefined>;
|
6080
6038
|
|
6081
|
-
export { AddonHandle, type AddressComponent, type AddressValidationJob, AddressValidationJobStatus, type AddressValidationResult, AddressValidationResultConfirmationLevel, AddressValidationStatus, type Animatable, type AnyStepData, ArrayInput, AspectType, type Asset, type AssetConfiguration, AssetNotFoundError, type AssetObjectVersion, AssetType, BringForwardCommand, BringToBackCommand, BringToFrontCommand, type Bundle$1 as Bundle, BundleDesignCreationCartAddMode, type BundleDesignCreationMessage, type BundleEvent, type BundleEventData, type BundleEventType, type Bundle as BundleRaw, type BundleStakeholder, CanvasCommand, CollectionProduct, type ColorDefinition, type ColorOption, ColorOptionGlobalPropertyHandle, type ColorProfileProps, CommandContext, type CommandState, type Condition, type ConditionalGlobalPropertiesChangedEventData, CreateElementCommand, CreateLayoutCommand, CurrencyContext, CurrencyService, type Customer, type CustomerDetailsInput, DeleteElementCommand, type DesignCreationMessage, type DesignCreationProgressUpdate, type DesignInputStep, type DigitalContentStepData, DigitalContentStepHandle, type EditedSteps, type ExportedStepData, type ExportedStepDataProperty, type ExportedStepDataPropertyType, FileUploadGlobalPropertyHandle, FlowExecutionNodeResult, FlowExecutionResult, FlowService, FontAlignmentCommand, FontColorCommand, FontSizeCommand, FontSourceCommand, type FrameElement, FrameService, FrameStep, type FrameStepData, FrameStepHandle, type FrameThresholdSettings, type
|
6039
|
+
export { AddonHandle, type AddressComponent, type AddressValidationJob, AddressValidationJobStatus, type AddressValidationResult, AddressValidationResultConfirmationLevel, AddressValidationStatus, type Animatable, type AnyStepData, ArrayInput, AspectType, type Asset, type AssetConfiguration, AssetNotFoundError, type AssetObjectVersion, AssetType, BringForwardCommand, BringToBackCommand, BringToFrontCommand, type Bundle$1 as Bundle, BundleDesignCreationCartAddMode, type BundleDesignCreationMessage, type BundleEvent, type BundleEventData, type BundleEventType, type Bundle as BundleRaw, type BundleStakeholder, CanvasCommand, CollectionProduct, type ColorDefinition, type ColorOption, ColorOptionGlobalPropertyHandle, type ColorProfileProps, CommandContext, type CommandState, type Condition, type ConditionalGlobalPropertiesChangedEventData, CreateElementCommand, CreateLayoutCommand, CurrencyContext, CurrencyService, type Customer, type CustomerDetailsInput, DeleteElementCommand, type DesignCreationMessage, type DesignCreationProgressUpdate, type DesignInputStep, type DigitalContentStepData, DigitalContentStepHandle, type EditedSteps, type ExportedStepData, type ExportedStepDataProperty, type ExportedStepDataPropertyType, FileUploadGlobalPropertyHandle, FlowExecutionNodeResult, FlowExecutionResult, FlowService, FontAlignmentCommand, FontColorCommand, FontSizeCommand, FontSourceCommand, type FrameElement, FrameService, FrameStep, type FrameStepData, FrameStepHandle, type FrameThresholdSettings, type GetNewWorkflowOptions, type GetWorkflowOptions, type GlobalPropertiesMandatoryChangedEventData, type GlobalPropertyConfiguration, GlobalPropertyHandle, GroupCommand, type ILayout, type IllustrationElement, type IllustrationStepData, IllustrationStepHandle, type ImageElement, InformationMessageType, type InformationResult, type InformationStepData, InformationStepHandle, type Integration, type IntegrationOptionResource, IntegrationProduct, IntegrationType, type LayoutComponentConfiguration, type LayoutData, type LayoutElement, LayoutElementFactory, LayoutElementType, LayoutNotFoundError, LayoutRenderingPurpose, type LayoutState, type LayoutsState, type MandatorySteps, MaterialEffectMode, type MaterialStepData, MaterialStepHandle, MisconfigurationError, MockWorkflowManager, type ModelStepData, ModelStepHandle, type ModuleStepData, ModuleStepHandle, MoveCommand, NodeType, ObjectInput, ObjectInputType, OptionGlobalPropertyHandle, OptionNotFoundError, type OptionResource, type Order, type OrderItem, type PapyrusComponent, ParseError, type PictureStepData, PictureStepHandle, type Placeable, type PmsSearchResult, type Point, type Product, ProductCameraRig, ProductCollection, ProductCollectionProductSortKey, ProductWorkflow$1 as ProductWorkflow, promiseCache as PromiseCache, PromiseQueue, type QuestionStepData, QuestionStepHandle, QueueablePromise, type Recipient, type Region, type RegionElement, type RenderableScene, ResizeCommand, ResourceNotFoundError, RotateCommand, type SavedDesign, ScaleAxis, type SelectionStorage, SendBackwardsCommand, type ShapeStepData, ShapeStepHandle, type ShareAction, ShareActionType, type SilentIllustrationStepData, SpiffCommerceClient, type Stakeholder, StakeholderType, type StateMutationFunc, type Step, type StepAspect, StepAspectType, type StepElements, type StepGroup, StepHandle, type StepStorage, StepType, TextAlgorithm, TextChangeCommand, type TextChangeResult, TextGlobalPropertyHandle, TextInput, type TextStepData, TextStepHandle, type TextStepStorage, type TextboxElement, type Theme, type ToastCallback, type Transaction, Transform, TransformCollection$1 as TransformCollection, UnhandledBehaviorError, UnitOfMeasurement, UpdateImageSourceCommand, Variant, type VariantResource, type Vector3, type Workflow, type WorkflowExperience, WorkflowExperienceEventType, type WorkflowExperienceHoverEventData, WorkflowExperienceImpl, type WorkflowManager, type WorkflowMetadata, type WorkflowPanel, type WorkflowScene, type WorkflowSelections, type WorkflowStorage, assetService, browserColorToHex, cmPerPixel, createDesign, currentDirection, dataUrlFromExternalUrl, deleteBundle, 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, overrideWorkflowExperienceRecipientAddress, 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 };
|