@conduitplatform/grpc-sdk 0.16.0-alpha.2 → 0.16.0-alpha.21
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.mdx +1 -7
- package/dist/classes/ConduitAuthorizedResource.js +5 -6
- package/dist/classes/ConduitAuthorizedResource.js.map +1 -1
- package/dist/classes/ConduitModule.d.ts +9 -6
- package/dist/classes/ConduitModule.js +68 -141
- package/dist/classes/ConduitModule.js.map +1 -1
- package/dist/classes/ConduitSchema.js +3 -4
- package/dist/classes/ConduitSchema.js.map +1 -1
- package/dist/classes/Error.js +17 -40
- package/dist/classes/Error.js.map +1 -1
- package/dist/classes/HealthCheck.js +30 -71
- package/dist/classes/HealthCheck.js.map +1 -1
- package/dist/classes/index.d.ts +2 -6
- package/dist/classes/index.js +2 -6
- package/dist/classes/index.js.map +1 -1
- package/dist/index.d.ts +34 -31
- package/dist/index.js +331 -499
- package/dist/index.js.map +1 -1
- package/dist/interceptors/grpcSignedToken.d.ts +1 -1
- package/dist/interceptors/grpcSignedToken.js +7 -79
- package/dist/interceptors/grpcSignedToken.js.map +1 -1
- package/dist/interceptors/moduleName.d.ts +1 -1
- package/dist/interceptors/moduleName.js +7 -79
- package/dist/interceptors/moduleName.js.map +1 -1
- package/dist/interfaces/ConduitMiddleware.js.map +1 -0
- package/dist/{routing/interfaces → interfaces}/ConduitRoute.d.ts +2 -3
- package/dist/interfaces/ConduitRoute.js.map +1 -0
- package/dist/{routing → interfaces}/ConduitRouteReturn.d.ts +3 -3
- package/dist/{routing → interfaces}/ConduitRouteReturn.js +9 -18
- package/dist/interfaces/ConduitRouteReturn.js.map +1 -0
- package/dist/interfaces/ConduitSchemaExtension.d.ts +1 -1
- package/dist/interfaces/GrpcCallback.d.ts +1 -1
- package/dist/{utilities/Logger.d.ts → interfaces/IConduitLogger.d.ts} +4 -7
- package/dist/interfaces/{ConduitService.js → IConduitLogger.js} +1 -1
- package/dist/interfaces/IConduitLogger.js.map +1 -0
- package/dist/{metrics/index.d.ts → interfaces/IConduitMetrics.d.ts} +5 -11
- package/dist/interfaces/IConduitMetrics.js +3 -0
- package/dist/interfaces/IConduitMetrics.js.map +1 -0
- package/dist/interfaces/Indexable.d.ts +7 -8
- package/dist/interfaces/Model.d.ts +66 -13
- package/dist/interfaces/Model.js.map +1 -1
- package/dist/interfaces/Params.d.ts +3 -3
- package/dist/interfaces/ProxyRoute.js.map +1 -0
- package/dist/interfaces/RawQuery.d.ts +2 -2
- package/dist/interfaces/Route.d.ts +64 -0
- package/dist/interfaces/Route.js +12 -0
- package/dist/interfaces/Route.js.map +1 -0
- package/dist/{routing/interfaces → interfaces}/Socket.d.ts +4 -5
- package/dist/interfaces/Socket.js.map +1 -0
- package/dist/interfaces/UntypedArray.d.ts +1 -1
- package/dist/interfaces/index.d.ts +9 -2
- package/dist/interfaces/index.js +9 -2
- package/dist/interfaces/index.js.map +1 -1
- package/dist/{routing/interfaces → interfaces}/types.d.ts +11 -9
- package/dist/{routing/interfaces → interfaces}/types.js.map +1 -1
- package/dist/module.proto +72 -0
- package/dist/modules/admin/index.d.ts +5 -5
- package/dist/modules/admin/index.js +18 -37
- package/dist/modules/admin/index.js.map +1 -1
- package/dist/modules/authentication/index.d.ts +5 -2
- package/dist/modules/authentication/index.js +30 -40
- package/dist/modules/authentication/index.js.map +1 -1
- package/dist/modules/authorization/index.d.ts +6 -2
- package/dist/modules/authorization/index.js +38 -47
- package/dist/modules/authorization/index.js.map +1 -1
- package/dist/modules/chat/index.js +16 -34
- package/dist/modules/chat/index.js.map +1 -1
- package/dist/modules/config/index.d.ts +14 -5
- package/dist/modules/config/index.js +85 -177
- package/dist/modules/config/index.js.map +1 -1
- package/dist/modules/core/index.js +8 -26
- package/dist/modules/core/index.js.map +1 -1
- package/dist/modules/database/index.d.ts +24 -14
- package/dist/modules/database/index.js +193 -134
- package/dist/modules/database/index.js.map +1 -1
- package/dist/modules/email/index.js +15 -33
- package/dist/modules/email/index.js.map +1 -1
- package/dist/modules/index.d.ts +0 -2
- package/dist/modules/index.js +0 -2
- package/dist/modules/index.js.map +1 -1
- package/dist/modules/pushNotifications/index.js +38 -56
- package/dist/modules/pushNotifications/index.js.map +1 -1
- package/dist/modules/router/index.d.ts +5 -5
- package/dist/modules/router/index.js +20 -39
- package/dist/modules/router/index.js.map +1 -1
- package/dist/modules/sms/index.js +17 -35
- package/dist/modules/sms/index.js.map +1 -1
- package/dist/modules/storage/index.d.ts +8 -4
- package/dist/modules/storage/index.js +66 -37
- package/dist/modules/storage/index.js.map +1 -1
- package/dist/protoUtils/authentication.d.ts +127 -46
- package/dist/protoUtils/authentication.js +481 -220
- package/dist/protoUtils/authentication.js.map +1 -1
- package/dist/protoUtils/authorization.d.ts +147 -82
- package/dist/protoUtils/authorization.js +684 -512
- package/dist/protoUtils/authorization.js.map +1 -1
- package/dist/protoUtils/chat.d.ts +7 -61
- package/dist/protoUtils/chat.js +130 -313
- package/dist/protoUtils/chat.js.map +1 -1
- package/dist/protoUtils/core.d.ts +88 -107
- package/dist/protoUtils/core.js +699 -733
- package/dist/protoUtils/core.js.map +1 -1
- package/dist/protoUtils/database.d.ts +195 -15
- package/dist/protoUtils/database.js +1077 -666
- package/dist/protoUtils/database.js.map +1 -1
- package/dist/protoUtils/email.d.ts +3 -48
- package/dist/protoUtils/email.js +145 -284
- package/dist/protoUtils/email.js.map +1 -1
- package/dist/protoUtils/google/protobuf/empty.d.ts +27 -0
- package/dist/protoUtils/google/protobuf/empty.js +46 -0
- package/dist/protoUtils/google/protobuf/empty.js.map +1 -0
- package/dist/protoUtils/grpc_health_check.d.ts +3 -4
- package/dist/protoUtils/grpc_health_check.js +37 -36
- package/dist/protoUtils/grpc_health_check.js.map +1 -1
- package/dist/protoUtils/index.d.ts +12 -0
- package/dist/{routing/interfaces → protoUtils}/index.js +12 -6
- package/dist/protoUtils/index.js.map +1 -0
- package/dist/protoUtils/module.d.ts +251 -0
- package/dist/protoUtils/module.js +874 -0
- package/dist/protoUtils/module.js.map +1 -0
- package/dist/protoUtils/push-notifications.d.ts +7 -50
- package/dist/protoUtils/push-notifications.js +269 -356
- package/dist/protoUtils/push-notifications.js.map +1 -1
- package/dist/protoUtils/router.d.ts +45 -111
- package/dist/protoUtils/router.js +357 -575
- package/dist/protoUtils/router.js.map +1 -1
- package/dist/protoUtils/sms.d.ts +3 -48
- package/dist/protoUtils/sms.js +120 -219
- package/dist/protoUtils/sms.js.map +1 -1
- package/dist/protoUtils/storage.d.ts +144 -62
- package/dist/protoUtils/storage.js +782 -282
- package/dist/protoUtils/storage.js.map +1 -1
- package/dist/types/db.d.ts +11 -11
- package/dist/types/index.d.ts +3 -10
- package/dist/types/index.js +21 -24
- package/dist/types/index.js.map +1 -1
- package/dist/utilities/EventBus.d.ts +3 -1
- package/dist/utilities/EventBus.js +38 -17
- package/dist/utilities/EventBus.js.map +1 -1
- package/dist/utilities/RedisManager.js +11 -21
- package/dist/utilities/RedisManager.js.map +1 -1
- package/dist/utilities/StateManager.js +13 -14
- package/dist/utilities/StateManager.js.map +1 -1
- package/dist/utilities/env.js +4 -4
- package/dist/utilities/env.js.map +1 -1
- package/dist/utilities/index.d.ts +3 -2
- package/dist/utilities/index.js +3 -2
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/sleep.js +1 -1
- package/dist/utilities/sleep.js.map +1 -1
- package/package.json +24 -25
- package/dist/classes/ConduitActiveSchema.d.ts +0 -19
- package/dist/classes/ConduitActiveSchema.js +0 -57
- package/dist/classes/ConduitActiveSchema.js.map +0 -1
- package/dist/classes/ConduitServiceModule.d.ts +0 -26
- package/dist/classes/ConduitServiceModule.js +0 -166
- package/dist/classes/ConduitServiceModule.js.map +0 -1
- package/dist/classes/ConfigController.d.ts +0 -7
- package/dist/classes/ConfigController.js +0 -27
- package/dist/classes/ConfigController.js.map +0 -1
- package/dist/classes/GrpcServer.d.ts +0 -22
- package/dist/classes/GrpcServer.js +0 -207
- package/dist/classes/GrpcServer.js.map +0 -1
- package/dist/classes/ManagedModule.d.ts +0 -74
- package/dist/classes/ManagedModule.js +0 -333
- package/dist/classes/ManagedModule.js.map +0 -1
- package/dist/classes/ModuleManager.d.ts +0 -11
- package/dist/classes/ModuleManager.js +0 -204
- package/dist/classes/ModuleManager.js.map +0 -1
- package/dist/helpers/GrpcHelper.d.ts +0 -8
- package/dist/helpers/GrpcHelper.js +0 -43
- package/dist/helpers/GrpcHelper.js.map +0 -1
- package/dist/helpers/TypeHelpers.d.ts +0 -44
- package/dist/helpers/TypeHelpers.js +0 -144
- package/dist/helpers/TypeHelpers.js.map +0 -1
- package/dist/helpers/index.d.ts +0 -3
- package/dist/helpers/index.js +0 -20
- package/dist/helpers/index.js.map +0 -1
- package/dist/helpers/wrapGrpcFunctions.d.ts +0 -5
- package/dist/helpers/wrapGrpcFunctions.js +0 -56
- package/dist/helpers/wrapGrpcFunctions.js.map +0 -1
- package/dist/interfaces/ConduitService.d.ts +0 -8
- package/dist/interfaces/ConduitService.js.map +0 -1
- package/dist/metrics/MetricsServer.d.ts +0 -9
- package/dist/metrics/MetricsServer.js +0 -94
- package/dist/metrics/MetricsServer.js.map +0 -1
- package/dist/metrics/clientMiddleware.d.ts +0 -2
- package/dist/metrics/clientMiddleware.js +0 -265
- package/dist/metrics/clientMiddleware.js.map +0 -1
- package/dist/metrics/config/defaults.d.ts +0 -91
- package/dist/metrics/config/defaults.js +0 -93
- package/dist/metrics/config/defaults.js.map +0 -1
- package/dist/metrics/index.js +0 -152
- package/dist/metrics/index.js.map +0 -1
- package/dist/modules/forms/index.d.ts +0 -6
- package/dist/modules/forms/index.js +0 -32
- package/dist/modules/forms/index.js.map +0 -1
- package/dist/modules/functions/index.d.ts +0 -6
- package/dist/modules/functions/index.js +0 -32
- package/dist/modules/functions/index.js.map +0 -1
- package/dist/protoUtils/forms.d.ts +0 -58
- package/dist/protoUtils/forms.js +0 -127
- package/dist/protoUtils/forms.js.map +0 -1
- package/dist/protoUtils/functions.d.ts +0 -58
- package/dist/protoUtils/functions.js +0 -127
- package/dist/protoUtils/functions.js.map +0 -1
- package/dist/routing/ConduitRouteReturn.js.map +0 -1
- package/dist/routing/ProxyRouteBuilder.d.ts +0 -21
- package/dist/routing/ProxyRouteBuilder.js +0 -81
- package/dist/routing/ProxyRouteBuilder.js.map +0 -1
- package/dist/routing/RouteBuilder.d.ts +0 -24
- package/dist/routing/RouteBuilder.js +0 -107
- package/dist/routing/RouteBuilder.js.map +0 -1
- package/dist/routing/RoutingManager.d.ts +0 -33
- package/dist/routing/RoutingManager.js +0 -201
- package/dist/routing/RoutingManager.js.map +0 -1
- package/dist/routing/RoutingUtilities.d.ts +0 -7
- package/dist/routing/RoutingUtilities.js +0 -13
- package/dist/routing/RoutingUtilities.js.map +0 -1
- package/dist/routing/index.d.ts +0 -7
- package/dist/routing/index.js +0 -24
- package/dist/routing/index.js.map +0 -1
- package/dist/routing/interfaces/ConduitMiddleware.js.map +0 -1
- package/dist/routing/interfaces/ConduitRoute.js.map +0 -1
- package/dist/routing/interfaces/ProxyRoute.js.map +0 -1
- package/dist/routing/interfaces/Route.d.ts +0 -52
- package/dist/routing/interfaces/Route.js +0 -21
- package/dist/routing/interfaces/Route.js.map +0 -1
- package/dist/routing/interfaces/Socket.js.map +0 -1
- package/dist/routing/interfaces/index.d.ts +0 -6
- package/dist/routing/interfaces/index.js.map +0 -1
- package/dist/routing/wrapRouterFunctions.d.ts +0 -8
- package/dist/routing/wrapRouterFunctions.js +0 -132
- package/dist/routing/wrapRouterFunctions.js.map +0 -1
- package/dist/utilities/Logger.js +0 -255
- package/dist/utilities/Logger.js.map +0 -1
- package/dist/utilities/linearBackoffTimeout.d.ts +0 -10
- package/dist/utilities/linearBackoffTimeout.js +0 -119
- package/dist/utilities/linearBackoffTimeout.js.map +0 -1
- package/dist/utilities/merge.d.ts +0 -1
- package/dist/utilities/merge.js +0 -15
- package/dist/utilities/merge.js.map +0 -1
- /package/dist/{routing/interfaces → interfaces}/ConduitMiddleware.d.ts +0 -0
- /package/dist/{routing/interfaces → interfaces}/ConduitMiddleware.js +0 -0
- /package/dist/{routing/interfaces → interfaces}/ConduitRoute.js +0 -0
- /package/dist/{routing/interfaces → interfaces}/ProxyRoute.d.ts +0 -0
- /package/dist/{routing/interfaces → interfaces}/ProxyRoute.js +0 -0
- /package/dist/{routing/interfaces → interfaces}/Socket.js +0 -0
- /package/dist/{routing/interfaces → interfaces}/types.js +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,40 +1,48 @@
|
|
|
1
|
-
import { Admin, Authentication, Authorization, Chat, Config, Core, DatabaseProvider, Email,
|
|
2
|
-
import { EventBus } from './utilities
|
|
3
|
-
import { RedisManager } from './utilities/RedisManager';
|
|
4
|
-
import { StateManager } from './utilities/StateManager';
|
|
1
|
+
import { Admin, Authentication, Authorization, Chat, Config, Core, DatabaseProvider, Email, PushNotifications, Router, SMS, Storage } from './modules';
|
|
2
|
+
import { EventBus, RedisManager, StateManager } from './utilities';
|
|
5
3
|
import { CompatServiceDefinition } from 'nice-grpc/lib/service-definitions';
|
|
6
|
-
import { ConduitModule } from './classes
|
|
4
|
+
import { ConduitModule } from './classes';
|
|
7
5
|
import { Client } from 'nice-grpc';
|
|
8
|
-
import { HealthDefinition } from './protoUtils
|
|
6
|
+
import { ConduitModuleDefinition, HealthDefinition } from './protoUtils';
|
|
9
7
|
import { HealthCheckStatus } from './types';
|
|
10
|
-
import { ConduitLogger } from './utilities/Logger';
|
|
11
|
-
import { ConduitMetrics } from './metrics';
|
|
12
8
|
import { ClusterOptions, RedisOptions } from 'ioredis';
|
|
9
|
+
import { IConduitLogger, IConduitMetrics } from './interfaces';
|
|
13
10
|
export default class ConduitGrpcSdk {
|
|
11
|
+
private static middleware;
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly instance: string;
|
|
14
14
|
private readonly serverUrl;
|
|
15
15
|
private readonly _watchModules;
|
|
16
16
|
private readonly _core?;
|
|
17
17
|
private readonly _config?;
|
|
18
18
|
private readonly _admin?;
|
|
19
|
-
private _redisManager;
|
|
20
|
-
private _redisDetails?;
|
|
21
19
|
private readonly _modules;
|
|
22
20
|
private readonly _availableModules;
|
|
23
21
|
private _dynamicModules;
|
|
24
22
|
private _eventBus?;
|
|
25
23
|
private _stateManager?;
|
|
26
24
|
private lastSearch;
|
|
27
|
-
private readonly name;
|
|
28
|
-
private readonly instance;
|
|
29
25
|
private readonly urlRemap?;
|
|
30
26
|
private readonly _serviceHealthStatusGetter;
|
|
31
27
|
private readonly _grpcToken?;
|
|
32
28
|
private _initialized;
|
|
33
|
-
|
|
34
|
-
static
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
constructor(serverUrl: string, name?: string, watchModules?: boolean, logger?: IConduitLogger, serviceHealthStatusGetter?: () => HealthCheckStatus);
|
|
30
|
+
private static _Logger;
|
|
31
|
+
static get Logger(): IConduitLogger | Console;
|
|
32
|
+
private static _Metrics;
|
|
33
|
+
static get Metrics(): IConduitMetrics | undefined;
|
|
34
|
+
static set Metrics(metrics: IConduitMetrics | undefined);
|
|
35
|
+
static get interceptors(): any[];
|
|
36
|
+
private _redisManager;
|
|
37
|
+
get redisManager(): RedisManager;
|
|
38
|
+
private _redisDetails?;
|
|
39
|
+
get redisDetails(): RedisOptions | {
|
|
40
|
+
nodes: {
|
|
41
|
+
host: string;
|
|
42
|
+
port: number;
|
|
43
|
+
}[];
|
|
44
|
+
options: ClusterOptions;
|
|
45
|
+
};
|
|
38
46
|
get bus(): EventBus | null;
|
|
39
47
|
get state(): StateManager | null;
|
|
40
48
|
get core(): Core;
|
|
@@ -44,39 +52,34 @@ export default class ConduitGrpcSdk {
|
|
|
44
52
|
get database(): DatabaseProvider | null;
|
|
45
53
|
get databaseProvider(): DatabaseProvider | null;
|
|
46
54
|
get storage(): Storage | null;
|
|
47
|
-
get forms(): Forms | null;
|
|
48
55
|
get emailProvider(): Email | null;
|
|
49
56
|
get pushNotifications(): PushNotifications | null;
|
|
50
57
|
get authentication(): Authentication | null;
|
|
51
58
|
get authorization(): Authorization | null;
|
|
52
59
|
get sms(): SMS | null;
|
|
53
60
|
get chat(): Chat | null;
|
|
54
|
-
get
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
host: string;
|
|
58
|
-
port: number;
|
|
59
|
-
}[];
|
|
60
|
-
options: ClusterOptions;
|
|
61
|
-
};
|
|
61
|
+
get grpcToken(): string | undefined;
|
|
62
|
+
addMiddleware(middleware: any): void;
|
|
63
|
+
initialize(): Promise<void>;
|
|
62
64
|
watchModules(): void;
|
|
63
65
|
monitorModule(moduleName: string, callback: (serving: boolean) => void, wait?: boolean): void;
|
|
64
66
|
unmonitorModule(moduleName: string): void;
|
|
65
67
|
initializeEventBus(): Promise<EventBus>;
|
|
66
|
-
get redisManager(): RedisManager;
|
|
67
68
|
/**
|
|
68
69
|
* Gets all the registered modules from the config and creates clients for them.
|
|
69
70
|
* This will only work on known modules, since the primary usage for the sdk is internal
|
|
70
71
|
*/
|
|
71
72
|
initializeModules(): Promise<string | void>;
|
|
73
|
+
updateModuleHealth(moduleName: string, serving: boolean): void;
|
|
72
74
|
createModuleClient(moduleName: string, moduleUrl: string): void;
|
|
73
75
|
isModuleUp(moduleName: string, moduleUrl: string, service?: string): Promise<any>;
|
|
74
76
|
moduleClient(name: string, type: CompatServiceDefinition): void;
|
|
75
77
|
getModule<T extends CompatServiceDefinition>(name: string): ConduitModule<T> | undefined;
|
|
76
78
|
getServiceClient<T extends CompatServiceDefinition>(name: string): Client<T> | undefined;
|
|
79
|
+
getModuleClient(name: string): Client<ConduitModuleDefinition> | undefined;
|
|
77
80
|
getHealthClient<T extends CompatServiceDefinition>(name: string): Client<typeof HealthDefinition> | undefined;
|
|
78
81
|
isAvailable(moduleName: string): boolean;
|
|
79
|
-
waitForExistence(moduleName: string): Promise<
|
|
82
|
+
waitForExistence(moduleName: string, onlyIfServing?: boolean): Promise<unknown>;
|
|
80
83
|
onceModuleUp(moduleName: string, callback: () => void): void;
|
|
81
84
|
onceModuleDown(moduleName: string, callback: () => void): void;
|
|
82
85
|
/**
|
|
@@ -84,13 +87,13 @@ export default class ConduitGrpcSdk {
|
|
|
84
87
|
* @param force If true will check for new modules no matter the interval
|
|
85
88
|
*/
|
|
86
89
|
refreshModules(force?: boolean): Promise<string | void>;
|
|
87
|
-
|
|
90
|
+
private _initialize;
|
|
88
91
|
}
|
|
89
92
|
export * from './interfaces';
|
|
90
93
|
export * from './classes';
|
|
91
94
|
export * from './modules';
|
|
92
|
-
export * from './helpers';
|
|
93
95
|
export * from './constants';
|
|
94
|
-
export * from './routing';
|
|
95
96
|
export * from './types';
|
|
96
97
|
export * from './utilities';
|
|
98
|
+
export * from './protoUtils';
|
|
99
|
+
export * from '@grpc/grpc-js';
|