@spiffcommerce/core 0.0.0-a2ce672c-2d8f-54fc-934a-a5036bd9742e

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,232 @@
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.8.1] - 27-03-2024
9
+
10
+ ### Fixed
11
+
12
+ - `WorkflowExperience.getTotalPriceSubunits` no longer always returns the discounted price.
13
+
14
+ ## [21.8.0] - 26-03-2024
15
+
16
+ ### Added
17
+
18
+ - `Bundle.removeStakeholder(email: string): Promise<void>`: Removes a single stakeholder from the Bundle, via email address.
19
+
20
+ ## [21.7.1] - 25-03-2024
21
+
22
+ ### Fixed
23
+
24
+ - `Bundle.getAllStakeholders()` now returns correct results on subsequent calls.
25
+
26
+ ## [21.7.0] - 25-03-2024
27
+
28
+ ### Added
29
+
30
+ - `CollectionProduct.getAllWorkflows(): ProductWorkflow[]`: Returns all workflows associated with this product.
31
+
32
+ ## [21.6.0] - 22-03-2024
33
+
34
+ ### Added
35
+
36
+ - `WorkflowExperienceEventType.PriceBreakChanged`: The relevant event fires whenever the price break to be used in a WorkflowExperience changes. This even will fire when the quantity changes, and will also fire when in a Bundle when other WorkflowExperiences using the same Product have quantity changes (or are added & removed from the Bundle).
37
+
38
+ ## [21.5.0] - 22-03-2024
39
+
40
+ ### Changed
41
+
42
+ - `StepHandle`: The override global property state setting now has a different value for each Global Property Aspect type. The get/set functions have been renamed and have an extra parameter to determine the Aspect Type.
43
+ - `getOverrideGlobalPreviewConfiguration` -> `getOverrideGlobalPropertyConfiguration(type: AspectType): boolean`.
44
+ - `setOverrideGlobalPreviewConfiguration` -> `setOverrideGlobalPropertyConfiguration(type: AspectType, value: boolean): void`
45
+
46
+
47
+ ## [21.4.1] - 21-03-2024
48
+
49
+ ### Changed
50
+
51
+ - `readTransactionsQuery` now fetches `printFileUrl1` to `printFileUrl5` for each transaction.
52
+
53
+ ## [21.4.0] - 20-03-2024
54
+
55
+ ### Added
56
+
57
+ - `StepHandle`:
58
+ - `getOverrideGlobalPreviewConfiguration(): boolean`: Returns a boolean that indicates whether this step should override (ignore) Global Property state.
59
+ - `setOverrideGlobalPreviewConfiguration(value: boolean): void`: Modifies whether this step should override (ignore) Global Property state.
60
+ - `getGlobalPropertyAspects(configurationId: string): string[]`: Returns all Aspect names in the supplied Global Property Configuration that this step is configured to use.
61
+ - `Bundle.getGlobalPropertyConfiguration(): GlobalPropertyConfiguration | undefined`: Returns the Global Property Configuration object associated with the Bundle, if it exists.
62
+
63
+ ## [21.3.1] - 20-03-2024
64
+
65
+ ### Fixed
66
+
67
+ - When a `Bundle` is loaded by ID, the `WorkflowExperience` objects it loads will not correctly be linked internally. This resolves issues regarding price breaks not calculating correctly on bundle reload when multiple transactions share a product.
68
+
69
+ ## [21.3.0] - 20-03-2024
70
+
71
+ ### Added
72
+
73
+ - `WorkflowExperience.priceBreakToBeApplied()` returns the percentage that will be used in `WorkflowExperience.getTotalPriceSubunits()` and related methods.
74
+
75
+ ### Changed
76
+
77
+ - `WorkflowExperience.getTotalPriceSubunits()` and related methods now consider price breaks in their calculations, but also now have a `disablePriceBreaks` argument.
78
+
79
+ ## [21.2.1] - 15-03-2024
80
+
81
+ ### Fixed
82
+
83
+ - Fixed Global Property Handles not updating values when WorkflowExperiences in the Bundle share the same Workflow.
84
+
85
+ ## [21.2.0] - 15-03-2024
86
+
87
+ ### Added
88
+
89
+ - `FileUploadGlobalPropertyHandle`:
90
+ - `hasImage(): boolean`: Returns a boolean value indicating if the associated state has an image.
91
+ - `getImage(): Promise<Asset | undefined>`: Retrieves the current image from the server.
92
+
93
+ ## [21.1.1] - 15-03-2024
94
+
95
+ ### Fixed
96
+
97
+ - Exported missing `AspectType` for global property handles.
98
+
99
+ ## [21.1.0] - 14-03-2024
100
+
101
+ ### Added
102
+
103
+ - `Bundle.hasGlobalProperties(): boolean`: Returns true when the bundle is linked to a Global Property Configuration.
104
+
105
+ ## [21.0.1] - 13-03-2024
106
+
107
+ ### Fixed
108
+
109
+ - Package now supplies this `CHANGELOG.md` in published releases.
110
+
111
+ ## [21.0.0] - 13-03-2024
112
+
113
+ ### Added
114
+
115
+ - `DesignCreationMessage` now has `quantity: number | undefined`.
116
+
117
+ ### Changed
118
+
119
+ - `Bundle.finish()` no longer returns an array of `DesignCreationMessage` objects, but instead returns a `BundleDesignCreationMessage` object which wraps the array of `DesignCreationMessage` entries.
120
+
121
+ ## [20.5.1] - 12-03-2024
122
+
123
+ ### Fixed
124
+
125
+ - `WorkflowExperience.getSelectionPriceSubunits()` (and consequently `getTotalPriceSubunits()`) can no longer return `NaN`.
126
+
127
+ ## [20.5.0] - 12-03-2024
128
+
129
+ ### Added
130
+
131
+ - `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`.
132
+
133
+ ## [20.4.5] - 08-03-2024
134
+
135
+ ### Added
136
+
137
+ - `RenderableScene` objects will now contain a `workflowScene: WorkflowScene` field. This is only provided for backwards compatibility and is considered deprecated functionality.
138
+
139
+ ## [20.4.4] - 08-03-2024
140
+
141
+ ### Fixed
142
+
143
+ - Updating quantity via `WorkflowExperience.setQuantity()` will now correctly update on the server.
144
+
145
+ ## [20.4.3] - 08-03-2024
146
+
147
+ ### Changed
148
+
149
+ - `WorkflowExperience.setQuantity()` now returns a promise that resolves once the quantity has been updated on the server.
150
+
151
+ ## [20.4.0] - 08-03-2024
152
+
153
+ ### Added
154
+
155
+ - `Transaction` entities now have `quantity: number | undefined`.
156
+ - New functions on `WorkflowExperience` for managing quantity:
157
+ - `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`.
158
+ - `setQuantity(<number>)`: Updates the quantity value on the underlying `Transaction` entity. Must be >= 1.
159
+ - New events functionality on `WorkflowExperience`. Currently the only event is `QuantityChanged`.
160
+ - `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.
161
+ - `removeEventListener(<type>, <callback>)`: Removes a previously registered callback.
162
+
163
+ ## [20.3.0] - 07-03-2024
164
+
165
+ ### Added
166
+
167
+ - `CollectionProduct.getCurrentIntegration()`: returns the `IntegrationProductResource` associated with the product that is linked to the current Integration (resolved via the application key).
168
+
169
+ ## [20.2.2] - 05-03-2024
170
+
171
+ ### Changed
172
+
173
+ - `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.
174
+
175
+ ## [20.2.1] - 29-02-2024
176
+
177
+ ### Changed
178
+
179
+ - 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`:
180
+ ```ts
181
+ // Before
182
+ export type GetWorkflowOptions = GetWorkflowFromTransactionOptions | GetWorkflowFromIntegrationProductOptions | GetWorkflowFromExternalProductOptions;
183
+
184
+ // After
185
+ export type GetNewWorkflowOptions = GetWorkflowFromIntegrationProductOptions | GetWorkflowFromExternalProductOptions;
186
+
187
+ export type GetWorkflowOptions = GetWorkflowFromTransactionOptions | GetNewWorkflowOptions;
188
+ ```
189
+ ## [20.2.0] - 29-02-2024
190
+
191
+ ### Added
192
+
193
+ - `SpiffCommerceClient.getIntegrationProduct(<options>)`: Fetches an `IntegrationProduct` object. Essentially a wrapper for the functions `getIntegrationProductById` and `getIntegrationProductFromExternalIds`. The options object type is as follows:
194
+ ```ts
195
+ {
196
+ type: "integration";
197
+ integrationProductId: string;
198
+ } | {
199
+ type: "external";
200
+ externalIntegrationId: string;
201
+ externalProductId: string;
202
+ }
203
+ ```
204
+
205
+ ## [20.1.0] - 23-02-2024
206
+
207
+ ### Added
208
+
209
+ - `IntegrationProduct.getAllWorkflows()`: Returns an array of `ProductWorkflow`, ordered by their internal `index` value (matches the order seen on the SpiffCommerce Hub).
210
+
211
+ ## [20.0.1] - 23-02-2024
212
+
213
+ ### Changed
214
+
215
+ - `StepHandle.executeAnimations()` now logs a warning to the console when the associated `WorkflowManager` is not associated with a `ThreeDPreviewService`.
216
+
217
+ ## [20.0.0] - 15-02-2024
218
+
219
+ ### Added
220
+
221
+ - Additional configuration options for GraphQL on bundles.
222
+ - A separate fetchProducts function on the ProductCollection interface.
223
+
224
+ ### Changed
225
+
226
+ - Removed async on getProducts call.
227
+
228
+ ### Removed
229
+
230
+ - Unused normalize.css file.
231
+ - Identical links assigned in each translation file.
232
+ - Duplicate index file for the english version.
package/LICENSE ADDED
@@ -0,0 +1,6 @@
1
+ Commercial License
2
+
3
+ Copyright (c) 2017 - 2022 Spiff Pty Ltd
4
+
5
+ Spiff Commerce Core SDK (https://spiff3d.com/pricing-packages/) is commercial software. You MUST agree to the End User License Agreement (https://spiff3d.com/terms-and-conditions/) to be able to
6
+ use the software.
package/README.md ADDED
@@ -0,0 +1,12 @@
1
+ # README
2
+
3
+ This is the Spiff Commerce Javascript client API.
4
+
5
+ ## What does this package achieve?
6
+
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
+ which is responsible for executing workflow steps and managing things like state and conditions.
9
+
10
+ - Whilst the workflow manager is exposed we recommend getting started with a "Workflow Experience" instead.
11
+
12
+ ## Getting Started