@spiffcommerce/core 27.2.1-beta.18eb4b53-df1a-5231-9227-b69c4fb0686d → 27.2.1-beta.31456104-bd13-593d-93cf-06c301698749

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
@@ -5,7 +5,6 @@ import { RenderableContextService, RenderableContext, ThreeDPreviewService, Mode
5
5
  import * as lodash from 'lodash';
6
6
  import { CompleteQuoteMessage, ThemeInstallConfigurationGraphQl, ConversionConfiguration } from '@spiffcommerce/theme-bridge';
7
7
  export { ConversionConfiguration, ConversionData, ConversionDataType, ConversionLocation } from '@spiffcommerce/theme-bridge';
8
- import { Currency } from 'dinero.js';
9
8
  import { FuseResult } from 'fuse.js';
10
9
  import { Font } from 'opentype.js';
11
10
 
@@ -1375,13 +1374,14 @@ declare abstract class GlobalPropertyHandle {
1375
1374
  /**
1376
1375
  * Applies the global state to all shared steps, if the state is set.
1377
1376
  * @param targetExperiences Optionally filter the workflow experiences it should be applied to.
1377
+ * @param checkAllSteps Whether to consider all steps in the workflow, not just the ones that are conditionally active.
1378
1378
  */
1379
- abstract applyGlobalState(targetExperiences?: WorkflowExperience[]): Promise<void>;
1379
+ abstract applyGlobalState(targetExperiences?: WorkflowExperience[], checkAllSteps?: boolean): Promise<void>;
1380
1380
  /**
1381
1381
  * Returns all steps that share this property.
1382
1382
  * @param targetExperiences Optionally filter the steps to only those in the given experiences.
1383
1383
  */
1384
- protected getSharedSteps(targetExperiences?: WorkflowExperience[]): StepHandle<AnyStepData>[];
1384
+ protected getSharedSteps(targetExperiences?: WorkflowExperience[], checkAllSteps?: boolean): StepHandle<AnyStepData>[];
1385
1385
  protected getStateValue(): string | undefined;
1386
1386
  }
1387
1387
  /**
@@ -1428,7 +1428,7 @@ declare class FileUploadGlobalPropertyHandle extends GlobalPropertyHandle {
1428
1428
  getBackgroundRemovedImage(): Promise<Asset | undefined>;
1429
1429
  getUseOriginalImage(): boolean;
1430
1430
  setUseOriginalImage(value: boolean): Promise<void>;
1431
- applyGlobalState(targetExperiences?: WorkflowExperience[]): Promise<void>;
1431
+ applyGlobalState(targetExperiences?: WorkflowExperience[], checkAllSteps?: boolean): Promise<void>;
1432
1432
  getAvailableColors(): ColorOption[];
1433
1433
  getCurrentColors(): {
1434
1434
  [key: string]: ColorDefinition;
@@ -1440,7 +1440,7 @@ declare class FileUploadGlobalPropertyHandle extends GlobalPropertyHandle {
1440
1440
  } | undefined>;
1441
1441
  changeColors(newFills: {
1442
1442
  [key: string]: ColorDefinition;
1443
- }): Promise<void>;
1443
+ }, checkAllSteps?: boolean): Promise<void>;
1444
1444
  private applyImageSelection;
1445
1445
  private updateSharedStepStorage;
1446
1446
  }
@@ -1453,7 +1453,7 @@ declare class TextGlobalPropertyHandle extends GlobalPropertyHandle {
1453
1453
  /**
1454
1454
  * Set the text.
1455
1455
  */
1456
- setText(text: string): Promise<void>;
1456
+ setText(text: string, checkAllSteps?: boolean): Promise<void>;
1457
1457
  applyGlobalState(targetExperiences?: WorkflowExperience[]): Promise<void>;
1458
1458
  private applyTextSelection;
1459
1459
  }
@@ -1484,7 +1484,7 @@ declare class OptionGlobalPropertyHandle extends GlobalPropertyHandle {
1484
1484
  * Select a given variant on the option for all shared steps.
1485
1485
  * @param variant The variant to select.
1486
1486
  */
1487
- selectVariant(variant: Variant, channel?: number): Promise<void>;
1487
+ selectVariant(variant: Variant, channel?: number, checkAllSteps?: boolean): Promise<void>;
1488
1488
  applyGlobalState(targetExperiences?: WorkflowExperience[]): Promise<void>;
1489
1489
  private applyVariantSelection;
1490
1490
  }
@@ -1505,7 +1505,7 @@ declare class ColorOptionGlobalPropertyHandle extends OptionGlobalPropertyHandle
1505
1505
  /**
1506
1506
  * Sets a custom color on the global state.
1507
1507
  */
1508
- setCustomColor(color: string): void;
1508
+ setCustomColor(color: string, checkAllSteps?: boolean): void;
1509
1509
  /**
1510
1510
  * Gets the custom color used by the global state.
1511
1511
  */
@@ -2188,37 +2188,6 @@ declare class IntegrationProduct {
2188
2188
  getAllWorkflows(): ProductWorkflow$1[];
2189
2189
  }
2190
2190
 
2191
- declare class CurrencyContext {
2192
- private readonly presentmentCurrency?;
2193
- private readonly partnerCurrency;
2194
- private readonly rateFrom;
2195
- private readonly rateTo;
2196
- constructor(rateFrom: number, rateTo: number, partnerCurrency: Currency, presentmentCurrency?: Currency);
2197
- /**
2198
- * @returns The currency code for the currency being used for monetary display.
2199
- */
2200
- code(): Currency;
2201
- /**
2202
- * @returns true if the conversion is required, false otherwise.
2203
- */
2204
- conversionRequired(): boolean;
2205
- /**
2206
- * Converts a monetary value from a workflow in a partner specified currency
2207
- * to the units of the currency being used for display.
2208
- * @param amount The amount in minor units to convert.
2209
- * @returns
2210
- */
2211
- getConvertedSubunits(amount: number): number;
2212
- /**
2213
- * Converts a monetary value from the database to the units of its currency.
2214
- */
2215
- private units;
2216
- /**
2217
- * Converts a monetary value in units to the subunits of its currency.
2218
- */
2219
- private subunits;
2220
- }
2221
-
2222
2191
  declare const getWorkflows: (ids: string[], options?: GetWorkflowGraphqlOptions) => Promise<Workflow[]>;
2223
2192
  declare const getWorkflow: (id: string, options?: GetWorkflowGraphqlOptions) => Promise<Workflow>;
2224
2193
  /**
@@ -2330,6 +2299,7 @@ interface ClientConfiguration {
2330
2299
  */
2331
2300
  declare class SpiffCommerceClient {
2332
2301
  private options;
2302
+ private currencyCode?;
2333
2303
  private customer?;
2334
2304
  private activeIntegration?;
2335
2305
  private marketplaceThemeInstallId?;
@@ -2344,8 +2314,8 @@ declare class SpiffCommerceClient {
2344
2314
  * and the Spiff Commerce platform.
2345
2315
  */
2346
2316
  getAssetManager(): AssetManager;
2317
+ getCurrencyCode(): string;
2347
2318
  getFlowService(): FlowService;
2348
- getCurrencyContext(presentmentCurrency: string): Promise<CurrencyContext>;
2349
2319
  getIntegration(): Promise<Integration>;
2350
2320
  canUseAddon(addonHandle: AddonHandle): Promise<boolean>;
2351
2321
  /**