@spiffcommerce/core 0.10.150 → 0.10.151

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
@@ -1177,42 +1177,6 @@ export const AdvancedEditor: FunctionComponent<{
1177
1177
  onElementSelected?: (id: string | undefined, element: PointerEvent) => void;
1178
1178
  onDragEnd?: () => void;
1179
1179
  }>;
1180
- 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>;
1181
- export interface SavedDesign {
1182
- /**
1183
- * The user's name for this saved design.
1184
- */
1185
- title: string;
1186
- /**
1187
- * A URL pointing to an image of the design. Typically a data URL
1188
- */
1189
- thumbnail?: string;
1190
- /**
1191
- * The ID of the transaction relating to this design.
1192
- */
1193
- transactionId: string;
1194
- /**
1195
- * The product ID for this transaction.
1196
- */
1197
- productId: string;
1198
- /**
1199
- * The integration product ID related to this order.
1200
- */
1201
- integrationProductId: string;
1202
- /**
1203
- * The name of the workflow annotated at time of save (may be different from current workflow name).
1204
- */
1205
- workflowName: string;
1206
- /**
1207
- * The ID of the workflow annotated at time of save.
1208
- */
1209
- workflowId: string;
1210
- /**
1211
- * The last edit that occured on this saved design.
1212
- */
1213
- lastEdited: Date;
1214
- }
1215
- export default designService;
1216
1180
  /**
1217
1181
  * A StepHandle allows for managing the state of a specific step in a workflow. This class
1218
1182
  * abstracts away the complexities of dealing with a step directly and allows for using high level
@@ -1389,6 +1353,76 @@ export class TextStepHandle extends StepHandle<_TextStepData1> {
1389
1353
  hasVaryingSelection(): boolean | undefined;
1390
1354
  getRegions(): import("@spiffcommerce/papyrus").Region[];
1391
1355
  }
1356
+ 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>;
1357
+ export interface SavedDesign {
1358
+ /**
1359
+ * The user's name for this saved design.
1360
+ */
1361
+ title: string;
1362
+ /**
1363
+ * A URL pointing to an image of the design. Typically a data URL
1364
+ */
1365
+ thumbnail?: string;
1366
+ /**
1367
+ * The ID of the transaction relating to this design.
1368
+ */
1369
+ transactionId: string;
1370
+ /**
1371
+ * The product ID for this transaction.
1372
+ */
1373
+ productId: string;
1374
+ /**
1375
+ * The integration product ID related to this order.
1376
+ */
1377
+ integrationProductId: string;
1378
+ /**
1379
+ * The name of the workflow annotated at time of save (may be different from current workflow name).
1380
+ */
1381
+ workflowName: string;
1382
+ /**
1383
+ * The ID of the workflow annotated at time of save.
1384
+ */
1385
+ workflowId: string;
1386
+ /**
1387
+ * The last edit that occured on this saved design.
1388
+ */
1389
+ lastEdited: Date;
1390
+ }
1391
+ /**
1392
+ * The design service exposes helper functionality wrapping important design management operations.
1393
+ * NOTE: In the future this interface should allow for storing/pulling designs from the server.
1394
+ */
1395
+ declare class DesignService {
1396
+ /**
1397
+ * @param func The function to call when a design is saved.
1398
+ */
1399
+ attachSaveListener(func: (design: SavedDesign) => void): void;
1400
+ /**
1401
+ * @param func The function to remove from the list of listeners.
1402
+ */
1403
+ detachSaveListener(func: (design: SavedDesign) => void): void;
1404
+ /**
1405
+ * Gets the currently persisted designs.
1406
+ */
1407
+ getSavedDesigns(): Promise<SavedDesign[]>;
1408
+ /**
1409
+ * Search for a transaction that has been saved.
1410
+ * @param transactionId The id to search for.
1411
+ * @returns The transaction for the given id provided it has been saved. undefined if it doesn't exist.
1412
+ */
1413
+ getSavedDesignByTransaction(transactionId: string): Promise<SavedDesign | undefined>;
1414
+ /**
1415
+ * Saves a design to storage.
1416
+ * @param design The design to save.
1417
+ */
1418
+ addDesign(design: SavedDesign): Promise<void>;
1419
+ /**
1420
+ * Removes a given design from storage.
1421
+ * @param transactionId
1422
+ */
1423
+ removeDesign(transactionId: string): Promise<void>;
1424
+ }
1425
+ export const designService: DesignService;
1392
1426
  /**
1393
1427
  * A Workflow experience encapsulates the workflow manager and command context. It
1394
1428
  * provides a simplified interface for interacting with the workflow manager. You
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spiffcommerce/core",
3
- "version": "0.10.150",
3
+ "version": "0.10.151",
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",