modal 0.5.0 → 0.5.2
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/README.md +29 -20
- package/dist/index.cjs +378 -60
- package/dist/index.d.cts +27 -2
- package/dist/index.d.ts +27 -2
- package/dist/index.js +378 -60
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Client, Status } from 'nice-grpc';
|
|
1
|
+
import { Client, Status, ClientMiddleware } from 'nice-grpc';
|
|
2
2
|
import { BinaryWriter, BinaryReader } from '@bufbuild/protobuf/wire';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -5875,6 +5875,15 @@ interface Profile {
|
|
|
5875
5875
|
tokenSecret?: string;
|
|
5876
5876
|
environment?: string;
|
|
5877
5877
|
imageBuilderVersion?: string;
|
|
5878
|
+
logLevel?: string;
|
|
5879
|
+
}
|
|
5880
|
+
|
|
5881
|
+
type LogLevel = "debug" | "info" | "warn" | "error";
|
|
5882
|
+
interface Logger {
|
|
5883
|
+
debug(message: string, ...args: any[]): void;
|
|
5884
|
+
info(message: string, ...args: any[]): void;
|
|
5885
|
+
warn(message: string, ...args: any[]): void;
|
|
5886
|
+
error(message: string, ...args: any[]): void;
|
|
5878
5887
|
}
|
|
5879
5888
|
|
|
5880
5889
|
interface ModalClientParams {
|
|
@@ -5884,6 +5893,18 @@ interface ModalClientParams {
|
|
|
5884
5893
|
endpoint?: string;
|
|
5885
5894
|
timeoutMs?: number;
|
|
5886
5895
|
maxRetries?: number;
|
|
5896
|
+
logger?: Logger;
|
|
5897
|
+
logLevel?: LogLevel;
|
|
5898
|
+
/**
|
|
5899
|
+
* Custom gRPC middleware to be applied to all API calls.
|
|
5900
|
+
* These middleware are appended after Modal's built-in middleware
|
|
5901
|
+
* (authentication, retry logic, and timeouts), allowing you to add
|
|
5902
|
+
* telemetry, tracing, or other observability features.
|
|
5903
|
+
*
|
|
5904
|
+
* Note that the Modal gRPC API is not considered a public API, and
|
|
5905
|
+
* can change without warning.
|
|
5906
|
+
*/
|
|
5907
|
+
grpcMiddleware?: ClientMiddleware[];
|
|
5887
5908
|
/** @ignore */
|
|
5888
5909
|
cpClient?: ModalGrpcClient;
|
|
5889
5910
|
}
|
|
@@ -5920,8 +5941,10 @@ declare class ModalClient {
|
|
|
5920
5941
|
/** @ignore */
|
|
5921
5942
|
readonly cpClient: ModalGrpcClient;
|
|
5922
5943
|
readonly profile: Profile;
|
|
5944
|
+
readonly logger: Logger;
|
|
5923
5945
|
private ipClients;
|
|
5924
5946
|
private authTokenManager;
|
|
5947
|
+
private customMiddleware;
|
|
5925
5948
|
constructor(params?: ModalClientParams);
|
|
5926
5949
|
environmentName(environment?: string): string;
|
|
5927
5950
|
imageBuilderVersion(version?: string): string;
|
|
@@ -5930,6 +5953,8 @@ declare class ModalClient {
|
|
|
5930
5953
|
close(): void;
|
|
5931
5954
|
version(): string;
|
|
5932
5955
|
private createClient;
|
|
5956
|
+
/** Middleware to retry transient errors and timeouts for unary requests. */
|
|
5957
|
+
private retryMiddleware;
|
|
5933
5958
|
private authMiddleware;
|
|
5934
5959
|
}
|
|
5935
5960
|
type TimeoutOptions = {
|
|
@@ -6068,4 +6093,4 @@ declare class SandboxTimeoutError extends Error {
|
|
|
6068
6093
|
|
|
6069
6094
|
declare function checkForRenamedParams(params: any, renames: Record<string, string>): void;
|
|
6070
6095
|
|
|
6071
|
-
export { AlreadyExistsError, App, type AppFromNameParams, AppService, type ClientOptions, CloudBucketMount, Cls, type ClsFromNameParams, ClsInstance, ClsService, type ClsWithBatchingParams, type ClsWithConcurrencyParams, type ClsWithOptionsParams, ContainerProcess, type DeleteOptions, type EphemeralOptions, FunctionCall, type FunctionCallCancelParams, type FunctionCallGetParams, FunctionCallService, type FunctionFromNameParams, FunctionService, type FunctionStats, FunctionTimeoutError, type FunctionUpdateAutoscalerParams, Function_, Image, type ImageDeleteParams, type ImageDockerfileCommandsParams, ImageService, InternalFailure, InvalidError, type LookupOptions, ModalClient, type ModalClientParams, type ModalReadStream, type ModalWriteStream, NotFoundError, type Profile, Proxy, type ProxyFromNameParams, ProxyService, Queue, type QueueClearParams, type QueueDeleteParams, QueueEmptyError, type QueueEphemeralParams, type QueueFromNameParams, QueueFullError, type QueueGetParams, type QueueIterateParams, type QueueLenParams, type QueuePutParams, QueueService, RemoteError, Retries, Sandbox, type SandboxCreateParams, type SandboxExecParams, SandboxFile, type SandboxFileMode, type SandboxFromNameParams, type SandboxListParams, SandboxService, SandboxTimeoutError, Secret, type SecretFromNameParams, type SecretFromObjectParams, SecretService, type StdioBehavior, type StreamMode, Tunnel, Volume, type VolumeEphemeralParams, type VolumeFromNameParams, VolumeService, checkForRenamedParams, close, initializeClient };
|
|
6096
|
+
export { AlreadyExistsError, App, type AppFromNameParams, AppService, type ClientOptions, CloudBucketMount, Cls, type ClsFromNameParams, ClsInstance, ClsService, type ClsWithBatchingParams, type ClsWithConcurrencyParams, type ClsWithOptionsParams, ContainerProcess, type DeleteOptions, type EphemeralOptions, FunctionCall, type FunctionCallCancelParams, type FunctionCallGetParams, FunctionCallService, type FunctionFromNameParams, FunctionService, type FunctionStats, FunctionTimeoutError, type FunctionUpdateAutoscalerParams, Function_, Image, type ImageDeleteParams, type ImageDockerfileCommandsParams, ImageService, InternalFailure, InvalidError, type LogLevel, type Logger, type LookupOptions, ModalClient, type ModalClientParams, type ModalReadStream, type ModalWriteStream, NotFoundError, type Profile, Proxy, type ProxyFromNameParams, ProxyService, Queue, type QueueClearParams, type QueueDeleteParams, QueueEmptyError, type QueueEphemeralParams, type QueueFromNameParams, QueueFullError, type QueueGetParams, type QueueIterateParams, type QueueLenParams, type QueuePutParams, QueueService, RemoteError, Retries, Sandbox, type SandboxCreateParams, type SandboxExecParams, SandboxFile, type SandboxFileMode, type SandboxFromNameParams, type SandboxListParams, SandboxService, SandboxTimeoutError, Secret, type SecretFromNameParams, type SecretFromObjectParams, SecretService, type StdioBehavior, type StreamMode, Tunnel, Volume, type VolumeEphemeralParams, type VolumeFromNameParams, VolumeService, checkForRenamedParams, close, initializeClient };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Client, Status } from 'nice-grpc';
|
|
1
|
+
import { Client, Status, ClientMiddleware } from 'nice-grpc';
|
|
2
2
|
import { BinaryWriter, BinaryReader } from '@bufbuild/protobuf/wire';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -5875,6 +5875,15 @@ interface Profile {
|
|
|
5875
5875
|
tokenSecret?: string;
|
|
5876
5876
|
environment?: string;
|
|
5877
5877
|
imageBuilderVersion?: string;
|
|
5878
|
+
logLevel?: string;
|
|
5879
|
+
}
|
|
5880
|
+
|
|
5881
|
+
type LogLevel = "debug" | "info" | "warn" | "error";
|
|
5882
|
+
interface Logger {
|
|
5883
|
+
debug(message: string, ...args: any[]): void;
|
|
5884
|
+
info(message: string, ...args: any[]): void;
|
|
5885
|
+
warn(message: string, ...args: any[]): void;
|
|
5886
|
+
error(message: string, ...args: any[]): void;
|
|
5878
5887
|
}
|
|
5879
5888
|
|
|
5880
5889
|
interface ModalClientParams {
|
|
@@ -5884,6 +5893,18 @@ interface ModalClientParams {
|
|
|
5884
5893
|
endpoint?: string;
|
|
5885
5894
|
timeoutMs?: number;
|
|
5886
5895
|
maxRetries?: number;
|
|
5896
|
+
logger?: Logger;
|
|
5897
|
+
logLevel?: LogLevel;
|
|
5898
|
+
/**
|
|
5899
|
+
* Custom gRPC middleware to be applied to all API calls.
|
|
5900
|
+
* These middleware are appended after Modal's built-in middleware
|
|
5901
|
+
* (authentication, retry logic, and timeouts), allowing you to add
|
|
5902
|
+
* telemetry, tracing, or other observability features.
|
|
5903
|
+
*
|
|
5904
|
+
* Note that the Modal gRPC API is not considered a public API, and
|
|
5905
|
+
* can change without warning.
|
|
5906
|
+
*/
|
|
5907
|
+
grpcMiddleware?: ClientMiddleware[];
|
|
5887
5908
|
/** @ignore */
|
|
5888
5909
|
cpClient?: ModalGrpcClient;
|
|
5889
5910
|
}
|
|
@@ -5920,8 +5941,10 @@ declare class ModalClient {
|
|
|
5920
5941
|
/** @ignore */
|
|
5921
5942
|
readonly cpClient: ModalGrpcClient;
|
|
5922
5943
|
readonly profile: Profile;
|
|
5944
|
+
readonly logger: Logger;
|
|
5923
5945
|
private ipClients;
|
|
5924
5946
|
private authTokenManager;
|
|
5947
|
+
private customMiddleware;
|
|
5925
5948
|
constructor(params?: ModalClientParams);
|
|
5926
5949
|
environmentName(environment?: string): string;
|
|
5927
5950
|
imageBuilderVersion(version?: string): string;
|
|
@@ -5930,6 +5953,8 @@ declare class ModalClient {
|
|
|
5930
5953
|
close(): void;
|
|
5931
5954
|
version(): string;
|
|
5932
5955
|
private createClient;
|
|
5956
|
+
/** Middleware to retry transient errors and timeouts for unary requests. */
|
|
5957
|
+
private retryMiddleware;
|
|
5933
5958
|
private authMiddleware;
|
|
5934
5959
|
}
|
|
5935
5960
|
type TimeoutOptions = {
|
|
@@ -6068,4 +6093,4 @@ declare class SandboxTimeoutError extends Error {
|
|
|
6068
6093
|
|
|
6069
6094
|
declare function checkForRenamedParams(params: any, renames: Record<string, string>): void;
|
|
6070
6095
|
|
|
6071
|
-
export { AlreadyExistsError, App, type AppFromNameParams, AppService, type ClientOptions, CloudBucketMount, Cls, type ClsFromNameParams, ClsInstance, ClsService, type ClsWithBatchingParams, type ClsWithConcurrencyParams, type ClsWithOptionsParams, ContainerProcess, type DeleteOptions, type EphemeralOptions, FunctionCall, type FunctionCallCancelParams, type FunctionCallGetParams, FunctionCallService, type FunctionFromNameParams, FunctionService, type FunctionStats, FunctionTimeoutError, type FunctionUpdateAutoscalerParams, Function_, Image, type ImageDeleteParams, type ImageDockerfileCommandsParams, ImageService, InternalFailure, InvalidError, type LookupOptions, ModalClient, type ModalClientParams, type ModalReadStream, type ModalWriteStream, NotFoundError, type Profile, Proxy, type ProxyFromNameParams, ProxyService, Queue, type QueueClearParams, type QueueDeleteParams, QueueEmptyError, type QueueEphemeralParams, type QueueFromNameParams, QueueFullError, type QueueGetParams, type QueueIterateParams, type QueueLenParams, type QueuePutParams, QueueService, RemoteError, Retries, Sandbox, type SandboxCreateParams, type SandboxExecParams, SandboxFile, type SandboxFileMode, type SandboxFromNameParams, type SandboxListParams, SandboxService, SandboxTimeoutError, Secret, type SecretFromNameParams, type SecretFromObjectParams, SecretService, type StdioBehavior, type StreamMode, Tunnel, Volume, type VolumeEphemeralParams, type VolumeFromNameParams, VolumeService, checkForRenamedParams, close, initializeClient };
|
|
6096
|
+
export { AlreadyExistsError, App, type AppFromNameParams, AppService, type ClientOptions, CloudBucketMount, Cls, type ClsFromNameParams, ClsInstance, ClsService, type ClsWithBatchingParams, type ClsWithConcurrencyParams, type ClsWithOptionsParams, ContainerProcess, type DeleteOptions, type EphemeralOptions, FunctionCall, type FunctionCallCancelParams, type FunctionCallGetParams, FunctionCallService, type FunctionFromNameParams, FunctionService, type FunctionStats, FunctionTimeoutError, type FunctionUpdateAutoscalerParams, Function_, Image, type ImageDeleteParams, type ImageDockerfileCommandsParams, ImageService, InternalFailure, InvalidError, type LogLevel, type Logger, type LookupOptions, ModalClient, type ModalClientParams, type ModalReadStream, type ModalWriteStream, NotFoundError, type Profile, Proxy, type ProxyFromNameParams, ProxyService, Queue, type QueueClearParams, type QueueDeleteParams, QueueEmptyError, type QueueEphemeralParams, type QueueFromNameParams, QueueFullError, type QueueGetParams, type QueueIterateParams, type QueueLenParams, type QueuePutParams, QueueService, RemoteError, Retries, Sandbox, type SandboxCreateParams, type SandboxExecParams, SandboxFile, type SandboxFileMode, type SandboxFromNameParams, type SandboxListParams, SandboxService, SandboxTimeoutError, Secret, type SecretFromNameParams, type SecretFromObjectParams, SecretService, type StdioBehavior, type StreamMode, Tunnel, Volume, type VolumeEphemeralParams, type VolumeFromNameParams, VolumeService, checkForRenamedParams, close, initializeClient };
|