@scalemule/sdk 0.0.34 → 0.0.36

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.mts CHANGED
@@ -4152,7 +4152,7 @@ interface TransformOptions {
4152
4152
  * Pre-generated square crop sizes (px).
4153
4153
  * URLs built with these sizes + fit=cover get instant cache hits (no server-side transform).
4154
4154
  */
4155
- declare const PHOTO_BREAKPOINTS: readonly [150, 320, 640, 1080];
4155
+ declare const PHOTO_BREAKPOINTS: readonly [36, 150, 320, 640, 1080];
4156
4156
  declare class PhotoService extends ServiceModule {
4157
4157
  protected basePath: string;
4158
4158
  upload(file: File | Blob, uploadOptions?: {
@@ -4191,11 +4191,19 @@ declare class PhotoService extends ServiceModule {
4191
4191
  *
4192
4192
  * // Profile avatar at 48px -> snaps to 150px
4193
4193
  * const url = sm.photo.getOptimalUrl(photoId, 48)
4194
+ *
4195
+ * // Tiny avatar at 36px -> exact cache hit on 36px micro-thumbnail
4196
+ * const url = sm.photo.getOptimalUrl(photoId, 36)
4194
4197
  * ```
4195
4198
  */
4196
4199
  getOptimalUrl(photoId: string, displayWidth: number, options?: {
4197
4200
  dpr?: number;
4198
4201
  }): string;
4202
+ /**
4203
+ * Get the 36px avatar micro-thumbnail URL for a photo.
4204
+ * Hits the pre-generated 36x36 bicubic-resized cached variant.
4205
+ */
4206
+ getAvatarThumbnailUrl(photoId: string): string;
4199
4207
  /**
4200
4208
  * Generate an HTML srcset string for responsive square photo display.
4201
4209
  *
package/dist/index.d.ts CHANGED
@@ -4152,7 +4152,7 @@ interface TransformOptions {
4152
4152
  * Pre-generated square crop sizes (px).
4153
4153
  * URLs built with these sizes + fit=cover get instant cache hits (no server-side transform).
4154
4154
  */
4155
- declare const PHOTO_BREAKPOINTS: readonly [150, 320, 640, 1080];
4155
+ declare const PHOTO_BREAKPOINTS: readonly [36, 150, 320, 640, 1080];
4156
4156
  declare class PhotoService extends ServiceModule {
4157
4157
  protected basePath: string;
4158
4158
  upload(file: File | Blob, uploadOptions?: {
@@ -4191,11 +4191,19 @@ declare class PhotoService extends ServiceModule {
4191
4191
  *
4192
4192
  * // Profile avatar at 48px -> snaps to 150px
4193
4193
  * const url = sm.photo.getOptimalUrl(photoId, 48)
4194
+ *
4195
+ * // Tiny avatar at 36px -> exact cache hit on 36px micro-thumbnail
4196
+ * const url = sm.photo.getOptimalUrl(photoId, 36)
4194
4197
  * ```
4195
4198
  */
4196
4199
  getOptimalUrl(photoId: string, displayWidth: number, options?: {
4197
4200
  dpr?: number;
4198
4201
  }): string;
4202
+ /**
4203
+ * Get the 36px avatar micro-thumbnail URL for a photo.
4204
+ * Hits the pre-generated 36x36 bicubic-resized cached variant.
4205
+ */
4206
+ getAvatarThumbnailUrl(photoId: string): string;
4199
4207
  /**
4200
4208
  * Generate an HTML srcset string for responsive square photo display.
4201
4209
  *
package/dist/index.js CHANGED
@@ -5963,7 +5963,7 @@ var SearchService = class extends ServiceModule {
5963
5963
  };
5964
5964
 
5965
5965
  // src/services/photo.ts
5966
- var PHOTO_BREAKPOINTS = [150, 320, 640, 1080];
5966
+ var PHOTO_BREAKPOINTS = [36, 150, 320, 640, 1080];
5967
5967
  var PhotoService = class extends ServiceModule {
5968
5968
  constructor() {
5969
5969
  super(...arguments);
@@ -6022,6 +6022,9 @@ var PhotoService = class extends ServiceModule {
6022
6022
  *
6023
6023
  * // Profile avatar at 48px -> snaps to 150px
6024
6024
  * const url = sm.photo.getOptimalUrl(photoId, 48)
6025
+ *
6026
+ * // Tiny avatar at 36px -> exact cache hit on 36px micro-thumbnail
6027
+ * const url = sm.photo.getOptimalUrl(photoId, 36)
6025
6028
  * ```
6026
6029
  */
6027
6030
  getOptimalUrl(photoId, displayWidth, options) {
@@ -6032,6 +6035,13 @@ var PhotoService = class extends ServiceModule {
6032
6035
  const size = PHOTO_BREAKPOINTS.find((bp) => bp >= physicalWidth) ?? PHOTO_BREAKPOINTS[PHOTO_BREAKPOINTS.length - 1];
6033
6036
  return this.getTransformUrl(photoId, { width: size, height: size, fit: "cover" });
6034
6037
  }
6038
+ /**
6039
+ * Get the 36px avatar micro-thumbnail URL for a photo.
6040
+ * Hits the pre-generated 36x36 bicubic-resized cached variant.
6041
+ */
6042
+ getAvatarThumbnailUrl(photoId) {
6043
+ return this.getOptimalUrl(photoId, 36);
6044
+ }
6035
6045
  /**
6036
6046
  * Generate an HTML srcset string for responsive square photo display.
6037
6047
  *
package/dist/index.mjs CHANGED
@@ -5591,7 +5591,7 @@ var SearchService = class extends ServiceModule {
5591
5591
  };
5592
5592
 
5593
5593
  // src/services/photo.ts
5594
- var PHOTO_BREAKPOINTS = [150, 320, 640, 1080];
5594
+ var PHOTO_BREAKPOINTS = [36, 150, 320, 640, 1080];
5595
5595
  var PhotoService = class extends ServiceModule {
5596
5596
  constructor() {
5597
5597
  super(...arguments);
@@ -5650,6 +5650,9 @@ var PhotoService = class extends ServiceModule {
5650
5650
  *
5651
5651
  * // Profile avatar at 48px -> snaps to 150px
5652
5652
  * const url = sm.photo.getOptimalUrl(photoId, 48)
5653
+ *
5654
+ * // Tiny avatar at 36px -> exact cache hit on 36px micro-thumbnail
5655
+ * const url = sm.photo.getOptimalUrl(photoId, 36)
5653
5656
  * ```
5654
5657
  */
5655
5658
  getOptimalUrl(photoId, displayWidth, options) {
@@ -5660,6 +5663,13 @@ var PhotoService = class extends ServiceModule {
5660
5663
  const size = PHOTO_BREAKPOINTS.find((bp) => bp >= physicalWidth) ?? PHOTO_BREAKPOINTS[PHOTO_BREAKPOINTS.length - 1];
5661
5664
  return this.getTransformUrl(photoId, { width: size, height: size, fit: "cover" });
5662
5665
  }
5666
+ /**
5667
+ * Get the 36px avatar micro-thumbnail URL for a photo.
5668
+ * Hits the pre-generated 36x36 bicubic-resized cached variant.
5669
+ */
5670
+ getAvatarThumbnailUrl(photoId) {
5671
+ return this.getOptimalUrl(photoId, 36);
5672
+ }
5663
5673
  /**
5664
5674
  * Generate an HTML srcset string for responsive square photo display.
5665
5675
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalemule/sdk",
3
- "version": "0.0.34",
3
+ "version": "0.0.36",
4
4
  "description": "Official TypeScript/JavaScript SDK for ScaleMule Backend-as-a-Service",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",