@spiffcommerce/core 11.1.2 → 11.3.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
@@ -985,6 +985,7 @@ export interface Customer {
985
985
  loginToken?: string;
986
986
  partner?: Partner;
987
987
  stakeholders?: Stakeholder[];
988
+ bundleStakeholders?: BundleStakeholder[];
988
989
  }
989
990
  export interface CustomerDetailsInput {
990
991
  emailAddress: string;
@@ -1004,6 +1005,19 @@ export interface Stakeholder {
1004
1005
  transaction?: Transaction;
1005
1006
  customer?: Customer;
1006
1007
  }
1008
+ interface Bundle {
1009
+ id?: string;
1010
+ bundleOwnerId?: string;
1011
+ bundleStakeholders?: BundleStakeholder[];
1012
+ partner?: Partner;
1013
+ transactions?: Transaction[];
1014
+ }
1015
+ interface BundleStakeholder {
1016
+ id: string;
1017
+ bundle?: Bundle;
1018
+ customer?: Customer;
1019
+ type?: StakeholderType;
1020
+ }
1007
1021
  interface StorageService {
1008
1022
  /**
1009
1023
  * Get a value.
@@ -1809,6 +1823,46 @@ export interface WorkflowExperience {
1809
1823
  [key: string]: string;
1810
1824
  }>;
1811
1825
  }
1826
+ /**
1827
+ * A bundle serves as a container for a set of workflow experience.
1828
+ */
1829
+ interface _Bundle1 {
1830
+ /**
1831
+ * @returns The client that this bundle is associated with.
1832
+ */
1833
+ getClient(): SpiffCommerceClient;
1834
+ /**
1835
+ * @returns The id of the bundle entity in the Spiff Commerce system.
1836
+ */
1837
+ getId(): string;
1838
+ /**
1839
+ * Returns true when the bundle contains transactions with shared properties.
1840
+ */
1841
+ hasGlobalProperties(): boolean;
1842
+ /**
1843
+ * Get a handle to the global properties available within this bundle. Setting values
1844
+ * via this method will make selections on all bundles that share the property.
1845
+ */
1846
+ getGlobalProperties(): any;
1847
+ /**
1848
+ * Add another workflow experience to this bundle.
1849
+ * @param experience The workflow experience to add to this bundle.
1850
+ */
1851
+ addWorkflowExperience(experience: WorkflowExperience): Promise<void>;
1852
+ /**
1853
+ * Remove a workflow experience from this bundle.
1854
+ * @param experience The workflow experience to remove from this bundle.
1855
+ */
1856
+ removeWorkflowExperience(experience: WorkflowExperience): Promise<void>;
1857
+ /**
1858
+ * Sort the list of workflow experiences.
1859
+ */
1860
+ sortWorkflowExperiences(sortFunc: (expA: WorkflowExperience, expB: WorkflowExperience) => number): void;
1861
+ /**
1862
+ * @returns The number of workflow experiences in this bundle.
1863
+ */
1864
+ getWorkflowExperienceCount(): number;
1865
+ }
1812
1866
  export const getWorkflow: (id: string) => Promise<_Workflow1>;
1813
1867
  /**
1814
1868
  * Options that can be used during instantiation of the SpiffCommerce Javascript Client.
@@ -1870,6 +1924,15 @@ export class SpiffCommerceClient {
1870
1924
  */
1871
1925
  getAssetManager(): AssetManager;
1872
1926
  getCurrencyCode(): string;
1927
+ /**
1928
+ * Attempts to load persisted authentication information from local storage, and authenticate with the Spiff Commerce API.
1929
+ * @param bundleId The ID of the bundle you intend to load.
1930
+ * @returns An object containing the success status of the authentication attempt, and the type of stakeholder when successful.
1931
+ */
1932
+ authenticateBundleFromLocalStorage(bundleId: string): Promise<{
1933
+ stakeholderType?: StakeholderType;
1934
+ success: boolean;
1935
+ }>;
1873
1936
  /**
1874
1937
  * Attempts to load persisted authentication information from local storage, and authenticate with the Spiff Commerce API.
1875
1938
  * @param transactionId The ID of the transaction that the user is attempting to load.
@@ -1906,6 +1969,16 @@ export class SpiffCommerceClient {
1906
1969
  * @returns True if the verification was successful, false otherwise.
1907
1970
  */
1908
1971
  verifyCode(emailAddress: string, verificationCode: string): Promise<boolean>;
1972
+ /**
1973
+ * @param configurationId The id of the configuration to be used for the bundle.
1974
+ * @returns A bundle to be used for grouping and operating on large amounts of workflow experiences.
1975
+ */
1976
+ getNewBundle(): Promise<_Bundle1>;
1977
+ /**
1978
+ * Retrieves an existing bundle from the API, by id.
1979
+ * @returns A bundle to be used for grouping and operating on large amounts of workflow experiences.
1980
+ */
1981
+ getExistingBundle(bundleId: string): Promise<_Bundle1>;
1909
1982
  /**
1910
1983
  * Creates a new instance of WorkflowExperience. A high level wrapper for workflows.
1911
1984
  * @param workflowId The id of the workflow to be run. Deprecated: Provide options instead.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spiffcommerce/core",
3
- "version": "11.1.2",
3
+ "version": "11.3.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",