stow-cli 2.1.0 → 2.2.1

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.
Files changed (49) hide show
  1. package/dist/app-Q6EW7VSM.js +249 -0
  2. package/dist/backfill-EVZT7RH6.js +67 -0
  3. package/dist/backfill-JCNPLFJU.js +67 -0
  4. package/dist/backfill-VAORMLMY.js +67 -0
  5. package/dist/buckets-AFNX7FV3.js +137 -0
  6. package/dist/buckets-VYI2QVLO.js +137 -0
  7. package/dist/buckets-ZHP3LBLC.js +137 -0
  8. package/dist/chunk-3BLL5SQJ.js +27 -0
  9. package/dist/chunk-5BVMPHKH.js +147 -0
  10. package/dist/chunk-5IX3ASXH.js +153 -0
  11. package/dist/chunk-FZGOTXTE.js +45 -0
  12. package/dist/chunk-P2BKGBQE.js +136 -0
  13. package/dist/chunk-PLZFHPLC.js +52 -0
  14. package/dist/cli.js +80 -53
  15. package/dist/delete-YEXSMG4I.js +34 -0
  16. package/dist/describe-CU5FBHZS.js +79 -0
  17. package/dist/describe-HSEHMJVD.js +79 -0
  18. package/dist/describe-J4ZMUXK7.js +79 -0
  19. package/dist/drops-5VIEW3XZ.js +39 -0
  20. package/dist/files-CFOTEASC.js +206 -0
  21. package/dist/files-UQODXWNT.js +206 -0
  22. package/dist/files-XU6MDPP4.js +206 -0
  23. package/dist/health-RICGWQGN.js +61 -0
  24. package/dist/health-SH6T6DZS.js +61 -0
  25. package/dist/health-YLNNKAFP.js +61 -0
  26. package/dist/jobs-PTV2W5PJ.js +102 -0
  27. package/dist/jobs-RMRGXLAA.js +90 -0
  28. package/dist/jobs-ROJFRPMR.js +90 -0
  29. package/dist/jobs-TND5AHCL.js +102 -0
  30. package/dist/jobs-TOLVGN6K.js +102 -0
  31. package/dist/jobs-ZWSEXNFA.js +90 -0
  32. package/dist/maintenance-6XNJ56LL.js +79 -0
  33. package/dist/maintenance-V2TXPXQE.js +79 -0
  34. package/dist/maintenance-ZJW2ES4L.js +79 -0
  35. package/dist/profiles-CHBGKQOE.js +53 -0
  36. package/dist/profiles-MB3TZQE4.js +53 -0
  37. package/dist/profiles-NVCJCYXR.js +53 -0
  38. package/dist/queues-AUGTAFBT.js +61 -0
  39. package/dist/queues-EZ2VZGXQ.js +61 -0
  40. package/dist/queues-NR25TGT7.js +61 -0
  41. package/dist/search-ETC2EXKM.js +135 -0
  42. package/dist/search-ICJO264J.js +135 -0
  43. package/dist/search-TRTPX2SQ.js +135 -0
  44. package/dist/tags-75SSHS26.js +90 -0
  45. package/dist/tags-TBFPDHIQ.js +90 -0
  46. package/dist/tags-VH44BGQL.js +90 -0
  47. package/dist/upload-OS6Q6LW5.js +126 -0
  48. package/dist/whoami-TVRKBM74.js +28 -0
  49. package/package.json +1 -1
