@hasna/files 0.2.30 → 0.2.31

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/README.md CHANGED
@@ -35,13 +35,13 @@ files sources sync-google-drive --dry-run
35
35
  files sources sync-google-drive
36
36
  ```
37
37
 
38
- The production default is `s3://hasna-xyz-prod-emails/drive/<profile>/...`
38
+ The production default is `s3://hasna-xyz-prod-files/google-drive/<profile>/...`
39
39
  using the `hasna-xyz-infra` AWS profile.
40
40
 
41
41
  For a custom S3 destination, pass the shared AWS profile explicitly:
42
42
 
43
43
  ```bash
44
- files sources add s3://my-files-bucket/drive --region us-west-2 --aws-profile hasna-xyz-infra
44
+ files sources add s3://my-files-bucket/google-drive --region us-east-1 --aws-profile hasna-xyz-infra
45
45
  ```
46
46
 
47
47
  To sync into local storage instead, add a local source and pass it as the
package/dist/cli/index.js CHANGED
@@ -168099,7 +168099,7 @@ function buildStorageKey(source, importedPath) {
168099
168099
  function shouldImport(config9, item, existing, destinationSource, storageType) {
168100
168100
  const importedPath = buildImportedPath(config9, item, existing.name);
168101
168101
  const storageKey = storageType === "s3" || storageType === "local" ? buildStorageKey(destinationSource, importedPath) : importedPath;
168102
- 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;
168102
+ return existing.path !== importedPath || !!item.hash && 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;
168103
168103
  }
168104
168104
  function buildImportedPath(config9, item, importedName) {
168105
168105
  if (config9.path_mode === "id_based") {
@@ -168338,11 +168338,11 @@ sources.command("add-google-drive").description("Add a Google Drive source that
168338
168338
  process.exit(1);
168339
168339
  });
168340
168340
  });
168341
- sources.command("bootstrap-prod-files").alias("bootstrap-prod-emails").description("Create or update the production S3 source for Google Drive archive sync").option("--bucket <bucket>", "Production archive bucket", "hasna-xyz-prod-emails").option("--region <region>", "AWS region", "us-west-2").option("--aws-profile <profile>", "AWS shared config profile", "hasna-xyz-infra").option("--prefix <prefix>", "S3 key prefix for Drive objects", "drive").option("-n, --name <name>", "Source name", "prod-emails-drive").option("--no-google-drive-default", "Do not set this source as the default Google Drive destination").option("--json", "Output as JSON").action((opts) => {
168341
+ sources.command("bootstrap-prod-files").alias("bootstrap-prod-emails").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) => {
168342
168342
  const machine = getCurrentMachine();
168343
168343
  const config9 = { profile: opts.awsProfile };
168344
- const legacyProductionNames = new Set([opts.name, "prod-emails-drive", "prod-files"]);
168345
- const legacyProductionBuckets = new Set([opts.bucket, "hasna-xyz-prod-emails", "hasna-xyz-prod-files", "hasna-prod-files"]);
168344
+ const legacyProductionNames = new Set([opts.name, "prod-files", "prod-emails-drive"]);
168345
+ const legacyProductionBuckets = new Set([opts.bucket, "hasna-xyz-prod-files", "hasna-xyz-prod-emails", "hasna-prod-files"]);
168346
168346
  const allSources = listSources();
168347
168347
  const activeDriveDestinationIds = new Set(allSources.filter((source2) => source2.enabled && source2.type === "google_drive").map((source2) => source2.config.destination_source_id).filter((id) => Boolean(id)));
168348
168348
  const configuredDefaultId = loadConfig().google_drive_default_destination_source_id;
package/dist/index.js CHANGED
@@ -164692,7 +164692,7 @@ function buildStorageKey(source, importedPath) {
164692
164692
  function shouldImport(config9, item, existing, destinationSource, storageType) {
164693
164693
  const importedPath = buildImportedPath(config9, item, existing.name);
164694
164694
  const storageKey = storageType === "s3" || storageType === "local" ? buildStorageKey(destinationSource, importedPath) : importedPath;
164695
- 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;
164695
+ return existing.path !== importedPath || !!item.hash && 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;
164696
164696
  }
164697
164697
  function buildImportedPath(config9, item, importedName) {
164698
164698
  if (config9.path_mode === "id_based") {
package/dist/mcp/index.js CHANGED
@@ -183623,7 +183623,7 @@ function buildStorageKey(source, importedPath) {
183623
183623
  function shouldImport(config9, item, existing, destinationSource, storageType) {
183624
183624
  const importedPath = buildImportedPath(config9, item, existing.name);
183625
183625
  const storageKey = storageType === "s3" || storageType === "local" ? buildStorageKey(destinationSource, importedPath) : importedPath;
183626
- 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;
183626
+ return existing.path !== importedPath || !!item.hash && 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;
183627
183627
  }
183628
183628
  function buildImportedPath(config9, item, importedName) {
183629
183629
  if (config9.path_mode === "id_based") {
@@ -164362,7 +164362,7 @@ function buildStorageKey(source, importedPath) {
164362
164362
  function shouldImport(config9, item, existing, destinationSource, storageType) {
164363
164363
  const importedPath = buildImportedPath(config9, item, existing.name);
164364
164364
  const storageKey = storageType === "s3" || storageType === "local" ? buildStorageKey(destinationSource, importedPath) : importedPath;
164365
- 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;
164365
+ return existing.path !== importedPath || !!item.hash && 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;
164366
164366
  }
164367
164367
  function buildImportedPath(config9, item, importedName) {
164368
164368
  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.30",
3
+ "version": "0.2.31",
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",