@hasna/files 0.2.22 → 0.2.24
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/cli/index.js +6 -4
- package/dist/index.js +5 -3
- package/dist/mcp/index.js +5 -3
- package/dist/server/index.js +5 -3
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -167800,7 +167800,7 @@ async function syncGoogleDriveSource(source) {
|
|
|
167800
167800
|
seen.push({ drive_id: item.drive_id, file_id: item.id });
|
|
167801
167801
|
try {
|
|
167802
167802
|
const existing = getGoogleDriveImportedObject(source.id, item.drive_id, item.id);
|
|
167803
|
-
if (existing && !shouldImport(config9, item, existing, destination.source
|
|
167803
|
+
if (existing && !shouldImport(config9, item, existing, destination.source, destination.storage_type))
|
|
167804
167804
|
continue;
|
|
167805
167805
|
const importResult = await importGoogleDriveItem(client2, item, config9, destination.source, destination.storage_type);
|
|
167806
167806
|
const fileRecord = upsertFile({
|
|
@@ -168095,8 +168095,10 @@ function escapeDriveQueryValue(value) {
|
|
|
168095
168095
|
function buildStorageKey(source, importedPath) {
|
|
168096
168096
|
return source.prefix ? posix.join(source.prefix, importedPath) : importedPath;
|
|
168097
168097
|
}
|
|
168098
|
-
function shouldImport(config9, item, existing,
|
|
168099
|
-
|
|
168098
|
+
function shouldImport(config9, item, existing, destinationSource, storageType) {
|
|
168099
|
+
const importedPath = buildImportedPath(config9, item, existing.name);
|
|
168100
|
+
const storageKey = storageType === "s3" || storageType === "local" ? buildStorageKey(destinationSource, importedPath) : importedPath;
|
|
168101
|
+
return existing.path !== importedPath || existing.hash !== item.hash || existing.modified_at !== item.modified_at || existing.version !== item.version || existing.destination_source_id !== destinationSource.id || existing.storage_type !== storageType || existing.storage_key !== storageKey || existing.deleted;
|
|
168100
168102
|
}
|
|
168101
168103
|
function buildImportedPath(config9, item, importedName) {
|
|
168102
168104
|
if (config9.path_mode === "id_based") {
|
|
@@ -168335,7 +168337,7 @@ sources.command("add-google-drive").description("Add a Google Drive source that
|
|
|
168335
168337
|
process.exit(1);
|
|
168336
168338
|
});
|
|
168337
168339
|
});
|
|
168338
|
-
sources.command("bootstrap-prod-files").description("Create or update the production S3 source for Google Drive archive sync").option("--bucket <bucket>", "Production archive bucket", "hasna-xyz-prod-
|
|
168340
|
+
sources.command("bootstrap-prod-files").description("Create or update the production S3 source for Google Drive archive sync").option("--bucket <bucket>", "Production archive bucket", "hasna-xyz-prod-files").option("--region <region>", "AWS region", "us-east-1").option("--aws-profile <profile>", "AWS shared config profile", "hasna-xyz-infra").option("--prefix <prefix>", "S3 key prefix for Drive objects", "google-drive").option("-n, --name <name>", "Source name", "prod-files").option("--no-google-drive-default", "Do not set this source as the default Google Drive destination").option("--json", "Output as JSON").action((opts) => {
|
|
168339
168341
|
const machine = getCurrentMachine();
|
|
168340
168342
|
const config9 = { profile: opts.awsProfile };
|
|
168341
168343
|
const legacyProductionNames = new Set([opts.name, "prod-files"]);
|
package/dist/index.js
CHANGED
|
@@ -164393,7 +164393,7 @@ async function syncGoogleDriveSource(source) {
|
|
|
164393
164393
|
seen.push({ drive_id: item.drive_id, file_id: item.id });
|
|
164394
164394
|
try {
|
|
164395
164395
|
const existing = getGoogleDriveImportedObject(source.id, item.drive_id, item.id);
|
|
164396
|
-
if (existing && !shouldImport(config9, item, existing, destination.source
|
|
164396
|
+
if (existing && !shouldImport(config9, item, existing, destination.source, destination.storage_type))
|
|
164397
164397
|
continue;
|
|
164398
164398
|
const importResult = await importGoogleDriveItem(client2, item, config9, destination.source, destination.storage_type);
|
|
164399
164399
|
const fileRecord = upsertFile({
|
|
@@ -164688,8 +164688,10 @@ function escapeDriveQueryValue(value) {
|
|
|
164688
164688
|
function buildStorageKey(source, importedPath) {
|
|
164689
164689
|
return source.prefix ? posix.join(source.prefix, importedPath) : importedPath;
|
|
164690
164690
|
}
|
|
164691
|
-
function shouldImport(config9, item, existing,
|
|
164692
|
-
|
|
164691
|
+
function shouldImport(config9, item, existing, destinationSource, storageType) {
|
|
164692
|
+
const importedPath = buildImportedPath(config9, item, existing.name);
|
|
164693
|
+
const storageKey = storageType === "s3" || storageType === "local" ? buildStorageKey(destinationSource, importedPath) : importedPath;
|
|
164694
|
+
return existing.path !== importedPath || existing.hash !== item.hash || existing.modified_at !== item.modified_at || existing.version !== item.version || existing.destination_source_id !== destinationSource.id || existing.storage_type !== storageType || existing.storage_key !== storageKey || existing.deleted;
|
|
164693
164695
|
}
|
|
164694
164696
|
function buildImportedPath(config9, item, importedName) {
|
|
164695
164697
|
if (config9.path_mode === "id_based") {
|
package/dist/mcp/index.js
CHANGED
|
@@ -183324,7 +183324,7 @@ async function syncGoogleDriveSource(source) {
|
|
|
183324
183324
|
seen.push({ drive_id: item.drive_id, file_id: item.id });
|
|
183325
183325
|
try {
|
|
183326
183326
|
const existing = getGoogleDriveImportedObject(source.id, item.drive_id, item.id);
|
|
183327
|
-
if (existing && !shouldImport(config9, item, existing, destination.source
|
|
183327
|
+
if (existing && !shouldImport(config9, item, existing, destination.source, destination.storage_type))
|
|
183328
183328
|
continue;
|
|
183329
183329
|
const importResult = await importGoogleDriveItem(client2, item, config9, destination.source, destination.storage_type);
|
|
183330
183330
|
const fileRecord = upsertFile({
|
|
@@ -183619,8 +183619,10 @@ function escapeDriveQueryValue(value) {
|
|
|
183619
183619
|
function buildStorageKey(source, importedPath) {
|
|
183620
183620
|
return source.prefix ? posix.join(source.prefix, importedPath) : importedPath;
|
|
183621
183621
|
}
|
|
183622
|
-
function shouldImport(config9, item, existing,
|
|
183623
|
-
|
|
183622
|
+
function shouldImport(config9, item, existing, destinationSource, storageType) {
|
|
183623
|
+
const importedPath = buildImportedPath(config9, item, existing.name);
|
|
183624
|
+
const storageKey = storageType === "s3" || storageType === "local" ? buildStorageKey(destinationSource, importedPath) : importedPath;
|
|
183625
|
+
return existing.path !== importedPath || existing.hash !== item.hash || existing.modified_at !== item.modified_at || existing.version !== item.version || existing.destination_source_id !== destinationSource.id || existing.storage_type !== storageType || existing.storage_key !== storageKey || existing.deleted;
|
|
183624
183626
|
}
|
|
183625
183627
|
function buildImportedPath(config9, item, importedName) {
|
|
183626
183628
|
if (config9.path_mode === "id_based") {
|
package/dist/server/index.js
CHANGED
|
@@ -164080,7 +164080,7 @@ async function syncGoogleDriveSource(source) {
|
|
|
164080
164080
|
seen.push({ drive_id: item.drive_id, file_id: item.id });
|
|
164081
164081
|
try {
|
|
164082
164082
|
const existing = getGoogleDriveImportedObject(source.id, item.drive_id, item.id);
|
|
164083
|
-
if (existing && !shouldImport(config9, item, existing, destination.source
|
|
164083
|
+
if (existing && !shouldImport(config9, item, existing, destination.source, destination.storage_type))
|
|
164084
164084
|
continue;
|
|
164085
164085
|
const importResult = await importGoogleDriveItem(client2, item, config9, destination.source, destination.storage_type);
|
|
164086
164086
|
const fileRecord = upsertFile({
|
|
@@ -164358,8 +164358,10 @@ function escapeDriveQueryValue(value) {
|
|
|
164358
164358
|
function buildStorageKey(source, importedPath) {
|
|
164359
164359
|
return source.prefix ? posix.join(source.prefix, importedPath) : importedPath;
|
|
164360
164360
|
}
|
|
164361
|
-
function shouldImport(config9, item, existing,
|
|
164362
|
-
|
|
164361
|
+
function shouldImport(config9, item, existing, destinationSource, storageType) {
|
|
164362
|
+
const importedPath = buildImportedPath(config9, item, existing.name);
|
|
164363
|
+
const storageKey = storageType === "s3" || storageType === "local" ? buildStorageKey(destinationSource, importedPath) : importedPath;
|
|
164364
|
+
return existing.path !== importedPath || existing.hash !== item.hash || existing.modified_at !== item.modified_at || existing.version !== item.version || existing.destination_source_id !== destinationSource.id || existing.storage_type !== storageType || existing.storage_key !== storageKey || existing.deleted;
|
|
164363
164365
|
}
|
|
164364
164366
|
function buildImportedPath(config9, item, importedName) {
|
|
164365
164367
|
if (config9.path_mode === "id_based") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hasna/files",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.24",
|
|
4
4
|
"description": "Agent-first file management — index local folders and S3 buckets, sync Google Drive, tag, search, and retrieve files via CLI + MCP",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|