@gigadrive/sdk 0.6.1 → 0.7.1

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 };