@spiffcommerce/core 1.2.0 → 1.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 +36 -20
- package/dist/module.js +31 -15
- package/dist/types.d.ts +53 -3
- package/package.json +1 -1
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
|
|
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.
|
|
@@ -945,9 +957,38 @@ export interface ConversionConfiguration {
|
|
|
945
957
|
id: string;
|
|
946
958
|
name?: string;
|
|
947
959
|
locations: ConversionLocation[];
|
|
948
|
-
requestedData:
|
|
960
|
+
requestedData: ConversionDataType[];
|
|
961
|
+
requestedDataItems: ConversionData[];
|
|
949
962
|
mandatory?: boolean;
|
|
950
963
|
}
|
|
964
|
+
/**
|
|
965
|
+
* Someone who has used a workflow experience and entered their contact details.
|
|
966
|
+
*/
|
|
967
|
+
export interface Customer {
|
|
968
|
+
id?: string;
|
|
969
|
+
emailAddress: string;
|
|
970
|
+
firstName?: string;
|
|
971
|
+
lastName?: string;
|
|
972
|
+
phoneNumber?: string;
|
|
973
|
+
}
|
|
974
|
+
export interface CustomerDetailsInput {
|
|
975
|
+
emailAddress: string;
|
|
976
|
+
firstName?: string;
|
|
977
|
+
lastName?: string;
|
|
978
|
+
phoneNumber?: string;
|
|
979
|
+
}
|
|
980
|
+
enum StakeholderType {
|
|
981
|
+
Owner = "Owner",
|
|
982
|
+
Approver = "Approver",
|
|
983
|
+
Editor = "Editor",
|
|
984
|
+
Viewer = "Viewer"
|
|
985
|
+
}
|
|
986
|
+
export interface Stakeholder {
|
|
987
|
+
id: string;
|
|
988
|
+
type?: StakeholderType;
|
|
989
|
+
transaction?: Transaction;
|
|
990
|
+
customer?: Customer;
|
|
991
|
+
}
|
|
951
992
|
interface StorageService {
|
|
952
993
|
/**
|
|
953
994
|
* Get a value.
|
|
@@ -1616,6 +1657,7 @@ export interface WorkflowExperience {
|
|
|
1616
1657
|
* Attach specific details about the customer to the experience. This is useful for things like retargeting. Currently only
|
|
1617
1658
|
* email is supported. From SpiffCommerce hosted experiences these details will be attached whenever the customer has provided & given permission.
|
|
1618
1659
|
* @param details The new customer details. Only email is supported.
|
|
1660
|
+
* @deprecated Use assignCustomerDetails instead.
|
|
1619
1661
|
*/
|
|
1620
1662
|
attachCustomerDetails(details: {
|
|
1621
1663
|
/**
|
|
@@ -1623,6 +1665,12 @@ export interface WorkflowExperience {
|
|
|
1623
1665
|
*/
|
|
1624
1666
|
email: string;
|
|
1625
1667
|
}): Promise<void>;
|
|
1668
|
+
/**
|
|
1669
|
+
* Attach specific details about the customer to the experience. This is useful for things like retargeting.
|
|
1670
|
+
* From SpiffCommerce hosted experiences these details will be attached whenever the customer has provided & given permission.
|
|
1671
|
+
* @param details The new customer details.
|
|
1672
|
+
*/
|
|
1673
|
+
assignCustomerDetails(details: CustomerDetailsInput): Promise<void>;
|
|
1626
1674
|
/**
|
|
1627
1675
|
* Attaches a listener to the scenes on a workflow experience. The scenes returned are a subset of the scenes configured in the
|
|
1628
1676
|
* workflow and are based on the current state of the experience. This is useful for building a navigation menu.
|
|
@@ -1762,6 +1810,8 @@ export class MockWorkflowManager implements WorkflowManager {
|
|
|
1762
1810
|
getTransaction(): {
|
|
1763
1811
|
id: string;
|
|
1764
1812
|
};
|
|
1813
|
+
getTransactionCustomer(): undefined;
|
|
1814
|
+
setTransactionCustomer(): void;
|
|
1765
1815
|
setTransactionCustomerDetails(): void;
|
|
1766
1816
|
getWorkflow(): {
|
|
1767
1817
|
id: string;
|