@gigadrive/sdk 0.2.0 → 0.3.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 +130 -1
- package/dist/index.d.ts +130 -1
- package/dist/index.js +59 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +58 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -488,6 +488,83 @@ declare class AiGatewayResource extends BaseResource {
|
|
|
488
488
|
getModel(modelId: string): Promise<AiModel>;
|
|
489
489
|
}
|
|
490
490
|
|
|
491
|
+
/** An application-scoped API key. The secret is never returned after creation. */
|
|
492
|
+
interface ApiKey {
|
|
493
|
+
/** Unique identifier (UUID). Used as the OAuth client ID. */
|
|
494
|
+
id: string;
|
|
495
|
+
/** Human-readable label. */
|
|
496
|
+
name: string;
|
|
497
|
+
/** Application this key is scoped to. */
|
|
498
|
+
applicationId: string | null;
|
|
499
|
+
/** API capability scopes granted to the key. */
|
|
500
|
+
scopes: string[];
|
|
501
|
+
/** ISO 8601 expiry, or `null` if the key never expires. */
|
|
502
|
+
expiresAt: string | null;
|
|
503
|
+
/** ISO 8601 creation timestamp. */
|
|
504
|
+
createdAt: string;
|
|
505
|
+
/** ISO 8601 last-updated timestamp. */
|
|
506
|
+
updatedAt: string;
|
|
507
|
+
}
|
|
508
|
+
/** Input for creating an application-scoped API key. */
|
|
509
|
+
interface CreateApiKeyInput {
|
|
510
|
+
/** Human-readable label for the key. */
|
|
511
|
+
name: string;
|
|
512
|
+
/** Application to scope the key to. The key can only act on this application. */
|
|
513
|
+
applicationId: string;
|
|
514
|
+
/**
|
|
515
|
+
* API capability scopes to grant. Each must be a subset of your own access and
|
|
516
|
+
* cannot include API key management. Defaults to a minimal read-only set.
|
|
517
|
+
*/
|
|
518
|
+
scopes?: string[];
|
|
519
|
+
/** Optional ISO 8601 expiry. Defaults to 90 days when omitted. */
|
|
520
|
+
expiresAt?: string;
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* The result of creating an API key. Includes the plaintext {@link secret},
|
|
524
|
+
* which is returned only once and cannot be retrieved again.
|
|
525
|
+
*/
|
|
526
|
+
interface CreateApiKeyResult extends ApiKey {
|
|
527
|
+
/** The plaintext client secret. Store it now — it cannot be retrieved again. */
|
|
528
|
+
secret: string;
|
|
529
|
+
}
|
|
530
|
+
/** Query for {@link ApiKeysResource.list}. */
|
|
531
|
+
interface ListApiKeysQuery {
|
|
532
|
+
/** Application whose keys should be listed. */
|
|
533
|
+
applicationId: string;
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Manage application-scoped API keys. Accessed via {@link GigadriveClient.apiKeys}.
|
|
537
|
+
*
|
|
538
|
+
* @example
|
|
539
|
+
* ```ts
|
|
540
|
+
* const key = await client.apiKeys.create({ name: 'ci', applicationId: 'app-id' });
|
|
541
|
+
* // Use key.id + key.secret as OAuth client credentials. Store the secret now.
|
|
542
|
+
* ```
|
|
543
|
+
*/
|
|
544
|
+
declare class ApiKeysResource extends BaseResource {
|
|
545
|
+
/**
|
|
546
|
+
* Provision a new application-scoped API key. The plaintext secret is returned
|
|
547
|
+
* exactly once — store it immediately.
|
|
548
|
+
*
|
|
549
|
+
* @param data - The key name, target application, and optional scopes/expiry.
|
|
550
|
+
* @returns The created key including its one-time plaintext secret.
|
|
551
|
+
*/
|
|
552
|
+
create(data: CreateApiKeyInput): Promise<CreateApiKeyResult>;
|
|
553
|
+
/**
|
|
554
|
+
* List the API keys scoped to an application. Secrets are never returned.
|
|
555
|
+
*
|
|
556
|
+
* @param query - The application whose keys should be listed.
|
|
557
|
+
* @returns A paginated list of API key metadata.
|
|
558
|
+
*/
|
|
559
|
+
list(query: ListApiKeysQuery): Promise<Paginated<ApiKey>>;
|
|
560
|
+
/**
|
|
561
|
+
* Permanently revoke an API key.
|
|
562
|
+
*
|
|
563
|
+
* @param apiKeyId - The API key ID (UUID).
|
|
564
|
+
*/
|
|
565
|
+
delete(apiKeyId: string): Promise<void>;
|
|
566
|
+
}
|
|
567
|
+
|
|
491
568
|
/** An environment variable attached to an organization, application, or environment. */
|
|
492
569
|
interface EnvVar {
|
|
493
570
|
/** Unique identifier. */
|
|
@@ -531,6 +608,39 @@ interface UpdateEnvVarInput {
|
|
|
531
608
|
/** Change the sensitive flag. */
|
|
532
609
|
sensitive?: boolean;
|
|
533
610
|
}
|
|
611
|
+
/**
|
|
612
|
+
* A resolved environment variable returned by the pull endpoint. Only
|
|
613
|
+
* non-sensitive variables are returned, so {@link value} is always the real value.
|
|
614
|
+
*/
|
|
615
|
+
interface ResolvedEnvVar {
|
|
616
|
+
/** The variable name (e.g. `DATABASE_URL`). */
|
|
617
|
+
key: string;
|
|
618
|
+
/** The resolved variable value. */
|
|
619
|
+
value: string;
|
|
620
|
+
/** Where the resolved value came from after applying org → app → environment inheritance. */
|
|
621
|
+
source: 'organization' | 'application' | 'environment';
|
|
622
|
+
}
|
|
623
|
+
/** Query options for {@link ApplicationEnvVarsResource.pull}. */
|
|
624
|
+
interface PullEnvVarsQuery {
|
|
625
|
+
/**
|
|
626
|
+
* Resolve environment-specific overrides for this environment slug on top of
|
|
627
|
+
* the organization and application baseline. Omit for the local development
|
|
628
|
+
* baseline (organization + application-wide variables only).
|
|
629
|
+
*/
|
|
630
|
+
environment?: string;
|
|
631
|
+
}
|
|
632
|
+
/** Result of pulling resolved environment variables for local development. */
|
|
633
|
+
interface PullEnvVarsResult {
|
|
634
|
+
/** Resolved, non-sensitive variables, ready to write to a local `.env` file. */
|
|
635
|
+
items: ResolvedEnvVar[];
|
|
636
|
+
/** Number of resolved variables returned. */
|
|
637
|
+
total: number;
|
|
638
|
+
/**
|
|
639
|
+
* Number of sensitive variables that were resolved but intentionally omitted.
|
|
640
|
+
* Secrets are never returned by the pull endpoint.
|
|
641
|
+
*/
|
|
642
|
+
omittedSensitive: number;
|
|
643
|
+
}
|
|
534
644
|
|
|
535
645
|
/**
|
|
536
646
|
* Manage environment variables scoped to an application.
|
|
@@ -552,6 +662,23 @@ declare class ApplicationEnvVarsResource extends BaseResource {
|
|
|
552
662
|
* ```
|
|
553
663
|
*/
|
|
554
664
|
list(applicationId: string, query?: ListQuery): Promise<Paginated<EnvVar>>;
|
|
665
|
+
/**
|
|
666
|
+
* Pull the environment variables that apply to an application for local
|
|
667
|
+
* development. Merges organization-wide, application-wide, and (optionally)
|
|
668
|
+
* environment-specific overrides, returning only non-sensitive values — ready
|
|
669
|
+
* to write to a local `.env` file.
|
|
670
|
+
*
|
|
671
|
+
* @param applicationId - The application ID (UUID).
|
|
672
|
+
* @param query - Optional environment targeting.
|
|
673
|
+
* @returns The resolved non-sensitive variables plus the count of omitted secrets.
|
|
674
|
+
*
|
|
675
|
+
* @example
|
|
676
|
+
* ```ts
|
|
677
|
+
* const { items } = await client.applications.envVars.pull('app-id');
|
|
678
|
+
* const dotenv = items.map((v) => `${v.key}=${v.value}`).join('\n');
|
|
679
|
+
* ```
|
|
680
|
+
*/
|
|
681
|
+
pull(applicationId: string, query?: PullEnvVarsQuery): Promise<PullEnvVarsResult>;
|
|
555
682
|
/**
|
|
556
683
|
* Create a new environment variable for an application.
|
|
557
684
|
*
|
|
@@ -2383,6 +2510,8 @@ declare class GigadriveClient {
|
|
|
2383
2510
|
readonly deployments: DeploymentsResource;
|
|
2384
2511
|
/** AI Gateway — OpenAI-compatible chat completions and model listing. */
|
|
2385
2512
|
readonly aiGateway: AiGatewayResource;
|
|
2513
|
+
/** Application-scoped API key management (create, list, revoke). */
|
|
2514
|
+
readonly apiKeys: ApiKeysResource;
|
|
2386
2515
|
constructor(config?: GigadriveClientConfig);
|
|
2387
2516
|
}
|
|
2388
2517
|
|
|
@@ -2521,4 +2650,4 @@ declare function paginate<T>(fetchPage: (cursor: string | undefined) => Promise<
|
|
|
2521
2650
|
*/
|
|
2522
2651
|
declare function parseSSEStream<T = unknown>(response: Response): AsyncGenerator<T>;
|
|
2523
2652
|
|
|
2524
|
-
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 Application, ApplicationEnvVarsResource, type ApplicationHostnameList, ApplicationRequestsResource, ApplicationStorageResource, ApplicationsResource, AuthenticationError, type ChatCompletionChoice, type ChatCompletionChunk, type ChatCompletionContentPart, type ChatCompletionMessage, type ChatCompletionRequest, type ChatCompletionResponse, type ChatCompletionUsage, type CreateDeploymentInput, type CreateEnvVarInput, 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 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, OrganizationsResource, type Paginated, type PresignedUrlResult, type ProviderRouting, type QueryValue, type ResponsesRequest, type ResponsesResponse, type RunUploadOptions, type SetProductionHostnameResult, type SpeechRequest, type StartUploadResult, 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 };
|
|
2653
|
+
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 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, OrganizationsResource, type Paginated, type PresignedUrlResult, type ProviderRouting, type PullEnvVarsQuery, type PullEnvVarsResult, type QueryValue, type ResolvedEnvVar, type ResponsesRequest, type ResponsesResponse, type RunUploadOptions, type SetProductionHostnameResult, type SpeechRequest, type StartUploadResult, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -488,6 +488,83 @@ declare class AiGatewayResource extends BaseResource {
|
|
|
488
488
|
getModel(modelId: string): Promise<AiModel>;
|
|
489
489
|
}
|
|
490
490
|
|
|
491
|
+
/** An application-scoped API key. The secret is never returned after creation. */
|
|
492
|
+
interface ApiKey {
|
|
493
|
+
/** Unique identifier (UUID). Used as the OAuth client ID. */
|
|
494
|
+
id: string;
|
|
495
|
+
/** Human-readable label. */
|
|
496
|
+
name: string;
|
|
497
|
+
/** Application this key is scoped to. */
|
|
498
|
+
applicationId: string | null;
|
|
499
|
+
/** API capability scopes granted to the key. */
|
|
500
|
+
scopes: string[];
|
|
501
|
+
/** ISO 8601 expiry, or `null` if the key never expires. */
|
|
502
|
+
expiresAt: string | null;
|
|
503
|
+
/** ISO 8601 creation timestamp. */
|
|
504
|
+
createdAt: string;
|
|
505
|
+
/** ISO 8601 last-updated timestamp. */
|
|
506
|
+
updatedAt: string;
|
|
507
|
+
}
|
|
508
|
+
/** Input for creating an application-scoped API key. */
|
|
509
|
+
interface CreateApiKeyInput {
|
|
510
|
+
/** Human-readable label for the key. */
|
|
511
|
+
name: string;
|
|
512
|
+
/** Application to scope the key to. The key can only act on this application. */
|
|
513
|
+
applicationId: string;
|
|
514
|
+
/**
|
|
515
|
+
* API capability scopes to grant. Each must be a subset of your own access and
|
|
516
|
+
* cannot include API key management. Defaults to a minimal read-only set.
|
|
517
|
+
*/
|
|
518
|
+
scopes?: string[];
|
|
519
|
+
/** Optional ISO 8601 expiry. Defaults to 90 days when omitted. */
|
|
520
|
+
expiresAt?: string;
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* The result of creating an API key. Includes the plaintext {@link secret},
|
|
524
|
+
* which is returned only once and cannot be retrieved again.
|
|
525
|
+
*/
|
|
526
|
+
interface CreateApiKeyResult extends ApiKey {
|
|
527
|
+
/** The plaintext client secret. Store it now — it cannot be retrieved again. */
|
|
528
|
+
secret: string;
|
|
529
|
+
}
|
|
530
|
+
/** Query for {@link ApiKeysResource.list}. */
|
|
531
|
+
interface ListApiKeysQuery {
|
|
532
|
+
/** Application whose keys should be listed. */
|
|
533
|
+
applicationId: string;
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Manage application-scoped API keys. Accessed via {@link GigadriveClient.apiKeys}.
|
|
537
|
+
*
|
|
538
|
+
* @example
|
|
539
|
+
* ```ts
|
|
540
|
+
* const key = await client.apiKeys.create({ name: 'ci', applicationId: 'app-id' });
|
|
541
|
+
* // Use key.id + key.secret as OAuth client credentials. Store the secret now.
|
|
542
|
+
* ```
|
|
543
|
+
*/
|
|
544
|
+
declare class ApiKeysResource extends BaseResource {
|
|
545
|
+
/**
|
|
546
|
+
* Provision a new application-scoped API key. The plaintext secret is returned
|
|
547
|
+
* exactly once — store it immediately.
|
|
548
|
+
*
|
|
549
|
+
* @param data - The key name, target application, and optional scopes/expiry.
|
|
550
|
+
* @returns The created key including its one-time plaintext secret.
|
|
551
|
+
*/
|
|
552
|
+
create(data: CreateApiKeyInput): Promise<CreateApiKeyResult>;
|
|
553
|
+
/**
|
|
554
|
+
* List the API keys scoped to an application. Secrets are never returned.
|
|
555
|
+
*
|
|
556
|
+
* @param query - The application whose keys should be listed.
|
|
557
|
+
* @returns A paginated list of API key metadata.
|
|
558
|
+
*/
|
|
559
|
+
list(query: ListApiKeysQuery): Promise<Paginated<ApiKey>>;
|
|
560
|
+
/**
|
|
561
|
+
* Permanently revoke an API key.
|
|
562
|
+
*
|
|
563
|
+
* @param apiKeyId - The API key ID (UUID).
|
|
564
|
+
*/
|
|
565
|
+
delete(apiKeyId: string): Promise<void>;
|
|
566
|
+
}
|
|
567
|
+
|
|
491
568
|
/** An environment variable attached to an organization, application, or environment. */
|
|
492
569
|
interface EnvVar {
|
|
493
570
|
/** Unique identifier. */
|
|
@@ -531,6 +608,39 @@ interface UpdateEnvVarInput {
|
|
|
531
608
|
/** Change the sensitive flag. */
|
|
532
609
|
sensitive?: boolean;
|
|
533
610
|
}
|
|
611
|
+
/**
|
|
612
|
+
* A resolved environment variable returned by the pull endpoint. Only
|
|
613
|
+
* non-sensitive variables are returned, so {@link value} is always the real value.
|
|
614
|
+
*/
|
|
615
|
+
interface ResolvedEnvVar {
|
|
616
|
+
/** The variable name (e.g. `DATABASE_URL`). */
|
|
617
|
+
key: string;
|
|
618
|
+
/** The resolved variable value. */
|
|
619
|
+
value: string;
|
|
620
|
+
/** Where the resolved value came from after applying org → app → environment inheritance. */
|
|
621
|
+
source: 'organization' | 'application' | 'environment';
|
|
622
|
+
}
|
|
623
|
+
/** Query options for {@link ApplicationEnvVarsResource.pull}. */
|
|
624
|
+
interface PullEnvVarsQuery {
|
|
625
|
+
/**
|
|
626
|
+
* Resolve environment-specific overrides for this environment slug on top of
|
|
627
|
+
* the organization and application baseline. Omit for the local development
|
|
628
|
+
* baseline (organization + application-wide variables only).
|
|
629
|
+
*/
|
|
630
|
+
environment?: string;
|
|
631
|
+
}
|
|
632
|
+
/** Result of pulling resolved environment variables for local development. */
|
|
633
|
+
interface PullEnvVarsResult {
|
|
634
|
+
/** Resolved, non-sensitive variables, ready to write to a local `.env` file. */
|
|
635
|
+
items: ResolvedEnvVar[];
|
|
636
|
+
/** Number of resolved variables returned. */
|
|
637
|
+
total: number;
|
|
638
|
+
/**
|
|
639
|
+
* Number of sensitive variables that were resolved but intentionally omitted.
|
|
640
|
+
* Secrets are never returned by the pull endpoint.
|
|
641
|
+
*/
|
|
642
|
+
omittedSensitive: number;
|
|
643
|
+
}
|
|
534
644
|
|
|
535
645
|
/**
|
|
536
646
|
* Manage environment variables scoped to an application.
|
|
@@ -552,6 +662,23 @@ declare class ApplicationEnvVarsResource extends BaseResource {
|
|
|
552
662
|
* ```
|
|
553
663
|
*/
|
|
554
664
|
list(applicationId: string, query?: ListQuery): Promise<Paginated<EnvVar>>;
|
|
665
|
+
/**
|
|
666
|
+
* Pull the environment variables that apply to an application for local
|
|
667
|
+
* development. Merges organization-wide, application-wide, and (optionally)
|
|
668
|
+
* environment-specific overrides, returning only non-sensitive values — ready
|
|
669
|
+
* to write to a local `.env` file.
|
|
670
|
+
*
|
|
671
|
+
* @param applicationId - The application ID (UUID).
|
|
672
|
+
* @param query - Optional environment targeting.
|
|
673
|
+
* @returns The resolved non-sensitive variables plus the count of omitted secrets.
|
|
674
|
+
*
|
|
675
|
+
* @example
|
|
676
|
+
* ```ts
|
|
677
|
+
* const { items } = await client.applications.envVars.pull('app-id');
|
|
678
|
+
* const dotenv = items.map((v) => `${v.key}=${v.value}`).join('\n');
|
|
679
|
+
* ```
|
|
680
|
+
*/
|
|
681
|
+
pull(applicationId: string, query?: PullEnvVarsQuery): Promise<PullEnvVarsResult>;
|
|
555
682
|
/**
|
|
556
683
|
* Create a new environment variable for an application.
|
|
557
684
|
*
|
|
@@ -2383,6 +2510,8 @@ declare class GigadriveClient {
|
|
|
2383
2510
|
readonly deployments: DeploymentsResource;
|
|
2384
2511
|
/** AI Gateway — OpenAI-compatible chat completions and model listing. */
|
|
2385
2512
|
readonly aiGateway: AiGatewayResource;
|
|
2513
|
+
/** Application-scoped API key management (create, list, revoke). */
|
|
2514
|
+
readonly apiKeys: ApiKeysResource;
|
|
2386
2515
|
constructor(config?: GigadriveClientConfig);
|
|
2387
2516
|
}
|
|
2388
2517
|
|
|
@@ -2521,4 +2650,4 @@ declare function paginate<T>(fetchPage: (cursor: string | undefined) => Promise<
|
|
|
2521
2650
|
*/
|
|
2522
2651
|
declare function parseSSEStream<T = unknown>(response: Response): AsyncGenerator<T>;
|
|
2523
2652
|
|
|
2524
|
-
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 Application, ApplicationEnvVarsResource, type ApplicationHostnameList, ApplicationRequestsResource, ApplicationStorageResource, ApplicationsResource, AuthenticationError, type ChatCompletionChoice, type ChatCompletionChunk, type ChatCompletionContentPart, type ChatCompletionMessage, type ChatCompletionRequest, type ChatCompletionResponse, type ChatCompletionUsage, type CreateDeploymentInput, type CreateEnvVarInput, 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 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, OrganizationsResource, type Paginated, type PresignedUrlResult, type ProviderRouting, type QueryValue, type ResponsesRequest, type ResponsesResponse, type RunUploadOptions, type SetProductionHostnameResult, type SpeechRequest, type StartUploadResult, 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 };
|
|
2653
|
+
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 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, OrganizationsResource, type Paginated, type PresignedUrlResult, type ProviderRouting, type PullEnvVarsQuery, type PullEnvVarsResult, type QueryValue, type ResolvedEnvVar, type ResponsesRequest, type ResponsesResponse, type RunUploadOptions, type SetProductionHostnameResult, type SpeechRequest, type StartUploadResult, 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 };
|
package/dist/index.js
CHANGED
|
@@ -37,6 +37,7 @@ __export(src_exports, {
|
|
|
37
37
|
AiGatewayUsageResource: () => AiGatewayUsageResource,
|
|
38
38
|
AiGatewayVideosResource: () => AiGatewayVideosResource,
|
|
39
39
|
ApiError: () => ApiError,
|
|
40
|
+
ApiKeysResource: () => ApiKeysResource,
|
|
40
41
|
ApplicationEnvVarsResource: () => ApplicationEnvVarsResource,
|
|
41
42
|
ApplicationRequestsResource: () => ApplicationRequestsResource,
|
|
42
43
|
ApplicationStorageResource: () => ApplicationStorageResource,
|
|
@@ -785,6 +786,39 @@ var AiGatewayResource = class extends BaseResource {
|
|
|
785
786
|
}
|
|
786
787
|
};
|
|
787
788
|
|
|
789
|
+
// src/resources/api-keys.ts
|
|
790
|
+
var ApiKeysResource = class extends BaseResource {
|
|
791
|
+
/**
|
|
792
|
+
* Provision a new application-scoped API key. The plaintext secret is returned
|
|
793
|
+
* exactly once — store it immediately.
|
|
794
|
+
*
|
|
795
|
+
* @param data - The key name, target application, and optional scopes/expiry.
|
|
796
|
+
* @returns The created key including its one-time plaintext secret.
|
|
797
|
+
*/
|
|
798
|
+
async create(data) {
|
|
799
|
+
return this.httpClient.post("/api-keys", data);
|
|
800
|
+
}
|
|
801
|
+
/**
|
|
802
|
+
* List the API keys scoped to an application. Secrets are never returned.
|
|
803
|
+
*
|
|
804
|
+
* @param query - The application whose keys should be listed.
|
|
805
|
+
* @returns A paginated list of API key metadata.
|
|
806
|
+
*/
|
|
807
|
+
async list(query) {
|
|
808
|
+
return this.httpClient.get("/api-keys", {
|
|
809
|
+
query
|
|
810
|
+
});
|
|
811
|
+
}
|
|
812
|
+
/**
|
|
813
|
+
* Permanently revoke an API key.
|
|
814
|
+
*
|
|
815
|
+
* @param apiKeyId - The API key ID (UUID).
|
|
816
|
+
*/
|
|
817
|
+
async delete(apiKeyId) {
|
|
818
|
+
return this.httpClient.delete(`/api-keys/${apiKeyId}`);
|
|
819
|
+
}
|
|
820
|
+
};
|
|
821
|
+
|
|
788
822
|
// src/resources/application-env-vars.ts
|
|
789
823
|
var ApplicationEnvVarsResource = class extends BaseResource {
|
|
790
824
|
/**
|
|
@@ -806,6 +840,27 @@ var ApplicationEnvVarsResource = class extends BaseResource {
|
|
|
806
840
|
query
|
|
807
841
|
});
|
|
808
842
|
}
|
|
843
|
+
/**
|
|
844
|
+
* Pull the environment variables that apply to an application for local
|
|
845
|
+
* development. Merges organization-wide, application-wide, and (optionally)
|
|
846
|
+
* environment-specific overrides, returning only non-sensitive values — ready
|
|
847
|
+
* to write to a local `.env` file.
|
|
848
|
+
*
|
|
849
|
+
* @param applicationId - The application ID (UUID).
|
|
850
|
+
* @param query - Optional environment targeting.
|
|
851
|
+
* @returns The resolved non-sensitive variables plus the count of omitted secrets.
|
|
852
|
+
*
|
|
853
|
+
* @example
|
|
854
|
+
* ```ts
|
|
855
|
+
* const { items } = await client.applications.envVars.pull('app-id');
|
|
856
|
+
* const dotenv = items.map((v) => `${v.key}=${v.value}`).join('\n');
|
|
857
|
+
* ```
|
|
858
|
+
*/
|
|
859
|
+
async pull(applicationId, query) {
|
|
860
|
+
return this.httpClient.get(`/applications/${applicationId}/env-vars/pull`, {
|
|
861
|
+
query
|
|
862
|
+
});
|
|
863
|
+
}
|
|
809
864
|
/**
|
|
810
865
|
* Create a new environment variable for an application.
|
|
811
866
|
*
|
|
@@ -2098,6 +2153,8 @@ var GigadriveClient = class {
|
|
|
2098
2153
|
deployments;
|
|
2099
2154
|
/** AI Gateway — OpenAI-compatible chat completions and model listing. */
|
|
2100
2155
|
aiGateway;
|
|
2156
|
+
/** Application-scoped API key management (create, list, revoke). */
|
|
2157
|
+
apiKeys;
|
|
2101
2158
|
constructor(config = {}) {
|
|
2102
2159
|
const baseUrl = config.baseUrl ?? readEnv("GIGADRIVE_API_BASE_URL") ?? DEFAULT_BASE_URL2;
|
|
2103
2160
|
const fetchFn = config.fetch ?? globalThis.fetch.bind(globalThis);
|
|
@@ -2108,6 +2165,7 @@ var GigadriveClient = class {
|
|
|
2108
2165
|
this.applications = new ApplicationsResource(httpClient);
|
|
2109
2166
|
this.deployments = new DeploymentsResource(httpClient);
|
|
2110
2167
|
this.aiGateway = new AiGatewayResource(httpClient);
|
|
2168
|
+
this.apiKeys = new ApiKeysResource(httpClient);
|
|
2111
2169
|
}
|
|
2112
2170
|
};
|
|
2113
2171
|
|
|
@@ -2131,6 +2189,7 @@ async function* paginate(fetchPage) {
|
|
|
2131
2189
|
AiGatewayUsageResource,
|
|
2132
2190
|
AiGatewayVideosResource,
|
|
2133
2191
|
ApiError,
|
|
2192
|
+
ApiKeysResource,
|
|
2134
2193
|
ApplicationEnvVarsResource,
|
|
2135
2194
|
ApplicationRequestsResource,
|
|
2136
2195
|
ApplicationStorageResource,
|