@spiffcommerce/core 20.1.0-beta.3 → 20.2.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/index.d.ts +18 -58
- package/dist/index.js +327 -324
- package/dist/index.umd.cjs +29 -29
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -137,7 +137,7 @@ declare class PromiseQueue<T extends QueueablePromise> {
|
|
|
137
137
|
* @param mustCover When true the image sgould be bounded in such a way that it covers the entire frame at all times.
|
|
138
138
|
*/
|
|
139
139
|
declare function getBoundedOffsets(newOffsets: FrameOffsets, frameData: FrameData, imageData: PatternImageData, mustCover?: boolean): FrameOffsets;
|
|
140
|
-
declare class FrameService
|
|
140
|
+
declare class FrameService {
|
|
141
141
|
private offsets;
|
|
142
142
|
private thresholdSettings;
|
|
143
143
|
private forceImageCover?;
|
|
@@ -379,7 +379,7 @@ declare enum InformationMessageType {
|
|
|
379
379
|
* Services required for the operaiton of individual steps.
|
|
380
380
|
*/
|
|
381
381
|
interface StepSpecificServices {
|
|
382
|
-
frameService?: FrameService
|
|
382
|
+
frameService?: FrameService;
|
|
383
383
|
module?: ModuleProduct;
|
|
384
384
|
}
|
|
385
385
|
type DesignCreationProgressUpdate = (message: string) => void;
|
|
@@ -1037,6 +1037,9 @@ interface TransformCollectionTransform {
|
|
|
1037
1037
|
rotation: Vector3;
|
|
1038
1038
|
scale: Vector3;
|
|
1039
1039
|
}
|
|
1040
|
+
type Extendable<T> = T & {
|
|
1041
|
+
[key: string]: any;
|
|
1042
|
+
};
|
|
1040
1043
|
|
|
1041
1044
|
/**
|
|
1042
1045
|
* An asset manager provides a way to create and
|
|
@@ -2141,6 +2144,7 @@ declare class IntegrationProduct {
|
|
|
2141
2144
|
getResource(): IntegrationProductResource;
|
|
2142
2145
|
getBasePrice(): number;
|
|
2143
2146
|
getDefaultWorkflow(): ProductWorkflow;
|
|
2147
|
+
getAllWorkflows(): ProductWorkflow[];
|
|
2144
2148
|
}
|
|
2145
2149
|
|
|
2146
2150
|
declare const getWorkflows: (ids: string[], options?: GetWorkflowGraphqlOptions) => Promise<Workflow[]>;
|
|
@@ -2378,6 +2382,7 @@ declare class SpiffCommerceClient {
|
|
|
2378
2382
|
* @returns The transaction associated with this client.
|
|
2379
2383
|
*/
|
|
2380
2384
|
getTransaction(): Transaction;
|
|
2385
|
+
configureUrls(hubUrl: string, serverUrl: string, servicesApiUrl: string): void;
|
|
2381
2386
|
/**
|
|
2382
2387
|
* A function used to synchronize transaction state with the server.
|
|
2383
2388
|
* @param options New state details. To be spread into the query.
|
|
@@ -2387,6 +2392,14 @@ declare class SpiffCommerceClient {
|
|
|
2387
2392
|
storeCustomer(customer: Customer): void;
|
|
2388
2393
|
getIntegrationProductById(integrationProductId: string): Promise<IntegrationProduct>;
|
|
2389
2394
|
getIntegrationProductFromExternalIds(externalIntegrationId: string, externalProductId: string): Promise<IntegrationProduct>;
|
|
2395
|
+
getIntegrationProduct(options: Extendable<{
|
|
2396
|
+
type: "integration";
|
|
2397
|
+
integrationProductId: string;
|
|
2398
|
+
}> | Extendable<{
|
|
2399
|
+
type: "external";
|
|
2400
|
+
externalIntegrationId: string;
|
|
2401
|
+
externalProductId: string;
|
|
2402
|
+
}>): Promise<IntegrationProduct>;
|
|
2390
2403
|
}
|
|
2391
2404
|
|
|
2392
2405
|
declare class Configuration {
|
|
@@ -2438,7 +2451,7 @@ declare class FrameStepService implements StepService<FrameStepData> {
|
|
|
2438
2451
|
selectImage(stepData: Step<FrameStepData>, asset: Asset, workflowManager: WorkflowManager): void;
|
|
2439
2452
|
selectVariant(stepData: Step<FrameStepData>, variant: VariantResource | undefined, elements: RegionElement[], workflowManager: WorkflowManager, setFrameIsUpdating?: (status: boolean) => void): Promise<void>;
|
|
2440
2453
|
getCreateElementCommand(id: string, region: Region, layout: ILayout, options: FrameCreateOpts): CreateElementCommand<FrameElement>;
|
|
2441
|
-
loadPatternFromString(src: string, frameService: FrameService
|
|
2454
|
+
loadPatternFromString(src: string, frameService: FrameService): Promise<void>;
|
|
2442
2455
|
private selectVariantCommand;
|
|
2443
2456
|
private frameSourceSvg;
|
|
2444
2457
|
/**
|
|
@@ -2881,7 +2894,7 @@ declare class FrameStepHandle extends StepHandle<FrameStepData> {
|
|
|
2881
2894
|
selectImage(asset: Asset): void;
|
|
2882
2895
|
getImageData(): PatternImageData | undefined;
|
|
2883
2896
|
getCurrentFrameStep(frameData: FrameData$1, uploading?: any, imageUploadComplete?: any, variants?: VariantResource[]): FrameStep;
|
|
2884
|
-
getFrameService(): FrameService
|
|
2897
|
+
getFrameService(): FrameService | undefined;
|
|
2885
2898
|
hasOverlayImageKey(): string | undefined;
|
|
2886
2899
|
hasOverlayImageUrl(): any;
|
|
2887
2900
|
}
|
|
@@ -2961,57 +2974,4 @@ declare class PromiseCache {
|
|
|
2961
2974
|
}
|
|
2962
2975
|
declare const promiseCache: PromiseCache;
|
|
2963
2976
|
|
|
2964
|
-
|
|
2965
|
-
/**
|
|
2966
|
-
* This event is sent when the frame has encountered an error.
|
|
2967
|
-
*/
|
|
2968
|
-
interface ErrorEvent {
|
|
2969
|
-
event: "OnError";
|
|
2970
|
-
data: Error;
|
|
2971
|
-
}
|
|
2972
|
-
/**
|
|
2973
|
-
* This event is sent when the user has clicked a close button within the frame.
|
|
2974
|
-
*/
|
|
2975
|
-
interface CancelEvent {
|
|
2976
|
-
event: "OnCancel";
|
|
2977
|
-
}
|
|
2978
|
-
/**
|
|
2979
|
-
* This event is sent when the content in the frame is loaded and ready to display. As
|
|
2980
|
-
* the point at which the content is considered 'loaded' can vary between themes, we require the theme developer to report it.
|
|
2981
|
-
*/
|
|
2982
|
-
interface LoadEvent {
|
|
2983
|
-
event: "OnLoad";
|
|
2984
|
-
}
|
|
2985
|
-
/**
|
|
2986
|
-
* This event is sent when the user has completed the transaction in the frame and is passing back information to the parent.
|
|
2987
|
-
*/
|
|
2988
|
-
interface TransactionCompleteEvent {
|
|
2989
|
-
event: "OnComplete";
|
|
2990
|
-
}
|
|
2991
|
-
/**
|
|
2992
|
-
* This event is sent when the user has completed the bundle experience in the frame and is passing back information to the parent.
|
|
2993
|
-
*/
|
|
2994
|
-
interface BundleCompleteEvent {
|
|
2995
|
-
bundleId: string;
|
|
2996
|
-
items: TransactionCompleteEvent[];
|
|
2997
|
-
event: "OnComplete";
|
|
2998
|
-
}
|
|
2999
|
-
/**
|
|
3000
|
-
* A union of the various frame events that can be sent to the parent window.
|
|
3001
|
-
*/
|
|
3002
|
-
type FrameEvent = BundleCompleteEvent | (TransactionCompleteEvent & DesignCreationMessage) | CancelEvent | ErrorEvent | LoadEvent;
|
|
3003
|
-
/**
|
|
3004
|
-
* Service for communicating with the parent window. Wraps calls to `window.parent.postMessage` and provides strongly typed events.
|
|
3005
|
-
*/
|
|
3006
|
-
declare class FrameService {
|
|
3007
|
-
/**
|
|
3008
|
-
* * Send a message to the parent window.
|
|
3009
|
-
* We don't currently know the domain of the parent window in a secure way so we use `window.parent.origin` to send the message.
|
|
3010
|
-
* FIXME: One day in the future let's build a whitelist or something similar that can be used to validate the origin of the parent window.
|
|
3011
|
-
* @param event The event to send. Must be strongly typed as one of the FrameEvent types.
|
|
3012
|
-
*/
|
|
3013
|
-
postMessage(event: FrameEvent): void;
|
|
3014
|
-
}
|
|
3015
|
-
declare const frameService: FrameService;
|
|
3016
|
-
|
|
3017
|
-
export { ArrayInput, AssetNotFoundError, Bundle, CollectionProduct, ColorOption, ConversionConfiguration, ConversionData, ConversionDataType, ConversionLocation, Customer, CustomerDetailsInput, DesignCreationMessage, DesignCreationProgressUpdate, DesignInputStep, EditedSteps, FlowExecutionNodeResult, FlowExecutionResult, FlowService, FrameEventType, FrameService$1 as FrameService, FrameStep, FrameStepHandle, FrameThresholdSettings, 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, WorkflowExperienceImpl, WorkflowManager, WorkflowMetadata, WorkflowScene, WorkflowSelections, WorkflowStorage, assetService, createDesign, designService, digitalContentStepService, frameService, frameStepService, generateCommands, generateStateFromDesignInputSteps, getBoundedOffsets, getWorkflow, getWorkflows, graphQlManager, illustrationStepService, materialStepService, modelStepService, moduleStepService, optionService, persistenceService, pictureStepService, questionStepService, shapeStepService, shortenUrl, spiffCoreConfiguration, stepAspectValuesToDesignInputSteps, textStepService, toast };
|
|
2977
|
+
export { ArrayInput, AssetNotFoundError, Bundle, CollectionProduct, ColorOption, ConversionConfiguration, ConversionData, ConversionDataType, ConversionLocation, Customer, CustomerDetailsInput, DesignCreationMessage, DesignCreationProgressUpdate, DesignInputStep, EditedSteps, FlowExecutionNodeResult, FlowExecutionResult, FlowService, FrameService, FrameStep, FrameStepHandle, FrameThresholdSettings, 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, 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 };
|