@spiffcommerce/core 16.0.0-beta.9 → 16.0.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/index.d.ts CHANGED
@@ -1794,8 +1794,70 @@ interface WorkflowExperienceHoverEventData {
1794
1794
  workflowExperience: WorkflowExperience;
1795
1795
  }
1796
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
+ }
1797
1858
  interface ExecutionResponse {
1798
1859
  id: string;
1860
+ nodes: ExecutionNodeResponse[];
1799
1861
  completedAt?: string;
1800
1862
  failedAt?: string;
1801
1863
  }
@@ -1803,9 +1865,64 @@ interface ExecutionResponse {
1803
1865
  * A service containing functionality for interacting with the Spiff Commerce API to execute and inspect the result of process flows.
1804
1866
  */
1805
1867
  declare class FlowService {
1868
+ /**
1869
+ *
1870
+ * @param id
1871
+ * @param inputs
1872
+ * @param options
1873
+ * @returns
1874
+ */
1806
1875
  execute(id: string, inputs: FlowExecutionInput[], options?: {
1807
- sleepTime: number;
1808
- }): 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;
1809
1926
  }
1810
1927
  /**
1811
1928
  * Handles preparing a flow input for transmission to the server.
@@ -1835,12 +1952,6 @@ declare class ObjectInput extends FlowExecutionInput {
1835
1952
  constructor(id: string, type: ObjectInputType);
1836
1953
  static validUUID(uuid: string): RegExpMatchArray | null;
1837
1954
  }
1838
- /**
1839
- * Handles validation of text input for transmission to the server.
1840
- */
1841
- declare class TextInput extends FlowExecutionInput {
1842
- constructor(id: string);
1843
- }
1844
1955
 
1845
1956
  declare const getWorkflows: (ids: string[], options?: GetWorkflowGraphqlOptions) => Promise<Workflow[]>;
1846
1957
  declare const getWorkflow: (id: string, options?: GetWorkflowGraphqlOptions) => Promise<Workflow>;
@@ -2655,4 +2766,4 @@ interface StepAspectValue {
2655
2766
  declare const stepAspectValuesToDesignInputSteps: (stepAspectValues: StepAspectValue[], workflow: Workflow) => DesignInputStep[];
2656
2767
  declare const generateStateFromDesignInputSteps: (designInputSteps: DesignInputStep[], workflow: Workflow, layouts: ILayout[], productOverlayImageUrl?: string) => Promise<LayoutsState>;
2657
2768
 
2658
- 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 };