@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
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
type: AllowedTypes;
|
|
23
|
+
required?: boolean;
|
|
24
|
+
}[];
|
|
25
|
+
export type ConduitUrlParams = {
|
|
26
|
+
[field in string]: ConduitUrlParam;
|
|
27
|
+
};
|
|
28
|
+
export type ConduitQueryParams = {
|
|
29
|
+
[field in string]: ConduitQueryParam;
|
|
30
|
+
};
|
|
31
|
+
export type ConduitReturnField = keyof typeof TYPE | TYPE | ConduitModel | {
|
|
32
|
+
[key: string]: TYPE | TYPE[] | ConduitModel | ConduitModel[];
|
|
33
|
+
};
|
|
34
|
+
export type ConduitReturnModel = {
|
|
35
|
+
[field: string]: ConduitReturnField | allowedTypes | allowedTypes[] | string | string[];
|
|
36
|
+
};
|
|
37
|
+
export type ConduitReturn = ConduitReturnField | ConduitReturnModel | string;
|
|
38
|
+
export declare enum ConduitRouteActions {
|
|
39
|
+
GET = "GET",
|
|
40
|
+
POST = "POST",
|
|
41
|
+
UPDATE = "PUT",
|
|
42
|
+
PATCH = "PATCH",
|
|
43
|
+
DELETE = "DELETE"
|
|
44
|
+
}
|
|
45
|
+
export interface ConduitRouteOptions {
|
|
46
|
+
queryParams?: ConduitQueryParams;
|
|
47
|
+
bodyParams?: ConduitModel;
|
|
48
|
+
urlParams?: ConduitUrlParams;
|
|
49
|
+
action: ConduitRouteActions;
|
|
50
|
+
path: string;
|
|
51
|
+
name?: string;
|
|
52
|
+
description?: string;
|
|
53
|
+
middlewares?: string[];
|
|
54
|
+
cacheControl?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface ConduitRouteObject {
|
|
57
|
+
options: ConduitRouteOptions;
|
|
58
|
+
returns: {
|
|
59
|
+
name: string;
|
|
60
|
+
fields: ConduitReturn;
|
|
61
|
+
};
|
|
62
|
+
grpcFunction: string;
|
|
63
|
+
}
|
|
64
|
+
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":";;;AA6CA,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,72 @@
|
|
|
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
|
+
}
|
|
15
|
+
|
|
16
|
+
service ClientRouter {
|
|
17
|
+
rpc Route(Request) returns (Response);
|
|
18
|
+
rpc SocketRoute(SocketRequest) returns (SocketResponse);
|
|
19
|
+
}
|
|
20
|
+
service AdminRouter {
|
|
21
|
+
rpc Route(Request) returns (Response);
|
|
22
|
+
rpc SocketRoute(SocketRequest) returns (SocketResponse);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
message Request {
|
|
26
|
+
string params = 1;
|
|
27
|
+
string path = 2;
|
|
28
|
+
string headers = 3;
|
|
29
|
+
string context = 4;
|
|
30
|
+
string cookies = 5;
|
|
31
|
+
string bodyParams = 6;
|
|
32
|
+
string urlParams = 7;
|
|
33
|
+
string queryParams = 8;
|
|
34
|
+
string functionName = 9;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
message Response {
|
|
38
|
+
string result = 1;
|
|
39
|
+
string redirect = 2;
|
|
40
|
+
repeated Cookie setCookies = 3;
|
|
41
|
+
repeated Cookie removeCookies = 4;
|
|
42
|
+
}
|
|
43
|
+
message Cookie {
|
|
44
|
+
string name = 1;
|
|
45
|
+
optional string value = 2;
|
|
46
|
+
CookieOptions options = 3;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
message CookieOptions {
|
|
50
|
+
bool httpOnly = 1;
|
|
51
|
+
bool secure = 2;
|
|
52
|
+
bool signed = 3;
|
|
53
|
+
int32 maxAge = 4;
|
|
54
|
+
string path = 5;
|
|
55
|
+
string domain = 6;
|
|
56
|
+
string sameSite = 7;
|
|
57
|
+
|
|
58
|
+
}
|
|
59
|
+
message SocketRequest {
|
|
60
|
+
string event = 1;
|
|
61
|
+
string socketId = 2;
|
|
62
|
+
string params = 3;
|
|
63
|
+
string context = 4;
|
|
64
|
+
string functionName = 5;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
message SocketResponse {
|
|
68
|
+
string event = 1;
|
|
69
|
+
string data = 2;
|
|
70
|
+
repeated string receivers = 3;
|
|
71
|
+
repeated string rooms = 4;
|
|
72
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ConduitModule } from '../../classes
|
|
2
|
-
import { AdminDefinition, RegisterAdminRouteRequest_PathDefinition } from '../../protoUtils
|
|
3
|
-
import {
|
|
1
|
+
import { ConduitModule } from '../../classes';
|
|
2
|
+
import { AdminDefinition, RegisterAdminRouteRequest_PathDefinition } from '../../protoUtils';
|
|
3
|
+
import { ConduitRouteActions } 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
|
-
|
|
8
|
-
|
|
7
|
+
register(paths: RegisterAdminRouteRequest_PathDefinition[], serverUrl?: string): Promise<any>;
|
|
8
|
+
patchRouteMiddlewares(path: string, action: ConduitRouteActions, middlewares: string[]): Promise<import("../../protoUtils/google/protobuf/empty").Empty>;
|
|
9
9
|
}
|
|
@@ -1,47 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.Admin = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
_this.initializeClient(core_1.AdminDefinition);
|
|
27
|
-
return _this;
|
|
4
|
+
const classes_1 = require("../../classes");
|
|
5
|
+
const protoUtils_1 = require("../../protoUtils");
|
|
6
|
+
class Admin extends classes_1.ConduitModule {
|
|
7
|
+
constructor(moduleName, url, grpcToken) {
|
|
8
|
+
super(moduleName, 'admin', url, grpcToken);
|
|
9
|
+
this.moduleName = moduleName;
|
|
10
|
+
this.initializeClient(protoUtils_1.AdminDefinition);
|
|
28
11
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
moduleName: moduleName,
|
|
32
|
-
routes: routes.map(function (r) { return JSON.stringify(r); }),
|
|
33
|
-
};
|
|
34
|
-
return this.client.generateProto(request);
|
|
35
|
-
};
|
|
36
|
-
Admin.prototype.register = function (paths, protoFile, serverUrl) {
|
|
37
|
-
var request = {
|
|
12
|
+
register(paths, serverUrl) {
|
|
13
|
+
const request = {
|
|
38
14
|
routes: paths,
|
|
39
|
-
protoFile: protoFile,
|
|
40
15
|
routerUrl: serverUrl,
|
|
41
16
|
};
|
|
42
17
|
return this.client.registerAdminRoute(request);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
18
|
+
}
|
|
19
|
+
patchRouteMiddlewares(path, action, middlewares) {
|
|
20
|
+
return this.client.patchRouteMiddlewares({
|
|
21
|
+
path: path,
|
|
22
|
+
action: action,
|
|
23
|
+
middlewares: middlewares,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
46
27
|
exports.Admin = Admin;
|
|
47
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/admin/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/admin/index.ts"],"names":[],"mappings":";;;AAAA,2CAA8C;AAC9C,iDAI0B;AAG1B,MAAa,KAAM,SAAQ,uBAAqC;IAC9D,YAAqB,UAAkB,EAAE,GAAW,EAAE,SAAkB;QACtE,KAAK,CAAC,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;QADxB,eAAU,GAAV,UAAU,CAAQ;QAErC,IAAI,CAAC,gBAAgB,CAAC,4BAAe,CAAC,CAAC;IACzC,CAAC;IAED,QAAQ,CACN,KAAiD,EACjD,SAAkB;QAElB,MAAM,OAAO,GAA8B;YACzC,MAAM,EAAE,KAAK;YACb,SAAS,EAAE,SAAS;SACrB,CAAC;QAEF,OAAO,IAAI,CAAC,MAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAClD,CAAC;IAED,qBAAqB,CACnB,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;CACF;AA7BD,sBA6BC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ConduitModule } from '../../classes
|
|
2
|
-
import { AuthenticationDefinition, UserCreateResponse, UserDeleteResponse, UserLoginResponse } from '../../protoUtils
|
|
1
|
+
import { ConduitModule } from '../../classes';
|
|
2
|
+
import { AuthenticationDefinition, TeamDeleteResponse, UserCreateResponse, UserDeleteResponse, UserLoginResponse, Team } from '../../protoUtils';
|
|
3
3
|
export declare class Authentication extends ConduitModule<typeof AuthenticationDefinition> {
|
|
4
4
|
private readonly moduleName;
|
|
5
5
|
constructor(moduleName: string, url: string, grpcToken?: string);
|
|
@@ -7,4 +7,7 @@ export declare class Authentication extends ConduitModule<typeof AuthenticationD
|
|
|
7
7
|
userDelete(userId: string): Promise<UserDeleteResponse>;
|
|
8
8
|
userCreate(email: string, verify?: boolean, password?: string): Promise<UserCreateResponse>;
|
|
9
9
|
changePass(email: string, password?: string): Promise<UserCreateResponse>;
|
|
10
|
+
getTeam(teamId: string): Promise<Team>;
|
|
11
|
+
createTeam(name: string, parentTeam?: string, isDefault?: boolean): Promise<Team>;
|
|
12
|
+
teamDelete(teamId: string): Promise<TeamDeleteResponse>;
|
|
10
13
|
}
|
|
@@ -1,45 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.Authentication = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return this.client.
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return this.client.
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
}
|
|
4
|
+
const classes_1 = require("../../classes");
|
|
5
|
+
const protoUtils_1 = require("../../protoUtils");
|
|
6
|
+
class Authentication extends classes_1.ConduitModule {
|
|
7
|
+
constructor(moduleName, url, grpcToken) {
|
|
8
|
+
super(moduleName, 'authentication', url, grpcToken);
|
|
9
|
+
this.moduleName = moduleName;
|
|
10
|
+
this.initializeClient(protoUtils_1.AuthenticationDefinition);
|
|
11
|
+
}
|
|
12
|
+
userLogin(userId, clientId) {
|
|
13
|
+
return this.client.userLogin({ userId, clientId });
|
|
14
|
+
}
|
|
15
|
+
userDelete(userId) {
|
|
16
|
+
return this.client.userDelete({ userId });
|
|
17
|
+
}
|
|
18
|
+
userCreate(email, verify = false, password) {
|
|
19
|
+
return this.client.userCreate({ email, verify, password });
|
|
20
|
+
}
|
|
21
|
+
changePass(email, password) {
|
|
22
|
+
return this.client.changePass({ email, password });
|
|
23
|
+
}
|
|
24
|
+
getTeam(teamId) {
|
|
25
|
+
return this.client.getTeam({ teamId });
|
|
26
|
+
}
|
|
27
|
+
createTeam(name, parentTeam, isDefault = false) {
|
|
28
|
+
return this.client.createTeam({ name, parentTeam, isDefault });
|
|
29
|
+
}
|
|
30
|
+
teamDelete(teamId) {
|
|
31
|
+
return this.client.teamDelete({ teamId });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
44
34
|
exports.Authentication = Authentication;
|
|
45
35
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/authentication/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/authentication/index.ts"],"names":[],"mappings":";;;AAAA,2CAA8C;AAC9C,iDAO0B;AAE1B,MAAa,cAAe,SAAQ,uBAA8C;IAChF,YAA6B,UAAkB,EAAE,GAAW,EAAE,SAAkB;QAC9E,KAAK,CAAC,UAAU,EAAE,gBAAgB,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;QADzB,eAAU,GAAV,UAAU,CAAQ;QAE7C,IAAI,CAAC,gBAAgB,CAAC,qCAAwB,CAAC,CAAC;IAClD,CAAC;IAED,SAAS,CAAC,MAAc,EAAE,QAAgB;QACxC,OAAO,IAAI,CAAC,MAAO,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,UAAU,CAAC,MAAc;QACvB,OAAO,IAAI,CAAC,MAAO,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,UAAU,CACR,KAAa,EACb,SAAkB,KAAK,EACvB,QAAiB;QAEjB,OAAO,IAAI,CAAC,MAAO,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED,UAAU,CAAC,KAAa,EAAE,QAAiB;QACzC,OAAO,IAAI,CAAC,MAAO,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,OAAO,CAAC,MAAc;QACpB,OAAO,IAAI,CAAC,MAAO,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED,UAAU,CAAC,IAAY,EAAE,UAAmB,EAAE,YAAqB,KAAK;QACtE,OAAO,IAAI,CAAC,MAAO,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,UAAU,CAAC,MAAc;QACvB,OAAO,IAAI,CAAC,MAAO,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IAC7C,CAAC;CACF;AArCD,wCAqCC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ConduitModule } from '../../classes
|
|
2
|
-
import { AuthorizationDefinition, Decision, DeleteAllRelationsRequest,
|
|
1
|
+
import { ConduitModule } from '../../classes';
|
|
2
|
+
import { AllowedResourcesRequest, AllowedResourcesResponse, AuthorizationDefinition, Decision, DeleteAllRelationsRequest, FindRelationRequest, FindRelationResponse, PermissionCheck, PermissionRequest, Relation, Resource, ResourceAccessListRequest } 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);
|
|
@@ -9,8 +10,11 @@ export declare class Authorization extends ConduitModule<typeof AuthorizationDef
|
|
|
9
10
|
deleteRelation(data: Relation): Promise<Empty>;
|
|
10
11
|
deleteAllRelations(data: DeleteAllRelationsRequest): Promise<Empty>;
|
|
11
12
|
createRelation(data: Relation): Promise<Empty>;
|
|
13
|
+
createRelations(subject: string, relation: string, resources: string[]): Promise<Empty>;
|
|
12
14
|
findRelation(data: FindRelationRequest): Promise<FindRelationResponse>;
|
|
13
15
|
can(data: PermissionCheck): Promise<Decision>;
|
|
14
16
|
grantPermission(data: PermissionRequest): Promise<Empty>;
|
|
15
17
|
removePermission(data: PermissionRequest): Promise<Empty>;
|
|
18
|
+
getAllowedResources(data: AllowedResourcesRequest): Promise<AllowedResourcesResponse>;
|
|
19
|
+
createResourceAccessList(data: ResourceAccessListRequest): Promise<Empty>;
|
|
16
20
|
}
|
|
@@ -1,62 +1,53 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.Authorization = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
Authorization.prototype.defineResource = function (data) {
|
|
4
|
+
const classes_1 = require("../../classes");
|
|
5
|
+
const protoUtils_1 = require("../../protoUtils");
|
|
6
|
+
class Authorization extends classes_1.ConduitModule {
|
|
7
|
+
constructor(moduleName, url, grpcToken) {
|
|
8
|
+
super(moduleName, 'authorization', url, grpcToken);
|
|
9
|
+
this.moduleName = moduleName;
|
|
10
|
+
this.initializeClient(protoUtils_1.AuthorizationDefinition);
|
|
11
|
+
}
|
|
12
|
+
defineResource(data) {
|
|
30
13
|
return this.client.defineResource(data);
|
|
31
|
-
}
|
|
32
|
-
|
|
14
|
+
}
|
|
15
|
+
updateResource(data) {
|
|
33
16
|
return this.client.updateResource(data);
|
|
34
|
-
}
|
|
35
|
-
|
|
17
|
+
}
|
|
18
|
+
deleteResource(data) {
|
|
36
19
|
return this.client.deleteResource(data);
|
|
37
|
-
}
|
|
38
|
-
|
|
20
|
+
}
|
|
21
|
+
deleteRelation(data) {
|
|
39
22
|
return this.client.deleteRelation(data);
|
|
40
|
-
}
|
|
41
|
-
|
|
23
|
+
}
|
|
24
|
+
deleteAllRelations(data) {
|
|
42
25
|
return this.client.deleteAllRelations(data);
|
|
43
|
-
}
|
|
44
|
-
|
|
26
|
+
}
|
|
27
|
+
createRelation(data) {
|
|
45
28
|
return this.client.createRelation(data);
|
|
46
|
-
}
|
|
47
|
-
|
|
29
|
+
}
|
|
30
|
+
createRelations(subject, relation, resources) {
|
|
31
|
+
return this.client.createRelations({ subject, relation, resources });
|
|
32
|
+
}
|
|
33
|
+
findRelation(data) {
|
|
48
34
|
return this.client.findRelation(data);
|
|
49
|
-
}
|
|
50
|
-
|
|
35
|
+
}
|
|
36
|
+
can(data) {
|
|
51
37
|
return this.client.can(data);
|
|
52
|
-
}
|
|
53
|
-
|
|
38
|
+
}
|
|
39
|
+
grantPermission(data) {
|
|
54
40
|
return this.client.grantPermission(data);
|
|
55
|
-
}
|
|
56
|
-
|
|
41
|
+
}
|
|
42
|
+
removePermission(data) {
|
|
57
43
|
return this.client.removePermission(data);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
44
|
+
}
|
|
45
|
+
getAllowedResources(data) {
|
|
46
|
+
return this.client.getAllowedResources(data);
|
|
47
|
+
}
|
|
48
|
+
createResourceAccessList(data) {
|
|
49
|
+
return this.client.createResourceAccessList(data);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
61
52
|
exports.Authorization = Authorization;
|
|
62
53
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/authorization/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/authorization/index.ts"],"names":[],"mappings":";;;AAAA,2CAA8C;AAC9C,iDAa0B;AAG1B,MAAa,aAAc,SAAQ,uBAA6C;IAC9E,YAA6B,UAAkB,EAAE,GAAW,EAAE,SAAkB;QAC9E,KAAK,CAAC,UAAU,EAAE,eAAe,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;QADxB,eAAU,GAAV,UAAU,CAAQ;QAE7C,IAAI,CAAC,gBAAgB,CAAC,oCAAuB,CAAC,CAAC;IACjD,CAAC;IAED,cAAc,CAAC,IAAc;QAC3B,OAAO,IAAI,CAAC,MAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,cAAc,CAAC,IAAc;QAC3B,OAAO,IAAI,CAAC,MAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,cAAc,CAAC,IAAc;QAC3B,OAAO,IAAI,CAAC,MAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,cAAc,CAAC,IAAc;QAC3B,OAAO,IAAI,CAAC,MAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,kBAAkB,CAAC,IAA+B;QAChD,OAAO,IAAI,CAAC,MAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAC/C,CAAC;IAED,cAAc,CAAC,IAAc;QAC3B,OAAO,IAAI,CAAC,MAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,eAAe,CACb,OAAe,EACf,QAAgB,EAChB,SAAmB;QAEnB,OAAO,IAAI,CAAC,MAAO,CAAC,eAAe,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;IACxE,CAAC;IAED,YAAY,CAAC,IAAyB;QACpC,OAAO,IAAI,CAAC,MAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAED,GAAG,CAAC,IAAqB;QACvB,OAAO,IAAI,CAAC,MAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAED,eAAe,CAAC,IAAuB;QACrC,OAAO,IAAI,CAAC,MAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;IAED,gBAAgB,CAAC,IAAuB;QACtC,OAAO,IAAI,CAAC,MAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED,mBAAmB,CAAC,IAA6B;QAC/C,OAAO,IAAI,CAAC,MAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IAED,wBAAwB,CAAC,IAA+B;QACtD,OAAO,IAAI,CAAC,MAAO,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;IACrD,CAAC;CACF;AA7DD,sCA6DC"}
|