@spiffcommerce/core 13.2.0 → 14.0.0-alpha.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/dist/main.js +64 -42
- package/dist/module.js +64 -42
- package/dist/types.d.ts +64 -10
- package/package.json +2 -2
package/dist/types.d.ts
CHANGED
|
@@ -165,7 +165,13 @@ export class ParseError extends ImplementationError {
|
|
|
165
165
|
*/
|
|
166
166
|
export function getBoundedOffsets(newOffsets: FrameOffsets, frameData: FrameData, imageData: PatternImageData, mustCover?: boolean): FrameOffsets;
|
|
167
167
|
export class FrameService {
|
|
168
|
+
/**
|
|
169
|
+
* The calculated minimum zoom value. Note: This is calculated based on the first frame.
|
|
170
|
+
*/
|
|
168
171
|
minZoomScale: number;
|
|
172
|
+
/**
|
|
173
|
+
* The calculated maximum zoom value. Note: This is calculated based on the first frame.
|
|
174
|
+
*/
|
|
169
175
|
maxZoomScale: number;
|
|
170
176
|
constructor(forceImageCover?: boolean);
|
|
171
177
|
/**
|
|
@@ -185,12 +191,12 @@ export class FrameService {
|
|
|
185
191
|
* Gets the current calculated frame data
|
|
186
192
|
* @returns A FrameData object or undefined if no frame has been set.
|
|
187
193
|
*/
|
|
188
|
-
getFrameData(): FrameData | undefined;
|
|
194
|
+
getFrameData(): FrameData[] | undefined;
|
|
189
195
|
/**
|
|
190
|
-
* Sets the current frame data
|
|
191
|
-
* @param
|
|
196
|
+
* Sets the current frame data. Note:
|
|
197
|
+
* @param paths The paths to lookup in our frame data cache.
|
|
192
198
|
*/
|
|
193
|
-
setFrameData(
|
|
199
|
+
setFrameData(paths: string[] | undefined): void;
|
|
194
200
|
/**
|
|
195
201
|
* Gets the currently set image of the frame..
|
|
196
202
|
* @returns A PatternImageData object, or undefined if no image is set.
|
|
@@ -200,11 +206,11 @@ export class FrameService {
|
|
|
200
206
|
* Gets the current calculated offsets of the pattern within the frame.
|
|
201
207
|
* @returns A FrameOffsets object or undefined if no offsets are defined.
|
|
202
208
|
*/
|
|
203
|
-
getOffsets(): FrameOffsets | undefined;
|
|
209
|
+
getOffsets(): FrameOffsets[] | undefined;
|
|
204
210
|
/**
|
|
205
211
|
* Updates the frame offsets explicitly.
|
|
206
212
|
*/
|
|
207
|
-
setOffsets(offsets: FrameOffsets): void;
|
|
213
|
+
setOffsets(offsets: FrameOffsets[]): void;
|
|
208
214
|
/**
|
|
209
215
|
* Sets the zoom of the cropper that owns this service.
|
|
210
216
|
* @param zoom The new zoom value.
|
|
@@ -220,11 +226,11 @@ export class FrameService {
|
|
|
220
226
|
setPatternData(value: PatternImageData): void;
|
|
221
227
|
/**
|
|
222
228
|
* Modify the offsets of the frame.
|
|
223
|
-
* @param value The new FrameOffsets
|
|
229
|
+
* @param value The new FrameOffsets objects.
|
|
224
230
|
* @param onComplete A callback, called when the modification is complete
|
|
225
231
|
*/
|
|
226
|
-
updateOffsets(value: FrameOffsets, onComplete?: () => void): void;
|
|
227
|
-
onFrameDataChanged(newListener: (frameData: FrameData | undefined) => void): void;
|
|
232
|
+
updateOffsets(value: FrameOffsets[], onComplete?: () => void): void;
|
|
233
|
+
onFrameDataChanged(newListener: (frameData: FrameData[] | undefined) => void): void;
|
|
228
234
|
/**
|
|
229
235
|
* Append a new listener to zoom events on this frame.
|
|
230
236
|
* @param newListener
|
|
@@ -1899,7 +1905,7 @@ export enum FrameStep {
|
|
|
1899
1905
|
export class FrameStepHandle extends StepHandle<_FrameStepData1> {
|
|
1900
1906
|
constructor(manager: WorkflowManager, step: _Step1<_FrameStepData1>);
|
|
1901
1907
|
selectVariant(variant: Variant): Promise<void>;
|
|
1902
|
-
onFrameDataChanged(callback: (frameData: _FrameData1) => void): void;
|
|
1908
|
+
onFrameDataChanged(callback: (frameData: _FrameData1[]) => void): void;
|
|
1903
1909
|
selectImage(asset: _Asset1): void;
|
|
1904
1910
|
getImageData(): PatternImageData | undefined;
|
|
1905
1911
|
getCurrentFrameStep(frameData: _FrameData1, uploading?: any, imageUploadComplete?: any, variants?: _VariantResource1[]): FrameStep;
|
|
@@ -2067,6 +2073,53 @@ interface _Bundle1 {
|
|
|
2067
2073
|
removeEventListener(event: BundleEvent, listener: () => void): void;
|
|
2068
2074
|
}
|
|
2069
2075
|
type BundleEvent = "conditional-global-properties-changed";
|
|
2076
|
+
interface ExecutionResponse {
|
|
2077
|
+
id: string;
|
|
2078
|
+
completedAt?: string;
|
|
2079
|
+
failedAt?: string;
|
|
2080
|
+
}
|
|
2081
|
+
/**
|
|
2082
|
+
* A service containing functionality for interacting with the Spiff Commerce API to execute and inspect the result of process flows.
|
|
2083
|
+
*/
|
|
2084
|
+
declare class FlowService {
|
|
2085
|
+
execute(id: string, inputs: FlowExecutionInput[], options?: {
|
|
2086
|
+
sleepTime: number;
|
|
2087
|
+
}): Promise<ExecutionResponse>;
|
|
2088
|
+
}
|
|
2089
|
+
/**
|
|
2090
|
+
* Handles preparing a flow input for transmission to the server.
|
|
2091
|
+
*/
|
|
2092
|
+
declare abstract class FlowExecutionInput {
|
|
2093
|
+
protected readonly value: string;
|
|
2094
|
+
constructor(value: string);
|
|
2095
|
+
getRaw(): string;
|
|
2096
|
+
getValueForTransmission(): string;
|
|
2097
|
+
}
|
|
2098
|
+
/**
|
|
2099
|
+
* Represents the type of object being referenced by the input.
|
|
2100
|
+
*/
|
|
2101
|
+
export const enum ObjectInputType {
|
|
2102
|
+
Transaction = "Transaction",
|
|
2103
|
+
Bundle = "Bundle",
|
|
2104
|
+
Product = "Product",
|
|
2105
|
+
Variant = "Variant",
|
|
2106
|
+
Option = "Option",
|
|
2107
|
+
LineItem = "LineItem",
|
|
2108
|
+
Asset = "Asset"
|
|
2109
|
+
}
|
|
2110
|
+
/**
|
|
2111
|
+
* Handles validation of spiffObject structure for transmission to the server.
|
|
2112
|
+
*/
|
|
2113
|
+
export class ObjectInput extends FlowExecutionInput {
|
|
2114
|
+
constructor(id: string, type: ObjectInputType);
|
|
2115
|
+
static validUUID(uuid: string): RegExpMatchArray | null;
|
|
2116
|
+
}
|
|
2117
|
+
/**
|
|
2118
|
+
* Handles validation of text input for transmission to the server.
|
|
2119
|
+
*/
|
|
2120
|
+
export class TextInput extends FlowExecutionInput {
|
|
2121
|
+
constructor(id: string);
|
|
2122
|
+
}
|
|
2070
2123
|
export const getWorkflow: (id: string) => Promise<_Workflow1>;
|
|
2071
2124
|
/**
|
|
2072
2125
|
* Options that can be used during instantiation of the SpiffCommerce Javascript Client.
|
|
@@ -2134,6 +2187,7 @@ export class SpiffCommerceClient {
|
|
|
2134
2187
|
*/
|
|
2135
2188
|
getAssetManager(): AssetManager;
|
|
2136
2189
|
getCurrencyCode(): string;
|
|
2190
|
+
getFlowService(): FlowService;
|
|
2137
2191
|
/**
|
|
2138
2192
|
* Attempts to load persisted authentication information from local storage, and authenticate with the Spiff Commerce API.
|
|
2139
2193
|
* @param bundleId The ID of the bundle you intend to load.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spiffcommerce/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0-alpha.0",
|
|
4
4
|
"description": "Core client API for interacting with the Spiff Commerce backend.",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|
|
89
89
|
"@apollo/client": "^3.7.0",
|
|
90
|
-
"@spiffcommerce/papyrus": "
|
|
90
|
+
"@spiffcommerce/papyrus": "4.0.1-alpha.1",
|
|
91
91
|
"cross-fetch": "^3.1.5",
|
|
92
92
|
"graphql": "^16.6.0",
|
|
93
93
|
"lodash.clonedeep": "^4.5.0",
|