@spiffcommerce/core 0.10.115 → 0.10.116

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
@@ -339,7 +339,7 @@ declare class IllustrationStepService implements StepService<_IllustrationStepDa
339
339
  getIllustrationBody(src: string): Promise<string>;
340
340
  getCreateElementCommand(id: string, region: Region, layout: _ILayout1, options: SVGCreateOpts): _CreateElementCommand1<_IllustrationElement1>;
341
341
  init(stepData: _Step1<_IllustrationStepData1>, workflowManager: WorkflowManager, reducerState?: _LayoutsState1): Promise<CommandWithFollowup | null>;
342
- availableColors(stepData: _Step1<_IllustrationStepData1>): Promise<{
342
+ availableColors(stepData: _Step1<_IllustrationStepData1>, workflowManager: WorkflowManager): Promise<{
343
343
  fill: string | undefined;
344
344
  stroke: string | undefined;
345
345
  variant: _VariantResource1;
@@ -406,7 +406,7 @@ declare class QuestionStepService implements StepService<_QuestionStepData1> {
406
406
  }
407
407
  export const questionStepService: QuestionStepService;
408
408
  declare class ShapeStepService implements StepService<_ShapeStepData1> {
409
- availableColours(stepData: _Step1<_ShapeStepData1>): Promise<{
409
+ availableColours(stepData: _Step1<_ShapeStepData1>, workflowManager: WorkflowManager): Promise<{
410
410
  fill: string | undefined;
411
411
  stroke: string | undefined;
412
412
  variant: _VariantResource1;
@@ -445,7 +445,7 @@ declare class TextStepService implements StepService<_TextStepData1> {
445
445
  * @param stepData The text step to get colors for.
446
446
  * @returns A list of color objects containg fill, stroke and variant if available.
447
447
  */
448
- availableColors(stepData: _Step1<_TextStepData1>): Promise<ColorOption[]>;
448
+ availableColors(stepData: _Step1<_TextStepData1>, workflowManager: WorkflowManager): Promise<ColorOption[]>;
449
449
  changeFill(stepData: _Step1<_TextStepData1>, newColor: ColorOption, elements: RegionElement[], workflowManager: WorkflowManager): Promise<void>;
450
450
  /**
451
451
  * Given an element and a string, filters any characters from the string that are
@@ -568,6 +568,7 @@ export interface WorkflowManager {
568
568
  getMetadata: (stepName: string) => StepMetadata | undefined;
569
569
  getWorkflowMetadata: () => WorkflowMetadata;
570
570
  getInformationResults(): InformationResult[];
571
+ getServer(): ServerService;
571
572
  getTransaction: () => Transaction;
572
573
  getWorkflow: () => _Workflow1;
573
574
  getWorkflowSelections: () => WorkflowSelections;
@@ -903,7 +904,7 @@ interface ServerResponse {
903
904
  /**
904
905
  * The body of the response containing any return data.
905
906
  */
906
- body: object;
907
+ body: any;
907
908
  headers: {
908
909
  "content-type": string;
909
910
  };
@@ -946,7 +947,7 @@ declare class OptionService {
946
947
  * @param server The server service for making the request.
947
948
  * @param id The option ID to be retrieved.
948
949
  */
949
- getOption(server: ServerService, id: string): Promise<IServerModel<_OptionResource1> | undefined>;
950
+ getOption(server: ServerService, id: string): Promise<undefined | IServerModel<_OptionResource1>>;
950
951
  getAssetTileImageForVariant(variant: _VariantResource1): Promise<string>;
951
952
  getDefaultVariant(option: _OptionResource1): _VariantResource1 | undefined;
952
953
  getDisplayImageSource: (variant?: _VariantResource1) => undefined | string;
@@ -964,7 +965,7 @@ declare class OptionService {
964
965
  * @param step The step to find an option on.
965
966
  * @returns An OptionResource in a promise.
966
967
  */
967
- getOptionFromStep: (step: _Step1<_AnyStepData1>) => Promise<IServerModel<_OptionResource1> | undefined>;
968
+ getOptionFromStep: (step: _Step1<_AnyStepData1>, server: ServerService) => Promise<IServerModel<_OptionResource1> | undefined>;
968
969
  }
969
970
  export const optionService: OptionService;
970
971
  export const CommandContextContext: import("react").Context<_CommandContext1>;
@@ -1437,7 +1438,7 @@ export interface DesignInputStep {
1437
1438
  }
1438
1439
  interface DesignInputStepData {
1439
1440
  }
1440
- export const generateCommands: (designInputSteps: DesignInputStep[], workflow: _Workflow1, layouts: _ILayout1[], productOverlayImageUrl?: string) => Promise<_CanvasCommand1[]>;
1441
+ export const generateCommands: (designInputSteps: DesignInputStep[], workflow: _Workflow1, layouts: _ILayout1[], server: ServerService, productOverlayImageUrl?: string) => Promise<_CanvasCommand1[]>;
1441
1442
  /**
1442
1443
  * Options that can be used during instantiation of the SpiffCommerce Javascript Client.
1443
1444
  * Please refer to the documentation for more information.
@@ -1491,7 +1492,7 @@ export class SpiffCommerceClient {
1491
1492
  * @param previewServiceConstructor A function called during initialization. Takes a class implementing ThreeDPreviewService in return.
1492
1493
  * @returns A workflow experience configured as requested.
1493
1494
  */
1494
- getWorkflowExperience(workflowId?: string, workflowState?: string, previewServiceConstructor?: (workflow: _Workflow1) => any): Promise<WorkflowExperience>;
1495
+ getWorkflowExperience(workflowId?: string, workflowState?: string, previewServiceConstructor?: (workflow: _Workflow1) => any, server?: ServerService): Promise<WorkflowExperience>;
1495
1496
  /**
1496
1497
  * @returns The preview service that was provided during construction.
1497
1498
  */
@@ -1506,6 +1507,7 @@ export class SpiffCommerceClient {
1506
1507
  getTransaction(): Transaction;
1507
1508
  }
1508
1509
  export class MockWorkflowManager implements WorkflowManager {
1510
+ getServer(): ServerService;
1509
1511
  getInitializationPromise(): Promise<void>;
1510
1512
  getProduct: () => Product;
1511
1513
  isInitialized(): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spiffcommerce/core",
3
- "version": "0.10.115",
3
+ "version": "0.10.116",
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",
@@ -9,7 +9,7 @@
9
9
  "scripts": {
10
10
  "build": "parcel build",
11
11
  "dev": "ladle serve",
12
- "test": "jest && tsc --noEmit --isolatedModules --skipLibCheck",
12
+ "test": "tsc --noEmit --isolatedModules --skipLibCheck && jest",
13
13
  "prepare": "yarn run build"
14
14
  },
15
15
  "targets": {