@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.
Files changed (121) hide show
  1. package/dist/classes/ConduitAuthorizedResource.js +5 -6
  2. package/dist/classes/ConduitAuthorizedResource.js.map +1 -1
  3. package/dist/classes/ConduitModule.d.ts +1 -2
  4. package/dist/classes/ConduitModule.js +69 -163
  5. package/dist/classes/ConduitModule.js.map +1 -1
  6. package/dist/classes/ConduitSchema.js +3 -4
  7. package/dist/classes/ConduitSchema.js.map +1 -1
  8. package/dist/classes/Error.js +17 -40
  9. package/dist/classes/Error.js.map +1 -1
  10. package/dist/classes/HealthCheck.js +27 -96
  11. package/dist/classes/HealthCheck.js.map +1 -1
  12. package/dist/index.d.ts +3 -1
  13. package/dist/index.js +320 -464
  14. package/dist/index.js.map +1 -1
  15. package/dist/interceptors/grpcSignedToken.d.ts +1 -1
  16. package/dist/interceptors/grpcSignedToken.js +7 -79
  17. package/dist/interceptors/grpcSignedToken.js.map +1 -1
  18. package/dist/interceptors/moduleName.d.ts +1 -1
  19. package/dist/interceptors/moduleName.js +7 -79
  20. package/dist/interceptors/moduleName.js.map +1 -1
  21. package/dist/interfaces/ConduitRouteReturn.js +9 -18
  22. package/dist/interfaces/ConduitRouteReturn.js.map +1 -1
  23. package/dist/interfaces/GrpcCallback.d.ts +1 -1
  24. package/dist/interfaces/Indexable.d.ts +7 -7
  25. package/dist/interfaces/Model.d.ts +19 -16
  26. package/dist/interfaces/Params.d.ts +3 -3
  27. package/dist/interfaces/RawQuery.d.ts +2 -2
  28. package/dist/interfaces/Route.d.ts +12 -9
  29. package/dist/interfaces/Route.js.map +1 -1
  30. package/dist/interfaces/Socket.d.ts +1 -1
  31. package/dist/interfaces/UntypedArray.d.ts +1 -1
  32. package/dist/interfaces/types.d.ts +6 -6
  33. package/dist/module.proto +58 -0
  34. package/dist/modules/admin/index.d.ts +2 -3
  35. package/dist/modules/admin/index.js +13 -39
  36. package/dist/modules/admin/index.js.map +1 -1
  37. package/dist/modules/authentication/index.d.ts +6 -2
  38. package/dist/modules/authentication/index.js +33 -40
  39. package/dist/modules/authentication/index.js.map +1 -1
  40. package/dist/modules/authorization/index.d.ts +4 -1
  41. package/dist/modules/authorization/index.js +38 -47
  42. package/dist/modules/authorization/index.js.map +1 -1
  43. package/dist/modules/chat/index.js +16 -34
  44. package/dist/modules/chat/index.js.map +1 -1
  45. package/dist/modules/config/index.d.ts +12 -3
  46. package/dist/modules/config/index.js +85 -177
  47. package/dist/modules/config/index.js.map +1 -1
  48. package/dist/modules/core/index.js +8 -26
  49. package/dist/modules/core/index.js.map +1 -1
  50. package/dist/modules/database/index.d.ts +19 -10
  51. package/dist/modules/database/index.js +184 -125
  52. package/dist/modules/database/index.js.map +1 -1
  53. package/dist/modules/email/index.js +15 -33
  54. package/dist/modules/email/index.js.map +1 -1
  55. package/dist/modules/pushNotifications/index.d.ts +4 -4
  56. package/dist/modules/pushNotifications/index.js +38 -60
  57. package/dist/modules/pushNotifications/index.js.map +1 -1
  58. package/dist/modules/router/index.d.ts +2 -3
  59. package/dist/modules/router/index.js +15 -41
  60. package/dist/modules/router/index.js.map +1 -1
  61. package/dist/modules/sms/index.js +17 -35
  62. package/dist/modules/sms/index.js.map +1 -1
  63. package/dist/modules/storage/index.d.ts +7 -7
  64. package/dist/modules/storage/index.js +64 -55
  65. package/dist/modules/storage/index.js.map +1 -1
  66. package/dist/protoUtils/authentication.d.ts +200 -4
  67. package/dist/protoUtils/authentication.js +789 -194
  68. package/dist/protoUtils/authentication.js.map +1 -1
  69. package/dist/protoUtils/authorization.d.ts +185 -15
  70. package/dist/protoUtils/authorization.js +965 -448
  71. package/dist/protoUtils/authorization.js.map +1 -1
  72. package/dist/protoUtils/chat.d.ts +18 -7
  73. package/dist/protoUtils/chat.js +210 -227
  74. package/dist/protoUtils/chat.js.map +1 -1
  75. package/dist/protoUtils/core.d.ts +55 -50
  76. package/dist/protoUtils/core.js +1018 -902
  77. package/dist/protoUtils/core.js.map +1 -1
  78. package/dist/protoUtils/database.d.ts +262 -16
  79. package/dist/protoUtils/database.js +1489 -832
  80. package/dist/protoUtils/database.js.map +1 -1
  81. package/dist/protoUtils/email.d.ts +13 -4
  82. package/dist/protoUtils/email.js +242 -253
  83. package/dist/protoUtils/email.js.map +1 -1
  84. package/dist/protoUtils/google/protobuf/empty.d.ts +4 -3
  85. package/dist/protoUtils/google/protobuf/empty.js +21 -38
  86. package/dist/protoUtils/google/protobuf/empty.js.map +1 -1
  87. package/dist/protoUtils/grpc_health_check.d.ts +10 -4
  88. package/dist/protoUtils/grpc_health_check.js +72 -83
  89. package/dist/protoUtils/grpc_health_check.js.map +1 -1
  90. package/dist/protoUtils/module.d.ts +202 -4
  91. package/dist/protoUtils/module.js +810 -72
  92. package/dist/protoUtils/module.js.map +1 -1
  93. package/dist/protoUtils/push-notifications.d.ts +26 -6
  94. package/dist/protoUtils/push-notifications.js +381 -317
  95. package/dist/protoUtils/push-notifications.js.map +1 -1
  96. package/dist/protoUtils/router.d.ts +18 -48
  97. package/dist/protoUtils/router.js +502 -560
  98. package/dist/protoUtils/router.js.map +1 -1
  99. package/dist/protoUtils/sms.d.ts +16 -4
  100. package/dist/protoUtils/sms.js +199 -175
  101. package/dist/protoUtils/sms.js.map +1 -1
  102. package/dist/protoUtils/storage.d.ts +37 -4
  103. package/dist/protoUtils/storage.js +639 -318
  104. package/dist/protoUtils/storage.js.map +1 -1
  105. package/dist/types/db.d.ts +13 -11
  106. package/dist/types/index.d.ts +2 -2
  107. package/dist/types/index.js +6 -24
  108. package/dist/types/index.js.map +1 -1
  109. package/dist/utilities/EventBus.d.ts +3 -1
  110. package/dist/utilities/EventBus.js +38 -17
  111. package/dist/utilities/EventBus.js.map +1 -1
  112. package/dist/utilities/RedisManager.js +11 -21
  113. package/dist/utilities/RedisManager.js.map +1 -1
  114. package/dist/utilities/StateManager.d.ts +9 -0
  115. package/dist/utilities/StateManager.js +58 -15
  116. package/dist/utilities/StateManager.js.map +1 -1
  117. package/dist/utilities/env.js +4 -4
  118. package/dist/utilities/env.js.map +1 -1
  119. package/dist/utilities/sleep.js +1 -1
  120. package/dist/utilities/sleep.js.map +1 -1
  121. 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 { ConduitProxyObject, ConduitRouteActions, ConduitRouteObject, SocketProtoDescription } from '../../interfaces';
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
- generateProtoFile(moduleName: string, routes: (ConduitRouteObject | SocketProtoDescription | ConduitProxyObject)[]): Promise<import("../../protoUtils").GenerateAdminProtoResponse>;
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
- var classes_1 = require("../../classes");
20
- var protoUtils_1 = require("../../protoUtils");
21
- var Admin = /** @class */ (function (_super) {
22
- __extends(Admin, _super);
23
- function Admin(moduleName, url, grpcToken) {
24
- var _this = _super.call(this, moduleName, 'admin', url, grpcToken) || this;
25
- _this.moduleName = moduleName;
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
- Admin.prototype.generateProtoFile = function (moduleName, routes) {
30
- var request = {
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
- Admin.prototype.patchRouteMiddlewares = function (path, action, middlewares) {
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
- return Admin;
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":";;;;;;;;;;;;;;;;;;AAAA,yCAA8C;AAC9C,+CAK0B;AAQ1B;IAA2B,yBAAqC;IAC9D,eAAqB,UAAkB,E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U,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/ConduitModule';
2
- import { AuthenticationDefinition, UserCreateResponse, UserDeleteResponse, UserLoginResponse } from '../../protoUtils/authentication';
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
- var ConduitModule_1 = require("../../classes/ConduitModule");
20
- var authentication_1 = require("../../protoUtils/authentication");
21
- var Authentication = /** @class */ (function (_super) {
22
- __extends(Authentication, _super);
23
- function Authentication(moduleName, url, grpcToken) {
24
- var _this = _super.call(this, moduleName, 'authentication', url, grpcToken) || this;
25
- _this.moduleName = moduleName;
26
- _this.initializeClient(authentication_1.AuthenticationDefinition);
27
- return _this;
28
- }
29
- Authentication.prototype.userLogin = function (userId, clientId) {
30
- return this.client.userLogin({ userId: userId, clientId: clientId });
31
- };
32
- Authentication.prototype.userDelete = function (userId) {
33
- return this.client.userDelete({ userId: userId });
34
- };
35
- Authentication.prototype.userCreate = function (email, verify, password) {
36
- if (verify === void 0) { verify = false; }
37
- return this.client.userCreate({ email: email, verify: verify, password: password });
38
- };
39
- Authentication.prototype.changePass = function (email, password) {
40
- return this.client.changePass({ email: email, password: password });
41
- };
42
- return Authentication;
43
- }(ConduitModule_1.ConduitModule));
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":";;;;;;;;;;;;;;;;;;AAAA,6DAA4D;AAC5D,kEAKyC;AAEzC;IAAoC,kCAA8C;IAChF,wBAA6B,UAAkB,EAAE,GAAW,EAAE,SAAkB;QAAhF,YACE,kBAAM,UAAU,EAAE,gBAAgB,EAAE,GAAG,EAAE,SAAS,CAAC,SAEpD;QAH4B,gBAAU,GAAV,UAAU,CAAQ;QAE7C,KAAI,CAAC,gBAAgB,CAAC,yCAAwB,CAAC,CAAC;;IAClD,CAAC;IAED,kCAAS,GAAT,UAAU,MAAc,EAAE,QAAgB;QACxC,OAAO,IAAI,CAAC,MAAO,CAAC,SAAS,CAAC,EAAE,MAAM,QAAA,EAAE,QAAQ,UAAA,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,mCAAU,GAAV,UAAW,MAAc;QACvB,OAAO,IAAI,CAAC,MAAO,CAAC,UAAU,CAAC,EAAE,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AE,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;IAED,mBAAmB,CACjB,WAAmB,EACnB,IAAa;QAEb,OAAO,IAAI,CAAC,MAAO,CAAC,mBAAmB,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;IACjE,CAAC;CACF;AA5CD,wCA4CC"}
@@ -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
- var classes_1 = require("../../classes");
20
- var protoUtils_1 = require("../../protoUtils");
21
- var Authorization = /** @class */ (function (_super) {
22
- __extends(Authorization, _super);
23
- function Authorization(moduleName, url, grpcToken) {
24
- var _this = _super.call(this, moduleName, 'authorization', url, grpcToken) || this;
25
- _this.moduleName = moduleName;
26
- _this.initializeClient(protoUtils_1.AuthorizationDefinition);
27
- return _this;
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
- Authorization.prototype.updateResource = function (data) {
14
+ }
15
+ updateResource(data) {
33
16
  return this.client.updateResource(data);
34
- };
35
- Authorization.prototype.deleteResource = function (data) {
17
+ }
18
+ deleteResource(data) {
36
19
  return this.client.deleteResource(data);
37
- };
38
- Authorization.prototype.deleteRelation = function (data) {
20
+ }
21
+ deleteRelation(data) {
39
22
  return this.client.deleteRelation(data);
40
- };
41
- Authorization.prototype.deleteAllRelations = function (data) {
23
+ }
24
+ deleteAllRelations(data) {
42
25
  return this.client.deleteAllRelations(data);
43
- };
44
- Authorization.prototype.createRelation = function (data) {
26
+ }
27
+ createRelation(data) {
45
28
  return this.client.createRelation(data);
46
- };
47
- Authorization.prototype.findRelation = function (data) {
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
- Authorization.prototype.can = function (data) {
35
+ }
36
+ can(data) {
51
37
  return this.client.can(data);
52
- };
53
- Authorization.prototype.grantPermission = function (data) {
38
+ }
39
+ grantPermission(data) {
54
40
  return this.client.grantPermission(data);
55
- };
56
- Authorization.prototype.removePermission = function (data) {
41
+ }
42
+ removePermission(data) {
57
43
  return this.client.removePermission(data);
58
- };
59
- return Authorization;
60
- }(classes_1.ConduitModule));
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":";;;;;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;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"}
@@ -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
- var ConduitModule_1 = require("../../classes/ConduitModule");
20
- var chat_1 = require("../../protoUtils/chat");
21
- var Chat = /** @class */ (function (_super) {
22
- __extends(Chat, _super);
23
- function Chat(moduleName, url, grpcToken) {
24
- var _this = _super.call(this, moduleName, 'chat', url, grpcToken) || this;
25
- _this.moduleName = moduleName;
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
- Chat.prototype.sendMessage = function (messageData) {
12
+ sendMessage(messageData) {
30
13
  return this.client.sendMessage(messageData);
31
- };
32
- Chat.prototype.createRoom = function (name, participants) {
33
- return this.client.createRoom({ name: name, participants: participants });
34
- };
35
- Chat.prototype.deleteRoom = function (id) {
36
- return this.client.deleteRoom({ id: id });
37
- };
38
- return Chat;
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":";;;;;;;;;;;;;;;;;;AAAA,6DAA4D;AAC5D,8CAAiF;AAEjF;IAA0B,wBAAoC;IAC5D,cAA6B,UAAkB,EAAE,GAAW,EAAE,SAAkB;QAAhF,YACE,kBAAM,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,CAAC,SAE1C;QAH4B,gBAAU,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AE,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/core';
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("../../index").ModuleExistsResponse>;
19
+ moduleExists(name: string): Promise<import("../../protoUtils").ModuleExistsResponse>;
19
20
  moduleList(): Promise<any[]>;
20
- getRedisDetails(): Promise<import("../../index").GetRedisDetailsResponse>;
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;