{"_id":"@aziontech/storage","name":"@aziontech/storage","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@aziontech/storage","version":"1.0.0","description":"Azion Storage Client provides a simple interface to interact with the Azion Storage API, allowing you to manage buckets and objects.","main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","require":"./dist/index.cjs","import":"./dist/index.mjs"}},"author":{"name":"aziontech"},"license":"MIT","dependencies":{"@aziontech/types":"1.0.0"},"devDependencies":{"@types/node":"^22.13.1","@jest/globals":"^29.7.0","@types/jest":"^29.5.12","jest":"^29.7.0","ts-jest":"^29.1.5","@aziontech/vite-config":"^0.0.0"},"repository":{"type":"git","url":"git+https://github.com/aziontech/lib.git","directory":"packages/storage"},"scripts":{"compile":"vite build","lint":"eslint .","lint:fix":"eslint --fix .","prettier":"prettier --write .","test":"jest --clearCache && jest -c jest.config.ts .","test:watch":"jest -c jest.config.js . --watch","test:coverage":"jest --clearCache && jest -c jest.config.js . --coverage"},"_id":"@aziontech/storage@1.0.0","bugs":{"url":"https://github.com/aziontech/lib/issues"},"homepage":"https://github.com/aziontech/lib#readme","_integrity":"sha512-wAP70DJ0g74XZg7wVFMggtYupYZgWKKDWvG/qQgQgLUnn00rFZ+ChkIxZvkw2Y3DwJy2d8ckMB0rU5xgXaXfrg==","_resolved":"/tmp/c5e0f0cd661ec7a53174481984901fb0/aziontech-storage-1.0.0.tgz","_from":"file:aziontech-storage-1.0.0.tgz","_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-wAP70DJ0g74XZg7wVFMggtYupYZgWKKDWvG/qQgQgLUnn00rFZ+ChkIxZvkw2Y3DwJy2d8ckMB0rU5xgXaXfrg==","shasum":"059bfe510b349f4f52a0ede60026d01d648edf42","tarball":"https://registry.npmjs.org/@aziontech/storage/-/storage-1.0.0.tgz","fileCount":6,"unpackedSize":92091,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIH2JeaC9XvwMCaeuhhdSkAmDbYj2ji3i8aFeN+QDyJ2kAiBPEwUkUrbchjJoY4/mu4SphdyADQr8daZ5dUDTrdsYkw=="}]},"_npmUser":{"name":"aziontechadmin","email":"services@azion.com"},"directories":{},"maintainers":[{"name":"aziontechadmin","email":"services@azion.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/storage_1.0.0_1776984620056_0.41235124859083183"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-23T22:50:19.937Z","1.0.0":"2026-04-23T22:50:20.191Z","modified":"2026-04-23T22:50:20.731Z"},"maintainers":[{"name":"aziontechadmin","email":"services@azion.com"}],"description":"Azion Storage Client provides a simple interface to interact with the Azion Storage API, allowing you to manage buckets and objects.","homepage":"https://github.com/aziontech/lib#readme","repository":{"type":"git","url":"git+https://github.com/aziontech/lib.git","directory":"packages/storage"},"author":{"name":"aziontech"},"bugs":{"url":"https://github.com/aziontech/lib/issues"},"license":"MIT","readme":"# Azion Storage Client\n\nAzion Storage Client provides a simple interface to interact with the Azion Storage API, allowing you to manage buckets and objects. This client is configurable and supports both debug mode and environment variable-based configuration.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Environment Variables](#environment-variables)\n- [Debug Mode](#debug-mode)\n- [Usage](#usage)\n  - [Using Environment Variables](#using-environment-variables)\n  - [Direct Method Calls](#direct-method-calls)\n  - [Client Configuration](#client-configuration)\n  - [API Examples](#api-examples)\n    - [Create Bucket](#create-bucket)\n    - [Delete Bucket](#delete-bucket)\n    - [Get Buckets](#get-buckets)\n    - [Get Bucket by Name](#get-bucket-by-name)\n    - [Update Bucket](#update-bucket)\n    - [Create Object](#create-object)\n    - [Get Object by Key](#get-object-by-key)\n    - [Get Objects](#get-objects)\n    - [Update Object](#update-object)\n    - [Delete Object](#delete-object)\n- [API Reference](#api-reference)\n  - [`createBucket`](#createbucket)\n  - [`deleteBucket`](#deletebucket)\n  - [`getBuckets`](#getbuckets)\n  - [`getBucket`](#getbucket)\n  - [`updateBucket`](#updatebucket)\n  - [`createObject`](#createobject)\n  - [`getObjectByKey`](#getobjectbykey)\n  - [`getObjects`](#getobjects)\n  - [`updateObject`](#updateobject)\n  - [`deleteObject`](#deleteobject)\n  - [`createClient`](#createclient)\n- [Types](#types)\n  - [`ClientConfig`](#clientconfig)\n  - [`StorageClient`](#storageclient)\n  - [`AzionStorageResponse`](#azionbucketresponse)\n  - [`Bucket`](#bucket)\n  - [`BucketObject`](#bucketobject)\n  - [`DeletedBucket`](#deletedbucket)\n  - [`DeletedBucketObject`](#deletedbucketobject)\n- [Contributing](#contributing)\n\n## Installation\n\nInstall the package using npm or yarn:\n\n```sh\nnpm install azion\n```\n\nor\n\n```sh\nyarn add azion\n```\n\n## Environment Variables\n\nYou can configure the client using the following environment variables:\n\n- `AZION_TOKEN`: Your Azion API token.\n- `AZION_DEBUG`: Enable debug mode (true/false).\n\nExample `.env` file:\n\n```sh\nAZION_TOKEN=your-api-token\nAZION_DEBUG=true\n```\n\n## Debug Mode\n\nDebug mode provides detailed logging of the API requests and responses. You can enable debug mode by setting the `AZION_DEBUG` environment variable to `true` or by passing `true` as the `debug` parameter in the methods.\n\n## Usage\n\n### Using Environment Variables\n\nYou can use the environment variables to configure the client without passing the token and debug parameters directly.\n\n### Direct Method Calls\n\nYou can use the provided wrapper methods to perform storage operations directly.\n\n### Client Configuration\n\nYou can create a client instance with specific configurations.\n\n### API Examples\n\n#### Create Bucket\n\n**JavaScript:**\n\n```javascript\nimport { createBucket } from '@aziontech/storage';\n\nconst { data, error } = await createBucket({ name: 'my-new-bucket', workloads_access: 'read_only' });\nif (data) {\n  console.log(`Bucket created with name: ${data.name}`);\n} else {\n  console.error('Failed to create bucket', error);\n}\n```\n\n**TypeScript:**\n\n```typescript\nimport { createBucket } from '@aziontech/storage';\nimport type { AzionStorageResponse, AzionBucket } from '@aziontech/storage';\nconst { data, error }: AzionStorageResponse<AzionBucket> = await createBucket({\n  name: 'my-new-bucket',\n  workloads_access: 'read_only',\n});\nif (data) {\n  console.log(`Bucket created with name: ${data.name}`);\n} else {\n  console.error('Failed to create bucket', error);\n}\n```\n\n#### Delete Bucket\n\n**JavaScript:**\n\n```javascript\nimport { deleteBucket } from '@aziontech/storage';\n\nconst { data, error } = await deleteBucket({ name: 'my-bucket' });\nif (data) {\n  console.log(`Bucket ${data.name} deleted successfully`);\n} else {\n  console.error('Failed to delete bucket', error);\n}\n```\n\n**TypeScript:**\n\n```typescript\nimport { deleteBucket, AzionDeletedBucket, AzionStorageResponse } from '@aziontech/storage';\n\nconst { data, error }: AzionStorageResponse<AzionDeletedBucket> = await deleteBucket({ name: 'my-bucket' });\nif (data) {\n  console.log(`Bucket ${data.name} deleted successfully`);\n} else {\n  console.error('Failed to delete bucket', error);\n}\n```\n\n#### Get Buckets\n\n**JavaScript:**\n\n```javascript\nimport { getBuckets } from '@aziontech/storage';\n\nconst { data: buckets, error } = await getBuckets({ params: { page: 1, page_size: 10 } });\nif (buckets) {\n  console.log(`Retrieved ${buckets.count} buckets`);\n} else {\n  console.error('Failed to retrieve buckets', error);\n}\n```\n\n**TypeScript:**\n\n```typescript\nimport { getBuckets, AzionStorageResponse, AzionBucketCollection } from '@aziontech/storage';\n\nconst { data: buckets, error }: AzionStorageResponse<AzionBucketCollection> = await getBuckets({\n  params: { page: 1, page_size: 10 },\n});\nif (buckets) {\n  console.log(`Retrieved ${buckets.count} buckets`);\n} else {\n  console.error('Failed to retrieve buckets', error);\n}\n```\n\n#### Get Bucket by Name\n\n**JavaScript:**\n\n```javascript\nimport { getBucket } from '@aziontech/storage';\n\nconst { data: bucket, error } = await getBucket({ name: 'my-bucket' });\nif (bucket) {\n  console.log(`Retrieved bucket: ${bucket.name}`);\n  console.log(`Workloads access: ${bucket.workloads_access}`);\n  console.log(`Last editor: ${bucket.last_editor}`);\n  console.log(`Last modified: ${bucket.last_modified}`);\n  console.log(`Product version: ${bucket.product_version}`);\n} else {\n  console.error('Bucket not found', error);\n}\n```\n\n**TypeScript:**\n\n```typescript\nimport { getBucket, AzionBucket, AzionStorageResponse } from '@aziontech/storage';\n\nconst { data: bucket, error }: AzionStorageResponse<AzionBucket> = await getBucket({ name: 'my-bucket' });\nif (bucket) {\n  console.log(`Retrieved bucket: ${bucket.name}`);\n  console.log(`Workloads access: ${bucket.workloads_access}`);\n} else {\n  console.error('Bucket not found', error);\n}\n```\n\n#### Setup Storage\n\nThe `setupStorage` function provides a convenient way to ensure a bucket exists. It first tries to get an existing bucket, and if it doesn't exist, creates it automatically. This is perfect for initialization scripts or ensuring your storage is ready to use.\n\n**JavaScript:**\n\n```javascript\nimport { setupStorage } from '@aziontech/storage';\n\nconst { data: bucket, error } = await setupStorage({\n  name: 'my-app-bucket',\n  workloads_access: 'read_write',\n});\nif (bucket) {\n  console.log(`Storage ready: ${bucket.name}`);\n  console.log(`Workloads access: ${bucket.workloads_access}`);\n} else {\n  console.error('Failed to setup storage', error);\n}\n```\n\n**TypeScript:**\n\n```typescript\nimport { setupStorage, AzionBucket, AzionStorageResponse } from '@aziontech/storage';\n\nconst { data: bucket, error }: AzionStorageResponse<AzionBucket> = await setupStorage({\n  name: 'my-app-bucket',\n  workloads_access: 'read_write',\n});\nif (bucket) {\n  console.log(`Storage ready: ${bucket.name}`);\n  // Now you can safely use the bucket for operations\n  await bucket.createObject({\n    key: 'config.json',\n    content: '{}',\n    params: { content_type: 'application/json' },\n  });\n} else {\n  console.error('Failed to setup storage', error);\n}\n```\n\n#### Update Bucket\n\n**JavaScript:**\n\n```javascript\nimport { updateBucket } from '@aziontech/storage';\n\nconst { data: updatedBucket, error } = await updateBucket({ name: 'my-bucket', workloads_access: 'private' });\nif (updatedBucket) {\n  console.log(`Bucket updated: ${updatedBucket.name}`);\n} else {\n  console.error('Failed to update bucket', error);\n}\n```\n\n**TypeScript:**\n\n```typescript\nimport { updateBucket, AzionBucket, AzionStorageResponse } from '@aziontech/storage';\n\nconst { data: updatedBucket, error }: AzionStorageResponse<AzionBucket> | null = await updateBucket({\n  name: 'my-bucket',\n  workloads_access: 'private',\n});\nif (updatedBucket) {\n  console.log(`Bucket updated: ${updatedBucket.name}`);\n} else {\n  console.error('Failed to update bucket', error);\n}\n```\n\n#### Create Object\n\n**JavaScript:**\n\n```javascript\nimport { createObject } from '@aziontech/storage';\n\nconst { data: newObject, error } = await createObject({\n  bucket: 'my-bucket',\n  key: 'new-file.txt',\n  content: 'File content',\n  params: { content_type: 'text/plain' },\n  options: { debug: true },\n});\nif (newObject) {\n  console.log(`Object created with key: ${newObject.key}`);\n  console.log(`Object content: ${newObject.content}`);\n} else {\n  console.error('Failed to create object', error);\n}\n```\n\n**TypeScript:**\n\n```typescript\nimport { createObject, AzionBucketObject, AzionStorageResponse } from '@aziontech/storage';\n\nconst { data: newObject, error }: AzionStorageResponse<AzionBucketObject> = await createObject({\n  bucket: 'my-bucket',\n  key: 'new-file.txt',\n  content: 'File content',\n  params: { content_type: 'text/plain' },\n  options: { debug: true },\n});\nif (newObject) {\n  console.log(`Object created with key: ${newObject.key}`);\n  console.log(`Object content: ${newObject.content}`);\n} else {\n  console.error('Failed to create object', error);\n}\n```\n\n#### Get Object by Key\n\n**JavaScript:**\n\n```javascript\nimport { getObjectByKey } from '@aziontech/storage';\n\nconst { data: object, error } = await getObjectByKey({ bucket: 'my-bucket', key: 'file.txt' });\nif (object) {\n  console.log(`Retrieved object: ${object.key}`);\n} else {\n  console.error('Object not found', error);\n}\n```\n\n**TypeScript:**\n\n```typescript\nimport { getObjectByKey, AzionBucketObject, AzionStorageResponse } from '@aziontech/storage';\n\nconst { data: object, error }: AzionStorageResponse<AzionBucketObject> = await getObjectByKey({\n  bucket: 'my-bucket',\n  key: 'file.txt',\n});\nif (object) {\n  console.log(`Retrieved object: ${object.key}`);\n} else {\n  console.error('Object not found', error);\n}\n```\n\n#### Get Objects\n\n**JavaScript:**\n\n```javascript\nimport { getObjects } from '@aziontech/storage';\n\nconst { data: objectsResult, error } = await getObjects({ bucket: 'my-bucket' });\nif (objectsResult) {\n  console.log(`Retrieved ${objectsResult.count} objects from the bucket`);\n} else {\n  console.error('Failed to retrieve objects', error);\n}\n```\n\n**TypeScript:**\n\n```typescript\nimport { getObjects, AzionBucketObject, AzionStorageResponse } from '@aziontech/storage';\n\nconst { data: objectResult, error }: AzionStorageResponse<AzionBucketObjects> = await getObjects({\n  bucket: 'my-bucket',\n});\nif (objectResult) {\n  console.log(`Retrieved ${objectResult.count} objects from the bucket`);\n} else {\n  console.error('Failed to retrieve objects', error);\n}\n```\n\n#### Update Object\n\n**JavaScript:**\n\n```javascript\nimport { updateObject } from '@aziontech/storage';\n\nconst { data: updatedObject, error } = await updateObject({\n  bucket: 'my-bucket',\n  key: 'file.txt',\n  content: 'Updated content',\n  params: { content_type: 'text/plain' },\n  options: { debug: true },\n});\nif (updatedObject) {\n  console.log(`Object updated: ${updatedObject.key}`);\n  console.log(`New content: ${updatedObject.content}`);\n} else {\n  console.error('Failed to update object', error);\n}\n```\n\n**TypeScript:**\n\n```typescript\nimport { updateObject, AzionBucketObject } from '@aziontech/storage';\n\nconst { data: updatedObject, error }: AzionStorageResponse<AzionBucketObject> = await updateObject({\n  bucket: 'my-bucket',\n  key: 'file.txt',\n  content: 'Updated content',\n  params: { content_type: 'text/plain' },\n  options: { debug: true },\n});\nif (updatedObject) {\n  console.log(`Object updated: ${updatedObject.key}`);\n  console.log(`New content: ${updatedObject.content}`);\n} else {\n  console.error('Failed to update object', error);\n}\n```\n\n#### Delete Object\n\n**JavaScript:**\n\n```javascript\nimport { deleteObject } from '@aziontech/storage';\n\nconst { data: result, error } = await deleteObject({ bucket: 'my-bucket', key: 'file.txt' });\nif (result) {\n  console.log(`Object ${result.key} deleted successfully`);\n} else {\n  console.error('Failed to delete object', error);\n}\n```\n\n**TypeScript:**\n\n```typescript\nimport { deleteObject, AzionDeletedBucketObject, AzionStorageResponse } from '@aziontech/storage';\n\nconst { data: result, error }: AzionStorageResponse<AzionDeletedBucketObject> = await deleteObject({\n  bucket: 'my-bucket',\n  key: 'file.txt',\n});\nif (result) {\n  console.log(`Object ${result.key} deleted successfully`);\n} else {\n  console.error('Failed to delete object', error);\n}\n```\n\n### Using Client\n\n**JavaScript:**\n\n```javascript\nimport { createClient } from '@aziontech/storage';\n\nconst client = createClient({ token: 'your-api-token', debug: true });\n\nconst { data, error } = await client.createBucket({ name: 'my-new-bucket', workloads_access: 'read_only' });\nif (data) {\n  console.log(`Bucket created with name: ${data.name}`);\n}\n\nconst { data: allBuckets } = await client.getBuckets();\nif (allBuckets) {\n  console.log(`Retrieved ${allBuckets.count} buckets`);\n}\n\n// Get a bucket first\nconst { data: bucket } = await client.getBucket({ name: 'my-new-bucket' });\nif (bucket) {\n  // Create an object in the bucket\n  const { data: newObject } = await bucket.createObject({\n    key: 'new-file.txt',\n    content: 'File content',\n    params: { content_type: 'text/plain' },\n  });\n  if (newObject) {\n    console.log(`Object created with key: ${newObject.key}`);\n  }\n\n  // Update the object\n  const { data: updateResult } = await bucket.updateObject({\n    key: 'new-file.txt',\n    content: 'Updated content',\n    params: { content_type: 'text/plain' },\n  });\n  if (updateResult) {\n    console.log(`Object updated with key: ${updateResult.key}`);\n  }\n}\n```\n\n**TypeScript:**\n\n```typescript\nimport {\n  createClient,\n  StorageClient,\n  AzionStorageResponse,\n  AzionBucket,\n  AzionBucketObject,\n  AzionBucketCollection,\n} from '@aziontech/storage';\n\nconst client: StorageClient = createClient({ token: 'your-api-token', debug: true });\n\nconst { data, error }: AzionStorageResponse<AzionBucket> = await client.createBucket({\n  name: 'my-new-bucket',\n  workloads_access: 'read_only',\n});\nif (data) {\n  console.log(`Bucket created with name: ${data.name}`);\n}\n\nconst { data: allBuckets }: AzionStorageResponse<AzionBucketCollection> = await client.getBuckets();\nif (allBuckets) {\n  console.log(`Retrieved ${allBuckets.count} buckets`);\n}\n\n// Get a bucket first\nconst { data: bucket }: AzionStorageResponse<AzionBucket> = await client.getBucket({ name: 'my-new-bucket' });\nif (bucket) {\n  // Create an object in the bucket\n  const { data: newObject }: AzionStorageResponse<AzionBucketObject> = await bucket.createObject({\n    key: 'new-file.txt',\n    content: 'File content',\n    params: { content_type: 'text/plain' },\n  });\n  if (newObject) {\n    console.log(`Object created with key: ${newObject.key}`);\n  }\n\n  // Update the object\n  const { data: updateResult }: AzionStorageResponse<AzionBucketObject> = await bucket.updateObject({\n    key: 'new-file.txt',\n    content: 'Updated content',\n    params: { content_type: 'text/plain' },\n  });\n  if (updateResult) {\n    console.log(`Object updated with key: ${updateResult.key}`);\n  }\n}\n```\n\n## API Reference\n\n### `createBucket`\n\nCreates a new bucket.\n\n**Parameters:**\n\n- `name: string` - Name of the new bucket.\n- `workloads_access: string` - Workloads access configuration for the bucket.\n- `options?: AzionClientOptions` - Optional parameters for the request.\n\n**Returns:**\n\n- `Promise<AzionStorageResponse<AzionBucket>>` - The created bucket object or error.\n\n### `deleteBucket`\n\nDeletes a bucket by its name.\n\n**Parameters:**\n\n- `name: string` - Name of the bucket to delete.\n- `debug?: boolean` - Enable debug mode for detailed logging.\n\n**Returns:**\n\n- `Promise<AzionStorageResponse<AzionDeletedBucket>>` - Object confirming deletion or error.\n\n### `getBuckets`\n\nRetrieves a list of buckets with optional filtering and pagination.\n\n**Parameters:**\n\n- `options?: AzionBucketCollectionOptions` - Optional parameters for filtering and pagination.\n  - `page?: number` - Page number for pagination.\n  - `page_size?: number` - Number of items per page.\n  - `search?: string` - Search term to filter buckets by name.\n  - `ordering?: string` - Field name to use when ordering the results.\n  - `fields?: string` - Comma-separated list of field names to include in the response.\n- `debug?: boolean` - Enable debug mode for detailed logging.\n\n**Returns:**\n\n- `Promise<AzionStorageResponse<AzionBucketCollection>>` - Array of bucket objects or error.\n\n### `getBucket`\n\nRetrieves a bucket by its name.\n\n**Parameters:**\n\n- `name: string` - Name of the bucket to retrieve.\n- `debug?: boolean` - Enable debug mode for detailed logging.\n\n**Returns:**\n\n- `Promise<AzionStorageResponse<AzionBucket>>` - The retrieved bucket object or error if not found.\n\n### `updateBucket`\n\nUpdates an existing bucket.\n\n**Parameters:**\n\n- `name: string` - Name of the bucket to update.\n- `workloads_access: string` - New Workloads access configuration for the bucket.\n- `debug?: boolean` - Enable debug mode for detailed logging.\n\n**Returns:**\n\n- `Promise<AzionStorageResponse<AzionBucket>>` - The updated bucket object or error if update failed.\n\n### `createObject`\n\nCreates a new object in a specific bucket.\n\n**Parameters:**\n\n- `bucket: string` - Name of the bucket to create the object in.\n- `key: string` - Key (name) of the object to create.\n- `content: string` - Content of the object to upload.\n- `params?: Object` - Object parameters.\n- `params.content_type?: string` - Content type of the object (defaults to 'application/octet-stream').\n- `options?: AzionClientOptions` - Optional parameters including debug mode.\n\n**Returns:**\n\n- `Promise<AzionStorageResponse<AzionBucketObject>>` - The created object or error message.\n\n### `getObjectByKey`\n\nRetrieves an object from a specific bucket by its key.\n\n**Parameters:**\n\n- `bucket: string` - Name of the bucket containing the object.\n- `key: string` - Key of the object to retrieve.\n- `options?: AzionClientOptions` - Optional parameters including debug mode.\n\n**Returns:**\n\n- `Promise<AzionBucketObject | null>` - The retrieved object or null if not found.\n\n### `getObjects`\n\nRetrieves a list of objects in a specific bucket.\n\n**Parameters:**\n\n- `bucket: string` - Name of the bucket to retrieve objects from.\n- `params?: AzionObjectCollectionParams` - Optional parameters for object collection.\n- `options?: AzionClientOptions` - Optional parameters including debug mode.\n\n**Returns:**\n\n- `Promise<AzionStorageResponse<AzionBucketObjects>>` - Array of bucket objects or error.\n\n### `updateObject`\n\nUpdates an existing object in a specific bucket.\n\n**Parameters:**\n\n- `bucket: string` - Name of the bucket containing the object.\n- `key: string` - Key of the object to update.\n- `content: string` - New content of the object.\n- `params?: Object` - Object parameters.\n- `params.content_type?: string` - Content type of the object (defaults to 'application/octet-stream').\n- `options?: AzionClientOptions` - Optional parameters including debug mode.\n\n**Returns:**\n\n- `Promise<AzionStorageResponse<AzionBucketObject>>` - The updated object or error message.\n\n### `deleteObject`\n\nDeletes an object from a specific bucket.\n\n**Parameters:**\n\n- `bucket: string` - Name of the bucket containing the object.\n- `key: string` - Key of the object to delete.\n- `options?: AzionClientOptions` - Optional parameters including debug mode.\n\n**Returns:**\n\n- `Promise<AzionStorageResponse<AzionDeletedBucketObject>>` - Confirmation of deletion or error if deletion failed.\n\n### `createClient`\n\nCreates a Storage client with methods to interact with Azion Storage.\n\n**Parameters:**\n\n- `config?: Partial<{ token: string; debug: boolean }>` - Configuration options for the Storage client.\n\n**Returns:**\n\n- `StorageClient` - An object with methods to interact with Storage.\n\n## Types\n\n### `ClientConfig`\n\nConfiguration options for the Storage client.\n\n- `token?: string` - Your Azion API token.\n- `debug?: boolean` - Enable debug mode for detailed logging.\n\n### `StorageClient`\n\nAn object with methods to interact with Storage.\n\n- `getBuckets: (options?: BucketCollectionOptions) => Promise<AzionStorageResponse<AzionBucketCollection>>`\n- `createBucket: (name: string, workloads_access: string) => Promise<AzionStorageResponse<AzionBucket>>`\n- `updateBucket: (name: string, workloads_access: string) => Promise<AzionStorageResponse<AzionBucket>>`\n- `deleteBucket: (name: string) => Promise<AzionStorageResponse<AzionDeletedBucket>>`\n- `getBucket: (name: string) => Promise<AzionStorageResponse<AzionBucket>>`\n\n### `AzionStorageResponse<T>`\n\nThe response object from a bucket operation.\n\n- `data?: T` - The data generic object.\n- `error?: { message: string; operation: string;}`\n\n### `AzionBucket`\n\nThe bucket object.\n\n- `name: string`\n- `workloads_access?: string`\n- `state?: 'executed' | 'executed-runtime' | 'pending'`\n- `last_editor?: string`\n- `last_modified?: string`\n- `product_version?: string`\n- `getObjects?: (params: { params: AzionObjectCollectionParams }) => Promise<AzionStorageResponse<AzionBucketObjects>>`\n- `getObjectByKey?: (params: { key: string }) => Promise<AzionStorageResponse<AzionBucketObject>>`\n- `createObject?: (params: { key: string, content: string, params?: { content_type?: string } }) => Promise<AzionStorageResponse<AzionBucketObject>>`\n- `updateObject?: (params: { key: string, content: string, params?: { content_type?: string } }) => Promise<AzionStorageResponse<AzionBucketObject>>`\n- `deleteObject?: (params: { key: string }) => Promise<AzionStorageResponse<AzionDeletedBucketObject>>`\n\n### `AzionBucketObject`\n\nThe bucket object.\n\n- `key: string`\n- `state?: 'executed' | 'pending'`\n- `size?: number`\n- `last_modified?: string`\n- `content_type?: string`\n- `content?: string`\n\n### `AzionDeletedBucket`\n\nThe response object from a delete bucket request.\n\n- `name: string`\n- `state: 'executed' | 'pending'`\n\n### `AzionDeletedBucketObject`\n\nThe response object from a delete object request.\n\n- `key: string`\n- `state: 'executed' | 'pending'`\n\n## Contributing\n\nFeel free to submit issues or pull requests to improve the functionality or documentation.\n","readmeFilename":"README.md","_rev":"1-9e94fbda029dbc1665530d47da0b6e22"}