@spiffcommerce/core 1.0.0 → 1.1.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/types.d.ts CHANGED
@@ -492,6 +492,11 @@ export interface WorkflowManager {
492
492
  getWorkflowMetadata: () => WorkflowMetadata;
493
493
  getInformationResults(): InformationResult[];
494
494
  getTransaction: () => Transaction;
495
+ getTransactionCustomer: () => Customer | undefined;
496
+ setTransactionCustomer: (customer: Customer) => void;
497
+ /**
498
+ * @deprecated Use setTransactionCustomer instead.
499
+ */
495
500
  setTransactionCustomerDetails: (details: {
496
501
  email: string;
497
502
  }) => void;
@@ -935,8 +940,15 @@ export enum ConversionLocation {
935
940
  /**
936
941
  * The data configured to be requested.
937
942
  */
938
- export enum ConversionData {
939
- Email = "Email"
943
+ export enum ConversionDataType {
944
+ Email = "Email",
945
+ FirstName = "FirstName",
946
+ LastName = "LastName",
947
+ Phone = "Phone"
948
+ }
949
+ export interface ConversionData {
950
+ type: ConversionDataType;
951
+ mandatory: boolean;
940
952
  }
941
953
  /**
942
954
  * The configuration for conversion, exposed on products currently.
@@ -948,6 +960,34 @@ export interface ConversionConfiguration {
948
960
  requestedData: ConversionData[];
949
961
  mandatory?: boolean;
950
962
  }
963
+ /**
964
+ * Someone who has used a workflow experience and entered their contact details.
965
+ */
966
+ export interface Customer {
967
+ id?: string;
968
+ emailAddress: string;
969
+ firstName?: string;
970
+ lastName?: string;
971
+ phoneNumber?: string;
972
+ }
973
+ export interface CustomerDetailsInput {
974
+ emailAddress: string;
975
+ firstName?: string;
976
+ lastName?: string;
977
+ phoneNumber?: string;
978
+ }
979
+ enum StakeholderType {
980
+ Owner = "Owner",
981
+ Approver = "Approver",
982
+ Editor = "Editor",
983
+ Viewer = "Viewer"
984
+ }
985
+ export interface Stakeholder {
986
+ id: string;
987
+ type?: StakeholderType;
988
+ transaction?: Transaction;
989
+ customer?: Customer;
990
+ }
951
991
  interface StorageService {
952
992
  /**
953
993
  * Get a value.
@@ -1616,6 +1656,7 @@ export interface WorkflowExperience {
1616
1656
  * Attach specific details about the customer to the experience. This is useful for things like retargeting. Currently only
1617
1657
  * email is supported. From SpiffCommerce hosted experiences these details will be attached whenever the customer has provided & given permission.
1618
1658
  * @param details The new customer details. Only email is supported.
1659
+ * @deprecated Use assignCustomerDetails instead.
1619
1660
  */
1620
1661
  attachCustomerDetails(details: {
1621
1662
  /**
@@ -1623,6 +1664,12 @@ export interface WorkflowExperience {
1623
1664
  */
1624
1665
  email: string;
1625
1666
  }): Promise<void>;
1667
+ /**
1668
+ * Attach specific details about the customer to the experience. This is useful for things like retargeting.
1669
+ * From SpiffCommerce hosted experiences these details will be attached whenever the customer has provided & given permission.
1670
+ * @param details The new customer details.
1671
+ */
1672
+ assignCustomerDetails(details: CustomerDetailsInput): Promise<void>;
1626
1673
  /**
1627
1674
  * Attaches a listener to the scenes on a workflow experience. The scenes returned are a subset of the scenes configured in the
1628
1675
  * workflow and are based on the current state of the experience. This is useful for building a navigation menu.
@@ -1762,6 +1809,8 @@ export class MockWorkflowManager implements WorkflowManager {
1762
1809
  getTransaction(): {
1763
1810
  id: string;
1764
1811
  };
1812
+ getTransactionCustomer(): undefined;
1813
+ setTransactionCustomer(): void;
1765
1814
  setTransactionCustomerDetails(): void;
1766
1815
  getWorkflow(): {
1767
1816
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spiffcommerce/core",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
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",