@@ -0,0 +1,53 @@
1
+ import {
2
+ output
3
+ } from "./chunk-P2BKGBQE.js";
4
+ import {
5
+ formatTable
6
+ } from "./chunk-FZGOTXTE.js";
7
+ import {
8
+ createStow
9
+ } from "./chunk-5LU25QZK.js";
10
+ import "./chunk-TOADDO2F.js";
11
+
12
+ // src/commands/profiles.ts
13
+ async function createProfile(options) {
14
+ const stow = createStow();
15
+ const profile = await stow.profiles.create({
16
+ name: options.name,
17
+ ...options.bucket ? { bucketId: options.bucket } : {}
18
+ });
19
+ output(profile, () => `Created profile: ${profile.name} (${profile.id})`, {
20
+ json: options.json
21
+ });
22
+ }
23
+ async function getProfile(id, options) {
24
+ const stow = createStow();
25
+ const profile = await stow.profiles.get(id);
26
+ output(
27
+ profile,
28
+ () => {
29
+ const lines = [`Profile: ${profile.name} (${profile.id})`];
30
+ if (profile.clusters && profile.clusters.length > 0) {
31
+ lines.push("\nClusters:");
32
+ const rows = profile.clusters.map((c) => [
33
+ String(c.index),
34
+ c.name ?? "(unnamed)",
35
+ String(c.signalCount)
36
+ ]);
37
+ lines.push(formatTable(["Index", "Name", "Signals"], rows));
38
+ }
39
+ return lines.join("\n");
40
+ },
41
+ { json: options.json }
42
+ );
43
+ }
44
+ async function deleteProfile(id) {
45
+ const stow = createStow();
46
+ await stow.profiles.delete(id);
47
+ console.log(`Deleted profile: ${id}`);
48
+ }
49
+ export {
50
+ createProfile,
51
+ deleteProfile,
52
+ getProfile
53
+ };
@@ -0,0 +1,53 @@
1
+ import {
2
+ output
3
+ } from "./chunk-5IX3ASXH.js";
4
+ import {
5
+ formatTable
6
+ } from "./chunk-FZGOTXTE.js";
7
+ import {
8
+ createStow
9
+ } from "./chunk-5LU25QZK.js";
10
+ import "./chunk-TOADDO2F.js";
11
+
12
+ // src/commands/profiles.ts
13
+ async function createProfile(options) {
14
+ const stow = createStow();
15
+ const profile = await stow.profiles.create({
16
+ name: options.name,
17
+ ...options.bucket ? { bucketId: options.bucket } : {}
18
+ });
19
+ output(profile, () => `Created profile: ${profile.name} (${profile.id})`, {
20
+ json: options.json
21
+ });
22
+ }
23
+ async function getProfile(id, options) {
24
+ const stow = createStow();
25
+ const profile = await stow.profiles.get(id);
26
+ output(
27
+ profile,
28
+ () => {
29
+ const lines = [`Profile: ${profile.name} (${profile.id})`];
30
+ if (profile.clusters && profile.clusters.length > 0) {
31
+ lines.push("\nClusters:");
32
+ const rows = profile.clusters.map((c) => [
33
+ String(c.index),
34
+ c.name ?? "(unnamed)",
35
+ String(c.signalCount)
36
+ ]);
37
+ lines.push(formatTable(["Index", "Name", "Signals"], rows));
38
+ }
39
+ return lines.join("\n");
40
+ },
41
+ { json: options.json }
42
+ );
43
+ }
44
+ async function deleteProfile(id) {
45
+ const stow = createStow();
46
+ await stow.profiles.delete(id);
47
+ console.log(`Deleted profile: ${id}`);
48
+ }
49
+ export {
50
+ createProfile,
51
+ deleteProfile,
52
+ getProfile
53
+ };
@@ -0,0 +1,53 @@
1
+ import {
2
+ output
3
+ } from "./chunk-5BVMPHKH.js";
4
+ import {
5
+ formatTable
6
+ } from "./chunk-FZGOTXTE.js";
7
+ import {
8
+ createStow
9
+ } from "./chunk-5LU25QZK.js";
10
+ import "./chunk-TOADDO2F.js";
11
+
12
+ // src/commands/profiles.ts
13
+ async function createProfile(options) {
14
+ const stow = createStow();
15
+ const profile = await stow.profiles.create({
16
+ name: options.name,
17
+ ...options.bucket ? { bucketId: options.bucket } : {}
18
+ });
19
+ output(profile, () => `Created profile: ${profile.name} (${profile.id})`, {
20
+ json: options.json
21
+ });
22
+ }
23
+ async function getProfile(id, options) {
24
+ const stow = createStow();
25
+ const profile = await stow.profiles.get(id);
26
+ output(
27
+ profile,
28
+ () => {
29
+ const lines = [`Profile: ${profile.name} (${profile.id})`];
30
+ if (profile.clusters && profile.clusters.length > 0) {
31
+ lines.push("\nClusters:");
32
+ const rows = profile.clusters.map((c) => [
33
+ String(c.index),
34
+ c.name ?? "(unnamed)",
35
+ String(c.signalCount)
36
+ ]);
37
+ lines.push(formatTable(["Index", "Name", "Signals"], rows));
38
+ }
39
+ return lines.join("\n");
40
+ },
41
+ { json: options.json }
42
+ );
43
+ }
44
+ async function deleteProfile(id) {
45
+ const stow = createStow();
46
+ await stow.profiles.delete(id);
47
+ console.log(`Deleted profile: ${id}`);
48
+ }
49
+ export {
50
+ createProfile,
51
+ deleteProfile,
52
+ getProfile
53
+ };
@@ -0,0 +1,61 @@
1
+ import {
2
+ adminRequest
3
+ } from "./chunk-QF7PVPWQ.js";
4
+ import {
5
+ isJsonOutput,
6
+ output
7
+ } from "./chunk-5BVMPHKH.js";
8
+ import {
9
+ formatTable
10
+ } from "./chunk-FZGOTXTE.js";
11
+ import "./chunk-TOADDO2F.js";
12
+
13
+ // src/commands/admin/queues.ts
14
+ async function listQueues(options) {
15
+ const result = await adminRequest({
16
+ method: "GET",
17
+ path: "/admin/queues"
18
+ });
19
+ const entries = Object.entries(result.queues);
20
+ if (entries.length === 0) {
21
+ if (isJsonOutput() || options.json) {
22
+ output(result.queues, void 0, { json: options.json });
23
+ } else {
24
+ console.log("No queues found.");
25
+ }
26
+ return;
27
+ }
28
+ output(
29
+ result.queues,
30
+ () => {
31
+ const rows = entries.map(([name, counts]) => [
32
+ name,
33
+ String(counts.waiting),
34
+ String(counts.active),
35
+ String(counts.completed),
36
+ String(counts.failed)
37
+ ]);
38
+ return formatTable(
39
+ ["Queue", "Waiting", "Active", "Completed", "Failed"],
40
+ rows
41
+ );
42
+ },
43
+ { json: options.json }
44
+ );
45
+ }
46
+ async function cleanQueue(queueName, options) {
47
+ const status = options.failed ? "failed" : "completed";
48
+ const grace = options.grace ? Number(options.grace) : 0;
49
+ const result = await adminRequest({
50
+ method: "POST",
51
+ path: `/admin/queues/${encodeURIComponent(queueName)}/clean`,
52
+ body: { status, grace }
53
+ });
54
+ console.log(
55
+ `Cleaned ${result.cleaned} ${result.status} jobs from ${result.queue}.`
56
+ );
57
+ }
58
+ export {
59
+ cleanQueue,
60
+ listQueues
61
+ };
@@ -0,0 +1,61 @@
1
+ import {
2
+ adminRequest
3
+ } from "./chunk-QF7PVPWQ.js";
4
+ import {
5
+ isJsonOutput,
6
+ output
7
+ } from "./chunk-P2BKGBQE.js";
8
+ import {
9
+ formatTable
10
+ } from "./chunk-FZGOTXTE.js";
11
+ import "./chunk-TOADDO2F.js";
12
+
13
+ // src/commands/admin/queues.ts
14
+ async function listQueues(options) {
15
+ const result = await adminRequest({
16
+ method: "GET",
17
+ path: "/admin/queues"
18
+ });
19
+ const entries = Object.entries(result.queues);
20
+ if (entries.length === 0) {
21
+ if (isJsonOutput() || options.json) {
22
+ output(result.queues, void 0, { json: options.json });
23
+ } else {
24
+ console.log("No queues found.");
25
+ }
26
+ return;
27
+ }
28
+ output(
29
+ result.queues,
30
+ () => {
31
+ const rows = entries.map(([name, counts]) => [
32
+ name,
33
+ String(counts.waiting),
34
+ String(counts.active),
35
+ String(counts.completed),
36
+ String(counts.failed)
37
+ ]);
38
+ return formatTable(
39
+ ["Queue", "Waiting", "Active", "Completed", "Failed"],
40
+ rows
41
+ );
42
+ },
43
+ { json: options.json }
44
+ );
45
+ }
46
+ async function cleanQueue(queueName, options) {
47
+ const status = options.failed ? "failed" : "completed";
48
+ const grace = options.grace ? Number(options.grace) : 0;
49
+ const result = await adminRequest({
50
+ method: "POST",
51
+ path: `/admin/queues/${encodeURIComponent(queueName)}/clean`,
52
+ body: { status, grace }
53
+ });
54
+ console.log(
55
+ `Cleaned ${result.cleaned} ${result.status} jobs from ${result.queue}.`
56
+ );
57
+ }
58
+ export {
59
+ cleanQueue,
60
+ listQueues
61
+ };
@@ -0,0 +1,61 @@
1
+ import {
2
+ adminRequest
3
+ } from "./chunk-QF7PVPWQ.js";
4
+ import {
5
+ isJsonOutput,
6
+ output
7
+ } from "./chunk-5IX3ASXH.js";
8
+ import {
9
+ formatTable
10
+ } from "./chunk-FZGOTXTE.js";
11
+ import "./chunk-TOADDO2F.js";
12
+
13
+ // src/commands/admin/queues.ts
14
+ async function listQueues(options) {
15
+ const result = await adminRequest({
16
+ method: "GET",
17
+ path: "/admin/queues"
18
+ });
19
+ const entries = Object.entries(result.queues);
20
+ if (entries.length === 0) {
21
+ if (isJsonOutput() || options.json) {
22
+ output(result.queues, void 0, { json: options.json });
23
+ } else {
24
+ console.log("No queues found.");
25
+ }
26
+ return;
27
+ }
28
+ output(
29
+ result.queues,
30
+ () => {
31
+ const rows = entries.map(([name, counts]) => [
32
+ name,
33
+ String(counts.waiting),
34
+ String(counts.active),
35
+ String(counts.completed),
36
+ String(counts.failed)
37
+ ]);
38
+ return formatTable(
39
+ ["Queue", "Waiting", "Active", "Completed", "Failed"],
40
+ rows
41
+ );
42
+ },
43
+ { json: options.json }
44
+ );
45
+ }
46
+ async function cleanQueue(queueName, options) {
47
+ const status = options.failed ? "failed" : "completed";
48
+ const grace = options.grace ? Number(options.grace) : 0;
49
+ const result = await adminRequest({
50
+ method: "POST",
51
+ path: `/admin/queues/${encodeURIComponent(queueName)}/clean`,
52
+ body: { status, grace }
53
+ });
54
+ console.log(
55
+ `Cleaned ${result.cleaned} ${result.status} jobs from ${result.queue}.`
56
+ );
57
+ }
58
+ export {
59
+ cleanQueue,
60
+ listQueues
61
+ };
@@ -0,0 +1,135 @@
1
+ import {
2
+ isJsonOutput,
3
+ output
4
+ } from "./chunk-5IX3ASXH.js";
5
+ import {
6
+ formatBytes,
7
+ formatTable
8
+ } from "./chunk-FZGOTXTE.js";
9
+ import {
10
+ createStow
11
+ } from "./chunk-5LU25QZK.js";
12
+ import "./chunk-TOADDO2F.js";
13
+
14
+ // src/commands/search.ts
15
+ async function textSearch(query, options) {
16
+ const stow = createStow();
17
+ const parsedLimit = options.limit ? Number.parseInt(options.limit, 10) : null;
18
+ const data = await stow.search.text({
19
+ query,
20
+ ...options.bucket ? { bucket: options.bucket } : {},
21
+ ...parsedLimit && parsedLimit > 0 ? { limit: parsedLimit } : {}
22
+ });
23
+ if (data.results.length === 0) {
24
+ if (isJsonOutput() || options.json) {
25
+ output(data);
26
+ } else {
27
+ console.log("No results found.");
28
+ }
29
+ return;
30
+ }
31
+ output(
32
+ data,
33
+ () => {
34
+ const rows = data.results.map((r) => [
35
+ r.key,
36
+ formatBytes(r.size),
37
+ r.similarity.toFixed(3)
38
+ ]);
39
+ return formatTable(["Key", "Size", "Similarity"], rows);
40
+ },
41
+ { json: options.json }
42
+ );
43
+ }
44
+ async function similarSearch(options) {
45
+ const stow = createStow();
46
+ const parsedLimit = options.limit ? Number.parseInt(options.limit, 10) : null;
47
+ const data = await stow.search.similar({
48
+ fileKey: options.file,
49
+ ...options.bucket ? { bucket: options.bucket } : {},
50
+ ...parsedLimit && parsedLimit > 0 ? { limit: parsedLimit } : {}
51
+ });
52
+ if (data.results.length === 0) {
53
+ if (isJsonOutput() || options.json) {
54
+ output(data);
55
+ } else {
56
+ console.log("No similar files found.");
57
+ }
58
+ return;
59
+ }
60
+ output(
61
+ data,
62
+ () => {
63
+ const rows = data.results.map((r) => [
64
+ r.key,
65
+ formatBytes(r.size),
66
+ r.similarity.toFixed(3)
67
+ ]);
68
+ return formatTable(["Key", "Size", "Similarity"], rows);
69
+ },
70
+ { json: options.json }
71
+ );
72
+ }
73
+ async function colorSearch(options) {
74
+ const stow = createStow();
75
+ const parsedLimit = options.limit ? Number.parseInt(options.limit, 10) : null;
76
+ const data = await stow.search.color({
77
+ hex: options.hex,
78
+ ...options.bucket ? { bucket: options.bucket } : {},
79
+ ...parsedLimit && parsedLimit > 0 ? { limit: parsedLimit } : {}
80
+ });
81
+ if (data.results.length === 0) {
82
+ if (isJsonOutput() || options.json) {
83
+ output(data);
84
+ } else {
85
+ console.log("No results found.");
86
+ }
87
+ return;
88
+ }
89
+ output(
90
+ data,
91
+ () => {
92
+ const rows = data.results.map((r) => [
93
+ r.key,
94
+ r.contentType,
95
+ r.colorDistance.toFixed(3)
96
+ ]);
97
+ return formatTable(["Key", "Type", "Distance"], rows);
98
+ },
99
+ { json: options.json }
100
+ );
101
+ }
102
+ async function diverseSearch(options) {
103
+ const stow = createStow();
104
+ const parsedLimit = options.limit ? Number.parseInt(options.limit, 10) : null;
105
+ const data = await stow.search.diverse({
106
+ ...options.bucket ? { bucket: options.bucket } : {},
107
+ ...parsedLimit && parsedLimit > 0 ? { limit: parsedLimit } : {}
108
+ });
109
+ if (data.results.length === 0) {
110
+ if (isJsonOutput() || options.json) {
111
+ output(data);
112
+ } else {
113
+ console.log("No results found.");
114
+ }
115
+ return;
116
+ }
117
+ output(
118
+ data,
119
+ () => {
120
+ const rows = data.results.map((r) => [
121
+ r.key,
122
+ formatBytes(r.size),
123
+ r.similarity.toFixed(3)
124
+ ]);
125
+ return formatTable(["Key", "Size", "Similarity"], rows);
126
+ },
127
+ { json: options.json }
128
+ );
129
+ }
130
+ export {
131
+ colorSearch,
132
+ diverseSearch,
133
+ similarSearch,
134
+ textSearch
135
+ };
@@ -0,0 +1,135 @@
1
+ import {
2
+ isJsonOutput,
3
+ output
4
+ } from "./chunk-5BVMPHKH.js";
5
+ import {
6
+ formatBytes,
7
+ formatTable
8
+ } from "./chunk-FZGOTXTE.js";
9
+ import {
10
+ createStow
11
+ } from "./chunk-5LU25QZK.js";
12
+ import "./chunk-TOADDO2F.js";
13
+
14
+ // src/commands/search.ts
15
+ async function textSearch(query, options) {
16
+ const stow = createStow();
17
+ const parsedLimit = options.limit ? Number.parseInt(options.limit, 10) : null;
18
+ const data = await stow.search.text({
19
+ query,
20
+ ...options.bucket ? { bucket: options.bucket } : {},
21
+ ...parsedLimit && parsedLimit > 0 ? { limit: parsedLimit } : {}
22
+ });
23
+ if (data.results.length === 0) {
24
+ if (isJsonOutput() || options.json) {
25
+ output(data);
26
+ } else {
27
+ console.log("No results found.");
28
+ }
29
+ return;
30
+ }
31
+ output(
32
+ data,
33
+ () => {
34
+ const rows = data.results.map((r) => [
35
+ r.key,
36
+ formatBytes(r.size),
37
+ r.similarity.toFixed(3)
38
+ ]);
39
+ return formatTable(["Key", "Size", "Similarity"], rows);
40
+ },
41
+ { json: options.json }
42
+ );
43
+ }
44
+ async function similarSearch(options) {
45
+ const stow = createStow();
46
+ const parsedLimit = options.limit ? Number.parseInt(options.limit, 10) : null;
47
+ const data = await stow.search.similar({
48
+ fileKey: options.file,
49
+ ...options.bucket ? { bucket: options.bucket } : {},
50
+ ...parsedLimit && parsedLimit > 0 ? { limit: parsedLimit } : {}
51
+ });
52
+ if (data.results.length === 0) {
53
+ if (isJsonOutput() || options.json) {
54
+ output(data);
55
+ } else {
56
+ console.log("No similar files found.");
57
+ }
58
+ return;
59
+ }
60
+ output(
61
+ data,
62
+ () => {
63
+ const rows = data.results.map((r) => [
64
+ r.key,
65
+ formatBytes(r.size),
66
+ r.similarity.toFixed(3)
67
+ ]);
68
+ return formatTable(["Key", "Size", "Similarity"], rows);
69
+ },
70
+ { json: options.json }
71
+ );
72
+ }
73
+ async function colorSearch(options) {
74
+ const stow = createStow();
75
+ const parsedLimit = options.limit ? Number.parseInt(options.limit, 10) : null;
76
+ const data = await stow.search.color({
77
+ hex: options.hex,
78
+ ...options.bucket ? { bucket: options.bucket } : {},
79
+ ...parsedLimit && parsedLimit > 0 ? { limit: parsedLimit } : {}
80
+ });
81
+ if (data.results.length === 0) {
82
+ if (isJsonOutput() || options.json) {
83
+ output(data);
84
+ } else {
85
+ console.log("No results found.");
86
+ }
87
+ return;
88
+ }
89
+ output(
90
+ data,
91
+ () => {
92
+ const rows = data.results.map((r) => [
93
+ r.key,
94
+ r.contentType,
95
+ r.colorDistance.toFixed(3)
96
+ ]);
97
+ return formatTable(["Key", "Type", "Distance"], rows);
98
+ },
99
+ { json: options.json }
100
+ );
101
+ }
102
+ async function diverseSearch(options) {
103
+ const stow = createStow();
104
+ const parsedLimit = options.limit ? Number.parseInt(options.limit, 10) : null;
105
+ const data = await stow.search.diverse({
106
+ ...options.bucket ? { bucket: options.bucket } : {},
107
+ ...parsedLimit && parsedLimit > 0 ? { limit: parsedLimit } : {}
108
+ });
109
+ if (data.results.length === 0) {
110
+ if (isJsonOutput() || options.json) {
111
+ output(data);
112
+ } else {
113
+ console.log("No results found.");
114
+ }
115
+ return;
116
+ }
117
+ output(
118
+ data,
119
+ () => {
120
+ const rows = data.results.map((r) => [
121
+ r.key,
122
+ formatBytes(r.size),
123
+ r.similarity.toFixed(3)
124
+ ]);
125
+ return formatTable(["Key", "Size", "Similarity"], rows);
126
+ },
127
+ { json: options.json }
128
+ );
129
+ }
130
+ export {
131
+ colorSearch,
132
+ diverseSearch,
133
+ similarSearch,
134
+ textSearch
135
+ };