@spiffcommerce/core 15.2.4 → 15.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 +23 -21
- package/dist/module.js +36 -34
- package/dist/types.d.ts +120 -3
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -2350,18 +2350,135 @@ interface ConditionalGlobalPropertiesChangedEventData {
|
|
|
2350
2350
|
interface WorkflowExperienceHoverEventData {
|
|
2351
2351
|
workflowExperience: WorkflowExperience;
|
|
2352
2352
|
}
|
|
2353
|
+
/**
|
|
2354
|
+
* A list of node types available in executions
|
|
2355
|
+
*/
|
|
2356
|
+
export enum NodeType {
|
|
2357
|
+
Split = "Split",
|
|
2358
|
+
TextJoin = "TextJoin",
|
|
2359
|
+
TextSlice = "TextSlice",
|
|
2360
|
+
TextUpper = "TextUpper",
|
|
2361
|
+
TextLower = "TextLower",
|
|
2362
|
+
ParseJson = "ParseJson",
|
|
2363
|
+
TextBuilder = "TextBuilder",
|
|
2364
|
+
Design = "Design",
|
|
2365
|
+
OverlayImage = "OverlayImage",
|
|
2366
|
+
OverlayText = "OverlayText",
|
|
2367
|
+
TableGenerator = "TableGenerator",
|
|
2368
|
+
QR = "QR",
|
|
2369
|
+
CSV = "CSV",
|
|
2370
|
+
PDF = "PDF",
|
|
2371
|
+
PNG = "PNG",
|
|
2372
|
+
Email = "Email",
|
|
2373
|
+
LocationDelivery = "LocationDelivery",
|
|
2374
|
+
TemplateEmail = "TemplateEmail",
|
|
2375
|
+
Map = "Map",
|
|
2376
|
+
Sort = "Sort",
|
|
2377
|
+
Group = "Group",
|
|
2378
|
+
InnerJoin = "InnerJoin",
|
|
2379
|
+
Contains = "Contains",
|
|
2380
|
+
Flatten = "Flatten",
|
|
2381
|
+
KeyValuePairs = "KeyValuePairs",
|
|
2382
|
+
ListConcatenate = "ListConcatenate",
|
|
2383
|
+
Repeat = "Repeat",
|
|
2384
|
+
Size = "Size",
|
|
2385
|
+
ListBuilder = "ListBuilder",
|
|
2386
|
+
MapBuilder = "MapBuilder",
|
|
2387
|
+
PairBuilder = "PairBuilder",
|
|
2388
|
+
AND = "AND",
|
|
2389
|
+
OR = "OR",
|
|
2390
|
+
NOT = "NOT",
|
|
2391
|
+
Equals = "Equals",
|
|
2392
|
+
Present = "Present",
|
|
2393
|
+
ManualOperation = "ManualOperation",
|
|
2394
|
+
Switch = "Switch",
|
|
2395
|
+
AssetMetadata = "AssetMetadata",
|
|
2396
|
+
DataSelect = "DataSelect",
|
|
2397
|
+
LayoutSelect = "LayoutSelect",
|
|
2398
|
+
TransactionMetadata = "TransactionMetadata",
|
|
2399
|
+
VariantSelection = "VariantSelection",
|
|
2400
|
+
StartTerminal = "StartTerminal",
|
|
2401
|
+
EndTerminal = "EndTerminal",
|
|
2402
|
+
MiscNote = "MiscNote",
|
|
2403
|
+
Assign = "Assign",
|
|
2404
|
+
CsvVlookup = "CsvVlookup",
|
|
2405
|
+
ProcessFlow = "ProcessFlow",
|
|
2406
|
+
TemporaryAssetUrl = "TemporaryAssetUrl",
|
|
2407
|
+
WebRequest = "WebRequest"
|
|
2408
|
+
}
|
|
2409
|
+
interface ExecutionNodeResponse {
|
|
2410
|
+
id: string;
|
|
2411
|
+
type: NodeType;
|
|
2412
|
+
artifacts: string;
|
|
2413
|
+
}
|
|
2353
2414
|
interface ExecutionResponse {
|
|
2354
2415
|
id: string;
|
|
2416
|
+
nodes: ExecutionNodeResponse[];
|
|
2355
2417
|
completedAt?: string;
|
|
2356
2418
|
failedAt?: string;
|
|
2357
2419
|
}
|
|
2358
2420
|
/**
|
|
2359
2421
|
* A service containing functionality for interacting with the Spiff Commerce API to execute and inspect the result of process flows.
|
|
2360
2422
|
*/
|
|
2361
|
-
|
|
2423
|
+
export class FlowService {
|
|
2424
|
+
/**
|
|
2425
|
+
*
|
|
2426
|
+
* @param id
|
|
2427
|
+
* @param inputs
|
|
2428
|
+
* @param options
|
|
2429
|
+
* @returns
|
|
2430
|
+
*/
|
|
2362
2431
|
execute(id: string, inputs: FlowExecutionInput[], options?: {
|
|
2363
|
-
sleepTime
|
|
2364
|
-
|
|
2432
|
+
sleepTime?: number;
|
|
2433
|
+
repeats?: number;
|
|
2434
|
+
}): Promise<FlowExecutionResult>;
|
|
2435
|
+
}
|
|
2436
|
+
/**
|
|
2437
|
+
* Handles preparing a flow input for transmission to the server.
|
|
2438
|
+
*/
|
|
2439
|
+
export class FlowExecutionResult {
|
|
2440
|
+
protected readonly execution: ExecutionResponse;
|
|
2441
|
+
constructor(execution: ExecutionResponse);
|
|
2442
|
+
/**
|
|
2443
|
+
* @returns The raw response from the server.
|
|
2444
|
+
*/
|
|
2445
|
+
getRaw(): ExecutionResponse;
|
|
2446
|
+
/**
|
|
2447
|
+
* @returns The nodes contained within the execution.
|
|
2448
|
+
*/
|
|
2449
|
+
getNodes(): FlowExecutionNodeResult[];
|
|
2450
|
+
/**
|
|
2451
|
+
* @param type The type of node to return.
|
|
2452
|
+
* @returns A list of nodes matching the requested type.
|
|
2453
|
+
*/
|
|
2454
|
+
getNodesByType(type: NodeType): FlowExecutionNodeResult[];
|
|
2455
|
+
/**
|
|
2456
|
+
* @returns A list of input nodes that exist in this execution.
|
|
2457
|
+
*/
|
|
2458
|
+
getInputs(): FlowExecutionNodeResult[];
|
|
2459
|
+
/**
|
|
2460
|
+
* @returns A list of out put nodes that exist in this execution.
|
|
2461
|
+
*/
|
|
2462
|
+
getOutputs(): FlowExecutionNodeResult[];
|
|
2463
|
+
/**
|
|
2464
|
+
* @returns A date object representing the point in time this execution completed.
|
|
2465
|
+
*/
|
|
2466
|
+
getCompletedAt(): Date | undefined;
|
|
2467
|
+
/**
|
|
2468
|
+
* @returns A date object representing the point in time this execution failed.
|
|
2469
|
+
*/
|
|
2470
|
+
getFailedAt(): Date | undefined;
|
|
2471
|
+
}
|
|
2472
|
+
/**
|
|
2473
|
+
* Handles preparing a flow input for transmission to the server.
|
|
2474
|
+
*/
|
|
2475
|
+
export class FlowExecutionNodeResult {
|
|
2476
|
+
protected readonly node: ExecutionNodeResponse;
|
|
2477
|
+
constructor(node: ExecutionNodeResponse);
|
|
2478
|
+
getId(): string;
|
|
2479
|
+
getType(): NodeType;
|
|
2480
|
+
getArtifacts(): Map<string, any>;
|
|
2481
|
+
getArtifactByName<T>(name: string): T;
|
|
2365
2482
|
}
|
|
2366
2483
|
/**
|
|
2367
2484
|
* Handles preparing a flow input for transmission to the server.
|