@cloudnux/cloud-sdk 0.18.0 → 0.20.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.ts CHANGED
@@ -1,13 +1,17 @@
1
- import { EventBrokerService, InvokeService, StorageService, LocationService, EventFunctionContext, EventBatchItemResult, HttpFunctionContext, InvokeFunctionContext, ScheduleFunctionContext, WebSocketFunctionContext, WebSocketService, CloudProvider } from '@cloudnux/core-cloud-provider';
2
- export { CloudProvider, ErrorCode, EventBrokerService, EventFunctionContext, EventMessage, EventRequest, EventResponse, HTTPAuth, HTTPRequest, HTTPResponse, HttpFunctionContext, InvokeFunctionContext, InvokeRequest, InvokeResponse, InvokeService, LocationAddress, LocationService, LocationSuggestion, ReverseGeocodeParams, ScheduleFunctionContext, ScheduleRequest, StorageService, StorageWriteOptions, SuggestionParams, WebSocketConnectionGoneError, WebSocketFunctionContext, WebSocketRequest, WebSocketResponse, WebSocketService } from '@cloudnux/core-cloud-provider';
1
+ import { EventBrokerService, InvokeService, StorageService, LocationService, EventFunctionContext, EventBatchItemResult, HttpFunctionContext, InvokeFunctionContext, ScheduleFunctionContext, WebSocketFunctionContext, FunctionsService, WebSocketService, LoggerService, ServiceKind, IService, CloudProvider } from '@cloudnux/core-cloud-provider';
2
+ export { CloudProvider, ErrorCode, EventBrokerService, EventFunctionContext, EventMessage, EventRequest, EventResponse, HTTPAuth, HTTPRequest, HTTPResponse, HttpFunctionContext, InvokeFunctionContext, InvokeRequest, InvokeResponse, InvokeService, LocationAddress, LocationService, LocationSuggestion, LoggerService, ReverseGeocodeParams, ScheduleFunctionContext, ScheduleRequest, StorageService, StorageWriteOptions, SuggestionParams, WebSocketConnectionGoneError, WebSocketFunctionContext, WebSocketRequest, WebSocketResponse, WebSocketService } from '@cloudnux/core-cloud-provider';
3
3
 
4
4
  declare const cloudEventBroker: () => EventBrokerService;
5
+ declare const resetCloudEventBroker: () => void;
5
6
 
6
7
  declare const cloudInvoke: () => InvokeService;
8
+ declare const resetCloudInvoke: () => void;
7
9
 
8
10
  declare const cloudStorage: () => StorageService;
11
+ declare const resetCloudStorage: () => void;
9
12
 
10
13
  declare const cloudLocations: () => LocationService;
14
+ declare const resetCloudLocations: () => void;
11
15
 
12
16
  type Handler$2 = (context: EventFunctionContext) => Promise<void>;
13
17
  declare function eventBrokerHandler(handler: Handler$2, ...args: any[]): Promise<EventBatchItemResult>;
@@ -24,8 +28,18 @@ declare function scheduleHandler(handler: Handler$1, ...args: any[]): Promise<an
24
28
  type Handler = (context: WebSocketFunctionContext) => Promise<void> | void;
25
29
  declare function websocketHandler(handler: Handler, ...args: any[]): Promise<any>;
26
30
 
31
+ declare const cloudFunctions: () => FunctionsService;
32
+ declare const resetCloudFunctions: () => void;
33
+
27
34
  declare const cloudWebSocket: () => WebSocketService;
35
+ declare const resetCloudWebSocket: () => void;
36
+
37
+ declare const cloudLogger: () => LoggerService;
38
+ declare const resetCloudLogger: () => void;
28
39
 
40
+ type CloudProviderOptions = {
41
+ serviceFactories?: Partial<Record<ServiceKind, () => IService>>;
42
+ };
29
43
  /**
30
44
  * Retrieves the current cloud provider instance.
31
45
  * @returns The current cloud provider instance.
@@ -37,7 +51,7 @@ declare function getCloudProvider(): CloudProvider;
37
51
  * @param cloudProvider - The cloud provider instance to set.
38
52
  * @throws Will throw an error if the cloud provider is not provided
39
53
  **/
40
- declare function useCloudProvider(cloudProvider: CloudProvider): void;
54
+ declare function useCloudProvider(cloudProvider: CloudProvider, options?: CloudProviderOptions): void;
41
55
 
42
56
  type ApiResponse<T = any> = {
43
57
  success: boolean;
@@ -113,4 +127,4 @@ declare enum HttpStatus {
113
127
  INTERNAL_SERVER_ERROR = 500
114
128
  }
115
129
 
116
- export { type ApiContentResponse, type ApiCursorListResponse, type ApiDeleteResponse, type ApiError, type ApiListResponse, type ApiResponse, type ApiResponseMeta, type ErrorResponse, HttpStatus, cloudEventBroker, cloudInvoke, cloudLocations, cloudStorage, cloudWebSocket, eventBrokerHandler, getCloudProvider, httpHandler, invokeHandler, scheduleHandler, useCloudProvider, websocketHandler };
130
+ export { type ApiContentResponse, type ApiCursorListResponse, type ApiDeleteResponse, type ApiError, type ApiListResponse, type ApiResponse, type ApiResponseMeta, type CloudProviderOptions, type ErrorResponse, HttpStatus, cloudEventBroker, cloudFunctions, cloudInvoke, cloudLocations, cloudLogger, cloudStorage, cloudWebSocket, eventBrokerHandler, getCloudProvider, httpHandler, invokeHandler, resetCloudEventBroker, resetCloudFunctions, resetCloudInvoke, resetCloudLocations, resetCloudLogger, resetCloudStorage, resetCloudWebSocket, scheduleHandler, useCloudProvider, websocketHandler };