@spiffcommerce/core 16.0.0-beta.8 → 16.0.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 CHANGED
@@ -1097,7 +1097,7 @@ declare class Variant {
1097
1097
  */
1098
1098
  getAssetResource(): Asset | undefined;
1099
1099
  /**
1100
- * @returns The URL for a thumbnail resource configured on this variant. When no thumbnail is configured explicitly we fall back to the base asset and see if a thumbnail is genererated for that.
1100
+ * @returns The URL for a thumbnail resource configured on this variant.
1101
1101
  */
1102
1102
  getThumbnail(): string | undefined;
1103
1103
  /**
@@ -1536,6 +1536,7 @@ declare abstract class GlobalPropertyHandle {
1536
1536
  }
1537
1537
 
1538
1538
  interface GlobalPropertyStateManager {
1539
+ getInitializationPromise(): Promise<void>;
1539
1540
  getGlobalPropertyState(): GlobalPropertyState | undefined;
1540
1541
  getAspect(name: string): string | undefined;
1541
1542
  setAspect(name: string, value: string): Promise<void>;
@@ -1793,8 +1794,70 @@ interface WorkflowExperienceHoverEventData {
1793
1794
  workflowExperience: WorkflowExperience;
1794
1795
  }
1795
1796
 
1797
+ /**
1798
+ * A list of node types available in executions
1799
+ */
1800
+ declare enum NodeType {
1801
+ Split = "Split",
1802
+ TextJoin = "TextJoin",
1803
+ TextSlice = "TextSlice",
1804
+ TextUpper = "TextUpper",
1805
+ TextLower = "TextLower",
1806
+ ParseJson = "ParseJson",
1807
+ TextBuilder = "TextBuilder",
1808
+ Design = "Design",
1809
+ OverlayImage = "OverlayImage",
1810
+ OverlayText = "OverlayText",
1811
+ TableGenerator = "TableGenerator",
1812
+ QR = "QR",
1813
+ CSV = "CSV",
1814
+ PDF = "PDF",
1815
+ PNG = "PNG",
1816
+ Email = "Email",
1817
+ LocationDelivery = "LocationDelivery",
1818
+ TemplateEmail = "TemplateEmail",
1819
+ Map = "Map",
1820
+ Sort = "Sort",
1821
+ Group = "Group",
1822
+ InnerJoin = "InnerJoin",
1823
+ Contains = "Contains",
1824
+ Flatten = "Flatten",
1825
+ KeyValuePairs = "KeyValuePairs",
1826
+ ListConcatenate = "ListConcatenate",
1827
+ Repeat = "Repeat",
1828
+ Size = "Size",
1829
+ ListBuilder = "ListBuilder",
1830
+ MapBuilder = "MapBuilder",
1831
+ PairBuilder = "PairBuilder",
1832
+ AND = "AND",
1833
+ OR = "OR",
1834
+ NOT = "NOT",
1835
+ Equals = "Equals",
1836
+ Present = "Present",
1837
+ ManualOperation = "ManualOperation",
1838
+ Switch = "Switch",
1839
+ AssetMetadata = "AssetMetadata",
1840
+ DataSelect = "DataSelect",
1841
+ LayoutSelect = "LayoutSelect",
1842
+ TransactionMetadata = "TransactionMetadata",
1843
+ VariantSelection = "VariantSelection",
1844
+ StartTerminal = "StartTerminal",
1845
+ EndTerminal = "EndTerminal",
1846
+ MiscNote = "MiscNote",
1847
+ Assign = "Assign",
1848
+ CsvVlookup = "CsvVlookup",
1849
+ ProcessFlow = "ProcessFlow",
1850
+ TemporaryAssetUrl = "TemporaryAssetUrl",
1851
+ WebRequest = "WebRequest"
1852
+ }
1853
+ interface ExecutionNodeResponse {
1854
+ id: string;
1855
+ type: NodeType;
1856
+ artifacts: string;
1857
+ }
1796
1858
  interface ExecutionResponse {
1797
1859
  id: string;
1860
+ nodes: ExecutionNodeResponse[];
1798
1861
  completedAt?: string;
1799
1862
  failedAt?: string;
1800
1863
  }
@@ -1802,9 +1865,64 @@ interface ExecutionResponse {
1802
1865
  * A service containing functionality for interacting with the Spiff Commerce API to execute and inspect the result of process flows.
1803
1866
  */
1804
1867
  declare class FlowService {
1868
+ /**
1869
+ *
1870
+ * @param id
1871
+ * @param inputs
1872
+ * @param options
1873
+ * @returns
1874
+ */
1805
1875
  execute(id: string, inputs: FlowExecutionInput[], options?: {
1806
- sleepTime: number;
1807
- }): Promise<ExecutionResponse>;
1876
+ sleepTime?: number;
1877
+ repeats?: number;
1878
+ }): Promise<FlowExecutionResult>;
1879
+ }
1880
+ /**
1881
+ * Handles preparing a flow input for transmission to the server.
1882
+ */
1883
+ declare class FlowExecutionResult {
1884
+ protected readonly execution: ExecutionResponse;
1885
+ constructor(execution: ExecutionResponse);
1886
+ /**
1887
+ * @returns The raw response from the server.
1888
+ */
1889
+ getRaw(): ExecutionResponse;
1890
+ /**
1891
+ * @returns The nodes contained within the execution.
1892
+ */
1893
+ getNodes(): FlowExecutionNodeResult[];
1894
+ /**
1895
+ * @param type The type of node to return.
1896
+ * @returns A list of nodes matching the requested type.
1897
+ */
1898
+ getNodesByType(type: NodeType): FlowExecutionNodeResult[];
1899
+ /**
1900
+ * @returns A list of input nodes that exist in this execution.
1901
+ */
1902
+ getInputs(): FlowExecutionNodeResult[];
1903
+ /**
1904
+ * @returns A list of out put nodes that exist in this execution.
1905
+ */
1906
+ getOutputs(): FlowExecutionNodeResult[];
1907
+ /**
1908
+ * @returns A date object representing the point in time this execution completed.
1909
+ */
1910
+ getCompletedAt(): Date | undefined;
1911
+ /**
1912
+ * @returns A date object representing the point in time this execution failed.
1913
+ */
1914
+ getFailedAt(): Date | undefined;
1915
+ }
1916
+ /**
1917
+ * Handles preparing a flow input for transmission to the server.
1918
+ */
1919
+ declare class FlowExecutionNodeResult {
1920
+ protected readonly node: ExecutionNodeResponse;
1921
+ constructor(node: ExecutionNodeResponse);
1922
+ getId(): string;
1923
+ getType(): NodeType;
1924
+ getArtifacts(): Map<string, any>;
1925
+ getArtifactByName<T>(name: string): T;
1808
1926
  }
