Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions packages/core/storage-js/src/StorageClient.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import StorageFileApi from './packages/StorageFileApi'
import StorageBucketApi from './packages/StorageBucketApi'
import StorageAnalyticsApi from './packages/StorageAnalyticsApi'
import StorageAnalyticsClient from './packages/StorageAnalyticsClient'
import { Fetch } from './lib/fetch'
import { StorageVectorsClient } from './lib/vectors'

Expand Down Expand Up @@ -66,12 +66,15 @@ export class StorageClient extends StorageBucketApi {
}

/**
*
* @alpha
*
* Access analytics storage operations using Iceberg tables.
*
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
*
* @category Analytics Buckets
* @returns A StorageAnalyticsApi instance configured with the current storage settings.
* @returns A StorageAnalyticsClient instance configured with the current storage settings.
* @example
* ```typescript
* const client = createClient(url, key)
Expand All @@ -87,7 +90,7 @@ export class StorageClient extends StorageBucketApi {
* await analytics.deleteBucket('old-analytics-bucket')
* ```
*/
get analytics(): StorageAnalyticsApi {
return new StorageAnalyticsApi(this.url + '/iceberg', this.headers, this.fetch)
get analytics(): StorageAnalyticsClient {
return new StorageAnalyticsClient(this.url + '/iceberg', this.headers, this.fetch)
}
}
2 changes: 1 addition & 1 deletion packages/core/storage-js/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export { StorageClient } from './StorageClient'
export type { StorageClientOptions } from './StorageClient'
export { default as StorageAnalyticsApi } from './packages/StorageAnalyticsApi'
export { default as StorageAnalyticsClient } from './packages/StorageAnalyticsClient'
export * from './lib/types'
export * from './lib/errors'
export * from './lib/vectors'
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@ import { resolveFetch } from '../lib/helpers'
import { AnalyticBucket } from '../lib/types'

/**
* API class for managing Analytics Buckets using Iceberg tables
* Client class for managing Analytics Buckets using Iceberg tables
* Provides methods for creating, listing, and deleting analytics buckets
*/
export default class StorageAnalyticsApi {
export default class StorageAnalyticsClient {
protected url: string
protected headers: { [key: string]: string }
protected fetch: Fetch
protected shouldThrowOnError = false

/**
* Creates a new StorageAnalyticsApi instance
* @alpha
*
* Creates a new StorageAnalyticsClient instance
*
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
*
Expand All @@ -26,7 +28,7 @@ export default class StorageAnalyticsApi {
*
* @example
* ```typescript
* const client = new StorageAnalyticsApi(url, headers)
* const client = new StorageAnalyticsClient(url, headers)
* ```
*/
constructor(url: string, headers: { [key: string]: string } = {}, fetch?: Fetch) {
Expand All @@ -36,6 +38,8 @@ export default class StorageAnalyticsApi {
}

/**
* @alpha
*
* Enable throwing errors instead of returning them in the response
* When enabled, failed operations will throw instead of returning { data: null, error }
*
Expand All @@ -50,6 +54,8 @@ export default class StorageAnalyticsApi {
}

/**
* @alpha
*
* Creates a new analytics bucket using Iceberg tables
* Analytics buckets are optimized for analytical queries and data processing
*
Expand Down Expand Up @@ -103,6 +109,8 @@ export default class StorageAnalyticsApi {
}

/**
* @alpha
*
* Retrieves the details of all Analytics Storage buckets within an existing project
* Only returns buckets of type 'ANALYTICS'
*
Expand Down Expand Up @@ -190,6 +198,8 @@ export default class StorageAnalyticsApi {
}

/**
* @alpha
*
* Deletes an existing analytics bucket
* A bucket can't be deleted with existing objects inside it
* You must first empty the bucket before deletion
Expand Down
Loading