@conduitplatform/grpc-sdk 0.16.0-alpha.1 → 0.16.0-alpha.10
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/ConduitModule.d.ts +9 -6
- package/dist/classes/ConduitModule.js +85 -48
- package/dist/classes/ConduitModule.js.map +1 -1
- package/dist/classes/ConduitSchema.js.map +1 -1
- package/dist/classes/HealthCheck.js +36 -9
- 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 +33 -31
- package/dist/index.js +155 -176
- package/dist/index.js.map +1 -1
- package/dist/interceptors/grpcSignedToken.d.ts +1 -1
- package/dist/interceptors/grpcSignedToken.js +2 -2
- package/dist/interceptors/moduleName.d.ts +1 -1
- package/dist/interceptors/moduleName.js +2 -2
- 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/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 +63 -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 +61 -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 +14 -0
- package/dist/modules/admin/index.d.ts +5 -4
- package/dist/modules/admin/index.js +12 -5
- package/dist/modules/admin/index.js.map +1 -1
- package/dist/modules/authorization/index.d.ts +3 -2
- package/dist/modules/authorization/index.js +4 -4
- package/dist/modules/authorization/index.js.map +1 -1
- package/dist/modules/config/index.d.ts +5 -5
- package/dist/modules/config/index.js +38 -28
- package/dist/modules/config/index.js.map +1 -1
- package/dist/modules/database/index.d.ts +6 -5
- package/dist/modules/database/index.js +15 -15
- package/dist/modules/database/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/router/index.d.ts +4 -3
- package/dist/modules/router/index.js +9 -2
- package/dist/modules/router/index.js.map +1 -1
- package/dist/modules/storage/index.d.ts +6 -2
- package/dist/modules/storage/index.js +22 -2
- package/dist/modules/storage/index.js.map +1 -1
- package/dist/protoUtils/authentication.d.ts +3 -48
- package/dist/protoUtils/authentication.js +1 -110
- package/dist/protoUtils/authentication.js.map +1 -1
- package/dist/protoUtils/authorization.d.ts +28 -82
- package/dist/protoUtils/authorization.js +10 -156
- package/dist/protoUtils/authorization.js.map +1 -1
- package/dist/protoUtils/chat.d.ts +7 -61
- package/dist/protoUtils/chat.js +3 -149
- package/dist/protoUtils/chat.js.map +1 -1
- package/dist/protoUtils/core.d.ts +115 -90
- package/dist/protoUtils/core.js +110 -48
- package/dist/protoUtils/core.js.map +1 -1
- package/dist/protoUtils/database.d.ts +7 -17
- package/dist/protoUtils/database.js +3 -41
- package/dist/protoUtils/database.js.map +1 -1
- package/dist/protoUtils/email.d.ts +3 -48
- package/dist/protoUtils/email.js +1 -110
- package/dist/protoUtils/email.js.map +1 -1
- package/dist/protoUtils/google/protobuf/empty.d.ts +25 -0
- package/dist/protoUtils/google/protobuf/empty.js +47 -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 +1 -2
- 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/{forms.d.ts → module.d.ts} +6 -7
- package/dist/protoUtils/{forms.js → module.js} +5 -6
- package/dist/protoUtils/module.js.map +1 -0
- package/dist/protoUtils/push-notifications.d.ts +3 -48
- package/dist/protoUtils/push-notifications.js +1 -110
- package/dist/protoUtils/push-notifications.js.map +1 -1
- package/dist/protoUtils/router.d.ts +45 -64
- package/dist/protoUtils/router.js +110 -156
- package/dist/protoUtils/router.js.map +1 -1
- package/dist/protoUtils/sms.d.ts +3 -48
- package/dist/protoUtils/sms.js +1 -110
- package/dist/protoUtils/sms.js.map +1 -1
- package/dist/protoUtils/storage.d.ts +134 -62
- package/dist/protoUtils/storage.js +433 -170
- 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 +15 -0
- package/dist/types/index.js.map +1 -1
- package/dist/utilities/RedisManager.js.map +1 -1
- package/dist/utilities/env.d.ts +1 -0
- package/dist/utilities/env.js +37 -0
- package/dist/utilities/env.js.map +1 -0
- package/dist/utilities/index.d.ts +4 -2
- package/dist/utilities/index.js +4 -2
- package/dist/utilities/index.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 -205
- 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.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}/ConduitRouteReturn.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
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { Indexable } from '../interfaces';
|
|
2
1
|
import winston, { LogCallback, Logger } from 'winston';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
addTransport(transport: winston.transport): void;
|
|
2
|
+
import { Indexable } from './Indexable';
|
|
3
|
+
export interface IConduitLogger {
|
|
4
|
+
get winston(): winston.Logger;
|
|
7
5
|
log(message: string, level?: string, cb?: LogCallback): Logger;
|
|
8
6
|
logObject(object: Indexable, message?: string, level?: string, cb?: LogCallback): Logger;
|
|
9
7
|
info(message: string, cb?: LogCallback): Logger;
|
|
@@ -11,6 +9,5 @@ export declare class ConduitLogger {
|
|
|
11
9
|
error(message: string | Error, cb?: LogCallback): Logger;
|
|
12
10
|
http(message: string, cb?: LogCallback): Logger;
|
|
13
11
|
verbose(message: string, cb?: LogCallback): Logger;
|
|
14
|
-
|
|
12
|
+
addTransport(transport: winston.transport): void;
|
|
15
13
|
}
|
|
16
|
-
export declare function setupLoki(module: string, instance: string): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IConduitLogger.js","sourceRoot":"","sources":["../../src/interfaces/IConduitLogger.ts"],"names":[],"mappings":""}
|
|
@@ -1,22 +1,16 @@
|
|
|
1
|
-
import { Counter, CounterConfiguration, Gauge, GaugeConfiguration, Histogram, HistogramConfiguration, LabelValues, Summary, SummaryConfiguration } from 'prom-client';
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
private readonly moduleName;
|
|
5
|
-
private readonly instance;
|
|
6
|
-
private readonly _registry;
|
|
7
|
-
private _httpServer;
|
|
8
|
-
constructor(moduleName: string, instance: string);
|
|
1
|
+
import { Counter, CounterConfiguration, Gauge, GaugeConfiguration, Histogram, HistogramConfiguration, LabelValues, Metric, MetricConfiguration, Summary, SummaryConfiguration } from 'prom-client';
|
|
2
|
+
import { MetricType } from '../types';
|
|
3
|
+
export interface IConduitMetrics {
|
|
9
4
|
initializeDefaultMetrics(): void;
|
|
10
|
-
registerMetric(type: MetricType, config: MetricConfiguration): void;
|
|
5
|
+
registerMetric(type: MetricType, config: MetricConfiguration<string>): void;
|
|
11
6
|
collectDefaultMetrics(): void;
|
|
12
7
|
createCounter(config: CounterConfiguration<any>): Counter<any>;
|
|
13
8
|
createSummary(config: SummaryConfiguration<any>): Summary<any>;
|
|
14
9
|
createHistogram(config: HistogramConfiguration<any>): Histogram<any>;
|
|
15
10
|
createGauge(config: GaugeConfiguration<any>): Gauge<any>;
|
|
16
|
-
getMetric(name: string):
|
|
11
|
+
getMetric(name: string): Metric<string> | undefined;
|
|
17
12
|
increment(metric: string, increment?: number, labels?: LabelValues<any>): void;
|
|
18
13
|
decrement(metric: string, decrement?: number, labels?: LabelValues<any>): void;
|
|
19
14
|
set(metric: string, value: number, labels?: LabelValues<any>): void;
|
|
20
15
|
observe(metric: string, value: number, labels?: LabelValues<any>): void;
|
|
21
|
-
private addPrefix;
|
|
22
16
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IConduitMetrics.js","sourceRoot":"","sources":["../../src/interfaces/IConduitMetrics.ts"],"names":[],"mappings":""}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type Indexable = {
|
|
2
2
|
[key: string]: any;
|
|
3
3
|
};
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export declare type Query = Indexable;
|
|
4
|
+
export type Params = Indexable;
|
|
5
|
+
export type Document = Indexable;
|
|
6
|
+
export type Route = Indexable;
|
|
7
|
+
export type Headers = Indexable;
|
|
8
|
+
export type Context = Indexable;
|
|
9
|
+
export type Cookies = Indexable;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { UntypedArray } from './UntypedArray';
|
|
2
1
|
export declare enum TYPE {
|
|
3
2
|
String = "String",
|
|
4
3
|
Number = "Number",
|
|
@@ -38,23 +37,73 @@ export declare enum PostgresIndexType {
|
|
|
38
37
|
GIN = "GIN",
|
|
39
38
|
BRIN = "BRIN"
|
|
40
39
|
}
|
|
41
|
-
export
|
|
42
|
-
|
|
43
|
-
type?: TYPE |
|
|
40
|
+
export type Array = any[];
|
|
41
|
+
type BaseConduitModelField = {
|
|
42
|
+
type?: TYPE | TYPE[] | ConduitModel | ArrayConduitModel[];
|
|
44
43
|
sqlType?: SQLDataType;
|
|
45
|
-
enum?: any;
|
|
46
44
|
default?: any;
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
description?: string;
|
|
46
|
+
required?: boolean;
|
|
49
47
|
select?: boolean;
|
|
48
|
+
};
|
|
49
|
+
type UniqueAndRequiredField = {
|
|
50
|
+
unique: true;
|
|
51
|
+
required: true;
|
|
52
|
+
index?: SchemaFieldIndex;
|
|
53
|
+
};
|
|
54
|
+
type NotUniqueField = {
|
|
55
|
+
unique?: false;
|
|
50
56
|
required?: boolean;
|
|
51
|
-
description?: string;
|
|
52
|
-
systemRequired?: boolean;
|
|
53
57
|
index?: SchemaFieldIndex;
|
|
54
|
-
}
|
|
55
|
-
export
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
};
|
|
59
|
+
export type BasicConduitModelField = BaseConduitModelField & (UniqueAndRequiredField | NotUniqueField);
|
|
60
|
+
export type ConduitModelFieldRelation = BasicConduitModelField & {
|
|
61
|
+
type: TYPE.Relation | TYPE.Relation[];
|
|
62
|
+
model: string;
|
|
63
|
+
};
|
|
64
|
+
export type ConduitModelFieldJSON = BasicConduitModelField & {
|
|
65
|
+
type: TYPE.JSON | TYPE.JSON[];
|
|
66
|
+
};
|
|
67
|
+
export type ConduitModelFieldEnum = BasicConduitModelField & {
|
|
68
|
+
type: ExcludeJSONRelation<TYPE> | ExcludeJSONRelation<TYPE>[];
|
|
69
|
+
enum: any;
|
|
70
|
+
};
|
|
71
|
+
export type ConduitModelField = BasicConduitModelField & {
|
|
72
|
+
type?: ExcludeJSONRelation<TYPE> | ExcludeJSONRelation<TYPE>[] | ConduitModel | ArrayConduitModel[];
|
|
73
|
+
};
|
|
74
|
+
export type allowedTypes = ExcludeRelation<TYPE> | ConduitModelField | ConduitModelFieldEnum | ConduitModelFieldJSON | ConduitModelFieldRelation;
|
|
75
|
+
type embeddableArray = ExcludeRelation<TYPE> | ConduitModelField | ConduitModelFieldEnum | ConduitModelFieldJSON;
|
|
76
|
+
type ExcludeRelation<T> = T extends TYPE.Relation ? never : T;
|
|
77
|
+
type ExcludeJSON<T> = T extends TYPE.JSON ? never : T;
|
|
78
|
+
type ExcludeJSONRelation<T> = ExcludeJSON<ExcludeRelation<T>>;
|
|
79
|
+
export type ArrayConduitModel = {
|
|
80
|
+
type?: never;
|
|
81
|
+
sqlType?: never;
|
|
82
|
+
default?: never;
|
|
83
|
+
description?: never;
|
|
84
|
+
required?: never;
|
|
85
|
+
select?: never;
|
|
86
|
+
unique?: never;
|
|
87
|
+
index?: never;
|
|
88
|
+
enum?: never;
|
|
89
|
+
model?: never;
|
|
90
|
+
} & {
|
|
91
|
+
[field in string]: embeddableArray | embeddableArray[];
|
|
92
|
+
};
|
|
93
|
+
export type ConduitModel = {
|
|
94
|
+
type?: never;
|
|
95
|
+
sqlType?: never;
|
|
96
|
+
default?: never;
|
|
97
|
+
description?: never;
|
|
98
|
+
required?: never;
|
|
99
|
+
select?: never;
|
|
100
|
+
unique?: never;
|
|
101
|
+
index?: never;
|
|
102
|
+
enum?: never;
|
|
103
|
+
model?: never;
|
|
104
|
+
} & {
|
|
105
|
+
[field in string]: allowedTypes | allowedTypes[] | ConduitModel;
|
|
106
|
+
};
|
|
58
107
|
export declare const ConduitModelOptionsPermModifyType: string[];
|
|
59
108
|
export interface ConduitSchemaOptions {
|
|
60
109
|
timestamps?: boolean;
|
|
@@ -115,3 +164,4 @@ export interface PostgresIndexOptions {
|
|
|
115
164
|
[opt: string]: any;
|
|
116
165
|
};
|
|
117
166
|
}
|
|
167
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Model.js","sourceRoot":"","sources":["../../src/interfaces/Model.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Model.js","sourceRoot":"","sources":["../../src/interfaces/Model.ts"],"names":[],"mappings":";;;AAAA,IAAY,IAQX;AARD,WAAY,IAAI;IACd,yBAAiB,CAAA;IACjB,yBAAiB,CAAA;IACjB,2BAAmB,CAAA;IACnB,qBAAa,CAAA;IACb,6BAAqB,CAAA;IACrB,qBAAa,CAAA;IACb,6BAAqB,CAAA;AACvB,CAAC,EARW,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAQf;AAED,IAAY,WAYX;AAZD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,4BAAa,CAAA;IACb,4BAAa,CAAA;IACb,0BAAW,CAAA;IACX,gCAAiB,CAAA;IACjB,8BAAe,CAAA;IACf,gCAAiB,CAAA;IACjB,kCAAmB,CAAA;IACnB,4BAAa,CAAA;IACb,oCAAqB,CAAA;IACrB,sCAAuB,CAAA;AACzB,CAAC,EAZW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAYtB;AAED,IAAY,cAQX;AARD,WAAY,cAAc;IACxB,6DAAa,CAAA;IACb,gEAAe,CAAA;IACf,qCAAmB,CAAA;IACnB,iDAA+B,CAAA;IAC/B,6CAA2B,CAAA;IAC3B,mCAAiB,CAAA;IACjB,+BAAa,CAAA;AACf,CAAC,EARW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAQzB;AAED,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IAC3B,oCAAe,CAAA;IACf,kCAAa,CAAA;IACb,kCAAa,CAAA;IACb,sCAAiB,CAAA;IACjB,gCAAW,CAAA;IACX,kCAAa,CAAA;AACf,CAAC,EAPW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAO5B;AAkGY,QAAA,iCAAiC,GAAG;IAC/C,YAAY;IACZ,SAAS;IACT,eAAe;CAChB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Indexable } from './Indexable';
|
|
2
|
-
export
|
|
2
|
+
export type UrlParams = {
|
|
3
3
|
[key: string]: string;
|
|
4
4
|
};
|
|
5
|
-
export
|
|
5
|
+
export type QueryParams = {
|
|
6
6
|
[key: string]: string | string[];
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type BodyParams = Indexable;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProxyRoute.js","sourceRoot":"","sources":["../../src/interfaces/ProxyRoute.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IAC3B,gCAAW,CAAA;IACX,kCAAa,CAAA;IACb,mCAAc,CAAA;IACd,oCAAe,CAAA;IACf,sCAAiB,CAAA;IACjB,gCAAW,CAAA;AACb,CAAC,EAPW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAO5B"}
|
|
@@ -2,7 +2,7 @@ export interface RawQuery {
|
|
|
2
2
|
mongoQuery?: RawMongoQuery;
|
|
3
3
|
sqlQuery?: RawSQLQuery;
|
|
4
4
|
}
|
|
5
|
-
export
|
|
5
|
+
export type RawMongoQuery = {
|
|
6
6
|
aggregate?: object[];
|
|
7
7
|
count?: object;
|
|
8
8
|
deleteOne?: object;
|
|
@@ -16,7 +16,7 @@ export declare type RawMongoQuery = {
|
|
|
16
16
|
updateMany?: object | object[];
|
|
17
17
|
options?: object;
|
|
18
18
|
};
|
|
19
|
-
export
|
|
19
|
+
export type RawSQLQuery = {
|
|
20
20
|
query: string;
|
|
21
21
|
options?: object;
|
|
22
22
|
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { allowedTypes, ConduitModel, TYPE } from './Model';
|
|
2
|
+
import { Indexable } from './Indexable';
|
|
3
|
+
export interface ConduitRouteParameters {
|
|
4
|
+
params?: Indexable;
|
|
5
|
+
path?: string;
|
|
6
|
+
headers: Indexable;
|
|
7
|
+
context?: Indexable;
|
|
8
|
+
cookies?: Indexable;
|
|
9
|
+
bodyParams?: Indexable;
|
|
10
|
+
urlParams?: Indexable;
|
|
11
|
+
queryParams?: Indexable;
|
|
12
|
+
}
|
|
13
|
+
type AllowedTypes = TYPE.String | TYPE.Number | TYPE.Boolean | TYPE.Date | TYPE.ObjectId;
|
|
14
|
+
export type ConduitUrlParam = AllowedTypes | {
|
|
15
|
+
type: AllowedTypes;
|
|
16
|
+
required?: boolean;
|
|
17
|
+
};
|
|
18
|
+
export type ConduitQueryParam = ConduitUrlParam | AllowedTypes[] | {
|
|
19
|
+
type: AllowedTypes[];
|
|
20
|
+
required?: boolean;
|
|
21
|
+
};
|
|
22
|
+
export type ConduitUrlParams = {
|
|
23
|
+
[field in string]: ConduitUrlParam;
|
|
24
|
+
};
|
|
25
|
+
export type ConduitQueryParams = {
|
|
26
|
+
[field in string]: ConduitQueryParam;
|
|
27
|
+
};
|
|
28
|
+
export type ConduitReturnField = keyof typeof TYPE | TYPE | ConduitModel | {
|
|
29
|
+
[key: string]: TYPE | TYPE[] | ConduitModel | ConduitModel[];
|
|
30
|
+
};
|
|
31
|
+
export type ConduitReturnModel = {
|
|
32
|
+
[field: string]: ConduitReturnField | allowedTypes | allowedTypes[] | string | string[];
|
|
33
|
+
};
|
|
34
|
+
export type ConduitReturn = ConduitReturnField | ConduitReturnModel | string;
|
|
35
|
+
export declare enum ConduitRouteActions {
|
|
36
|
+
GET = "GET",
|
|
37
|
+
POST = "POST",
|
|
38
|
+
UPDATE = "PUT",
|
|
39
|
+
PATCH = "PATCH",
|
|
40
|
+
DELETE = "DELETE"
|
|
41
|
+
}
|
|
42
|
+
export interface ConduitRouteOptions {
|
|
43
|
+
queryParams?: ConduitQueryParams;
|
|
44
|
+
bodyParams?: ConduitModel;
|
|
45
|
+
urlParams?: ConduitUrlParams;
|
|
46
|
+
action: ConduitRouteActions;
|
|
47
|
+
path: string;
|
|
48
|
+
name?: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
middlewares?: string[];
|
|
51
|
+
cacheControl?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface ConduitRouteObject {
|
|
54
|
+
options: ConduitRouteOptions;
|
|
55
|
+
returns: {
|
|
56
|
+
name: string;
|
|
57
|
+
fields: ConduitReturn;
|
|
58
|
+
};
|
|
59
|
+
grpcFunction: string;
|
|
60
|
+
}
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConduitRouteActions = void 0;
|
|
4
|
+
var ConduitRouteActions;
|
|
5
|
+
(function (ConduitRouteActions) {
|
|
6
|
+
ConduitRouteActions["GET"] = "GET";
|
|
7
|
+
ConduitRouteActions["POST"] = "POST";
|
|
8
|
+
ConduitRouteActions["UPDATE"] = "PUT";
|
|
9
|
+
ConduitRouteActions["PATCH"] = "PATCH";
|
|
10
|
+
ConduitRouteActions["DELETE"] = "DELETE";
|
|
11
|
+
})(ConduitRouteActions = exports.ConduitRouteActions || (exports.ConduitRouteActions = {}));
|
|
12
|
+
//# sourceMappingURL=Route.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Route.js","sourceRoot":"","sources":["../../src/interfaces/Route.ts"],"names":[],"mappings":";;;AA4CA,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC7B,kCAAW,CAAA;IACX,oCAAa,CAAA;IACb,qCAAc,CAAA;IACd,sCAAe,CAAA;IACf,wCAAiB,CAAA;AACnB,CAAC,EANW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAM9B"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { ConduitRouteReturnDefinition } from '
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export declare type ConduitSocketParamTypes = (TYPE | ConduitSocketParamTypes)[];
|
|
1
|
+
import { ConduitRouteReturnDefinition } from './ConduitRouteReturn';
|
|
2
|
+
import { TYPE } from './Model';
|
|
3
|
+
export type ConduitSocketParamTypes = (TYPE | ConduitSocketParamTypes)[];
|
|
5
4
|
export interface ConduitSocketOptions {
|
|
6
5
|
path: string;
|
|
7
6
|
name?: string;
|
|
@@ -11,7 +10,7 @@ export interface ConduitSocketOptions {
|
|
|
11
10
|
export interface ConduitSocketEventHandler {
|
|
12
11
|
params?: ConduitSocketParamTypes;
|
|
13
12
|
returnType?: ConduitRouteReturnDefinition;
|
|
14
|
-
handler:
|
|
13
|
+
handler: any;
|
|
15
14
|
}
|
|
16
15
|
export interface EventsProtoDescription {
|
|
17
16
|
[name: string]: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Socket.js","sourceRoot":"","sources":["../../src/interfaces/Socket.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type UntypedArray = any[];
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
1
|
+
export * from './ConduitMiddleware';
|
|
2
|
+
export * from './ConduitRoute';
|
|
3
|
+
export * from './ProxyRoute';
|
|
4
|
+
export * from './Route';
|
|
5
|
+
export * from './Socket';
|
|
6
|
+
export * from './types';
|
|
3
7
|
export * from './Model';
|
|
4
8
|
export * from './GrpcCallback';
|
|
5
9
|
export * from './Indexable';
|
|
6
10
|
export * from './RawQuery';
|
|
7
11
|
export * from './UntypedArray';
|
|
8
12
|
export * from './Params';
|
|
13
|
+
export * from './ConduitRouteReturn';
|
|
14
|
+
export * from './IConduitLogger';
|
|
15
|
+
export * from './IConduitMetrics';
|
package/dist/interfaces/index.js
CHANGED
|
@@ -14,12 +14,19 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
18
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./ConduitMiddleware"), exports);
|
|
18
|
+
__exportStar(require("./ConduitRoute"), exports);
|
|
19
|
+
__exportStar(require("./ProxyRoute"), exports);
|
|
20
|
+
__exportStar(require("./Route"), exports);
|
|
21
|
+
__exportStar(require("./Socket"), exports);
|
|
22
|
+
__exportStar(require("./types"), exports);
|
|
19
23
|
__exportStar(require("./Model"), exports);
|
|
20
24
|
__exportStar(require("./GrpcCallback"), exports);
|
|
21
25
|
__exportStar(require("./Indexable"), exports);
|
|
22
26
|
__exportStar(require("./RawQuery"), exports);
|
|
23
27
|
__exportStar(require("./UntypedArray"), exports);
|
|
24
28
|
__exportStar(require("./Params"), exports);
|
|
29
|
+
__exportStar(require("./ConduitRouteReturn"), exports);
|
|
30
|
+
__exportStar(require("./IConduitLogger"), exports);
|
|
31
|
+
__exportStar(require("./IConduitMetrics"), exports);
|
|
25
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,iDAA+B;AAC/B,+CAA6B;AAC7B,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,0CAAwB;AACxB,iDAA+B;AAC/B,8CAA4B;AAC5B,6CAA2B;AAC3B,iDAA+B;AAC/B,2CAAyB;AACzB,uDAAqC;AACrC,mDAAiC;AACjC,oDAAkC"}
|
|
@@ -1,35 +1,37 @@
|
|
|
1
|
-
import { Context, Cookies,
|
|
2
|
-
import { GrpcRequest } from '
|
|
3
|
-
export
|
|
1
|
+
import { Context, Cookies, Indexable, Params } from './Indexable';
|
|
2
|
+
import { GrpcRequest } from '../types';
|
|
3
|
+
export type ParsedRouterRequest = GrpcRequest<{
|
|
4
4
|
params: Params;
|
|
5
5
|
urlParams: Params;
|
|
6
6
|
queryParams: Params;
|
|
7
7
|
bodyParams: Params;
|
|
8
8
|
path: string;
|
|
9
|
-
headers: Headers
|
|
9
|
+
headers: Headers & {
|
|
10
|
+
authorization?: string;
|
|
11
|
+
};
|
|
10
12
|
context: Context;
|
|
11
13
|
cookies: Cookies;
|
|
12
14
|
}>;
|
|
13
|
-
export
|
|
15
|
+
export type UnparsedRouterResponse = {
|
|
14
16
|
result?: Indexable;
|
|
15
17
|
redirect?: string;
|
|
16
18
|
setCookies: Cookies[];
|
|
17
19
|
removeCookies: Cookies[];
|
|
18
20
|
} | Indexable | string;
|
|
19
|
-
export
|
|
21
|
+
export type ParsedSocketRequest = GrpcRequest<{
|
|
20
22
|
event: string;
|
|
21
23
|
socketId: string;
|
|
22
24
|
params: string[];
|
|
23
25
|
context: Context;
|
|
24
26
|
cookies: Cookies;
|
|
25
27
|
}>;
|
|
26
|
-
|
|
28
|
+
type EventResponse = {
|
|
27
29
|
event: string;
|
|
28
30
|
data: Indexable;
|
|
29
31
|
receivers?: string[];
|
|
30
32
|
};
|
|
31
|
-
export
|
|
32
|
-
|
|
33
|
+
export type UnparsedSocketResponse = EventResponse | JoinRoomResponse;
|
|
34
|
+
type JoinRoomResponse = {
|
|
33
35
|
rooms: string[];
|
|
34
36
|
};
|
|
35
37
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/interfaces/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
package conduit.module.v1;
|
|
3
|
+
|
|
4
|
+
message SetConfigRequest {
|
|
5
|
+
string newConfig = 1;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
message SetConfigResponse {
|
|
9
|
+
string updatedConfig = 1;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
service ConduitModule {
|
|
13
|
+
rpc SetConfig(SetConfigRequest) returns (SetConfigResponse);
|
|
14
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { ConduitModule } from '../../classes
|
|
2
|
-
import { AdminDefinition, RegisterAdminRouteRequest_PathDefinition } from '../../protoUtils
|
|
3
|
-
import { ConduitProxyObject, ConduitRouteObject, SocketProtoDescription } from '../../
|
|
1
|
+
import { ConduitModule } from '../../classes';
|
|
2
|
+
import { AdminDefinition, RegisterAdminRouteRequest_PathDefinition } from '../../protoUtils';
|
|
3
|
+
import { ConduitProxyObject, ConduitRouteActions, ConduitRouteObject, SocketProtoDescription } from '../../interfaces';
|
|
4
4
|
export declare class Admin extends ConduitModule<typeof AdminDefinition> {
|
|
5
5
|
readonly moduleName: string;
|
|
6
6
|
constructor(moduleName: string, url: string, grpcToken?: string);
|
|
7
|
-
generateProtoFile(moduleName: string, routes: (ConduitRouteObject | SocketProtoDescription | ConduitProxyObject)[]): Promise<import("../../protoUtils
|
|
7
|
+
generateProtoFile(moduleName: string, routes: (ConduitRouteObject | SocketProtoDescription | ConduitProxyObject)[]): Promise<import("../../protoUtils").GenerateAdminProtoResponse>;
|
|
8
8
|
register(paths: RegisterAdminRouteRequest_PathDefinition[], protoFile: string, serverUrl?: string): Promise<any>;
|
|
9
|
+
patchRouteMiddlewares(path: string, action: ConduitRouteActions, middlewares: string[]): Promise<import("../../protoUtils/google/protobuf/empty").Empty>;
|
|
9
10
|
}
|
|
@@ -16,14 +16,14 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
16
16
|
})();
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.Admin = void 0;
|
|
19
|
-
var
|
|
20
|
-
var
|
|
19
|
+
var classes_1 = require("../../classes");
|
|
20
|
+
var protoUtils_1 = require("../../protoUtils");
|
|
21
21
|
var Admin = /** @class */ (function (_super) {
|
|
22
22
|
__extends(Admin, _super);
|
|
23
23
|
function Admin(moduleName, url, grpcToken) {
|
|
24
24
|
var _this = _super.call(this, moduleName, 'admin', url, grpcToken) || this;
|
|
25
25
|
_this.moduleName = moduleName;
|
|
26
|
-
_this.initializeClient(
|
|
26
|
+
_this.initializeClient(protoUtils_1.AdminDefinition);
|
|
27
27
|
return _this;
|
|
28
28
|
}
|
|
29
29
|
Admin.prototype.generateProtoFile = function (moduleName, routes) {
|
|
@@ -31,7 +31,7 @@ var Admin = /** @class */ (function (_super) {
|
|
|
31
31
|
moduleName: moduleName,
|
|
32
32
|
routes: routes.map(function (r) { return JSON.stringify(r); }),
|
|
33
33
|
};
|
|
34
|
-
return this.client.
|
|
34
|
+
return this.client.generateAdminProto(request);
|
|
35
35
|
};
|
|
36
36
|
Admin.prototype.register = function (paths, protoFile, serverUrl) {
|
|
37
37
|
var request = {
|
|
@@ -41,7 +41,14 @@ var Admin = /** @class */ (function (_super) {
|
|
|
41
41
|
};
|
|
42
42
|
return this.client.registerAdminRoute(request);
|
|
43
43
|
};
|
|
44
|
+
Admin.prototype.patchRouteMiddlewares = function (path, action, middlewares) {
|
|
45
|
+
return this.client.patchRouteMiddlewares({
|
|
46
|
+
path: path,
|
|
47
|
+
action: action,
|
|
48
|
+
middlewares: middlewares,
|
|
49
|
+
});
|
|
50
|
+
};
|
|
44
51
|
return Admin;
|
|
45
|
-
}(
|
|
52
|
+
}(classes_1.ConduitModule));
|
|
46
53
|
exports.Admin = Admin;
|
|
47
54
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/admin/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/admin/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,yCAA8C;AAC9C,+CAK0B;AAQ1B;IAA2B,yBAAqC;IAC9D,eAAqB,UAAkB,EAAE,GAAW,EAAE,SAAkB;QAAxE,YACE,kBAAM,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,CAAC,SAE3C;QAHoB,gBAAU,GAAV,UAAU,CAAQ;QAErC,KAAI,CAAC,gBAAgB,CAAC,4BAAe,CAAC,CAAC;;IACzC,CAAC;IAED,iCAAiB,GAAjB,UACE,UAAkB,EAClB,MAA4E;QAE5E,IAAM,OAAO,GAA8B;YACzC,UAAU,YAAA;YACV,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAjB,CAAiB,CAAC;SAC3C,CAAC;QACF,OAAO,IAAI,CAAC,MAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAClD,CAAC;IAED,wBAAQ,GAAR,UACE,KAAiD,EACjD,SAAiB,EACjB,SAAkB;QAElB,IAAM,OAAO,GAA8B;YACzC,MAAM,EAAE,KAAK;YACb,SAAS,EAAE,SAAS;YACpB,SAAS,EAAE,SAAS;SACrB,CAAC;QAEF,OAAO,IAAI,CAAC,MAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAClD,CAAC;IAED,qCAAqB,GAArB,UACE,IAAY,EACZ,MAA2B,EAC3B,WAAqB;QAErB,OAAO,IAAI,CAAC,MAAO,CAAC,qBAAqB,CAAC;YACxC,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,MAAM;YACd,WAAW,EAAE,WAAW;SACzB,CAAC,CAAC;IACL,CAAC;IACH,YAAC;AAAD,CAAC,AA1CD,CAA2B,uBAAa,GA0CvC;AA1CY,sBAAK"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ConduitModule } from '../../classes
|
|
2
|
-
import { AuthorizationDefinition, Decision, DeleteAllRelationsRequest,
|
|
1
|
+
import { ConduitModule } from '../../classes';
|
|
2
|
+
import { AuthorizationDefinition, Decision, DeleteAllRelationsRequest, FindRelationRequest, FindRelationResponse, PermissionCheck, PermissionRequest, Relation, Resource } from '../../protoUtils';
|
|
3
|
+
import { Empty } from '../../protoUtils/google/protobuf/empty';
|
|
3
4
|
export declare class Authorization extends ConduitModule<typeof AuthorizationDefinition> {
|
|
4
5
|
private readonly moduleName;
|
|
5
6
|
constructor(moduleName: string, url: string, grpcToken?: string);
|
|
@@ -16,14 +16,14 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
16
16
|
})();
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.Authorization = void 0;
|
|
19
|
-
var
|
|
20
|
-
var
|
|
19
|
+
var classes_1 = require("../../classes");
|
|
20
|
+
var protoUtils_1 = require("../../protoUtils");
|
|
21
21
|
var Authorization = /** @class */ (function (_super) {
|
|
22
22
|
__extends(Authorization, _super);
|
|
23
23
|
function Authorization(moduleName, url, grpcToken) {
|
|
24
24
|
var _this = _super.call(this, moduleName, 'authorization', url, grpcToken) || this;
|
|
25
25
|
_this.moduleName = moduleName;
|
|
26
|
-
_this.initializeClient(
|
|
26
|
+
_this.initializeClient(protoUtils_1.AuthorizationDefinition);
|
|
27
27
|
return _this;
|
|
28
28
|
}
|
|
29
29
|
Authorization.prototype.defineResource = function (data) {
|
|
@@ -57,6 +57,6 @@ var Authorization = /** @class */ (function (_super) {
|
|
|
57
57
|
return this.client.removePermission(data);
|
|
58
58
|
};
|
|
59
59
|
return Authorization;
|
|
60
|
-
}(
|
|
60
|
+
}(classes_1.ConduitModule));
|
|
61
61
|
exports.Authorization = Authorization;
|
|
62
62
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/authorization/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/authorization/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,yCAA8C;AAC9C,+CAU0B;AAG1B;IAAmC,iCAA6C;IAC9E,uBAA6B,UAAkB,EAAE,GAAW,EAAE,SAAkB;QAAhF,YACE,kBAAM,UAAU,EAAE,eAAe,EAAE,GAAG,EAAE,SAAS,CAAC,SAEnD;QAH4B,gBAAU,GAAV,UAAU,CAAQ;QAE7C,KAAI,CAAC,gBAAgB,CAAC,oCAAuB,CAAC,CAAC;;IACjD,CAAC;IAED,sCAAc,GAAd,UAAe,IAAc;QAC3B,OAAO,IAAI,CAAC,MAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,sCAAc,GAAd,UAAe,IAAc;QAC3B,OAAO,IAAI,CAAC,MAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,sCAAc,GAAd,UAAe,IAAc;QAC3B,OAAO,IAAI,CAAC,MAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,sCAAc,GAAd,UAAe,IAAc;QAC3B,OAAO,IAAI,CAAC,MAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,0CAAkB,GAAlB,UAAmB,IAA+B;QAChD,OAAO,IAAI,CAAC,MAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAC/C,CAAC;IAED,sCAAc,GAAd,UAAe,IAAc;QAC3B,OAAO,IAAI,CAAC,MAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,oCAAY,GAAZ,UAAa,IAAyB;QACpC,OAAO,IAAI,CAAC,MAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAED,2BAAG,GAAH,UAAI,IAAqB;QACvB,OAAO,IAAI,CAAC,MAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAED,uCAAe,GAAf,UAAgB,IAAuB;QACrC,OAAO,IAAI,CAAC,MAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;IAED,wCAAgB,GAAhB,UAAiB,IAAuB;QACtC,OAAO,IAAI,CAAC,MAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IACH,oBAAC;AAAD,CAAC,AA7CD,CAAmC,uBAAa,GA6C/C;AA7CY,sCAAa"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
|
-
import { ConduitModule } from '../../classes
|
|
3
|
+
import { ConduitModule } from '../../classes';
|
|
4
4
|
import { HealthCheckStatus } from '../../types';
|
|
5
5
|
import { ConfigDefinition } from '../../protoUtils/core';
|
|
6
6
|
export declare class Config extends ConduitModule<typeof ConfigDefinition> {
|
|
7
7
|
readonly url: string;
|
|
8
8
|
private readonly emitter;
|
|
9
9
|
private coreLive;
|
|
10
|
-
private readonly _serviceHealthStatusGetter
|
|
11
|
-
constructor(moduleName: string, url: string, serviceHealthStatusGetter
|
|
10
|
+
private readonly _serviceHealthStatusGetter?;
|
|
11
|
+
constructor(moduleName: string, url: string, serviceHealthStatusGetter?: () => HealthCheckStatus, grpcToken?: string);
|
|
12
12
|
getServerConfig(): Promise<any>;
|
|
13
13
|
getModuleUrlByName(name: string): Promise<{
|
|
14
14
|
url: string;
|
|
15
15
|
}>;
|
|
16
16
|
get(name: string): Promise<any>;
|
|
17
17
|
configure(config: any, schema: any, override: boolean): Promise<any>;
|
|
18
|
-
moduleExists(name: string): Promise<import("../../
|
|
18
|
+
moduleExists(name: string): Promise<import("../../index").ModuleExistsResponse>;
|
|
19
19
|
moduleList(): Promise<any[]>;
|
|
20
|
-
getRedisDetails(): Promise<import("../../
|
|
20
|
+
getRedisDetails(): Promise<import("../../index").GetRedisDetailsResponse>;
|
|
21
21
|
registerModule(name: string, url: string, healthStatus: Omit<HealthCheckStatus, HealthCheckStatus.SERVICE_UNKNOWN>): Promise<boolean>;
|
|
22
22
|
moduleHealthProbe(name: string, url: string): void;
|
|
23
23
|
getModuleWatcher(): EventEmitter;
|