1809
1927
  /**
1810
1928
  * Handles preparing a flow input for transmission to the server.
@@ -1834,12 +1952,6 @@ declare class ObjectInput extends FlowExecutionInput {
1834
1952
  constructor(id: string, type: ObjectInputType);
1835
1953
  static validUUID(uuid: string): RegExpMatchArray | null;
1836
1954
  }
1837
- /**
1838
- * Handles validation of text input for transmission to the server.
1839
- */
1840
- declare class TextInput extends FlowExecutionInput {
1841
- constructor(id: string);
1842
- }
1843
1955
 
1844
1956
  declare const getWorkflows: (ids: string[], options?: GetWorkflowGraphqlOptions) => Promise<Workflow[]>;
1845
1957
  declare const getWorkflow: (id: string, options?: GetWorkflowGraphqlOptions) => Promise<Workflow>;
@@ -2654,4 +2766,4 @@ interface StepAspectValue {
2654
2766
  declare const stepAspectValuesToDesignInputSteps: (stepAspectValues: StepAspectValue[], workflow: Workflow) => DesignInputStep[];
2655
2767
  declare const generateStateFromDesignInputSteps: (designInputSteps: DesignInputStep[], workflow: Workflow, layouts: ILayout[], productOverlayImageUrl?: string) => Promise<LayoutsState>;
2656
2768
 
2657
- export { AssetNotFoundError, BulkPriceCalculationStrategy, BulkStepHandle, Bundle, CollectionProduct, ColorOption, ConversionConfiguration, ConversionData, ConversionDataType, ConversionLocation, Customer, CustomerDetailsInput, DesignCreationMessage, DesignCreationProgressUpdate, DesignInputStep, EditedSteps, FrameService, FrameStep, FrameStepHandle, GetWorkflowOptions, GlobalPropertyHandle, IllustrationStepHandle, InformationMessageType, InformationResult, InformationStepHandle, LayoutNotFoundError, MandatorySteps, MaterialStepHandle, MisconfigurationError, MockWorkflowManager, ModelStepHandle, ObjectInput, ObjectInputType, OptionNotFoundError, ParseError, PictureStepHandle, Product, ProductCameraRig, ProductCollection, PromiseQueue, QuestionStepHandle, QueueablePromise, RegionElement, RenderableScene, ResourceNotFoundError, SavedDesign, SelectionStorage, ShapeStepHandle, SilentIllustrationStepData, SpiffCommerceClient, Stakeholder, StakeholderType, StateMutationFunc, StepElements, StepHandle, TextInput, TextStepHandle, TextStepStorage, Transaction, UnhandledBehaviorError, Variant, VariationRecord, WorkflowExperience, WorkflowExperienceImpl, WorkflowManager, WorkflowMetadata, WorkflowScene, WorkflowSelections, WorkflowStorage, assetService, createDesign, designService, digitalContentStepService, frameStepService, gatherVaryingStepAspects, generateCommands, generateStateFromDesignInputSteps, getBoundedOffsets, getWorkflow, getWorkflows, graphQlManager, illustrationStepService, materialStepService, modelStepService, moduleStepService, optionService, persistenceService, pictureStepService, questionStepService, shapeStepService, shortenUrl, spiffCoreConfiguration, stepAspectValuesToDesignInputSteps, textStepService, toast };
2769
+ export { AssetNotFoundError, BulkPriceCalculationStrategy, BulkStepHandle, Bundle, CollectionProduct, ColorOption, ConversionConfiguration, ConversionData, ConversionDataType, ConversionLocation, Customer, CustomerDetailsInput, DesignCreationMessage, DesignCreationProgressUpdate, DesignInputStep, EditedSteps, FlowExecutionNodeResult, FlowExecutionResult, FlowService, FrameService, FrameStep, FrameStepHandle, GetWorkflowOptions, GlobalPropertyHandle, IllustrationStepHandle, InformationMessageType, InformationResult, InformationStepHandle, LayoutNotFoundError, MandatorySteps, MaterialStepHandle, MisconfigurationError, MockWorkflowManager, ModelStepHandle, NodeType, ObjectInput, ObjectInputType, OptionNotFoundError, ParseError, PictureStepHandle, Product, ProductCameraRig, ProductCollection, PromiseQueue, QuestionStepHandle, QueueablePromise, RegionElement, RenderableScene, ResourceNotFoundError, SavedDesign, SelectionStorage, ShapeStepHandle, SilentIllustrationStepData, SpiffCommerceClient, Stakeholder, StakeholderType, StateMutationFunc, StepElements, StepHandle, TextStepHandle, TextStepStorage, Transaction, UnhandledBehaviorError, Variant, VariationRecord, WorkflowExperience, WorkflowExperienceImpl, WorkflowManager, WorkflowMetadata, WorkflowScene, WorkflowSelections, WorkflowStorage, assetService, createDesign, designService, digitalContentStepService, frameStepService, gatherVaryingStepAspects, generateCommands, generateStateFromDesignInputSteps, getBoundedOffsets, getWorkflow, getWorkflows, graphQlManager, illustrationStepService, materialStepService, modelStepService, moduleStepService, optionService, persistenceService, pictureStepService, questionStepService, shapeStepService, shortenUrl, spiffCoreConfiguration, stepAspectValuesToDesignInputSteps, textStepService, toast };