@howells/stow-server 0.3.1 → 0.3.2

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
@@ -688,16 +688,22 @@ declare class StowServer {
688
688
  * Extract color palette from an image file.
689
689
  * Requires a searchable bucket.
690
690
  */
691
- extractColors(key: string): Promise<TaskTriggerResult>;
691
+ extractColors(key: string, options?: {
692
+ bucket?: string;
693
+ }): Promise<TaskTriggerResult>;
692
694
  /**
693
695
  * Extract dimensions (width/height) from an image or video file.
694
696
  */
695
- extractDimensions(key: string): Promise<TaskTriggerResult>;
697
+ extractDimensions(key: string, options?: {
698
+ bucket?: string;
699
+ }): Promise<TaskTriggerResult>;
696
700
  /**
697
701
  * Generate a vector embedding for an image file.
698
702
  * Requires a searchable bucket.
699
703
  */
700
- embed(key: string): Promise<TaskTriggerResult>;
704
+ embed(key: string, options?: {
705
+ bucket?: string;
706
+ }): Promise<TaskTriggerResult>;
701
707
  /**
702
708
  * Replace a file's content by fetching from a new URL.
703
709
  *
package/dist/index.d.ts CHANGED
@@ -688,16 +688,22 @@ declare class StowServer {
688
688
  * Extract color palette from an image file.
689
689
  * Requires a searchable bucket.
690
690
  */
691
- extractColors(key: string): Promise<TaskTriggerResult>;
691
+ extractColors(key: string, options?: {
692
+ bucket?: string;
693
+ }): Promise<TaskTriggerResult>;
692
694
  /**
693
695
  * Extract dimensions (width/height) from an image or video file.
694
696
  */
695
- extractDimensions(key: string): Promise<TaskTriggerResult>;
697
+ extractDimensions(key: string, options?: {
698
+ bucket?: string;
699
+ }): Promise<TaskTriggerResult>;
696
700
  /**
697
701
  * Generate a vector embedding for an image file.
698
702
  * Requires a searchable bucket.
699
703
  */
700
- embed(key: string): Promise<TaskTriggerResult>;
704
+ embed(key: string, options?: {
705
+ bucket?: string;
706
+ }): Promise<TaskTriggerResult>;
701
707
  /**
702
708
  * Replace a file's content by fetching from a new URL.
703
709
  *
package/dist/index.js CHANGED
@@ -672,9 +672,10 @@ var StowServer = class {
672
672
  * Extract color palette from an image file.
673
673
  * Requires a searchable bucket.
674
674
  */
675
- extractColors(key) {
675
+ extractColors(key, options) {
676
+ const path = `/api/files/${encodeURIComponent(key)}/extract-colors`;
676
677
  return this.request(
677
- `/api/files/${encodeURIComponent(key)}/extract-colors`,
678
+ this.withBucket(path, options?.bucket),
678
679
  { method: "POST" },
679
680
  taskTriggerResultSchema
680
681
  );
@@ -682,9 +683,10 @@ var StowServer = class {
682
683
  /**
683
684
  * Extract dimensions (width/height) from an image or video file.
684
685
  */
685
- extractDimensions(key) {
686
+ extractDimensions(key, options) {
687
+ const path = `/api/files/${encodeURIComponent(key)}/extract-dimensions`;
686
688
  return this.request(
687
- `/api/files/${encodeURIComponent(key)}/extract-dimensions`,
689
+ this.withBucket(path, options?.bucket),
688
690
  { method: "POST" },
689
691
  taskTriggerResultSchema
690
692
  );
@@ -693,9 +695,10 @@ var StowServer = class {
693
695
  * Generate a vector embedding for an image file.
694
696
  * Requires a searchable bucket.
695
697
  */
696
- embed(key) {
698
+ embed(key, options) {
699
+ const path = `/api/files/${encodeURIComponent(key)}/embed`;
697
700
  return this.request(
698
- `/api/files/${encodeURIComponent(key)}/embed`,
701
+ this.withBucket(path, options?.bucket),
699
702
  { method: "POST" },
700
703
  taskTriggerResultSchema
701
704
  );
package/dist/index.mjs CHANGED
@@ -647,9 +647,10 @@ var StowServer = class {
647
647
  * Extract color palette from an image file.
648
648
  * Requires a searchable bucket.
649
649
  */
650
- extractColors(key) {
650
+ extractColors(key, options) {
651
+ const path = `/api/files/${encodeURIComponent(key)}/extract-colors`;
651
652
  return this.request(
652
- `/api/files/${encodeURIComponent(key)}/extract-colors`,
653
+ this.withBucket(path, options?.bucket),
653
654
  { method: "POST" },
654
655
  taskTriggerResultSchema
655
656
  );
@@ -657,9 +658,10 @@ var StowServer = class {
657
658
  /**
658
659
  * Extract dimensions (width/height) from an image or video file.
659
660
  */
660
- extractDimensions(key) {
661
+ extractDimensions(key, options) {
662
+ const path = `/api/files/${encodeURIComponent(key)}/extract-dimensions`;
661
663
  return this.request(
662
- `/api/files/${encodeURIComponent(key)}/extract-dimensions`,
664
+ this.withBucket(path, options?.bucket),
663
665
  { method: "POST" },
664
666
  taskTriggerResultSchema
665
667
  );
@@ -668,9 +670,10 @@ var StowServer = class {
668
670
  * Generate a vector embedding for an image file.
669
671
  * Requires a searchable bucket.
670
672
  */
671
- embed(key) {
673
+ embed(key, options) {
674
+ const path = `/api/files/${encodeURIComponent(key)}/embed`;
672
675
  return this.request(
673
- `/api/files/${encodeURIComponent(key)}/embed`,
676
+ this.withBucket(path, options?.bucket),
674
677
  { method: "POST" },
675
678
  taskTriggerResultSchema
676
679
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@howells/stow-server",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Server-side SDK for Stow file storage",
5
5
  "license": "MIT",
6
6
  "repository": {