@spiffcommerce/core 0.10.82 → 0.10.84

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
@@ -1156,6 +1156,33 @@ export const AdvancedEditor: FunctionComponent<{
1156
1156
  onMouseMove?: (event: React.MouseEvent<SVGRectElement, MouseEvent>) => void;
1157
1157
  onElementSelected?: (id: string | undefined, element: PointerEvent) => void;
1158
1158
  }>;
1159
+ export const createDesign: (workflowManager: WorkflowManager, workflow: _Workflow1, layouts: _ILayout1[], getReducerState: () => _CommandState1, product: Product, transaction: Transaction, workflowSelections: WorkflowSelections, designName: string, onProgressUpdate: DesignCreationProgressUpdate, updateVariationRecords: (variationRecords: VariationRecord[]) => Promise<void>, variationRecords: VariationRecord[], createPreviewImage: (shouldRender3D?: boolean) => Promise<string>, workflowMetadata?: WorkflowMetadata) => Promise<DesignCreationMessage>;
1160
+ export interface SavedDesign {
1161
+ /**
1162
+ * The user's name for this saved design.
1163
+ */
1164
+ title: string;
1165
+ /**
1166
+ * A URL pointing to an image of the design.
1167
+ */
1168
+ thumbnail: string;
1169
+ /**
1170
+ * The ID of the transaction relating to this design.
1171
+ */
1172
+ transactionId: string;
1173
+ /**
1174
+ * The product ID for this transaction.
1175
+ */
1176
+ productId: string;
1177
+ /**
1178
+ * The name of the workflow annotated at time of save (may be different from current workflow name).
1179
+ */
1180
+ workflowName: string;
1181
+ /**
1182
+ * The last edit that occured on this saved design.
1183
+ */
1184
+ lastEdited: Date;
1185
+ }
1159
1186
  /**
1160
1187
  * A StepHandle allows for managing the state of a specific step in a workflow. This class
1161
1188
  * abstracts away the complexities of dealing with a step directly and allows for using high level
@@ -1283,7 +1310,6 @@ export class TextStepHandle extends StepHandle<_TextStepData1> {
1283
1310
  hasVaryingSelection(): boolean | undefined;
1284
1311
  getRegions(): import("@spiffcommerce/papyrus").Region[];
1285
1312
  }
1286
- export const createDesign: (workflowManager: WorkflowManager, workflow: _Workflow1, layouts: _ILayout1[], getReducerState: () => _CommandState1, product: Product, transaction: Transaction, workflowSelections: WorkflowSelections, designName: string, onProgressUpdate: DesignCreationProgressUpdate, updateVariationRecords: (variationRecords: VariationRecord[]) => Promise<void>, variationRecords: VariationRecord[], createPreviewImage: (shouldRender3D?: boolean) => Promise<string>, workflowMetadata?: WorkflowMetadata) => Promise<DesignCreationMessage>;
1287
1313
  /**
1288
1314
  * A Workflow experience encapsulates the workflow manager and command context. It
1289
1315
  * provides a simplified interface for interacting with the workflow manager. You
@@ -1335,7 +1361,7 @@ export interface WorkflowExperience {
1335
1361
  * on configuration.
1336
1362
  * @param title The title for the saved design.
1337
1363
  */
1338
- save(title: string): Promise<void>;
1364
+ save(title: string): Promise<SavedDesign>;
1339
1365
  /**
1340
1366
  * Returns a copy of the currently loaded design as a new, seperated workflow experience with
1341
1367
  * a fresh transaction.
@@ -1382,6 +1408,15 @@ interface ClientOptions {
1382
1408
  */
1383
1409
  export class SpiffCommerceClient {
1384
1410
  constructor(options: ClientOptions);
1411
+ /**
1412
+ * @returns A list of designs saved.
1413
+ */
1414
+ getSavedDesigns(): Promise<SavedDesign[]>;
1415
+ /**
1416
+ * Removes a design from storage. This will be a noop if the design isn't already saved.
1417
+ * @param experience The workflow experience to remove from storage.
1418
+ */
1419
+ deleteDesign(experience: WorkflowExperience): Promise<void>;
1385
1420
  /**
1386
1421
  * Initialize the client from an integration product.
1387
1422
  * @param integrationProductId The integration product to use.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spiffcommerce/core",
3
- "version": "0.10.82",
3
+ "version": "0.10.84",
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",