@spiffcommerce/core 21.0.0 → 21.0.2

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 ADDED
@@ -0,0 +1,135 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [21.0.1] - 13-03-2024
9
+
10
+ ### Fixed
11
+
12
+ - Package now supplies this `CHANGELOG.md` in published releases.
13
+
14
+ ## [21.0.0] - 13-03-2024
15
+
16
+ ### Added
17
+
18
+ - `DesignCreationMessage` now has `quantity: number | undefined`.
19
+
20
+ ### Changed
21
+
22
+ - `Bundle.finish()` no longer returns an array of `DesignCreationMessage` objects, but instead returns a `BundleDesignCreationMessage` object which wraps the array of `DesignCreationMessage` entries.
23
+
24
+ ## [20.5.1] - 12-03-2024
25
+
26
+ ### Fixed
27
+
28
+ - `WorkflowExperience.getSelectionPriceSubunits()` (and consequently `getTotalPriceSubunits()`) can no longer return `NaN`.
29
+
30
+ ## [20.5.0] - 12-03-2024
31
+
32
+ ### Added
33
+
34
+ - `WorkflowManager.injectIntoPreviewService()` now has a second argument `refocusCamera`, a boolean which allows you to disable the automatic refocusing of the camera when the model is loaded. This requires `@spiffcommerce/preview@^5.7.0`.
35
+
36
+ ## [20.4.5] - 08-03-2024
37
+
38
+ ### Added
39
+
40
+ - `RenderableScene` objects will now contain a `workflowScene: WorkflowScene` field. This is only provided for backwards compatibility and is considered deprecated functionality.
41
+
42
+ ## [20.4.4] - 08-03-2024
43
+
44
+ ### Fixed
45
+
46
+ - Updating quantity via `WorkflowExperience.setQuantity()` will now correctly update on the server.
47
+
48
+ ## [20.4.3] - 08-03-2024
49
+
50
+ ### Changed
51
+
52
+ - `WorkflowExperience.setQuantity()` now returns a promise that resolves once the quantity has been updated on the server.
53
+
54
+ ## [20.4.0] - 08-03-2024
55
+
56
+ ### Added
57
+
58
+ - `Transaction` entities now have `quantity: number | undefined`.
59
+ - New functions on `WorkflowExperience` for managing quantity:
60
+ - `getQuantity()`: The amount that was, or will be, ordered of the underlying `Transaction`. This will default to `1` if the value is undefined. If you want to read the raw value, use `getWorkflowManager().getTransaction().quantity`.
61
+ - `setQuantity(<number>)`: Updates the quantity value on the underlying `Transaction` entity. Must be >= 1.
62
+ - New events functionality on `WorkflowExperience`. Currently the only event is `QuantityChanged`.
63
+ - `addEventListener(<type>, <callback>)`: Registers a callback function to be called when the specified event is raised. The associated `WorkflowExperience` is passed as a parameter to the callback function.
64
+ - `removeEventListener(<type>, <callback>)`: Removes a previously registered callback.
65
+
66
+ ## [20.3.0] - 07-03-2024
67
+
68
+ ### Added
69
+
70
+ - `CollectionProduct.getCurrentIntegration()`: returns the `IntegrationProductResource` associated with the product that is linked to the current Integration (resolved via the application key).
71
+
72
+ ## [20.2.2] - 05-03-2024
73
+
74
+ ### Changed
75
+
76
+ - `WorkflowExperience.getStepById(<string>)` now internally caches the `StepHandle` objects that it creates. This resolves an issue with functional rendering systems that re-render when the object reference changes, where they would re-renderer whenever this function was called even if the object was identical.
77
+
78
+ ## [20.2.1] - 29-02-2024
79
+
80
+ ### Changed
81
+
82
+ - The union type `GetWorkflowOptions` has some of its entries wrapped in another union. The types that will create a brand new `Transaction` are now nested under `GetNewWorkflowOptions`:
83
+ ```ts
84
+ // Before
85
+ export type GetWorkflowOptions = GetWorkflowFromTransactionOptions | GetWorkflowFromIntegrationProductOptions | GetWorkflowFromExternalProductOptions;
86
+
87
+ // After
88
+ export type GetNewWorkflowOptions = GetWorkflowFromIntegrationProductOptions | GetWorkflowFromExternalProductOptions;
89
+
90
+ export type GetWorkflowOptions = GetWorkflowFromTransactionOptions | GetNewWorkflowOptions;
91
+ ```
92
+ ## [20.2.0] - 29-02-2024
93
+
94
+ ### Added
95
+
96
+ - `SpiffCommerceClient.getIntegrationProduct(<options>)`: Fetches an `IntegrationProduct` object. Essentially a wrapper for the functions `getIntegrationProductById` and `getIntegrationProductFromExternalIds`. The options object type is as follows:
97
+ ```ts
98
+ {
99
+ type: "integration";
100
+ integrationProductId: string;
101
+ } | {
102
+ type: "external";
103
+ externalIntegrationId: string;
104
+ externalProductId: string;
105
+ }
106
+ ```
107
+
108
+ ## [20.1.0] - 23-02-2024
109
+
110
+ ### Added
111
+
112
+ - `IntegrationProduct.getAllWorkflows()`: Returns an array of `ProductWorkflow`, ordered by their internal `index` value (matches the order seen on the SpiffCommerce Hub).
113
+
114
+ ## [20.0.1] - 23-02-2024
115
+
116
+ ### Changed
117
+
118
+ - `StepHandle.executeAnimations()` now logs a warning to the console when the associated `WorkflowManager` is not associated with a `ThreeDPreviewService`.
119
+
120
+ ## [20.0.0] - 15-02-2024
121
+
122
+ ### Added
123
+
124
+ - Additional configuration options for GraphQL on bundles.
125
+ - A separate fetchProducts function on the ProductCollection interface.
126
+
127
+ ### Changed
128
+
129
+ - Removed async on getProducts call.
130
+
131
+ ### Removed
132
+
133
+ - Unused normalize.css file.
134
+ - Identical links assigned in each translation file.
135
+ - Duplicate index file for the english version.
package/README.md CHANGED
@@ -7,6 +7,6 @@ This is the Spiff Commerce Javascript client API.
7
7
  - The Client API manages the heavy lifting related to setting up, executing & finishing a workflow experience. It is a wrapper around the Workflow Manager,
