@howells/stow-server 0.2.0 → 0.3.0

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
@@ -272,9 +272,9 @@ interface DeleteProfileSignalsResult {
272
272
  totalSignals: number;
273
273
  vectorUpdated: boolean;
274
274
  }
275
- interface ReprocessResult {
275
+ interface TaskTriggerResult {
276
276
  key: string;
277
- triggered: string[];
277
+ triggered: string;
278
278
  }
279
279
  interface ReplaceResult {
280
280
  contentType: string;
@@ -631,12 +631,19 @@ declare class StowServer {
631
631
  bucket?: string;
632
632
  }): Promise<FileResult>;
633
633
  /**
634
- * Reprocess a file: reset all derived data (embeddings, colors, dimensions,
635
- * AI metadata, taxonomies) and re-trigger processing tasks.
634
+ * Extract color palette from an image file.
635
+ * Requires a searchable bucket.
636
636
  */
637
- reprocessFile(key: string, options?: {
638
- bucket?: string;
639
- }): Promise<ReprocessResult>;
637
+ extractColors(key: string): Promise<TaskTriggerResult>;
638
+ /**
639
+ * Extract dimensions (width/height) from an image or video file.
640
+ */
641
+ extractDimensions(key: string): Promise<TaskTriggerResult>;
642
+ /**
643
+ * Generate a vector embedding for an image file.
644
+ * Requires a searchable bucket.
645
+ */
646
+ embed(key: string): Promise<TaskTriggerResult>;
640
647
  /**
641
648
  * Replace a file's content by fetching from a new URL.
642
649
  *
@@ -768,4 +775,4 @@ declare class StowServer {
768
775
  private renameProfileCluster;
769
776
  }
770
777
 
771
- export { type BucketResult, type ColorSearchRequest, type ColorSearchResult, type ColorSearchResultItem, type ConfirmUploadRequest, type CreateBucketRequest, type DeleteProfileSignalsResult, type DiverseSearchRequest, type Drop, type DropResult, type FileColor, type FileColorProfile, type FileResult, type FilteredMetadata, type ListBucketsResult, type ListDropsResult, type ListFilesItem, type ListFilesResult, type PresignDedupeResult, type PresignNewResult, type PresignRequest, type PresignResult, type ProfileClusterResult, type ProfileCreateRequest, type ProfileFilesResult, type ProfileResult, type ProfileSignalInput, type ProfileSignalResult, type ProfileSignalType, type ProfileSignalsResponse, type ReclusterRequest, type ReclusterResult, type RenameClusterRequest, type ReplaceResult, type ReprocessResult, type SearchFilters, type SearchIncludeField, type SearchResultItem, type SimilarSearchRequest, type SimilarSearchResult, StowError, StowServer, type StowServerConfig, type TextSearchRequest, type TransformOptions, type UpdateBucketRequest, type UploadResult, type WhoamiResult };
778
+ export { type BucketResult, type ColorSearchRequest, type ColorSearchResult, type ColorSearchResultItem, type ConfirmUploadRequest, type CreateBucketRequest, type DeleteProfileSignalsResult, type DiverseSearchRequest, type Drop, type DropResult, type FileColor, type FileColorProfile, type FileResult, type FilteredMetadata, type ListBucketsResult, type ListDropsResult, type ListFilesItem, type ListFilesResult, type PresignDedupeResult, type PresignNewResult, type PresignRequest, type PresignResult, type ProfileClusterResult, type ProfileCreateRequest, type ProfileFilesResult, type ProfileResult, type ProfileSignalInput, type ProfileSignalResult, type ProfileSignalType, type ProfileSignalsResponse, type ReclusterRequest, type ReclusterResult, type RenameClusterRequest, type ReplaceResult, type SearchFilters, type SearchIncludeField, type SearchResultItem, type SimilarSearchRequest, type SimilarSearchResult, StowError, StowServer, type StowServerConfig, type TaskTriggerResult, type TextSearchRequest, type TransformOptions, type UpdateBucketRequest, type UploadResult, type WhoamiResult };
package/dist/index.d.ts CHANGED
@@ -272,9 +272,9 @@ interface DeleteProfileSignalsResult {
272
272
  totalSignals: number;
273
273
  vectorUpdated: boolean;
274
274
  }
275
- interface ReprocessResult {
275
+ interface TaskTriggerResult {
276
276
  key: string;
277
- triggered: string[];
277
+ triggered: string;
278
278
  }
279
279
  interface ReplaceResult {
280
280
  contentType: string;
@@ -631,12 +631,19 @@ declare class StowServer {
631
631
  bucket?: string;
632
632
  }): Promise<FileResult>;
633
633
  /**
634
- * Reprocess a file: reset all derived data (embeddings, colors, dimensions,
635
- * AI metadata, taxonomies) and re-trigger processing tasks.
634
+ * Extract color palette from an image file.
635
+ * Requires a searchable bucket.
636
636
  */
637
- reprocessFile(key: string, options?: {
638
- bucket?: string;
639
- }): Promise<ReprocessResult>;
637
+ extractColors(key: string): Promise<TaskTriggerResult>;
638
+ /**
639
+ * Extract dimensions (width/height) from an image or video file.
640
+ */
641
+ extractDimensions(key: string): Promise<TaskTriggerResult>;
642
+ /**
643
+ * Generate a vector embedding for an image file.
644
+ * Requires a searchable bucket.
645
+ */
646
+ embed(key: string): Promise<TaskTriggerResult>;
640
647
  /**
641
648
  * Replace a file's content by fetching from a new URL.
642
649
  *
@@ -768,4 +775,4 @@ declare class StowServer {
768
775
  private renameProfileCluster;
769
776
  }
770
777
 
771
- export { type BucketResult, type ColorSearchRequest, type ColorSearchResult, type ColorSearchResultItem, type ConfirmUploadRequest, type CreateBucketRequest, type DeleteProfileSignalsResult, type DiverseSearchRequest, type Drop, type DropResult, type FileColor, type FileColorProfile, type FileResult, type FilteredMetadata, type ListBucketsResult, type ListDropsResult, type ListFilesItem, type ListFilesResult, type PresignDedupeResult, type PresignNewResult, type PresignRequest, type PresignResult, type ProfileClusterResult, type ProfileCreateRequest, type ProfileFilesResult, type ProfileResult, type ProfileSignalInput, type ProfileSignalResult, type ProfileSignalType, type ProfileSignalsResponse, type ReclusterRequest, type ReclusterResult, type RenameClusterRequest, type ReplaceResult, type ReprocessResult, type SearchFilters, type SearchIncludeField, type SearchResultItem, type SimilarSearchRequest, type SimilarSearchResult, StowError, StowServer, type StowServerConfig, type TextSearchRequest, type TransformOptions, type UpdateBucketRequest, type UploadResult, type WhoamiResult };
778
+ export { type BucketResult, type ColorSearchRequest, type ColorSearchResult, type ColorSearchResultItem, type ConfirmUploadRequest, type CreateBucketRequest, type DeleteProfileSignalsResult, type DiverseSearchRequest, type Drop, type DropResult, type FileColor, type FileColorProfile, type FileResult, type FilteredMetadata, type ListBucketsResult, type ListDropsResult, type ListFilesItem, type ListFilesResult, type PresignDedupeResult, type PresignNewResult, type PresignRequest, type PresignResult, type ProfileClusterResult, type ProfileCreateRequest, type ProfileFilesResult, type ProfileResult, type ProfileSignalInput, type ProfileSignalResult, type ProfileSignalType, type ProfileSignalsResponse, type ReclusterRequest, type ReclusterResult, type RenameClusterRequest, type ReplaceResult, type SearchFilters, type SearchIncludeField, type SearchResultItem, type SimilarSearchRequest, type SimilarSearchResult, StowError, StowServer, type StowServerConfig, type TaskTriggerResult, type TextSearchRequest, type TransformOptions, type UpdateBucketRequest, type UploadResult, type WhoamiResult };
package/dist/index.js CHANGED
@@ -122,9 +122,9 @@ var listFilesSchema = import_zod.z.object({
122
122
  ),
123
123
  nextCursor: import_zod.z.string().nullable()
124
124
  });
125
- var reprocessResultSchema = import_zod.z.object({
125
+ var taskTriggerResultSchema = import_zod.z.object({
126
126
  key: import_zod.z.string(),
127
- triggered: import_zod.z.array(import_zod.z.string())
127
+ triggered: import_zod.z.string()
128
128
  });
129
129
  var replaceResultSchema = import_zod.z.object({
130
130
  key: import_zod.z.string(),
@@ -662,15 +662,35 @@ var StowServer = class {
662
662
  );
663
663
  }
664
664
  /**
665
- * Reprocess a file: reset all derived data (embeddings, colors, dimensions,
666
- * AI metadata, taxonomies) and re-trigger processing tasks.
665
+ * Extract color palette from an image file.
666
+ * Requires a searchable bucket.
667
667
  */
668
- reprocessFile(key, options) {
669
- const path = `/api/files/${encodeURIComponent(key)}/reprocess`;
668
+ extractColors(key) {
670
669
  return this.request(
671
- this.withBucket(path, options?.bucket),
670
+ `/api/files/${encodeURIComponent(key)}/extract-colors`,
671
+ { method: "POST" },
672
+ taskTriggerResultSchema
673
+ );
674
+ }
675
+ /**
676
+ * Extract dimensions (width/height) from an image or video file.
677
+ */
678
+ extractDimensions(key) {
679
+ return this.request(
680
+ `/api/files/${encodeURIComponent(key)}/extract-dimensions`,
681
+ { method: "POST" },
682
+ taskTriggerResultSchema
683
+ );
684
+ }
685
+ /**
686
+ * Generate a vector embedding for an image file.
687
+ * Requires a searchable bucket.
688
+ */
689
+ embed(key) {
690
+ return this.request(
691
+ `/api/files/${encodeURIComponent(key)}/embed`,
672
692
  { method: "POST" },
673
- reprocessResultSchema
693
+ taskTriggerResultSchema
674
694
  );
675
695
  }
676
696
  /**
package/dist/index.mjs CHANGED
@@ -97,9 +97,9 @@ var listFilesSchema = z.object({
97
97
  ),
98
98
  nextCursor: z.string().nullable()
99
99
  });
100
- var reprocessResultSchema = z.object({
100
+ var taskTriggerResultSchema = z.object({
101
101
  key: z.string(),
102
- triggered: z.array(z.string())
102
+ triggered: z.string()
103
103
  });
104
104
  var replaceResultSchema = z.object({
105
105
  key: z.string(),
@@ -637,15 +637,35 @@ var StowServer = class {
637
637
  );
638
638
  }
639
639
  /**
640
- * Reprocess a file: reset all derived data (embeddings, colors, dimensions,
641
- * AI metadata, taxonomies) and re-trigger processing tasks.
640
+ * Extract color palette from an image file.
641
+ * Requires a searchable bucket.
642
642
  */
643
- reprocessFile(key, options) {
644
- const path = `/api/files/${encodeURIComponent(key)}/reprocess`;
643
+ extractColors(key) {
645
644
  return this.request(
646
- this.withBucket(path, options?.bucket),
645
+ `/api/files/${encodeURIComponent(key)}/extract-colors`,
646
+ { method: "POST" },
647
+ taskTriggerResultSchema
648
+ );
649
+ }
650
+ /**
651
+ * Extract dimensions (width/height) from an image or video file.
652
+ */
653
+ extractDimensions(key) {
654
+ return this.request(
655
+ `/api/files/${encodeURIComponent(key)}/extract-dimensions`,
656
+ { method: "POST" },
657
+ taskTriggerResultSchema
658
+ );
659
+ }
660
+ /**
661
+ * Generate a vector embedding for an image file.
662
+ * Requires a searchable bucket.
663
+ */
664
+ embed(key) {
665
+ return this.request(
666
+ `/api/files/${encodeURIComponent(key)}/embed`,
647
667
  { method: "POST" },
648
- reprocessResultSchema
668
+ taskTriggerResultSchema
649
669
  );
650
670
  }
651
671
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@howells/stow-server",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Server-side SDK for Stow file storage",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -29,21 +29,21 @@
29
29
  "files": [
30
30
  "dist"
31
31
  ],
32
+ "scripts": {
33
+ "build": "tsup src/index.ts --format cjs,esm --dts",
34
+ "dev": "tsup src/index.ts --format cjs,esm --dts --watch",
35
+ "test": "vitest run",
36
+ "test:watch": "vitest"
37
+ },
32
38
  "peerDependencies": {
33
39
  "zod": "^3.0.0 || ^4.0.0"
34
40
  },
35
41
  "devDependencies": {
42
+ "@stow/typescript-config": "workspace:*",
36
43
  "@types/node": "^25.3.0",
37
44
  "tsup": "^8.5.1",
38
45
  "typescript": "^5.9.3",
39
46
  "vitest": "^4.0.18",
40
- "zod": "^4.3.6",
41
- "@stow/typescript-config": "0.0.0"
42
- },
43
- "scripts": {
44
- "build": "tsup src/index.ts --format cjs,esm --dts",
45
- "dev": "tsup src/index.ts --format cjs,esm --dts --watch",
46
- "test": "vitest run",
47
- "test:watch": "vitest"
47
+ "zod": "^4.3.6"
48
48
  }
49
- }
49
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Stow
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.