@spiffcommerce/core 0.10.91 → 0.10.93

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
@@ -268,7 +268,17 @@ interface StorageService {
268
268
  setMap<K = any, V = any>(key: string, val: Map<K, V>): void;
269
269
  }
270
270
  export const persistenceService: StorageService;
271
- declare class AssetService {
271
+ /**
272
+ * An asset manager provides a way to create and
273
+ * manage assets on the Spiff Commerce Platform.
274
+ */
275
+ interface AssetManager {
276
+ /**
277
+ * Uploads a file to the Spiff Commerce Platform.
278
+ */
279
+ uploadFile: (file: File, onProgress: (val: number) => void) => Promise<IServerModel<_Asset1>>;
280
+ }
281
+ declare class AssetService implements AssetManager {
272
282
  constructor();
273
283
  /**
274
284
  * Allows for retrieving an asset, returns the option from a cache if possible.
@@ -286,7 +296,8 @@ declare class AssetService {
286
296
  * Upload a user asset to the server. Using callbacks to notify important events.
287
297
  * The asset will be stored via the persistence service for future access, if available.
288
298
  */
289
- uploadAssetWithProgress(file: FileInfo, assetType: _AssetType1, onProgress: (val: number) => void, onComplete: (asset: IServerModel<_Asset1>) => void, anonymous?: boolean, partnerId?: string): Promise<IServerModel<_Asset1>>;
299
+ uploadAssetWithProgress(file: FileInfo, assetType: _AssetType1, onProgress: (val: number) => void, anonymous?: boolean, partnerId?: string): Promise<IServerModel<_Asset1>>;
300
+ uploadFile(file: File, onProgress: (val: number) => void): Promise<IServerModel<_Asset1>>;
290
301
  removePersistedAsset(assetKey: string): void;
291
302
  getPersistedAssets(): PersistedAsset[];
292
303
  /**
@@ -1264,6 +1275,18 @@ export class IllustrationStepHandle extends StepHandle<_IllustrationStepData1> {
1264
1275
  * Set color for the illustration.
1265
1276
  */
1266
1277
  setColor(key: string, value: string): Promise<void>;
1278
+ getColorOption(): Promise<import("@spiffcommerce/papyrus").IServerModel<import("@spiffcommerce/papyrus").OptionResource> | undefined>;
1279
+ getAvailableColors(): Promise<{
1280
+ fill: string | undefined;
1281
+ stroke: string | undefined;
1282
+ variant: _VariantResource1;
1283
+ }[] | {
1284
+ fill: string;
1285
+ stroke: string;
1286
+ }[]>;
1287
+ hasVaryingSelection(): boolean | undefined;
1288
+ hasVaryingColors(): boolean | undefined;
1289
+ isColorPickerEnabled(): boolean;
1267
1290
  }
1268
1291
  export class PictureStepHandle extends StepHandle<_PictureStepData1> {
1269
1292
  constructor(manager: WorkflowManager, step: _Step1<_PictureStepData1>);
@@ -1424,6 +1447,11 @@ interface ClientOptions {
1424
1447
  */
1425
1448
  export class SpiffCommerceClient {
1426
1449
  constructor(options: ClientOptions);
1450
+ /**
1451
+ * @returns The asset manager allows for common operations related to assets
1452
+ * and the Spiff Commerce platform.
1453
+ */
1454
+ getAssetManager(): AssetManager;
1427
1455
  /**
1428
1456
  * @returns A list of designs saved.
1429
1457
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spiffcommerce/core",
3
- "version": "0.10.91",
3
+ "version": "0.10.93",
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",