8
8
  which is responsible for executing workflow steps and managing things like state and conditions.
9
9
 
10
- - Whilst the workflow manager is exposed we recommened getting started with a "Workflow Experience" instead.
10
+ - Whilst the workflow manager is exposed we recommend getting started with a "Workflow Experience" instead.
11
11
 
12
12
  ## Getting Started
package/dist/index.d.ts CHANGED
@@ -3028,4 +3028,4 @@ declare class PromiseCache {
3028
3028
  }
3029
3029
  declare const promiseCache: PromiseCache;
3030
3030
 
3031
- export { ArrayInput, AssetNotFoundError, Bundle, BundleDesignCreationMessage, CollectionProduct, ColorOption, ConversionConfiguration, ConversionData, ConversionDataType, ConversionLocation, Customer, CustomerDetailsInput, DesignCreationMessage, DesignCreationProgressUpdate, DesignInputStep, EditedSteps, FlowExecutionNodeResult, FlowExecutionResult, FlowService, FrameService, FrameStep, FrameStepHandle, FrameThresholdSettings, GetNewWorkflowOptions, GetWorkflowOptions, GlobalPropertyHandle, IllustrationStepHandle, InformationMessageType, InformationResult, InformationStepHandle, IntegrationProduct, IntegrationType, LayoutNotFoundError, MandatorySteps, MaterialStepHandle, MisconfigurationError, MockWorkflowManager, ModelStepHandle, NodeType, ObjectInput, ObjectInputType, OptionNotFoundError, ParseError, PictureStepHandle, Product, ProductCameraRig, ProductCollection, ProductWorkflow, promiseCache as PromiseCache, PromiseQueue, QuestionStepHandle, QueueablePromise, RegionElement, RenderableScene, ResourceNotFoundError, SavedDesign, SelectionStorage, ShapeStepHandle, SilentIllustrationStepData, SpiffCommerceClient, Stakeholder, StakeholderType, StateMutationFunc, StepElements, StepHandle, TextInput, TextStepHandle, TextStepStorage, Transaction, Transform, TransformCollection, UnhandledBehaviorError, Variant, Vector3, WorkflowExperience, WorkflowExperienceEventType, WorkflowExperienceImpl, WorkflowManager, WorkflowMetadata, WorkflowScene, WorkflowSelections, WorkflowStorage, assetService, createDesign, designService, digitalContentStepService, frameStepService, generateCommands, generateStateFromDesignInputSteps, getBoundedOffsets, getWorkflow, getWorkflows, graphQlManager, illustrationStepService, materialStepService, modelStepService, moduleStepService, optionService, persistenceService, pictureStepService, questionStepService, shapeStepService, shortenUrl, spiffCoreConfiguration, stepAspectValuesToDesignInputSteps, textStepService, toast };
3031
+ export { ArrayInput, AssetNotFoundError, Bundle, BundleDesignCreationMessage, BundleEvent, BundleEventData, BundleEventType, CollectionProduct, ColorOption, ConditionalGlobalPropertiesChangedEventData, ConversionConfiguration, ConversionData, ConversionDataType, ConversionLocation, Customer, CustomerDetailsInput, DesignCreationMessage, DesignCreationProgressUpdate, DesignInputStep, EditedSteps, FlowExecutionNodeResult, FlowExecutionResult, FlowService, FrameService, FrameStep, FrameStepHandle, FrameThresholdSettings, GetNewWorkflowOptions, GetWorkflowOptions, GlobalPropertyHandle, IllustrationStepHandle, InformationMessageType, InformationResult, InformationStepHandle, IntegrationProduct, IntegrationType, LayoutNotFoundError, MandatorySteps, MaterialStepHandle, MisconfigurationError, MockWorkflowManager, ModelStepHandle, NodeType, ObjectInput, ObjectInputType, OptionNotFoundError, ParseError, PictureStepHandle, Product, ProductCameraRig, ProductCollection, ProductWorkflow, promiseCache as PromiseCache, PromiseQueue, QuestionStepHandle, QueueablePromise, RegionElement, RenderableScene, ResourceNotFoundError, SavedDesign, SelectionStorage, ShapeStepHandle, SilentIllustrationStepData, SpiffCommerceClient, Stakeholder, StakeholderType, StateMutationFunc, StepElements, StepHandle, TextInput, TextStepHandle, TextStepStorage, Transaction, Transform, TransformCollection, UnhandledBehaviorError, Variant, Vector3, WorkflowExperience, WorkflowExperienceEventType, WorkflowExperienceHoverEventData, WorkflowExperienceImpl, WorkflowManager, WorkflowMetadata, WorkflowScene, WorkflowSelections, WorkflowStorage, assetService, createDesign, designService, digitalContentStepService, frameStepService, generateCommands, generateStateFromDesignInputSteps, getBoundedOffsets, getWorkflow, getWorkflows, graphQlManager, illustrationStepService, materialStepService, modelStepService, moduleStepService, optionService, persistenceService, pictureStepService, questionStepService, shapeStepService, shortenUrl, spiffCoreConfiguration, stepAspectValuesToDesignInputSteps, textStepService, toast };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spiffcommerce/core",
3
- "version": "21.0.0",
3
+ "version": "21.0.2",
4
4
  "description": "Core client API for interacting with the Spiff Commerce backend.",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.umd.cjs",
@@ -22,7 +22,10 @@
22
22
  "print"
23
23
  ],
24
24
  "files": [
25
- "dist"
25
+ "dist",
26
+ "CHANGELOG.md",
27
+ "README.md",
28
+ "LICENSE"
26
29
  ],
27
30
  "author": "SpiffCommerce",
28
31
  "devDependencies": {