@gigadrive/sdk 0.6.1 → 0.7.0

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/index.d.mts CHANGED
@@ -1,3 +1,5 @@
1
+ import { NormalizedImagePolicy } from '@gigadrive/network-config';
2
+
1
3
  /** The result of a credential provider's token fetch. */
2
4
  interface TokenResult {
3
5
  /** The access token to use in API requests. */
@@ -2674,6 +2676,41 @@ declare class DeploymentsResource extends BaseResource {
2674
2676
  getHostnames(deploymentId: string): Promise<Paginated<Hostname>>;
2675
2677
  }
2676
2678
 
2679
+ interface ImageCacheInspection {
2680
+ enabled: boolean;
2681
+ deploymentTag: string;
2682
+ sourceTag: string | null;
2683
+ policy: NormalizedImagePolicy | null;
2684
+ }
2685
+ interface ImageCachePurgeResult {
2686
+ purged: true;
2687
+ tag: string;
2688
+ }
2689
+ interface ManagedImageUrlOptions {
2690
+ /** Deployment or custom application origin, for example `https://app.gigadrive.app`. */
2691
+ origin: string;
2692
+ /** Local application path or approved absolute remote URL. */
2693
+ source: string;
2694
+ filename?: string;
2695
+ width?: number;
2696
+ height?: number;
2697
+ quality?: number;
2698
+ format?: 'avif' | 'webp' | 'jpeg' | 'png';
2699
+ fit?: 'contain' | 'cover' | 'fill' | 'inside' | 'outside';
2700
+ variant?: string;
2701
+ }
2702
+ /** Creates the stable, framework-neutral managed image URL served on an application hostname. */
2703
+ declare const createManagedImageUrl: (options: ManagedImageUrlOptions) => string;
2704
+ /** Managed image optimization cache inspection and source/deployment purge operations. */
2705
+ declare class ImageOptimizationResource extends BaseResource {
2706
+ /** Create a managed image URL without making an API request. */
2707
+ url(options: ManagedImageUrlOptions): string;
2708
+ /** Inspect the immutable deployment policy and Bunny cache tags used for a source. */
2709
+ inspect(deploymentId: string, source?: string): Promise<ImageCacheInspection>;
2710
+ /** Purge all variants for one source, or every optimized image in the deployment when omitted. */
2711
+ purge(deploymentId: string, source?: string): Promise<ImageCachePurgeResult>;
2712
+ }
2713
+
2677
2714
  /** Input for minting a routing-only sticky session URL. */
2678
2715
  interface CreateStickySessionUrlInput {
2679
2716
  /** Opaque application key shared by callers that must reach the same instance. */
@@ -2860,6 +2897,8 @@ declare class GigadriveClient {
2860
2897
  readonly apiKeys: ApiKeysResource;
2861
2898
  /** Signed URLs that keep related requests on one MicroVM instance. */
2862
2899
  readonly stickySessions: StickySessionsResource;
2900
+ /** Managed image optimization inspection and cache purge operations. */
2901
+ readonly imageOptimization: ImageOptimizationResource;
2863
2902
  constructor(config?: GigadriveClientConfig);
2864
2903
  }
2865
2904
 
@@ -2998,4 +3037,4 @@ declare function paginate<T>(fetchPage: (cursor: string | undefined) => Promise<
2998
3037
  */
2999
3038
  declare function parseSSEStream<T = unknown>(response: Response): AsyncGenerator<T>;
3000
3039
 
3001
- export { AiGatewayAudioResource, type AiGatewayBudget, type AiGatewayBudgetInput, AiGatewayBudgetsResource, AiGatewayPoliciesResource, type AiGatewayPolicy, type AiGatewayPolicyInput, type AiGatewayProviderAttempt, type AiGatewayRequestEvent, type AiGatewayRequestsQuery, AiGatewayResource, type AiGatewayUsageBreakdown, type AiGatewayUsageQuery, AiGatewayUsageResource, type AiGatewayUsageSummary, AiGatewayVideosResource, type AiModel, type AiModelCapabilities, type AiModelRoutingProvider, ApiError, type ApiKey, ApiKeysResource, type Application, ApplicationEnvVarsResource, type ApplicationHostnameList, ApplicationRequestsResource, ApplicationStorageResource, ApplicationsResource, AuthenticationError, type ChatCompletionChoice, type ChatCompletionChunk, type ChatCompletionContentPart, type ChatCompletionMessage, type ChatCompletionRequest, type ChatCompletionResponse, type ChatCompletionUsage, type CreateApiKeyInput, type CreateApiKeyResult, type CreateDeploymentInput, type CreateEnvVarInput, type CreateOrganizationInput, type CreateStickySessionUrlInput, type CreateStickySessionUrlResult, type CreateStorageBucketInput, type CreateUploadSessionInput, type CreateUploadSessionResponse, type Deployment, type DeploymentLog, type DeploymentLogPage, type DeploymentLogType, type DeploymentStatus, DeploymentsResource, type EnvVar, type GatewayRequestOptions, type GatewayResult, GigadriveClient, type GigadriveClientConfig, GigadriveError, type Hostname, type HostnameAvailability, type ListApiKeysQuery, type ListApplicationsQuery, type ListDeploymentLogsQuery, type ListDeploymentsQuery, type ListQuery, type ListRequestsQuery, type ListStorageObjectsQuery, type NetworkRequest, type NetworkRequestApplicationRef, type NetworkRequestAssetRef, type NetworkRequestBucketRef, type NetworkRequestDeploymentRef, type NetworkRequestDetails, type NetworkRequestFunctionRef, type NetworkRequestMetrics, type NetworkRequestObjectRef, type NetworkRequestSummary, type NetworkResponseDetails, type NodeReadableLike, type Organization, OrganizationAiGatewayResource, OrganizationEnvVarsResource, type OrganizationMember, OrganizationMembersResource, type OrganizationMembershipRole, type OrganizationProductAccess, type OrganizationProductEntitlement, type OrganizationProductEntitlementCheck, type OrganizationProductSubscription, OrganizationProductsResource, OrganizationsResource, type Paginated, type PresignedUrlResult, type ProductAccessMode, type ProductAccessResolutionSource, type ProductDefaultAccessPolicy, type ProductDefinition, type ProductEntitlementStatus, type ProductPlan, type ProductSubscriptionStatus, type ProviderRouting, type PullEnvVarsQuery, type PullEnvVarsResult, type QueryValue, type ResolvedEnvVar, type ResponsesRequest, type ResponsesResponse, type RunUploadOptions, type SetProductionHostnameResult, type SpeechRequest, type StartUploadResult, StickySessionsResource, type StorageBucket, StorageBucketsResource, type StorageObject, type StorageObjectAccess, type StorageObjectList, StorageObjectsResource, type StorageUploadSession, StorageUploadSessionsResource, type TranscriptionRequest, type TranscriptionResponse, type UpdateEnvVarInput, type UploadBatchItemResult, type UploadBatchOptions, type UploadByteSource, type UploadData, UploadError, type UploadFileInput, type UploadFileResult, type UploadPart, UploadSessionExpiredError, type UploadUrlStorage, type VideoGenerationRequest, type VideoGenerationResponse, type VideoModelList, type WaitForCompletionOptions, paginate, parseSSEStream };
3040
+ export { AiGatewayAudioResource, type AiGatewayBudget, type AiGatewayBudgetInput, AiGatewayBudgetsResource, AiGatewayPoliciesResource, type AiGatewayPolicy, type AiGatewayPolicyInput, type AiGatewayProviderAttempt, type AiGatewayRequestEvent, type AiGatewayRequestsQuery, AiGatewayResource, type AiGatewayUsageBreakdown, type AiGatewayUsageQuery, AiGatewayUsageResource, type AiGatewayUsageSummary, AiGatewayVideosResource, type AiModel, type AiModelCapabilities, type AiModelRoutingProvider, ApiError, type ApiKey, ApiKeysResource, type Application, ApplicationEnvVarsResource, type ApplicationHostnameList, ApplicationRequestsResource, ApplicationStorageResource, ApplicationsResource, AuthenticationError, type ChatCompletionChoice, type ChatCompletionChunk, type ChatCompletionContentPart, type ChatCompletionMessage, type ChatCompletionRequest, type ChatCompletionResponse, type ChatCompletionUsage, type CreateApiKeyInput, type CreateApiKeyResult, type CreateDeploymentInput, type CreateEnvVarInput, type CreateOrganizationInput, type CreateStickySessionUrlInput, type CreateStickySessionUrlResult, type CreateStorageBucketInput, type CreateUploadSessionInput, type CreateUploadSessionResponse, type Deployment, type DeploymentLog, type DeploymentLogPage, type DeploymentLogType, type DeploymentStatus, DeploymentsResource, type EnvVar, type GatewayRequestOptions, type GatewayResult, GigadriveClient, type GigadriveClientConfig, GigadriveError, type Hostname, type HostnameAvailability, type ImageCacheInspection, type ImageCachePurgeResult, ImageOptimizationResource, type ListApiKeysQuery, type ListApplicationsQuery, type ListDeploymentLogsQuery, type ListDeploymentsQuery, type ListQuery, type ListRequestsQuery, type ListStorageObjectsQuery, type ManagedImageUrlOptions, type NetworkRequest, type NetworkRequestApplicationRef, type NetworkRequestAssetRef, type NetworkRequestBucketRef, type NetworkRequestDeploymentRef, type NetworkRequestDetails, type NetworkRequestFunctionRef, type NetworkRequestMetrics, type NetworkRequestObjectRef, type NetworkRequestSummary, type NetworkResponseDetails, type NodeReadableLike, type Organization, OrganizationAiGatewayResource, OrganizationEnvVarsResource, type OrganizationMember, OrganizationMembersResource, type OrganizationMembershipRole, type OrganizationProductAccess, type OrganizationProductEntitlement, type OrganizationProductEntitlementCheck, type OrganizationProductSubscription, OrganizationProductsResource, OrganizationsResource, type Paginated, type PresignedUrlResult, type ProductAccessMode, type ProductAccessResolutionSource, type ProductDefaultAccessPolicy, type ProductDefinition, type ProductEntitlementStatus, type ProductPlan, type ProductSubscriptionStatus, type ProviderRouting, type PullEnvVarsQuery, type PullEnvVarsResult, type QueryValue, type ResolvedEnvVar, type ResponsesRequest, type ResponsesResponse, type RunUploadOptions, type SetProductionHostnameResult, type SpeechRequest, type StartUploadResult, StickySessionsResource, type StorageBucket, StorageBucketsResource, type StorageObject, type StorageObjectAccess, type StorageObjectList, StorageObjectsResource, type StorageUploadSession, StorageUploadSessionsResource, type TranscriptionRequest, type TranscriptionResponse, type UpdateEnvVarInput, type UploadBatchItemResult, type UploadBatchOptions, type UploadByteSource, type UploadData, UploadError, type UploadFileInput, type UploadFileResult, type UploadPart, UploadSessionExpiredError, type UploadUrlStorage, type VideoGenerationRequest, type VideoGenerationResponse, type VideoModelList, type WaitForCompletionOptions, createManagedImageUrl, paginate, parseSSEStream };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { NormalizedImagePolicy } from '@gigadrive/network-config';
2
+
1
3
  /** The result of a credential provider's token fetch. */
2
4
  interface TokenResult {
3
5
  /** The access token to use in API requests. */
@@ -2674,6 +2676,41 @@ declare class DeploymentsResource extends BaseResource {
2674
2676
  getHostnames(deploymentId: string): Promise<Paginated<Hostname>>;
2675
2677
  }
2676
2678
 
2679
+ interface ImageCacheInspection {
2680
+ enabled: boolean;
2681
+ deploymentTag: string;
2682
+ sourceTag: string | null;
2683
+ policy: NormalizedImagePolicy | null;
2684
+ }
2685
+ interface ImageCachePurgeResult {
2686
+ purged: true;
2687
+ tag: string;
2688
+ }
2689
+ interface ManagedImageUrlOptions {
2690
+ /** Deployment or custom application origin, for example `https://app.gigadrive.app`. */
2691
+ origin: string;
2692
+ /** Local application path or approved absolute remote URL. */
2693
+ source: string;
2694
+ filename?: string;
2695
+ width?: number;
2696
+ height?: number;
2697
+ quality?: number;
2698
+ format?: 'avif' | 'webp' | 'jpeg' | 'png';
2699
+ fit?: 'contain' | 'cover' | 'fill' | 'inside' | 'outside';
2700
+ variant?: string;
2701
+ }
2702
+ /** Creates the stable, framework-neutral managed image URL served on an application hostname. */
2703
+ declare const createManagedImageUrl: (options: ManagedImageUrlOptions) => string;
2704
+ /** Managed image optimization cache inspection and source/deployment purge operations. */
2705
+ declare class ImageOptimizationResource extends BaseResource {
2706
+ /** Create a managed image URL without making an API request. */
2707
+ url(options: ManagedImageUrlOptions): string;
2708
+ /** Inspect the immutable deployment policy and Bunny cache tags used for a source. */
2709
+ inspect(deploymentId: string, source?: string): Promise<ImageCacheInspection>;
2710
+ /** Purge all variants for one source, or every optimized image in the deployment when omitted. */
2711
+ purge(deploymentId: string, source?: string): Promise<ImageCachePurgeResult>;
2712
+ }
2713
+
2677
2714
  /** Input for minting a routing-only sticky session URL. */
2678
2715
  interface CreateStickySessionUrlInput {
2679
2716
  /** Opaque application key shared by callers that must reach the same instance. */
@@ -2860,6 +2897,8 @@ declare class GigadriveClient {
2860
2897
  readonly apiKeys: ApiKeysResource;
2861
2898
  /** Signed URLs that keep related requests on one MicroVM instance. */
2862
2899
  readonly stickySessions: StickySessionsResource;
2900
+ /** Managed image optimization inspection and cache purge operations. */
2901
+ readonly imageOptimization: ImageOptimizationResource;
2863
2902
  constructor(config?: GigadriveClientConfig);
2864
2903
  }
2865
2904
 
@@ -2998,4 +3037,4 @@ declare function paginate<T>(fetchPage: (cursor: string | undefined) => Promise<
2998
3037
  */
2999
3038
  declare function parseSSEStream<T = unknown>(response: Response): AsyncGenerator<T>;
3000
3039
 
3001
- export { AiGatewayAudioResource, type AiGatewayBudget, type AiGatewayBudgetInput, AiGatewayBudgetsResource, AiGatewayPoliciesResource, type AiGatewayPolicy, type AiGatewayPolicyInput, type AiGatewayProviderAttempt, type AiGatewayRequestEvent, type AiGatewayRequestsQuery, AiGatewayResource, type AiGatewayUsageBreakdown, type AiGatewayUsageQuery, AiGatewayUsageResource, type AiGatewayUsageSummary, AiGatewayVideosResource, type AiModel, type AiModelCapabilities, type AiModelRoutingProvider, ApiError, type ApiKey, ApiKeysResource, type Application, ApplicationEnvVarsResource, type ApplicationHostnameList, ApplicationRequestsResource, ApplicationStorageResource, ApplicationsResource, AuthenticationError, type ChatCompletionChoice, type ChatCompletionChunk, type ChatCompletionContentPart, type ChatCompletionMessage, type ChatCompletionRequest, type ChatCompletionResponse, type ChatCompletionUsage, type CreateApiKeyInput, type CreateApiKeyResult, type CreateDeploymentInput, type CreateEnvVarInput, type CreateOrganizationInput, type CreateStickySessionUrlInput, type CreateStickySessionUrlResult, type CreateStorageBucketInput, type CreateUploadSessionInput, type CreateUploadSessionResponse, type Deployment, type DeploymentLog, type DeploymentLogPage, type DeploymentLogType, type DeploymentStatus, DeploymentsResource, type EnvVar, type GatewayRequestOptions, type GatewayResult, GigadriveClient, type GigadriveClientConfig, GigadriveError, type Hostname, type HostnameAvailability, type ListApiKeysQuery, type ListApplicationsQuery, type ListDeploymentLogsQuery, type ListDeploymentsQuery, type ListQuery, type ListRequestsQuery, type ListStorageObjectsQuery, type NetworkRequest, type NetworkRequestApplicationRef, type NetworkRequestAssetRef, type NetworkRequestBucketRef, type NetworkRequestDeploymentRef, type NetworkRequestDetails, type NetworkRequestFunctionRef, type NetworkRequestMetrics, type NetworkRequestObjectRef, type NetworkRequestSummary, type NetworkResponseDetails, type NodeReadableLike, type Organization, OrganizationAiGatewayResource, OrganizationEnvVarsResource, type OrganizationMember, OrganizationMembersResource, type OrganizationMembershipRole, type OrganizationProductAccess, type OrganizationProductEntitlement, type OrganizationProductEntitlementCheck, type OrganizationProductSubscription, OrganizationProductsResource, OrganizationsResource, type Paginated, type PresignedUrlResult, type ProductAccessMode, type ProductAccessResolutionSource, type ProductDefaultAccessPolicy, type ProductDefinition, type ProductEntitlementStatus, type ProductPlan, type ProductSubscriptionStatus, type ProviderRouting, type PullEnvVarsQuery, type PullEnvVarsResult, type QueryValue, type ResolvedEnvVar, type ResponsesRequest, type ResponsesResponse, type RunUploadOptions, type SetProductionHostnameResult, type SpeechRequest, type StartUploadResult, StickySessionsResource, type StorageBucket, StorageBucketsResource, type StorageObject, type StorageObjectAccess, type StorageObjectList, StorageObjectsResource, type StorageUploadSession, StorageUploadSessionsResource, type TranscriptionRequest, type TranscriptionResponse, type UpdateEnvVarInput, type UploadBatchItemResult, type UploadBatchOptions, type UploadByteSource, type UploadData, UploadError, type UploadFileInput, type UploadFileResult, type UploadPart, UploadSessionExpiredError, type UploadUrlStorage, type VideoGenerationRequest, type VideoGenerationResponse, type VideoModelList, type WaitForCompletionOptions, paginate, parseSSEStream };
3040
+ export { AiGatewayAudioResource, type AiGatewayBudget, type AiGatewayBudgetInput, AiGatewayBudgetsResource, AiGatewayPoliciesResource, type AiGatewayPolicy, type AiGatewayPolicyInput, type AiGatewayProviderAttempt, type AiGatewayRequestEvent, type AiGatewayRequestsQuery, AiGatewayResource, type AiGatewayUsageBreakdown, type AiGatewayUsageQuery, AiGatewayUsageResource, type AiGatewayUsageSummary, AiGatewayVideosResource, type AiModel, type AiModelCapabilities, type AiModelRoutingProvider, ApiError, type ApiKey, ApiKeysResource, type Application, ApplicationEnvVarsResource, type ApplicationHostnameList, ApplicationRequestsResource, ApplicationStorageResource, ApplicationsResource, AuthenticationError, type ChatCompletionChoice, type ChatCompletionChunk, type ChatCompletionContentPart, type ChatCompletionMessage, type ChatCompletionRequest, type ChatCompletionResponse, type ChatCompletionUsage, type CreateApiKeyInput, type CreateApiKeyResult, type CreateDeploymentInput, type CreateEnvVarInput, type CreateOrganizationInput, type CreateStickySessionUrlInput, type CreateStickySessionUrlResult, type CreateStorageBucketInput, type CreateUploadSessionInput, type CreateUploadSessionResponse, type Deployment, type DeploymentLog, type DeploymentLogPage, type DeploymentLogType, type DeploymentStatus, DeploymentsResource, type EnvVar, type GatewayRequestOptions, type GatewayResult, GigadriveClient, type GigadriveClientConfig, GigadriveError, type Hostname, type HostnameAvailability, type ImageCacheInspection, type ImageCachePurgeResult, ImageOptimizationResource, type ListApiKeysQuery, type ListApplicationsQuery, type ListDeploymentLogsQuery, type ListDeploymentsQuery, type ListQuery, type ListRequestsQuery, type ListStorageObjectsQuery, type ManagedImageUrlOptions, type NetworkRequest, type NetworkRequestApplicationRef, type NetworkRequestAssetRef, type NetworkRequestBucketRef, type NetworkRequestDeploymentRef, type NetworkRequestDetails, type NetworkRequestFunctionRef, type NetworkRequestMetrics, type NetworkRequestObjectRef, type NetworkRequestSummary, type NetworkResponseDetails, type NodeReadableLike, type Organization, OrganizationAiGatewayResource, OrganizationEnvVarsResource, type OrganizationMember, OrganizationMembersResource, type OrganizationMembershipRole, type OrganizationProductAccess, type OrganizationProductEntitlement, type OrganizationProductEntitlementCheck, type OrganizationProductSubscription, OrganizationProductsResource, OrganizationsResource, type Paginated, type PresignedUrlResult, type ProductAccessMode, type ProductAccessResolutionSource, type ProductDefaultAccessPolicy, type ProductDefinition, type ProductEntitlementStatus, type ProductPlan, type ProductSubscriptionStatus, type ProviderRouting, type PullEnvVarsQuery, type PullEnvVarsResult, type QueryValue, type ResolvedEnvVar, type ResponsesRequest, type ResponsesResponse, type RunUploadOptions, type SetProductionHostnameResult, type SpeechRequest, type StartUploadResult, StickySessionsResource, type StorageBucket, StorageBucketsResource, type StorageObject, type StorageObjectAccess, type StorageObjectList, StorageObjectsResource, type StorageUploadSession, StorageUploadSessionsResource, type TranscriptionRequest, type TranscriptionResponse, type UpdateEnvVarInput, type UploadBatchItemResult, type UploadBatchOptions, type UploadByteSource, type UploadData, UploadError, type UploadFileInput, type UploadFileResult, type UploadPart, UploadSessionExpiredError, type UploadUrlStorage, type VideoGenerationRequest, type VideoGenerationResponse, type VideoModelList, type WaitForCompletionOptions, createManagedImageUrl, paginate, parseSSEStream };
package/dist/index.js CHANGED
@@ -46,6 +46,7 @@ __export(src_exports, {
46
46
  DeploymentsResource: () => DeploymentsResource,
47
47
  GigadriveClient: () => GigadriveClient,
48
48
  GigadriveError: () => GigadriveError,
49
+ ImageOptimizationResource: () => ImageOptimizationResource,
49
50
  OrganizationAiGatewayResource: () => OrganizationAiGatewayResource,
50
51
  OrganizationEnvVarsResource: () => OrganizationEnvVarsResource,
51
52
  OrganizationMembersResource: () => OrganizationMembersResource,
@@ -57,6 +58,7 @@ __export(src_exports, {
57
58
  StorageUploadSessionsResource: () => StorageUploadSessionsResource,
58
59
  UploadError: () => UploadError,
59
60
  UploadSessionExpiredError: () => UploadSessionExpiredError,
61
+ createManagedImageUrl: () => createManagedImageUrl,
60
62
  paginate: () => paginate,
61
63
  parseSSEStream: () => parseSSEStream
62
64
  });
@@ -1967,6 +1969,45 @@ var DeploymentsResource = class extends BaseResource {
1967
1969
  }
1968
1970
  };
1969
1971
 
1972
+ // src/resources/image-optimization.ts
1973
+ var createManagedImageUrl = (options) => {
1974
+ const inferredFilename = options.source.split("/").filter(Boolean).at(-1)?.split("?")[0] || "image.image";
1975
+ const filename = (options.filename ?? inferredFilename).replace(/[^A-Za-z0-9._-]/g, "_") || "image.image";
1976
+ const url = new URL(
1977
+ `/_gigadrive/image/${encodeURIComponent(options.source)}/${encodeURIComponent(filename)}`,
1978
+ options.origin
1979
+ );
1980
+ for (const [name, value] of Object.entries({
1981
+ width: options.width,
1982
+ height: options.height,
1983
+ quality: options.quality,
1984
+ format: options.format,
1985
+ fit: options.fit,
1986
+ variant: options.variant
1987
+ })) {
1988
+ if (value !== void 0) url.searchParams.set(name, String(value));
1989
+ }
1990
+ return url.toString();
1991
+ };
1992
+ var ImageOptimizationResource = class extends BaseResource {
1993
+ /** Create a managed image URL without making an API request. */
1994
+ url(options) {
1995
+ return createManagedImageUrl(options);
1996
+ }
1997
+ /** Inspect the immutable deployment policy and Bunny cache tags used for a source. */
1998
+ inspect(deploymentId, source) {
1999
+ return this.httpClient.get(`/deployments/${deploymentId}/image-cache`, {
2000
+ query: { source }
2001
+ });
2002
+ }
2003
+ /** Purge all variants for one source, or every optimized image in the deployment when omitted. */
2004
+ purge(deploymentId, source) {
2005
+ return this.httpClient.delete(`/deployments/${deploymentId}/image-cache`, {
2006
+ query: { source }
2007
+ });
2008
+ }
2009
+ };
2010
+
1970
2011
  // src/resources/organization-ai-gateway.ts
1971
2012
  var AiGatewayUsageResource = class extends BaseResource {
1972
2013
  /** Get an aggregated usage summary with breakdowns by model, provider, and user. */
@@ -2331,6 +2372,8 @@ var GigadriveClient = class {
2331
2372
  apiKeys;
2332
2373
  /** Signed URLs that keep related requests on one MicroVM instance. */
2333
2374
  stickySessions;
2375
+ /** Managed image optimization inspection and cache purge operations. */
2376
+ imageOptimization;
2334
2377
  constructor(config = {}) {
2335
2378
  const baseUrl = config.baseUrl ?? readEnv("GIGADRIVE_API_BASE_URL") ?? DEFAULT_BASE_URL2;
2336
2379
  const fetchFn = config.fetch ?? globalThis.fetch.bind(globalThis);
@@ -2343,6 +2386,7 @@ var GigadriveClient = class {
2343
2386
  this.aiGateway = new AiGatewayResource(httpClient);
2344
2387
  this.apiKeys = new ApiKeysResource(httpClient);
2345
2388
  this.stickySessions = new StickySessionsResource(httpClient);
2389
+ this.imageOptimization = new ImageOptimizationResource(httpClient);
2346
2390
  }
2347
2391
  };
2348
2392
 
@@ -2375,6 +2419,7 @@ async function* paginate(fetchPage) {
2375
2419
  DeploymentsResource,
2376
2420
  GigadriveClient,
2377
2421
  GigadriveError,
2422
+ ImageOptimizationResource,
2378
2423
  OrganizationAiGatewayResource,
2379
2424
  OrganizationEnvVarsResource,
2380
2425
  OrganizationMembersResource,
@@ -2386,6 +2431,7 @@ async function* paginate(fetchPage) {
2386
2431
  StorageUploadSessionsResource,
2387
2432
  UploadError,
2388
2433
  UploadSessionExpiredError,
2434
+ createManagedImageUrl,
2389
2435
  paginate,
2390
2436
  parseSSEStream
2391
2437
  });