@conduitplatform/grpc-sdk 0.16.0-alpha.9 → 0.16.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/classes/ConduitAuthorizedResource.js +5 -6
- package/dist/classes/ConduitAuthorizedResource.js.map +1 -1
- package/dist/classes/ConduitModule.d.ts +1 -2
- package/dist/classes/ConduitModule.js +69 -163
- 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 +27 -96
- package/dist/classes/HealthCheck.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +320 -464
- 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/ConduitRouteReturn.js +9 -18
- package/dist/interfaces/ConduitRouteReturn.js.map +1 -1
- package/dist/interfaces/GrpcCallback.d.ts +1 -1
- package/dist/interfaces/Indexable.d.ts +7 -7
- package/dist/interfaces/Model.d.ts +19 -16
- package/dist/interfaces/Params.d.ts +3 -3
- package/dist/interfaces/RawQuery.d.ts +2 -2
- package/dist/interfaces/Route.d.ts +12 -9
- package/dist/interfaces/Route.js.map +1 -1
- package/dist/interfaces/Socket.d.ts +1 -1
- package/dist/interfaces/UntypedArray.d.ts +1 -1
- package/dist/interfaces/types.d.ts +6 -6
- package/dist/module.proto +58 -0
- package/dist/modules/admin/index.d.ts +2 -3
- package/dist/modules/admin/index.js +13 -39
- package/dist/modules/admin/index.js.map +1 -1
- package/dist/modules/authentication/index.d.ts +6 -2
- package/dist/modules/authentication/index.js +33 -40
- package/dist/modules/authentication/index.js.map +1 -1
- package/dist/modules/authorization/index.d.ts +4 -1
- 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 +12 -3
- 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 +19 -10
- package/dist/modules/database/index.js +184 -125
- 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/pushNotifications/index.d.ts +4 -4
- package/dist/modules/pushNotifications/index.js +38 -60
- package/dist/modules/pushNotifications/index.js.map +1 -1
- package/dist/modules/router/index.d.ts +2 -3
- package/dist/modules/router/index.js +15 -41
- 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 +7 -7
- package/dist/modules/storage/index.js +64 -55
- package/dist/modules/storage/index.js.map +1 -1
- package/dist/protoUtils/authentication.d.ts +200 -4
- package/dist/protoUtils/authentication.js +789 -194
- package/dist/protoUtils/authentication.js.map +1 -1
- package/dist/protoUtils/authorization.d.ts +185 -15
- package/dist/protoUtils/authorization.js +965 -448
- package/dist/protoUtils/authorization.js.map +1 -1
- package/dist/protoUtils/chat.d.ts +18 -7
- package/dist/protoUtils/chat.js +210 -227
- package/dist/protoUtils/chat.js.map +1 -1
- package/dist/protoUtils/core.d.ts +55 -50
- package/dist/protoUtils/core.js +1018 -902
- package/dist/protoUtils/core.js.map +1 -1
- package/dist/protoUtils/database.d.ts +262 -16
- package/dist/protoUtils/database.js +1489 -832
- package/dist/protoUtils/database.js.map +1 -1
- package/dist/protoUtils/email.d.ts +13 -4
- package/dist/protoUtils/email.js +242 -253
- package/dist/protoUtils/email.js.map +1 -1
- package/dist/protoUtils/google/protobuf/empty.d.ts +4 -3
- package/dist/protoUtils/google/protobuf/empty.js +21 -38
- package/dist/protoUtils/google/protobuf/empty.js.map +1 -1
- package/dist/protoUtils/grpc_health_check.d.ts +10 -4
- package/dist/protoUtils/grpc_health_check.js +72 -83
- package/dist/protoUtils/grpc_health_check.js.map +1 -1
- package/dist/protoUtils/module.d.ts +202 -4
- package/dist/protoUtils/module.js +810 -72
- package/dist/protoUtils/module.js.map +1 -1
- package/dist/protoUtils/push-notifications.d.ts +26 -6
- package/dist/protoUtils/push-notifications.js +381 -317
- package/dist/protoUtils/push-notifications.js.map +1 -1
- package/dist/protoUtils/router.d.ts +18 -48
- package/dist/protoUtils/router.js +502 -560
- package/dist/protoUtils/router.js.map +1 -1
- package/dist/protoUtils/sms.d.ts +16 -4
- package/dist/protoUtils/sms.js +199 -175
- package/dist/protoUtils/sms.js.map +1 -1
- package/dist/protoUtils/storage.d.ts +37 -4
- package/dist/protoUtils/storage.js +639 -318
- package/dist/protoUtils/storage.js.map +1 -1
- package/dist/types/db.d.ts +13 -11
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +6 -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.d.ts +9 -0
- package/dist/utilities/StateManager.js +58 -15
- 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/sleep.js +1 -1
- package/dist/utilities/sleep.js.map +1 -1
- package/package.json +26 -19
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { ConduitModule } from '../../classes';
|
|
2
2
|
import { AdminDefinition, RegisterAdminRouteRequest_PathDefinition } from '../../protoUtils';
|
|
3
|
-
import {
|
|
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
|
-
register(paths: RegisterAdminRouteRequest_PathDefinition[], protoFile: string, serverUrl?: string): Promise<any>;
|
|
7
|
+
register(paths: RegisterAdminRouteRequest_PathDefinition[], serverUrl?: string): Promise<any>;
|
|
9
8
|
patchRouteMiddlewares(path: string, action: ConduitRouteActions, middlewares: string[]): Promise<import("../../protoUtils/google/protobuf/empty").Empty>;
|
|
10
9
|
}
|
|
@@ -1,54 +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(protoUtils_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.generateAdminProto(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
|
-
|
|
18
|
+
}
|
|
19
|
+
patchRouteMiddlewares(path, action, middlewares) {
|
|
45
20
|
return this.client.patchRouteMiddlewares({
|
|
46
21
|
path: path,
|
|
47
22
|
action: action,
|
|
48
23
|
middlewares: middlewares,
|
|
49
24
|
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
}(classes_1.ConduitModule));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
53
27
|
exports.Admin = Admin;
|
|
54
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, ValidateAccessTokenResponse } 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,8 @@ 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>;
|
|
13
|
+
validateAccessToken(accessToken: string, path?: string): Promise<ValidateAccessTokenResponse>;
|
|
10
14
|
}
|
|
@@ -1,45 +1,38 @@
|
|
|
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
|
+
validateAccessToken(accessToken, path) {
|
|
34
|
+
return this.client.validateAccessToken({ accessToken, path });
|
|
35
|
+
}
|
|
36
|
+
}
|
|
44
37
|
exports.Authentication = Authentication;
|
|
45
38
|
//# 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,iDAQ0B;AAE1B,MAAa,cAAe,SAAQ,uBAA8C;IAChF,YAA6B,UAAkB,EAAE,GAAW,EAAE,SAAkB;QAC9E,KAAK,CAAC,UAAU,EAAE,gBAAgB,EAAE,GAAG,EAAE,SAAS,CAAC,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|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConduitModule } from '../../classes';
|
|
2
|
-
import { AuthorizationDefinition, Decision, DeleteAllRelationsRequest, FindRelationRequest, FindRelationResponse, PermissionCheck, PermissionRequest, Relation, Resource } from '../../protoUtils';
|
|
2
|
+
import { AllowedResourcesRequest, AllowedResourcesResponse, AuthorizationDefinition, Decision, DeleteAllRelationsRequest, FindRelationRequest, FindRelationResponse, PermissionCheck, PermissionRequest, Relation, Resource, ResourceAccessListRequest } from '../../protoUtils';
|
|
3
3
|
import { Empty } from '../../protoUtils/google/protobuf/empty';
|
|
4
4
|
export declare class Authorization extends ConduitModule<typeof AuthorizationDefinition> {
|
|
5
5
|
private readonly moduleName;
|
|
@@ -10,8 +10,11 @@ export declare class Authorization extends ConduitModule<typeof AuthorizationDef
|
|
|
10
10
|
deleteRelation(data: Relation): Promise<Empty>;
|
|
11
11
|
deleteAllRelations(data: DeleteAllRelationsRequest): Promise<Empty>;
|
|
12
12
|
createRelation(data: Relation): Promise<Empty>;
|
|
13
|
+
createRelations(subject: string, relation: string, resources: string[]): Promise<Empty>;
|
|
13
14
|
findRelation(data: FindRelationRequest): Promise<FindRelationResponse>;
|
|
14
15
|
can(data: PermissionCheck): Promise<Decision>;
|
|
15
16
|
grantPermission(data: PermissionRequest): Promise<Empty>;
|
|
16
17
|
removePermission(data: PermissionRequest): Promise<Empty>;
|
|
18
|
+
getAllowedResources(data: AllowedResourcesRequest): Promise<AllowedResourcesResponse>;
|
|
19
|
+
createResourceAccessList(data: ResourceAccessListRequest): Promise<Empty>;
|
|
17
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;Q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,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"}
|
|
@@ -1,41 +1,23 @@
|
|
|
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.Chat = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
_this.initializeClient(chat_1.ChatDefinition);
|
|
27
|
-
return _this;
|
|
4
|
+
const ConduitModule_1 = require("../../classes/ConduitModule");
|
|
5
|
+
const chat_1 = require("../../protoUtils/chat");
|
|
6
|
+
class Chat extends ConduitModule_1.ConduitModule {
|
|
7
|
+
constructor(moduleName, url, grpcToken) {
|
|
8
|
+
super(moduleName, 'chat', url, grpcToken);
|
|
9
|
+
this.moduleName = moduleName;
|
|
10
|
+
this.initializeClient(chat_1.ChatDefinition);
|
|
28
11
|
}
|
|
29
|
-
|
|
12
|
+
sendMessage(messageData) {
|
|
30
13
|
return this.client.sendMessage(messageData);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return this.client.createRoom({ name
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return this.client.deleteRoom({
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
}(ConduitModule_1.ConduitModule));
|
|
14
|
+
}
|
|
15
|
+
createRoom(name, participants) {
|
|
16
|
+
return this.client.createRoom({ name, participants });
|
|
17
|
+
}
|
|
18
|
+
deleteRoom(id) {
|
|
19
|
+
return this.client.deleteRoom({ _id: id });
|
|
20
|
+
}
|
|
21
|
+
}
|
|
40
22
|
exports.Chat = Chat;
|
|
41
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/chat/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/chat/index.ts"],"names":[],"mappings":";;;AAAA,+DAA4D;AAC5D,gDAAiF;AAEjF,MAAa,IAAK,SAAQ,6BAAoC;IAC5D,YACmB,UAAkB,EACnC,GAAW,EACX,SAAkB;QAElB,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;QAJzB,eAAU,GAAV,UAAU,CAAQ;QAKnC,IAAI,CAAC,gBAAgB,CAAC,qBAAc,CAAC,CAAC;IACxC,CAAC;IAED,WAAW,CAAC,WAA+B;QACzC,OAAO,IAAI,CAAC,MAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAC/C,CAAC;IAED,UAAU,CAAC,IAAY,EAAE,YAAsB;QAC7C,OAAO,IAAI,CAAC,MAAO,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,UAAU,CAAC,EAAU;QACnB,OAAO,IAAI,CAAC,MAAO,CAAC,UAAU,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;IAC9C,CAAC;CACF;AArBD,oBAqBC"}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
3
|
import { ConduitModule } from '../../classes';
|
|
4
4
|
import { HealthCheckStatus } from '../../types';
|
|
5
|
-
import { ConfigDefinition } from '../../protoUtils
|
|
5
|
+
import { ConfigDefinition } from '../../protoUtils';
|
|
6
|
+
import { ClusterOptions, RedisOptions } from 'ioredis';
|
|
6
7
|
export declare class Config extends ConduitModule<typeof ConfigDefinition> {
|
|
7
8
|
readonly url: string;
|
|
8
9
|
private readonly emitter;
|
|
@@ -15,9 +16,17 @@ export declare class Config extends ConduitModule<typeof ConfigDefinition> {
|
|
|
15
16
|
}>;
|
|
16
17
|
get(name: string): Promise<any>;
|
|
17
18
|
configure(config: any, schema: any, override: boolean): Promise<any>;
|
|
18
|
-
moduleExists(name: string): Promise<import("../../
|
|
19
|
+
moduleExists(name: string): Promise<import("../../protoUtils").ModuleExistsResponse>;
|
|
19
20
|
moduleList(): Promise<any[]>;
|
|
20
|
-
getRedisDetails(): Promise<
|
|
21
|
+
getRedisDetails(): Promise<{
|
|
22
|
+
standalone?: RedisOptions;
|
|
23
|
+
cluster?: ClusterOptions;
|
|
24
|
+
redisHost?: string;
|
|
25
|
+
redisPort?: number;
|
|
26
|
+
redisUsername?: string;
|
|
27
|
+
redisPassword?: string;
|
|
28
|
+
redisConfig?: string;
|
|
29
|
+
}>;
|
|
21
30
|
registerModule(name: string, url: string, healthStatus: Omit<HealthCheckStatus, HealthCheckStatus.SERVICE_UNKNOWN>): Promise<boolean>;
|
|
22
31
|
moduleHealthProbe(name: string, url: string): void;
|
|
23
32
|
getModuleWatcher(): EventEmitter;
|