remove unused listItems function

pb/validator-gcp
pbio 6 days ago
parent 803efa2075
commit 31ca59ae52
  1. 21
      typescript/sdk/src/gcp/storage.ts
  2. 4
      typescript/sdk/src/gcp/validator.ts

@ -42,27 +42,6 @@ export class GcpStorageWrapper {
} }
} }
// List items in the bucket with optional folder prefix
async listItems(): Promise<string[]> {
const bucket = this.client.bucket(this.bucket);
const options = this.config.folder
? { prefix: this.config.folder + '/' }
: {};
try {
const [files] = await bucket.getFiles(options);
return files.map((file) => {
const fullPath = file.name;
// If there's a folder prefix, remove it from the returned paths
return this.config.folder
? fullPath.slice(this.config.folder.length + 1)
: fullPath;
});
} catch (e) {
throw new Error(`Failed to list items in bucket: ${e}`);
}
}
formatKey(key: string): string { formatKey(key: string): string {
return this.config.folder ? `${this.config.folder}/${key}` : key; return this.config.folder ? `${this.config.folder}/${key}` : key;
} }

@ -71,10 +71,6 @@ export class GcpValidator extends BaseValidator {
throw new Error(`Unable to parse location ${storageLocation}`); throw new Error(`Unable to parse location ${storageLocation}`);
} }
async listItems(): Promise<string[]> {
return this.storage.listItems();
}
async getAnnouncement(): Promise<Announcement> { async getAnnouncement(): Promise<Announcement> {
const { value } = await this.getSignedAnnouncement(); const { value } = await this.getSignedAnnouncement();
return value; return value;

Loading…
Cancel
Save