@spiffcommerce/core 13.2.0 → 13.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/types.d.ts CHANGED
@@ -2067,6 +2067,53 @@ interface _Bundle1 {
2067
2067
  removeEventListener(event: BundleEvent, listener: () => void): void;
2068
2068
  }
2069
2069
  type BundleEvent = "conditional-global-properties-changed";
2070
+ interface ExecutionResponse {
2071
+ id: string;
2072
+ completedAt?: string;
2073
+ failedAt?: string;
2074
+ }
2075
+ /**
2076
+ * A service containing functionality for interacting with the Spiff Commerce API to execute and inspect the result of process flows.
2077
+ */
2078
+ declare class FlowService {
2079
+ execute(id: string, inputs: FlowExecutionInput[], options?: {
2080
+ sleepTime: number;
2081
+ }): Promise<ExecutionResponse>;
2082
+ }
2083
+ /**
2084
+ * Handles preparing a flow input for transmission to the server.
2085
+ */
2086
+ declare abstract class FlowExecutionInput {
2087
+ protected readonly value: string;
2088
+ constructor(value: string);
2089
+ getRaw(): string;
2090
+ getValueForTransmission(): string;
2091
+ }
2092
+ /**
2093
+ * Represents the type of object being referenced by the input.
2094
+ */
2095
+ export const enum ObjectInputType {
2096
+ Transaction = "Transaction",
2097
+ Bundle = "Bundle",
2098
+ Product = "Product",
2099
+ Variant = "Variant",
2100
+ Option = "Option",
2101
+ LineItem = "LineItem",
2102
+ Asset = "Asset"
2103
+ }
2104
+ /**
2105
+ * Handles validation of spiffObject structure for transmission to the server.
2106
+ */
2107
+ export class ObjectInput extends FlowExecutionInput {
2108
+ constructor(id: string, type: ObjectInputType);
2109
+ static validUUID(uuid: string): RegExpMatchArray | null;
2110
+ }
2111
+ /**
2112
+ * Handles validation of text input for transmission to the server.
2113
+ */
2114
+ export class TextInput extends FlowExecutionInput {
2115
+ constructor(id: string);
2116
+ }
2070
2117
  export const getWorkflow: (id: string) => Promise<_Workflow1>;
2071
2118
  /**
2072
2119
  * Options that can be used during instantiation of the SpiffCommerce Javascript Client.
@@ -2134,6 +2181,7 @@ export class SpiffCommerceClient {
2134
2181
  */
2135
2182
  getAssetManager(): AssetManager;
2136
2183
  getCurrencyCode(): string;
2184
+ getFlowService(): FlowService;
2137
2185
  /**
2138
2186
  * Attempts to load persisted authentication information from local storage, and authenticate with the Spiff Commerce API.
2139
2187
  * @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": "13.2.0",
3
+ "version": "13.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",