@spiffcommerce/core 10.2.0 → 10.3.1
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 +124 -33
- package/dist/module.js +117 -26
- package/dist/types.d.ts +53 -12
- package/package.json +2 -2
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Workflow as _Workflow1, StepAspect as _StepAspect1, Step as _Step1, AnyStepData as _AnyStepData1, Asset as _Asset1, Region, VariantResource as _VariantResource1, FrameOffsets, PatternImageData, DigitalContentStepData as _DigitalContentStepData1, LayoutsState as _LayoutsState1, CanvasCommand as _CanvasCommand1, FrameStepData as _FrameStepData1, ILayout as _ILayout1, CreateElementCommand as _CreateElementCommand1, FrameElement as _FrameElement1, ColorDefinition as _ColorDefinition1, IllustrationStepData as _IllustrationStepData1, IllustrationElement as _IllustrationElement1, LayoutData as _LayoutData1, MaterialStepData as _MaterialStepData1, ModelStepData as _ModelStepData1, ModuleStepData as _ModuleStepData1, PictureStepData as _PictureStepData1, QuestionStepData as _QuestionStepData1, ShapeStepData as _ShapeStepData1, FontData, GroupCommand as _GroupCommand1, OptionResource as _OptionResource1, TextboxElement as _TextboxElement1, TextFillImage, TextStepData as _TextStepData1, StepStorage as _StepStorage1, SerializableStep, CommandState as _CommandState1, CommandContext as _CommandContext1, LayoutState, MaterialResource, AssetType as _AssetType1, Point, ScaleAxis, UnitOfMeasurement as _UnitOfMeasurement1, StepType as _StepType1, BulkStepData as _BulkStepData1, FrameData as _FrameData1, Animatable, AnyStepData, Asset, AssetType, BringForwardCommand, BringToFrontCommand, BringToBackCommand, BulkStepData, CanvasCommand, ColorDefinition, CommandContext, CommandState, CreateElementCommand, DeleteElementCommand, DigitalContentStepData, FontAlignmentCommand, FontColorCommand, FontSizeCommand, FontSourceCommand, FrameElement, FrameStepData, GroupCommand, ILayout, IllustrationElement, IllustrationStepData, ImageElement, LayoutData, LayoutElement, LayoutElementFactory, LayoutElementType, LayoutsState, MaterialStepData, ModelStepData, ModuleStepData, MoveCommand, OptionResource, PictureStepData, QuestionStepData, ResizeCommand, RotateCommand, SendBackwardsCommand, ShapeStepData, Step, StepAspect, StepAspectType, StepStorage, StepType, TextChangeCommand, TextStepData, TextboxElement, UnitOfMeasurement, VariantResource, Workflow, dataUrlFromExternalUrl, findElement, frameDataCache, generate, generateSVGWithUnknownColors, getAttributesFromArrayBuffer, getFrameData, getSvgElement, loadFontFromDataUrl, loadFontFromExternalUrl, patternImageDataCache, CreateLayoutCommand, rehydrateSerializedLayout, ColorProfileProps, WorkflowPanel, determineCorrectFontSizeAndLines, registerJSDOM, getAxisAlignedBoundingBox } from "@spiffcommerce/papyrus";
|
|
1
|
+
import { Workflow as _Workflow1, StepAspect as _StepAspect1, Step as _Step1, AnyStepData as _AnyStepData1, Asset as _Asset1, Region, VariantResource as _VariantResource1, FrameOffsets, PatternImageData, DigitalContentStepData as _DigitalContentStepData1, LayoutsState as _LayoutsState1, CanvasCommand as _CanvasCommand1, FrameStepData as _FrameStepData1, ILayout as _ILayout1, CreateElementCommand as _CreateElementCommand1, FrameElement as _FrameElement1, ColorDefinition as _ColorDefinition1, IllustrationStepData as _IllustrationStepData1, IllustrationElement as _IllustrationElement1, LayoutData as _LayoutData1, MaterialStepData as _MaterialStepData1, ModelStepData as _ModelStepData1, ModuleStepData as _ModuleStepData1, PictureStepData as _PictureStepData1, QuestionStepData as _QuestionStepData1, ShapeStepData as _ShapeStepData1, FontData, GroupCommand as _GroupCommand1, OptionResource as _OptionResource1, TextboxElement as _TextboxElement1, TextFillImage, TextStepData as _TextStepData1, StepStorage as _StepStorage1, SerializableStep, CommandState as _CommandState1, CommandContext as _CommandContext1, LayoutState, MaterialResource, AssetType as _AssetType1, Point, ScaleAxis, UnitOfMeasurement as _UnitOfMeasurement1, StepType as _StepType1, BulkStepData as _BulkStepData1, Theme as _Theme1, FrameData as _FrameData1, Animatable, AnyStepData, Asset, AssetType, BringForwardCommand, BringToFrontCommand, BringToBackCommand, BulkStepData, CanvasCommand, ColorDefinition, CommandContext, CommandState, CreateElementCommand, DeleteElementCommand, DigitalContentStepData, FontAlignmentCommand, FontColorCommand, FontSizeCommand, FontSourceCommand, FrameElement, FrameStepData, GroupCommand, ILayout, IllustrationElement, IllustrationStepData, ImageElement, LayoutData, LayoutElement, LayoutElementFactory, LayoutElementType, LayoutsState, MaterialStepData, ModelStepData, ModuleStepData, MoveCommand, OptionResource, PictureStepData, QuestionStepData, ResizeCommand, RotateCommand, SendBackwardsCommand, ShapeStepData, Step, StepAspect, StepAspectType, StepStorage, StepType, TextChangeCommand, TextStepData, TextboxElement, UnitOfMeasurement, VariantResource, Workflow, dataUrlFromExternalUrl, findElement, frameDataCache, generate, generateSVGWithUnknownColors, getAttributesFromArrayBuffer, getFrameData, getSvgElement, loadFontFromDataUrl, loadFontFromExternalUrl, patternImageDataCache, CreateLayoutCommand, rehydrateSerializedLayout, ColorProfileProps, WorkflowPanel, determineCorrectFontSizeAndLines, registerJSDOM, getAxisAlignedBoundingBox, Theme } from "@spiffcommerce/papyrus";
|
|
2
2
|
import { ApolloClient } from "@apollo/client";
|
|
3
3
|
import React, { ReactNode, Dispatch, FunctionComponent, RefObject, PointerEvent, KeyboardEvent } from "react";
|
|
4
4
|
export const gatherVaryingStepAspects: (workflow: _Workflow1) => _StepAspect1[];
|
|
@@ -699,6 +699,10 @@ export interface Transaction {
|
|
|
699
699
|
bulkSourceUrl?: string;
|
|
700
700
|
bulkEmailAddress?: string;
|
|
701
701
|
lastSyncedAt?: string;
|
|
702
|
+
/**
|
|
703
|
+
* The users who have access to this transaction.
|
|
704
|
+
*/
|
|
705
|
+
stakeholders?: Stakeholder[];
|
|
702
706
|
}
|
|
703
707
|
interface IntegrationProduct {
|
|
704
708
|
id: string;
|
|
@@ -978,6 +982,9 @@ export interface Customer {
|
|
|
978
982
|
firstName?: string;
|
|
979
983
|
lastName?: string;
|
|
980
984
|
phoneNumber?: string;
|
|
985
|
+
loginToken?: string;
|
|
986
|
+
partner?: Partner;
|
|
987
|
+
stakeholders?: Stakeholder[];
|
|
981
988
|
}
|
|
982
989
|
export interface CustomerDetailsInput {
|
|
983
990
|
emailAddress: string;
|
|
@@ -985,7 +992,7 @@ export interface CustomerDetailsInput {
|
|
|
985
992
|
lastName?: string;
|
|
986
993
|
phoneNumber?: string;
|
|
987
994
|
}
|
|
988
|
-
enum StakeholderType {
|
|
995
|
+
export enum StakeholderType {
|
|
989
996
|
Owner = "Owner",
|
|
990
997
|
Approver = "Approver",
|
|
991
998
|
Editor = "Editor",
|
|
@@ -1864,18 +1871,39 @@ export class SpiffCommerceClient {
|
|
|
1864
1871
|
getAssetManager(): AssetManager;
|
|
1865
1872
|
getCurrencyCode(): string;
|
|
1866
1873
|
/**
|
|
1867
|
-
*
|
|
1868
|
-
* @param
|
|
1869
|
-
* @
|
|
1874
|
+
* Attempts to load persisted authentication information from local storage, and authenticate with the Spiff Commerce API.
|
|
1875
|
+
* @param transactionId The ID of the transaction that the user is attempting to load.
|
|
1876
|
+
* @returns An object containing the following:
|
|
1877
|
+
* - `customLogoLink`: A link to a custom logo to display in the header.
|
|
1878
|
+
* - `transactionReadOnly`: Whether or not the transaction is read-only. Shadow will not accept any changes to the transaction if this is set to true.
|
|
1879
|
+
* - `stakeholderType`: The type of stakeholder that the user is authenticated as.
|
|
1880
|
+
* - `success`: Whether or not the authentication was successful.
|
|
1881
|
+
* @throws An error if the transaction is not found.
|
|
1882
|
+
*/
|
|
1883
|
+
loadTransactionAuth(transactionId: string): Promise<{
|
|
1884
|
+
customLogoLink?: string;
|
|
1885
|
+
transactionReadOnly?: boolean;
|
|
1886
|
+
stakeholderType?: StakeholderType;
|
|
1887
|
+
success: boolean;
|
|
1888
|
+
theme?: _Theme1;
|
|
1889
|
+
}>;
|
|
1890
|
+
/**
|
|
1891
|
+
* Generates a verification code for the given email address. An error will be thrown if the email address is not associated with the transaction.
|
|
1892
|
+
* @param transactionId The ID of the transaction that the user is attempting to load.
|
|
1893
|
+
* @param emailAddress The email address to generate a verification code for. The user will be sent an email with the verification code.
|
|
1870
1894
|
*/
|
|
1871
|
-
|
|
1895
|
+
generateVerificationCode(transactionId: string, emailAddress: string): Promise<void>;
|
|
1872
1896
|
/**
|
|
1873
|
-
*
|
|
1874
|
-
* @param transactionId The
|
|
1875
|
-
* @
|
|
1876
|
-
* @
|
|
1897
|
+
* Verifies the given email address with the given verification code.
|
|
1898
|
+
* @param transactionId The ID of the transaction that the user is attempting to load.
|
|
1899
|
+
* @param emailAddress The email address to verify.
|
|
1900
|
+
* @param verificationCode The verification code to verify the email address with.
|
|
1901
|
+
* @returns An object containing the success status of the verification attempt, and a stakeholder type if the verification was successful.
|
|
1877
1902
|
*/
|
|
1878
|
-
|
|
1903
|
+
verifyCode(transactionId: string, emailAddress: string, verificationCode: string): Promise<{
|
|
1904
|
+
success: boolean;
|
|
1905
|
+
stakeholderType?: StakeholderType;
|
|
1906
|
+
}>;
|
|
1879
1907
|
/**
|
|
1880
1908
|
* Creates a new instance of WorkflowExperience. A high level wrapper for workflows.
|
|
1881
1909
|
* @param workflowId The id of the workflow to be run. Deprecated: Provide options instead.
|
|
@@ -1885,6 +1913,19 @@ export class SpiffCommerceClient {
|
|
|
1885
1913
|
* @returns A workflow experience configured as requested.
|
|
1886
1914
|
*/
|
|
1887
1915
|
getWorkflowExperience(workflowId?: string, workflowState?: string, previewServiceConstructor?: (workflow: _Workflow1) => any, options?: GetWorkflowOptions): Promise<WorkflowExperience>;
|
|
1916
|
+
/**
|
|
1917
|
+
* Initialize the client from an integration product.
|
|
1918
|
+
* @param integrationProductId The integration product to use.
|
|
1919
|
+
* @deprecated Use getWorkflowExperience to initialize the experience.
|
|
1920
|
+
*/
|
|
1921
|
+
initFromIntegrationProduct(integrationProductId: string): Promise<void>;
|
|
1922
|
+
/**
|
|
1923
|
+
* Initialize the client from an existing transaction.
|
|
1924
|
+
* @param transactionId The id of the transaction
|
|
1925
|
+
* @returns A promise resolving at initialization completion.
|
|
1926
|
+
* @deprecated Use getWorkflowExperience to initialize the experience.
|
|
1927
|
+
*/
|
|
1928
|
+
initFromTransaction(transactionId: string, readOnly?: boolean): Promise<void>;
|
|
1888
1929
|
/**
|
|
1889
1930
|
* @returns The preview service that was provided during construction.
|
|
1890
1931
|
*/
|
|
@@ -1997,6 +2038,6 @@ export class FrameStepHandle extends StepHandle<_FrameStepData1> {
|
|
|
1997
2038
|
export const TransformWrapper: React.FunctionComponent;
|
|
1998
2039
|
export { CommandContext };
|
|
1999
2040
|
export { AssetType, BringForwardCommand, BringToFrontCommand, BringToBackCommand, CanvasCommand, CreateElementCommand, CreateLayoutCommand, DeleteElementCommand, FontAlignmentCommand, FontColorCommand, FontSizeCommand, FontSourceCommand, GroupCommand, LayoutElementFactory, LayoutElementType, MoveCommand, ResizeCommand, RotateCommand, SendBackwardsCommand, StepAspectType, StepType, TextChangeCommand, UnitOfMeasurement, dataUrlFromExternalUrl, findElement, frameDataCache, generate, getAxisAlignedBoundingBox, generateSVGWithUnknownColors, getAttributesFromArrayBuffer, rehydrateSerializedLayout, getFrameData, getSvgElement, loadFontFromDataUrl, loadFontFromExternalUrl, determineCorrectFontSizeAndLines, patternImageDataCache, registerJSDOM };
|
|
2000
|
-
export { Animatable, AnyStepData, Asset, BulkStepData, ColorProfileProps, ColorDefinition, CommandState, WorkflowPanel, DigitalContentStepData, FrameElement, FrameStepData, ILayout, IllustrationElement, IllustrationStepData, ImageElement, LayoutData, LayoutElement, LayoutsState, MaterialStepData, ModelStepData, ModuleStepData, OptionResource, PictureStepData, QuestionStepData, ShapeStepData, Step, StepAspect, StepStorage, TextStepData, TextboxElement, VariantResource, Workflow };
|
|
2041
|
+
export { Animatable, AnyStepData, Asset, BulkStepData, ColorProfileProps, ColorDefinition, CommandState, WorkflowPanel, DigitalContentStepData, FrameElement, FrameStepData, ILayout, IllustrationElement, IllustrationStepData, ImageElement, LayoutData, LayoutElement, LayoutsState, MaterialStepData, ModelStepData, ModuleStepData, OptionResource, PictureStepData, QuestionStepData, ShapeStepData, Step, StepAspect, StepStorage, TextStepData, TextboxElement, Theme, VariantResource, Workflow };
|
|
2001
2042
|
|
|
2002
2043
|
//# sourceMappingURL=types.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spiffcommerce/core",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.3.1",
|
|
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": "^2.0.
|
|
90
|
+
"@spiffcommerce/papyrus": "^2.0.4",
|
|
91
91
|
"cross-fetch": "^3.1.5",
|
|
92
92
|
"graphql": "^16.6.0",
|
|
93
93
|
"lodash.clonedeep": "^4.5.0",
|