@spiffcommerce/core 20.2.2 → 20.4.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
@@ -640,6 +640,10 @@ interface Transaction {
640
640
  * The users who have access to this transaction.
641
641
  */
642
642
  stakeholders?: Stakeholder[];
643
+ /**
644
+ * The amount of this transaction that was, or will be, ordered
645
+ */
646
+ quantity?: number;
643
647
  }
644
648
  /**
645
649
  * An integration product represents the connection of a product in SpiffCommerce with
@@ -681,6 +685,7 @@ interface Integration {
681
685
  enabled: boolean;
682
686
  externalIntegrationId?: string;
683
687
  type?: IntegrationType;
688
+ isCurrent?: boolean;
684
689
  }
685
690
  declare enum IntegrationType {
686
691
  Hub = "Hub",
@@ -1531,6 +1536,33 @@ interface WorkflowExperience {
1531
1536
  getExportedData(): Map<string, {
1532
1537
  [key: string]: string;
1533
1538
  }>;
1539
+ /**
1540
+ * Get the quantity of this WorkflowExperience's Transaction.
1541
+ * @returns The amount that was, or will be, ordered.
1542
+ */
1543
+ getQuantity(): number;
1544
+ /**
1545
+ * Sets the quantity of this WorkflowExperience's Transaction.
1546
+ * @throws {Error} if the WorkflowExperience is read-only.
1547
+ * @throws {RangeError} if the value is below 1.
1548
+ * @param quantity The amount that was, or will be, ordered.
1549
+ */
1550
+ setQuantity(quantity: number): void;
1551
+ /**
1552
+ * Registers a callback function to be called when the specified event is raised.
1553
+ * @param type The type of event to listen for.
1554
+ * @param callback The function to call when the event occurs.
1555
+ */
1556
+ addEventListener(type: WorkflowExperienceEventType, callback: (workflowExperience: WorkflowExperience) => void): void;
1557
+ /**
1558
+ * Removes a previously registered callback.
1559
+ * @param type The type of event.
1560
+ * @param callback The function to remove.
1561
+ */
1562
+ removeEventListener(type: WorkflowExperienceEventType, callback: (workflowExperience: WorkflowExperience) => void): void;
1563
+ }
1564
+ declare enum WorkflowExperienceEventType {
1565
+ QuantityChanged = "QuantityChanged"
1534
1566
  }
1535
1567
  declare class WorkflowExperienceImpl implements WorkflowExperience {
1536
1568
  readonly client: SpiffCommerceClient;
@@ -1540,6 +1572,7 @@ declare class WorkflowExperienceImpl implements WorkflowExperience {
1540
1572
  readonly cachedStepHandles: Map<string, StepHandle<any>>;
1541
1573
  private renderableScenes;
1542
1574
  private renderableSceneCallbacks;
1575
+ private eventCallbacks;
1543
1576
  constructor(client: SpiffCommerceClient, experienceOptions: ExperienceOptions);
1544
1577
  getClient(): SpiffCommerceClient;
1545
1578
  getIsReadOnly(): boolean;
@@ -1576,6 +1609,11 @@ declare class WorkflowExperienceImpl implements WorkflowExperience {
1576
1609
  getExportedData(): Map<string, {
1577
1610
  [key: string]: string;
1578
1611
  }>;
1612
+ getQuantity(): number;
1613
+ setQuantity(quantity: number): void;
1614
+ addEventListener(type: WorkflowExperienceEventType, callback: (workflowExperience: WorkflowExperience) => void): void;
1615
+ removeEventListener(type: WorkflowExperienceEventType, callback: (workflowExperience: WorkflowExperience) => void): void;
1616
+ private callEvent;
1579
1617
  }
1580
1618
 
1581
1619
  /**
@@ -1676,6 +1714,7 @@ declare class CollectionProduct {
1676
1714
  * @returns The integration if found. Throws an error if not found as this data is typically a neccesity.
1677
1715
  */
1678
1716
  getIntegrationByType(type: IntegrationType, externalId?: string): IntegrationProductResource;
1717
+ getCurrentIntegration(): IntegrationProductResource;
1679
1718
  /**
1680
1719
  * A helper function for pulling the default workflow.
1681
1720
  */