@tinycloud/sdk-services 3.1.0-beta.6 → 3.1.0-beta.7
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/{BaseService-BhpVpA9b.d.cts → BaseService-C8zRy0ww.d.cts} +73 -1
- package/dist/{BaseService-CuV-ZVPs.d.ts → BaseService-DU-lE-Qx.d.ts} +73 -1
- package/dist/encryption/index.cjs +85 -3
- package/dist/encryption/index.cjs.map +1 -1
- package/dist/encryption/index.d.cts +1 -1
- package/dist/encryption/index.d.ts +1 -1
- package/dist/encryption/index.js +85 -3
- package/dist/encryption/index.js.map +1 -1
- package/dist/index.cjs +177 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -39
- package/dist/index.d.ts +11 -39
- package/dist/index.js +177 -30
- package/dist/index.js.map +1 -1
- package/dist/kv/index.cjs +123 -15
- package/dist/kv/index.cjs.map +1 -1
- package/dist/kv/index.d.cts +21 -11
- package/dist/kv/index.d.ts +21 -11
- package/dist/kv/index.js +123 -15
- package/dist/kv/index.js.map +1 -1
- package/dist/sql/index.cjs +106 -9
- package/dist/sql/index.cjs.map +1 -1
- package/dist/sql/index.d.cts +5 -2
- package/dist/sql/index.d.ts +5 -2
- package/dist/sql/index.js +106 -9
- package/dist/sql/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { a as IServiceContext, c as InvokeFunction, d as InvokeAnyFunction, F as FetchFunction, S as ServiceSession, e as RetryPolicy, T as TelemetryConfig, I as IService, E as EventHandler, b as ServiceError, R as Result, P as PermissionHint, f as StorageQuotaInfo } from './types-qwMmB7qB.cjs';
|
|
2
2
|
export { g as ErrorCode, h as ErrorCodes, i as FetchRequestInit, j as FetchResponse, k as InvocationFact, l as InvocationFacts, m as InvokeAnyEntry, n as ServiceErrorEvent, o as ServiceHeaders, p as ServiceRequestEvent, q as ServiceResponseEvent, r as ServiceRetryEvent, s as TelemetryEventHandler, t as TelemetryEvents, u as TelemetrySpanEvent, v as defaultRetryPolicy, w as err, x as ok, y as serviceError } from './types-qwMmB7qB.cjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { B as BaseService } from './BaseService-
|
|
4
|
+
import { B as BaseService } from './BaseService-C8zRy0ww.cjs';
|
|
5
|
+
export { a as BaseServiceOptions, R as RequestSignal, S as ServiceConstructor, b as ServiceRegistration } from './BaseService-C8zRy0ww.cjs';
|
|
5
6
|
import { IKVService } from './kv/index.cjs';
|
|
6
7
|
export { DEFAULT_SIGNED_READ_URL_EXPIRY_MS, IPrefixedKVService, KVAction, KVActionType, KVBatchPutItem, KVBatchPutOptions, KVBatchPutResponse, KVBatchReadResponse, KVCreateSignedReadUrlOptions, KVDeleteOptions, KVGetOptions, KVHeadOptions, KVListOptions, KVListResponse, KVPutOptions, KVResponse, KVResponseHeaders, KVService, KVServiceConfig, KVSignedReadUrlResponse, PrefixedKVService } from './kv/index.cjs';
|
|
7
8
|
export { BatchOptions, BatchResponse, DatabaseHandle, ExecuteOptions, ExecuteResponse, IDatabaseHandle, ISQLMigrations, ISQLService, QueryOptions, QueryResponse, SQLAction, SQLActionType, SQLMigrations, SQLService, SQLServiceConfig, SqlMigration, SqlMigrationApplyOptions, SqlMigrationApplyResponse, SqlStatement, SqlValue } from './sql/index.cjs';
|
|
@@ -1050,8 +1051,11 @@ declare function authExpiredError(service: string): ServiceError;
|
|
|
1050
1051
|
declare function networkError(service: string, message: string, cause?: Error): ServiceError;
|
|
1051
1052
|
/**
|
|
1052
1053
|
* Create a service error for timeouts.
|
|
1054
|
+
*
|
|
1055
|
+
* @param timeoutMs - The configured timeout that elapsed, when known
|
|
1056
|
+
* @param cause - The underlying timeout error, when known
|
|
1053
1057
|
*/
|
|
1054
|
-
declare function timeoutError(service: string): ServiceError;
|
|
1058
|
+
declare function timeoutError(service: string, timeoutMs?: number, cause?: Error): ServiceError;
|
|
1055
1059
|
/**
|
|
1056
1060
|
* Create a service error for aborted requests.
|
|
1057
1061
|
*/
|
|
@@ -1158,41 +1162,6 @@ declare function wrapError(service: string, error: unknown, defaultCode?: string
|
|
|
1158
1162
|
*/
|
|
1159
1163
|
declare function errorResult(error: ServiceError): Result<never, ServiceError>;
|
|
1160
1164
|
|
|
1161
|
-
/**
|
|
1162
|
-
* Base Service Types
|
|
1163
|
-
*
|
|
1164
|
-
* Types specific to the base service infrastructure.
|
|
1165
|
-
*/
|
|
1166
|
-
|
|
1167
|
-
/**
|
|
1168
|
-
* Service constructor type for registration.
|
|
1169
|
-
* Used by the SDK to instantiate services.
|
|
1170
|
-
*/
|
|
1171
|
-
interface ServiceConstructor<TConfig = Record<string, unknown>, TService extends IService = IService> {
|
|
1172
|
-
/** Service identifier used for registration */
|
|
1173
|
-
readonly serviceName: string;
|
|
1174
|
-
/** Create a new instance of the service */
|
|
1175
|
-
new (config?: TConfig): TService;
|
|
1176
|
-
}
|
|
1177
|
-
/**
|
|
1178
|
-
* Service registration entry.
|
|
1179
|
-
*/
|
|
1180
|
-
interface ServiceRegistration {
|
|
1181
|
-
/** The service class constructor */
|
|
1182
|
-
constructor: ServiceConstructor;
|
|
1183
|
-
/** Configuration for this service instance */
|
|
1184
|
-
config?: Record<string, unknown>;
|
|
1185
|
-
}
|
|
1186
|
-
/**
|
|
1187
|
-
* Options for base service operations.
|
|
1188
|
-
*/
|
|
1189
|
-
interface BaseServiceOptions {
|
|
1190
|
-
/** Override the default timeout for this operation */
|
|
1191
|
-
timeout?: number;
|
|
1192
|
-
/** Custom abort signal for this operation */
|
|
1193
|
-
signal?: AbortSignal;
|
|
1194
|
-
}
|
|
1195
|
-
|
|
1196
1165
|
/**
|
|
1197
1166
|
* DuckDB Service Types
|
|
1198
1167
|
*
|
|
@@ -1208,7 +1177,10 @@ interface DuckDbServiceConfig {
|
|
|
1208
1177
|
*/
|
|
1209
1178
|
defaultDatabase?: string;
|
|
1210
1179
|
/**
|
|
1211
|
-
*
|
|
1180
|
+
* Timeout in milliseconds for each DuckDB request, including reading the
|
|
1181
|
+
* response body. When it elapses the request is aborted and the operation
|
|
1182
|
+
* returns an `ErrorCodes.TIMEOUT` error. Unset (the default), `0`, or
|
|
1183
|
+
* `Infinity` means no timeout.
|
|
1212
1184
|
*/
|
|
1213
1185
|
timeout?: number;
|
|
1214
1186
|
/** Allow additional config properties */
|
|
@@ -2315,4 +2287,4 @@ declare class SecretsService implements ISecretsService {
|
|
|
2315
2287
|
listAll(): Promise<Result<SecretCatalogEntry[], SecretsError>>;
|
|
2316
2288
|
}
|
|
2317
2289
|
|
|
2318
|
-
export { type AuthorizationVerdict, BaseService, type
|
|
2290
|
+
export { type AuthorizationVerdict, BaseService, type ColumnInfo, type DataVaultConfig, DataVaultService, DecryptCapabilityProof, DuckDbAction, type DuckDbActionType, type DuckDbBatchOptions, type BatchResponse as DuckDbBatchResponse, DuckDbDatabaseHandle, type DuckDbExecuteOptions, type ExecuteResponse as DuckDbExecuteResponse, type DuckDbOptions, type DuckDbQueryOptions, type QueryResponse as DuckDbQueryResponse, DuckDbService, type DuckDbServiceConfig, type DuckDbStatement, type DuckDbValue, EventHandler, FetchFunction, GenericKVResponseSchema, type GenericKVResponseType, GenericResultSchema, type HookEvent, type HookServiceName, type HookStreamEvent, type HookSubscription, type HookWebhookListOptions, type HookWebhookRecord, type HookWebhookRegistration, type HookWebhookScope, type HookWebhookUnregisterOptions, HooksService, type HooksServiceConfig, type IDataVaultService, type IDuckDbDatabaseHandle, type IDuckDbService, IEncryptionService, type IHooksService, IKVService, type ISecretsService, IService, IServiceContext, InvokeAnyFunction, InvokeFunction, KVListResponseSchema, type KVListResponseType, KVListResultSchema, type KVListResultType, KVResponseHeadersSchema, type KVResponseHeadersType, type ParsedSecretCatalogKey, PermissionHint, type QuotaConfig, type QuotaStatus, type ResolvedSecretPath, Result, RetryPolicy, RetryPolicySchema, type RetryPolicyType, SECRET_NAME_RE, STORAGE_FULL_MESSAGE, STORAGE_WRITE_TOO_LARGE_MESSAGE, type SchemaInfo, type SecretCatalogEntry, type SecretPayload, type SecretScopeOptions, type SecretsError, SecretsService, ServiceContext, type ServiceContextConfig, ServiceError, ServiceErrorEventSchema, type ServiceErrorEventType, ServiceErrorSchema, type ServiceErrorType, ServiceRequestEventSchema, type ServiceRequestEventType, ServiceResponseEventSchema, type ServiceResponseEventType, ServiceRetryEventSchema, type ServiceRetryEventType, ServiceSession, ServiceSessionSchema, type ServiceSessionType, StorageQuotaInfo, type SubscribeOptions, type TableInfo, TelemetryConfig, TelemetrySpanEventSchema, type TelemetrySpanEventType, type TinyCloudDebugEnableOptions, type TinyCloudDebugEvent, type TinyCloudDebugLevel, TinyCloudDebugLogger, type TinyCloudDebugTimer, TinyCloudQuota, type ValidationError, type VaultCrypto, type VaultEntry, type VaultError, type VaultGetOptions, type VaultGrantOptions, VaultHeaders, type VaultListOptions, type VaultListPage, type VaultNetworkReadResult, VaultPublicSpaceKVActions, type VaultPutOptions, type ViewInfo, type WasmVaultFunctions, abortedError, authExpiredError, authRequiredError, authUnauthorizedError, authorizationVerdictOf, canonicalizeSecretScope, clearTinyCloudDebugLogs, createKVResponseSchema, createResultSchema, createVaultCrypto, disableTinyCloudDebug, enableTinyCloudDebug, errorResult, getTinyCloudDebugLogs, installTinyCloudDebugGlobals, isStorageFullError, networkError, notFoundError, parseAuthError, parseCapabilityResource, parsePermissionHint, parsePermissionHintFromErrorText, parseSecretCatalogKey, parseStorageQuotaBytes, permissionDeniedError, resolveSecretListPrefix, resolveSecretPath, storageLimitReachedError, storageQuotaExceededError, storageRejectionError, timeoutError, tinyCloudDebugLogger, validateKVListResponse, validateKVResponseHeaders, validateRetryPolicy, validateServiceError, validateServiceRequestEvent, validateServiceResponseEvent, validateServiceSession, validateTelemetrySpanEvent, validatedCapabilityOf, wrapError };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { a as IServiceContext, c as InvokeFunction, d as InvokeAnyFunction, F as FetchFunction, S as ServiceSession, e as RetryPolicy, T as TelemetryConfig, I as IService, E as EventHandler, b as ServiceError, R as Result, P as PermissionHint, f as StorageQuotaInfo } from './types-qwMmB7qB.js';
|
|
2
2
|
export { g as ErrorCode, h as ErrorCodes, i as FetchRequestInit, j as FetchResponse, k as InvocationFact, l as InvocationFacts, m as InvokeAnyEntry, n as ServiceErrorEvent, o as ServiceHeaders, p as ServiceRequestEvent, q as ServiceResponseEvent, r as ServiceRetryEvent, s as TelemetryEventHandler, t as TelemetryEvents, u as TelemetrySpanEvent, v as defaultRetryPolicy, w as err, x as ok, y as serviceError } from './types-qwMmB7qB.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { B as BaseService } from './BaseService-
|
|
4
|
+
import { B as BaseService } from './BaseService-DU-lE-Qx.js';
|
|
5
|
+
export { a as BaseServiceOptions, R as RequestSignal, S as ServiceConstructor, b as ServiceRegistration } from './BaseService-DU-lE-Qx.js';
|
|
5
6
|
import { IKVService } from './kv/index.js';
|
|
6
7
|
export { DEFAULT_SIGNED_READ_URL_EXPIRY_MS, IPrefixedKVService, KVAction, KVActionType, KVBatchPutItem, KVBatchPutOptions, KVBatchPutResponse, KVBatchReadResponse, KVCreateSignedReadUrlOptions, KVDeleteOptions, KVGetOptions, KVHeadOptions, KVListOptions, KVListResponse, KVPutOptions, KVResponse, KVResponseHeaders, KVService, KVServiceConfig, KVSignedReadUrlResponse, PrefixedKVService } from './kv/index.js';
|
|
7
8
|
export { BatchOptions, BatchResponse, DatabaseHandle, ExecuteOptions, ExecuteResponse, IDatabaseHandle, ISQLMigrations, ISQLService, QueryOptions, QueryResponse, SQLAction, SQLActionType, SQLMigrations, SQLService, SQLServiceConfig, SqlMigration, SqlMigrationApplyOptions, SqlMigrationApplyResponse, SqlStatement, SqlValue } from './sql/index.js';
|
|
@@ -1050,8 +1051,11 @@ declare function authExpiredError(service: string): ServiceError;
|
|
|
1050
1051
|
declare function networkError(service: string, message: string, cause?: Error): ServiceError;
|
|
1051
1052
|
/**
|
|
1052
1053
|
* Create a service error for timeouts.
|
|
1054
|
+
*
|
|
1055
|
+
* @param timeoutMs - The configured timeout that elapsed, when known
|
|
1056
|
+
* @param cause - The underlying timeout error, when known
|
|
1053
1057
|
*/
|
|
1054
|
-
declare function timeoutError(service: string): ServiceError;
|
|
1058
|
+
declare function timeoutError(service: string, timeoutMs?: number, cause?: Error): ServiceError;
|
|
1055
1059
|
/**
|
|
1056
1060
|
* Create a service error for aborted requests.
|
|
1057
1061
|
*/
|
|
@@ -1158,41 +1162,6 @@ declare function wrapError(service: string, error: unknown, defaultCode?: string
|
|
|
1158
1162
|
*/
|
|
1159
1163
|
declare function errorResult(error: ServiceError): Result<never, ServiceError>;
|
|
1160
1164
|
|
|
1161
|
-
/**
|
|
1162
|
-
* Base Service Types
|
|
1163
|
-
*
|
|
1164
|
-
* Types specific to the base service infrastructure.
|
|
1165
|
-
*/
|
|
1166
|
-
|
|
1167
|
-
/**
|
|
1168
|
-
* Service constructor type for registration.
|
|
1169
|
-
* Used by the SDK to instantiate services.
|
|
1170
|
-
*/
|
|
1171
|
-
interface ServiceConstructor<TConfig = Record<string, unknown>, TService extends IService = IService> {
|
|
1172
|
-
/** Service identifier used for registration */
|
|
1173
|
-
readonly serviceName: string;
|
|
1174
|
-
/** Create a new instance of the service */
|
|
1175
|
-
new (config?: TConfig): TService;
|
|
1176
|
-
}
|
|
1177
|
-
/**
|
|
1178
|
-
* Service registration entry.
|
|
1179
|
-
*/
|
|
1180
|
-
interface ServiceRegistration {
|
|
1181
|
-
/** The service class constructor */
|
|
1182
|
-
constructor: ServiceConstructor;
|
|
1183
|
-
/** Configuration for this service instance */
|
|
1184
|
-
config?: Record<string, unknown>;
|
|
1185
|
-
}
|
|
1186
|
-
/**
|
|
1187
|
-
* Options for base service operations.
|
|
1188
|
-
*/
|
|
1189
|
-
interface BaseServiceOptions {
|
|
1190
|
-
/** Override the default timeout for this operation */
|
|
1191
|
-
timeout?: number;
|
|
1192
|
-
/** Custom abort signal for this operation */
|
|
1193
|
-
signal?: AbortSignal;
|
|
1194
|
-
}
|
|
1195
|
-
|
|
1196
1165
|
/**
|
|
1197
1166
|
* DuckDB Service Types
|
|
1198
1167
|
*
|
|
@@ -1208,7 +1177,10 @@ interface DuckDbServiceConfig {
|
|
|
1208
1177
|
*/
|
|
1209
1178
|
defaultDatabase?: string;
|
|
1210
1179
|
/**
|
|
1211
|
-
*
|
|
1180
|
+
* Timeout in milliseconds for each DuckDB request, including reading the
|
|
1181
|
+
* response body. When it elapses the request is aborted and the operation
|
|
1182
|
+
* returns an `ErrorCodes.TIMEOUT` error. Unset (the default), `0`, or
|
|
1183
|
+
* `Infinity` means no timeout.
|
|
1212
1184
|
*/
|
|
1213
1185
|
timeout?: number;
|
|
1214
1186
|
/** Allow additional config properties */
|
|
@@ -2315,4 +2287,4 @@ declare class SecretsService implements ISecretsService {
|
|
|
2315
2287
|
listAll(): Promise<Result<SecretCatalogEntry[], SecretsError>>;
|
|
2316
2288
|
}
|
|
2317
2289
|
|
|
2318
|
-
export { type AuthorizationVerdict, BaseService, type
|
|
2290
|
+
export { type AuthorizationVerdict, BaseService, type ColumnInfo, type DataVaultConfig, DataVaultService, DecryptCapabilityProof, DuckDbAction, type DuckDbActionType, type DuckDbBatchOptions, type BatchResponse as DuckDbBatchResponse, DuckDbDatabaseHandle, type DuckDbExecuteOptions, type ExecuteResponse as DuckDbExecuteResponse, type DuckDbOptions, type DuckDbQueryOptions, type QueryResponse as DuckDbQueryResponse, DuckDbService, type DuckDbServiceConfig, type DuckDbStatement, type DuckDbValue, EventHandler, FetchFunction, GenericKVResponseSchema, type GenericKVResponseType, GenericResultSchema, type HookEvent, type HookServiceName, type HookStreamEvent, type HookSubscription, type HookWebhookListOptions, type HookWebhookRecord, type HookWebhookRegistration, type HookWebhookScope, type HookWebhookUnregisterOptions, HooksService, type HooksServiceConfig, type IDataVaultService, type IDuckDbDatabaseHandle, type IDuckDbService, IEncryptionService, type IHooksService, IKVService, type ISecretsService, IService, IServiceContext, InvokeAnyFunction, InvokeFunction, KVListResponseSchema, type KVListResponseType, KVListResultSchema, type KVListResultType, KVResponseHeadersSchema, type KVResponseHeadersType, type ParsedSecretCatalogKey, PermissionHint, type QuotaConfig, type QuotaStatus, type ResolvedSecretPath, Result, RetryPolicy, RetryPolicySchema, type RetryPolicyType, SECRET_NAME_RE, STORAGE_FULL_MESSAGE, STORAGE_WRITE_TOO_LARGE_MESSAGE, type SchemaInfo, type SecretCatalogEntry, type SecretPayload, type SecretScopeOptions, type SecretsError, SecretsService, ServiceContext, type ServiceContextConfig, ServiceError, ServiceErrorEventSchema, type ServiceErrorEventType, ServiceErrorSchema, type ServiceErrorType, ServiceRequestEventSchema, type ServiceRequestEventType, ServiceResponseEventSchema, type ServiceResponseEventType, ServiceRetryEventSchema, type ServiceRetryEventType, ServiceSession, ServiceSessionSchema, type ServiceSessionType, StorageQuotaInfo, type SubscribeOptions, type TableInfo, TelemetryConfig, TelemetrySpanEventSchema, type TelemetrySpanEventType, type TinyCloudDebugEnableOptions, type TinyCloudDebugEvent, type TinyCloudDebugLevel, TinyCloudDebugLogger, type TinyCloudDebugTimer, TinyCloudQuota, type ValidationError, type VaultCrypto, type VaultEntry, type VaultError, type VaultGetOptions, type VaultGrantOptions, VaultHeaders, type VaultListOptions, type VaultListPage, type VaultNetworkReadResult, VaultPublicSpaceKVActions, type VaultPutOptions, type ViewInfo, type WasmVaultFunctions, abortedError, authExpiredError, authRequiredError, authUnauthorizedError, authorizationVerdictOf, canonicalizeSecretScope, clearTinyCloudDebugLogs, createKVResponseSchema, createResultSchema, createVaultCrypto, disableTinyCloudDebug, enableTinyCloudDebug, errorResult, getTinyCloudDebugLogs, installTinyCloudDebugGlobals, isStorageFullError, networkError, notFoundError, parseAuthError, parseCapabilityResource, parsePermissionHint, parsePermissionHintFromErrorText, parseSecretCatalogKey, parseStorageQuotaBytes, permissionDeniedError, resolveSecretListPrefix, resolveSecretPath, storageLimitReachedError, storageQuotaExceededError, storageRejectionError, timeoutError, tinyCloudDebugLogger, validateKVListResponse, validateKVResponseHeaders, validateRetryPolicy, validateServiceError, validateServiceRequestEvent, validateServiceResponseEvent, validateServiceSession, validateTelemetrySpanEvent, validatedCapabilityOf, wrapError };
|