@conduitplatform/grpc-sdk 0.16.0-alpha.8 → 0.16.0-rc.0

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 (123) hide show
  1. package/dist/classes/ConduitAuthorizedResource.js +5 -6
  2. package/dist/classes/ConduitAuthorizedResource.js.map +1 -1
  3. package/dist/classes/ConduitModule.js +59 -162
  4. package/dist/classes/ConduitModule.js.map +1 -1
  5. package/dist/classes/ConduitSchema.js +3 -4
  6. package/dist/classes/ConduitSchema.js.map +1 -1
  7. package/dist/classes/Error.js +17 -40
  8. package/dist/classes/Error.js.map +1 -1
  9. package/dist/classes/HealthCheck.js +28 -96
  10. package/dist/classes/HealthCheck.js.map +1 -1
  11. package/dist/index.d.ts +2 -1
  12. package/dist/index.js +300 -462
  13. package/dist/index.js.map +1 -1
  14. package/dist/interceptors/grpcSignedToken.d.ts +1 -1
  15. package/dist/interceptors/grpcSignedToken.js +7 -79
  16. package/dist/interceptors/grpcSignedToken.js.map +1 -1
  17. package/dist/interceptors/moduleName.d.ts +1 -1
  18. package/dist/interceptors/moduleName.js +7 -79
  19. package/dist/interceptors/moduleName.js.map +1 -1
  20. package/dist/interfaces/ConduitRouteReturn.d.ts +3 -3
  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 +66 -13
  26. package/dist/interfaces/Model.js.map +1 -1
  27. package/dist/interfaces/Params.d.ts +3 -3
  28. package/dist/interfaces/RawQuery.d.ts +2 -2
  29. package/dist/interfaces/Route.d.ts +30 -19
  30. package/dist/interfaces/Route.js +1 -10
  31. package/dist/interfaces/Route.js.map +1 -1
  32. package/dist/interfaces/Socket.d.ts +1 -1
  33. package/dist/interfaces/UntypedArray.d.ts +1 -1
  34. package/dist/interfaces/types.d.ts +6 -6
  35. package/dist/module.proto +58 -0
  36. package/dist/modules/admin/index.d.ts +3 -3
  37. package/dist/modules/admin/index.js +18 -37
  38. package/dist/modules/admin/index.js.map +1 -1
  39. package/dist/modules/authentication/index.d.ts +6 -2
  40. package/dist/modules/authentication/index.js +33 -40
  41. package/dist/modules/authentication/index.js.map +1 -1
  42. package/dist/modules/authorization/index.d.ts +4 -1
  43. package/dist/modules/authorization/index.js +38 -47
  44. package/dist/modules/authorization/index.js.map +1 -1
  45. package/dist/modules/chat/index.js +16 -34
  46. package/dist/modules/chat/index.js.map +1 -1
  47. package/dist/modules/config/index.d.ts +10 -1
  48. package/dist/modules/config/index.js +82 -177
  49. package/dist/modules/config/index.js.map +1 -1
  50. package/dist/modules/core/index.js +8 -26
  51. package/dist/modules/core/index.js.map +1 -1
  52. package/dist/modules/database/index.d.ts +19 -10
  53. package/dist/modules/database/index.js +184 -125
  54. package/dist/modules/database/index.js.map +1 -1
  55. package/dist/modules/email/index.js +15 -33
  56. package/dist/modules/email/index.js.map +1 -1
  57. package/dist/modules/pushNotifications/index.d.ts +4 -4
  58. package/dist/modules/pushNotifications/index.js +38 -60
  59. package/dist/modules/pushNotifications/index.js.map +1 -1
  60. package/dist/modules/router/index.d.ts +3 -3
  61. package/dist/modules/router/index.js +20 -39
  62. package/dist/modules/router/index.js.map +1 -1
  63. package/dist/modules/sms/index.js +17 -35
  64. package/dist/modules/sms/index.js.map +1 -1
  65. package/dist/modules/storage/index.d.ts +7 -7
  66. package/dist/modules/storage/index.js +64 -55
  67. package/dist/modules/storage/index.js.map +1 -1
  68. package/dist/protoUtils/authentication.d.ts +200 -4
  69. package/dist/protoUtils/authentication.js +789 -194
  70. package/dist/protoUtils/authentication.js.map +1 -1
  71. package/dist/protoUtils/authorization.d.ts +155 -5
  72. package/dist/protoUtils/authorization.js +860 -447
  73. package/dist/protoUtils/authorization.js.map +1 -1
  74. package/dist/protoUtils/chat.d.ts +18 -7
  75. package/dist/protoUtils/chat.js +210 -227
  76. package/dist/protoUtils/chat.js.map +1 -1
  77. package/dist/protoUtils/core.d.ts +86 -49
  78. package/dist/protoUtils/core.js +1057 -852
  79. package/dist/protoUtils/core.js.map +1 -1
  80. package/dist/protoUtils/database.d.ts +262 -16
  81. package/dist/protoUtils/database.js +1489 -832
  82. package/dist/protoUtils/database.js.map +1 -1
  83. package/dist/protoUtils/email.d.ts +13 -4
  84. package/dist/protoUtils/email.js +242 -253
  85. package/dist/protoUtils/email.js.map +1 -1
  86. package/dist/protoUtils/google/protobuf/empty.d.ts +6 -3
  87. package/dist/protoUtils/google/protobuf/empty.js +21 -38
  88. package/dist/protoUtils/google/protobuf/empty.js.map +1 -1
  89. package/dist/protoUtils/grpc_health_check.d.ts +10 -4
  90. package/dist/protoUtils/grpc_health_check.js +72 -83
  91. package/dist/protoUtils/grpc_health_check.js.map +1 -1
  92. package/dist/protoUtils/module.d.ts +202 -4
  93. package/dist/protoUtils/module.js +810 -72
  94. package/dist/protoUtils/module.js.map +1 -1
  95. package/dist/protoUtils/push-notifications.d.ts +26 -6
  96. package/dist/protoUtils/push-notifications.js +381 -317
  97. package/dist/protoUtils/push-notifications.js.map +1 -1
  98. package/dist/protoUtils/router.d.ts +50 -48
  99. package/dist/protoUtils/router.js +529 -498
  100. package/dist/protoUtils/router.js.map +1 -1
  101. package/dist/protoUtils/sms.d.ts +16 -4
  102. package/dist/protoUtils/sms.js +199 -175
  103. package/dist/protoUtils/sms.js.map +1 -1
  104. package/dist/protoUtils/storage.d.ts +39 -4
  105. package/dist/protoUtils/storage.js +641 -345
  106. package/dist/protoUtils/storage.js.map +1 -1
  107. package/dist/types/db.d.ts +13 -11
  108. package/dist/types/index.d.ts +2 -2
  109. package/dist/types/index.js +6 -24
  110. package/dist/types/index.js.map +1 -1
  111. package/dist/utilities/EventBus.d.ts +3 -1
  112. package/dist/utilities/EventBus.js +38 -17
  113. package/dist/utilities/EventBus.js.map +1 -1
  114. package/dist/utilities/RedisManager.js +11 -21
  115. package/dist/utilities/RedisManager.js.map +1 -1
  116. package/dist/utilities/StateManager.d.ts +9 -0
  117. package/dist/utilities/StateManager.js +58 -15
  118. package/dist/utilities/StateManager.js.map +1 -1
  119. package/dist/utilities/env.js +4 -4
  120. package/dist/utilities/env.js.map +1 -1
  121. package/dist/utilities/sleep.js +1 -1
  122. package/dist/utilities/sleep.js.map +1 -1
  123. package/package.json +26 -19
@@ -1,77 +1,55 @@
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.PushNotifications = void 0;
19
- var ConduitModule_1 = require("../../classes/ConduitModule");
20
- var push_notifications_1 = require("../../protoUtils/push-notifications");
21
- var PushNotifications = /** @class */ (function (_super) {
22
- __extends(PushNotifications, _super);
23
- function PushNotifications(moduleName, url, grpcToken) {
24
- var _this = _super.call(this, moduleName, 'push-notifications', url, grpcToken) || this;
25
- _this.moduleName = moduleName;
26
- _this.initializeClient(push_notifications_1.PushNotificationsDefinition);
27
- return _this;
4
+ const ConduitModule_1 = require("../../classes/ConduitModule");
5
+ const push_notifications_1 = require("../../protoUtils/push-notifications");
6
+ class PushNotifications extends ConduitModule_1.ConduitModule {
7
+ constructor(moduleName, url, grpcToken) {
8
+ super(moduleName, 'push-notifications', url, grpcToken);
9
+ this.moduleName = moduleName;
10
+ this.initializeClient(push_notifications_1.PushNotificationsDefinition);
28
11
  }
29
- PushNotifications.prototype.sendNotificationToken = function (token, platform, userId) {
12
+ sendNotificationToken(token, platform, userId) {
30
13
  return this.client.setNotificationToken({
31
- token: token,
32
- platform: platform,
33
- userId: userId,
34
- }).then(function (res) {
14
+ token,
15
+ platform,
16
+ userId,
17
+ }).then(res => {
35
18
  return JSON.parse(res.newTokenDocument);
36
19
  });
37
- };
38
- PushNotifications.prototype.getNotificationTokens = function (userId) {
20
+ }
21
+ getNotificationTokens(userId) {
39
22
  return this.client.getNotificationTokens({
40
- userId: userId,
41
- }).then(function (res) {
42
- return res.tokenDocuments;
23
+ userId,
24
+ }).then(res => {
25
+ return res.tokenDocuments.map((tokenDocument) => {
26
+ return JSON.parse(tokenDocument);
27
+ });
43
28
  });
44
- };
45
- PushNotifications.prototype.sendNotification = function (sendTo, title, body, data, platform) {
29
+ }
30
+ sendNotification(sendTo, title, body, data, platform) {
46
31
  return this.client.sendNotification({
47
- sendTo: sendTo,
48
- title: title,
49
- body: body,
50
- data: data,
51
- platform: platform,
52
- }).then(function (res) {
53
- return JSON.parse(res.message);
32
+ sendTo,
33
+ title,
34
+ body,
35
+ data,
36
+ platform,
54
37
  });
55
- };
56
- PushNotifications.prototype.sendManyNotifications = function (notifications) {
38
+ }
39
+ sendManyNotifications(notifications) {
57
40
  return this.client.sendManyNotifications({
58
- notifications: notifications,
59
- }).then(function (res) {
60
- return JSON.parse(res.message);
41
+ notifications,
61
42
  });
62
- };
63
- PushNotifications.prototype.sendNotificationToManyDevices = function (sendTo, title, body, data, platform) {
43
+ }
44
+ sendNotificationToManyDevices(sendTo, title, body, data, platform) {
64
45
  return this.client.sendNotificationToManyDevices({
65
- sendTo: sendTo,
66
- title: title,
67
- body: body,
68
- data: data,
69
- platform: platform,
70
- }).then(function (res) {
71
- return JSON.parse(res.message);
46
+ sendTo,
47
+ title,
48
+ body,
49
+ data,
50
+ platform,
72
51
  });
73
- };
74
- return PushNotifications;
75
- }(ConduitModule_1.ConduitModule));
52
+ }
53
+ }
76
54
  exports.PushNotifications = PushNotifications;
77
55
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/pushNotifications/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,6DAA4D;AAC5D,0EAAkF;AAElF;IAAuC,qCAAiD;IACtF,2BAA6B,UAAkB,EAAE,GAAW,EAAE,SAAkB;QAAhF,YACE,kBAAM,UAAU,EAAE,oBAAoB,EAAE,GAAG,EAAE,SAAS,CAAC,SAExD;QAH4B,gBAAU,GAAV,UAAU,CAAQ;QAE7C,KAAI,CAAC,gBAAgB,CAAC,gDAA2B,CAAC,CAAC;;IACrD,CAAC;IAED,iDAAqB,GAArB,UAAsB,KAAa,EAAE,QAAgB,EAAE,MAAc;QACnE,OAAO,IAAI,CAAC,MAAO,CAAC,oBAAoB,CAAC;YACvC,KAAK,OAAA;YACL,QAAQ,UAAA;YACR,MAAM,QAAA;SACP,CAAC,CAAC,IAAI,CAAC,UAAA,GAAG;YACT,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAC1C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,iDAAqB,GAArB,UAAsB,MAAc;QAClC,OAAO,IAAI,CAAC,MAAO,CAAC,qBAAqB,CAAC;YACxC,MAAM,QAAA;SACP,CAAC,CAAC,IAAI,CAAC,UAAA,GAAG;YACT,OAAO,GAAG,CAAC,cAAc,CAAC;QAC5B,CAAC,CAAC,CAAC;IACL,CAAC;IAED,4CAAgB,GAAhB,UACE,MAAc,EACd,KAAa,EACb,IAAa,EACb,IAAa,EACb,QAAiB;QAEjB,OAAO,IAAI,CAAC,MAAO,CAAC,gBAAgB,CAAC;YACnC,MAAM,QAAA;YACN,KAAK,OAAA;YACL,IAAI,MAAA;YACJ,IAAI,MAAA;YACJ,QAAQ,UAAA;SACT,CAAC,CAAC,IAAI,CAAC,UAAA,GAAG;YACT,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;IACL,CAAC;IAED,iDAAqB,GAArB,UACE,aAEC;QAED,OAAO,IAAI,CAAC,MAAO,CAAC,qBAAqB,CAAC;YACxC,aAAa,eAAA;SACd,CAAC,CAAC,IAAI,CAAC,UAAA,GAAG;YACT,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;IACL,CAAC;IAED,yDAA6B,GAA7B,UACE,MAAgB,EAChB,KAAa,EACb,IAAa,EACb,IAAa,EACb,QAAiB;QAEjB,OAAO,IAAI,CAAC,MAAO,CAAC,6BAA6B,CAAC;YAChD,MAAM,QAAA;YACN,KAAK,OAAA;YACL,IAAI,MAAA;YACJ,IAAI,MAAA;YACJ,QAAQ,UAAA;SACT,CAAC,CAAC,IAAI,CAAC,UAAA,GAAG;YACT,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;IACL,CAAC;IACH,wBAAC;AAAD,CAAC,AAvED,CAAuC,6BAAa,GAuEnD;AAvEY,8CAAiB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/pushNotifications/index.ts"],"names":[],"mappings":";;;AAAA,+DAA4D;AAC5D,4EAAkF;AAElF,MAAa,iBAAkB,SAAQ,6BAAiD;IACtF,YACmB,UAAkB,EACnC,GAAW,EACX,SAAkB;QAElB,KAAK,CAAC,UAAU,EAAE,oBAAoB,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;QAJvC,eAAU,GAAV,UAAU,CAAQ;QAKnC,IAAI,CAAC,gBAAgB,CAAC,gDAA2B,CAAC,CAAC;IACrD,CAAC;IAED,qBAAqB,CAAC,KAAa,EAAE,QAAgB,EAAE,MAAc;QACnE,OAAO,IAAI,CAAC,MAAO,CAAC,oBAAoB,CAAC;YACvC,KAAK;YACL,QAAQ;YACR,MAAM;SACP,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YACZ,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAC1C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,qBAAqB,CAAC,MAAc;QAClC,OAAO,IAAI,CAAC,MAAO,CAAC,qBAAqB,CAAC;YACxC,MAAM;SACP,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YACZ,OAAO,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,aAAqB,EAAE,EAAE;gBACtD,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;YACnC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAED,gBAAgB,CACd,MAAc,EACd,KAAa,EACb,IAAa,EACb,IAAa,EACb,QAAiB;QAEjB,OAAO,IAAI,CAAC,MAAO,CAAC,gBAAgB,CAAC;YACnC,MAAM;YACN,KAAK;YACL,IAAI;YACJ,IAAI;YACJ,QAAQ;SACT,CAAC,CAAC;IACL,CAAC;IAED,qBAAqB,CACnB,aAEC;QAED,OAAO,IAAI,CAAC,MAAO,CAAC,qBAAqB,CAAC;YACxC,aAAa;SACd,CAAC,CAAC;IACL,CAAC;IAED,6BAA6B,CAC3B,MAAgB,EAChB,KAAa,EACb,IAAa,EACb,IAAa,EACb,QAAiB;QAEjB,OAAO,IAAI,CAAC,MAAO,CAAC,6BAA6B,CAAC;YAChD,MAAM;YACN,KAAK;YACL,IAAI;YACJ,IAAI;YACJ,QAAQ;SACT,CAAC,CAAC;IACL,CAAC;CACF;AAvED,8CAuEC"}
@@ -1,10 +1,10 @@
1
1
  import { ConduitModule } from '../../classes';
2
2
  import { RegisterConduitRouteRequest_PathDefinition, RouterDefinition, SocketData } from '../../protoUtils/router';
3
- import { ConduitProxyObject, ConduitRouteObject, SocketProtoDescription } from '../../interfaces';
3
+ import { ConduitRouteActions } from '../../interfaces';
4
4
  export declare class Router extends ConduitModule<typeof RouterDefinition> {
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/router").GenerateProtoResponse>;
8
- register(paths: RegisterConduitRouteRequest_PathDefinition[], protoFile: string, url?: string): Promise<any>;
7
+ register(paths: RegisterConduitRouteRequest_PathDefinition[], url?: string): Promise<any>;
9
8
  socketPush(data: SocketData): Promise<import("../../protoUtils/google/protobuf/empty").Empty>;
9
+ patchRouteMiddlewares(path: string, action: ConduitRouteActions, middlewares: string[]): Promise<import("../../protoUtils/google/protobuf/empty").Empty>;
10
10
  }
@@ -1,50 +1,31 @@
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.Router = void 0;
19
- var classes_1 = require("../../classes");
20
- var router_1 = require("../../protoUtils/router");
21
- var Router = /** @class */ (function (_super) {
22
- __extends(Router, _super);
23
- function Router(moduleName, url, grpcToken) {
24
- var _this = _super.call(this, moduleName, 'router', url, grpcToken) || this;
25
- _this.moduleName = moduleName;
26
- _this.initializeClient(router_1.RouterDefinition);
27
- return _this;
4
+ const classes_1 = require("../../classes");
5
+ const router_1 = require("../../protoUtils/router");
6
+ class Router extends classes_1.ConduitModule {
7
+ constructor(moduleName, url, grpcToken) {
8
+ super(moduleName, 'router', url, grpcToken);
9
+ this.moduleName = moduleName;
10
+ this.initializeClient(router_1.RouterDefinition);
28
11
  }
29
- Router.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.generateProto(request);
35
- };
36
- Router.prototype.register = function (paths, protoFile, url) {
37
- var request = {
12
+ register(paths, url) {
13
+ const request = {
38
14
  routes: paths,
39
- protoFile: protoFile,
40
15
  routerUrl: url,
41
16
  };
42
17
  return this.client.registerConduitRoute(request);
43
- };
44
- Router.prototype.socketPush = function (data) {
18
+ }
19
+ socketPush(data) {
45
20
  return this.client.socketPush(data);
46
- };
47
- return Router;
48
- }(classes_1.ConduitModule));
21
+ }
22
+ patchRouteMiddlewares(path, action, middlewares) {
23
+ return this.client.patchRouteMiddlewares({
24
+ path: path,
25
+ action: action,
26
+ middlewares: middlewares,
27
+ });
28
+ }
29
+ }
49
30
  exports.Router = Router;
50
31
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/router/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,yCAA8C;AAC9C,kDAMiC;AAOjC;IAA4B,0BAAsC;IAChE,gBAAqB,UAAkB,EAAE,GAAW,EAAE,SAAkB;QAAxE,YACE,kBAAM,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,CAAC,SAE5C;QAHoB,gBAAU,GAAV,UAAU,CAAQ;QAErC,KAAI,CAAC,gBAAgB,CAAC,yBAAgB,CAAC,CAAC;;IAC1C,CAAC;IAED,kCAAiB,GAAjB,UACE,UAAkB,EAClB,MAA4E;QAE5E,IAAM,OAAO,GAAyB;YACpC,UAAU,YAAA;YACV,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,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AC;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;AAhCD,wBAgCC"}
@@ -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.SMS = void 0;
19
- var ConduitModule_1 = require("../../classes/ConduitModule");
20
- var sms_1 = require("../../protoUtils/sms");
21
- var SMS = /** @class */ (function (_super) {
22
- __extends(SMS, _super);
23
- function SMS(moduleName, url, grpcToken) {
24
- var _this = _super.call(this, moduleName, 'sms', url, grpcToken) || this;
25
- _this.moduleName = moduleName;
26
- _this.initializeClient(sms_1.SmsDefinition);
27
- return _this;
4
+ const ConduitModule_1 = require("../../classes/ConduitModule");
5
+ const sms_1 = require("../../protoUtils/sms");
6
+ class SMS extends ConduitModule_1.ConduitModule {
7
+ constructor(moduleName, url, grpcToken) {
8
+ super(moduleName, 'sms', url, grpcToken);
9
+ this.moduleName = moduleName;
10
+ this.initializeClient(sms_1.SmsDefinition);
28
11
  }
29
- SMS.prototype.sendSms = function (to, message) {
30
- return this.client.sendSms({ to: to, message: message });
31
- };
32
- SMS.prototype.sendVerificationCode = function (to) {
33
- return this.client.sendVerificationCode({ to: to });
34
- };
35
- SMS.prototype.verify = function (verificationSid, code) {
36
- return this.client.verify({ verificationSid: verificationSid, code: code });
37
- };
38
- return SMS;
39
- }(ConduitModule_1.ConduitModule));
12
+ sendSms(to, message) {
13
+ return this.client.sendSms({ to, message });
14
+ }
15
+ sendVerificationCode(to) {
16
+ return this.client.sendVerificationCode({ to });
17
+ }
18
+ verify(verificationSid, code) {
19
+ return this.client.verify({ verificationSid, code });
20
+ }
21
+ }
40
22
  exports.SMS = SMS;
41
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/sms/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,6DAA4D;AAC5D,4CAK8B;AAE9B;IAAyB,uBAAmC;IAC1D,aAA6B,UAAkB,EAAE,GAAW,EAAE,SAAkB;QAAhF,YACE,kBAAM,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,CAAC,SAEzC;QAH4B,gBAAU,GAAV,UAAU,CAAQ;QAE7C,KAAI,CAAC,gBAAgB,CAAC,mBAAa,CAAC,CAAC;;IACvC,CAAC;IAED,qBAAO,GAAP,UAAQ,EAAU,EAAE,OAAe;QACjC,OAAO,IAAI,CAAC,MAAO,CAAC,OAAO,CAAC,EAAE,EAAE,IAAA,EAAE,OAAO,SAAA,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,kCAAoB,GAApB,UAAqB,EAAU;QAC7B,OAAO,IAAI,CAAC,MAAO,CAAC,oBAAoB,CAAC,EAAE,EAAE,IAAA,EAAE,CAAC,CAAC;IACnD,CAAC;IAED,oBAAM,GAAN,UAAO,eAAuB,EAAE,IAAY;QAC1C,OAAO,IAAI,CAAC,MAAO,CAAC,MAAM,CAAC,EAAE,eAAe,iBAAA,EAAE,IAAI,MAAA,EAAE,CAAC,CAAC;IACxD,CAAC;IACH,UAAC;AAAD,CAAC,AAjBD,CAAyB,6BAAa,GAiBrC;AAjBY,kBAAG"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/sms/index.ts"],"names":[],"mappings":";;;AAAA,+DAA4D;AAC5D,8CAK8B;AAE9B,MAAa,GAAI,SAAQ,6BAAmC;IAC1D,YAA6B,UAAkB,EAAE,GAAW,EAAE,SAAkB;QAC9E,KAAK,CAAC,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;QADd,eAAU,GAAV,UAAU,CAAQ;QAE7C,IAAI,CAAC,gBAAgB,CAAC,mBAAa,CAAC,CAAC;IACvC,CAAC;IAED,OAAO,CAAC,EAAU,EAAE,OAAe;QACjC,OAAO,IAAI,CAAC,MAAO,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,oBAAoB,CAAC,EAAU;QAC7B,OAAO,IAAI,CAAC,MAAO,CAAC,oBAAoB,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IACnD,CAAC;IAED,MAAM,CAAC,eAAuB,EAAE,IAAY;QAC1C,OAAO,IAAI,CAAC,MAAO,CAAC,MAAM,CAAC,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;IACxD,CAAC;CACF;AAjBD,kBAiBC"}
@@ -3,11 +3,11 @@ import { DeleteFileResponse, FileResponse, GetFileDataResponse, StorageDefinitio
3
3
  export declare class Storage extends ConduitModule<typeof StorageDefinition> {
4
4
  private readonly moduleName;
5
5
  constructor(moduleName: string, url: string, grpcToken?: string);
6
- getFile(id: string): Promise<FileResponse>;
7
- getFileData(id: string): Promise<GetFileDataResponse>;
8
- createFile(name: string, data: string, folder?: string, container?: string, mimeType?: string, isPublic?: boolean): Promise<FileResponse>;
9
- updateFile(id: string, data: string, name?: string, folder?: string, container?: string, mimeType?: string): Promise<FileResponse>;
10
- deleteFile(id: string): Promise<DeleteFileResponse>;
11
- createFileByUrl(name: string, folder?: string, container?: string, mimeType?: string, size?: number, isPublic?: boolean): Promise<import("../../protoUtils/storage").FileByUrlResponse>;
12
- updateFileByUrl(id: string, name?: string, folder?: string, container?: string, mimeType?: string, size?: number): Promise<import("../../protoUtils/storage").FileByUrlResponse>;
6
+ getFile(id: string, userId?: string, scope?: string): Promise<FileResponse>;
7
+ getFileData(id: string, userId?: string, scope?: string): Promise<GetFileDataResponse>;
8
+ createFile(name: string, data: string, folder?: string, container?: string, mimeType?: string, isPublic?: boolean, userId?: string, scope?: string): Promise<FileResponse>;
9
+ updateFile(id: string, data: string, name?: string, folder?: string, container?: string, mimeType?: string, userId?: string, scope?: string): Promise<FileResponse>;
10
+ deleteFile(id: string, userId?: string, scope?: string): Promise<DeleteFileResponse>;
11
+ createFileByUrl(name: string, folder?: string, container?: string, mimeType?: string, size?: number, isPublic?: boolean, userId?: string, scope?: string): Promise<import("../../protoUtils/storage").FileByUrlResponse>;
12
+ updateFileByUrl(id: string, name?: string, folder?: string, container?: string, mimeType?: string, size?: number, userId?: string, scope?: string): Promise<import("../../protoUtils/storage").FileByUrlResponse>;
13
13
  }
@@ -1,62 +1,71 @@
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.Storage = void 0;
19
- var ConduitModule_1 = require("../../classes/ConduitModule");
20
- var storage_1 = require("../../protoUtils/storage");
21
- var Storage = /** @class */ (function (_super) {
22
- __extends(Storage, _super);
23
- function Storage(moduleName, url, grpcToken) {
24
- var _this = _super.call(this, moduleName, 'storage', url, grpcToken) || this;
25
- _this.moduleName = moduleName;
26
- _this.initializeClient(storage_1.StorageDefinition);
27
- return _this;
28
- }
29
- Storage.prototype.getFile = function (id) {
30
- return this.client.getFile({ id: id });
31
- };
32
- Storage.prototype.getFileData = function (id) {
33
- return this.client.getFileData({ id: id });
34
- };
35
- Storage.prototype.createFile = function (name, data, folder, container, mimeType, isPublic) {
36
- if (isPublic === void 0) { isPublic = false; }
37
- return this.client.createFile({ name: name, mimeType: mimeType, data: data, folder: folder, isPublic: isPublic, container: container });
38
- };
39
- Storage.prototype.updateFile = function (id, data, name, folder, container, mimeType) {
40
- return this.client.updateFile({ name: name, mimeType: mimeType, data: data, folder: folder, id: id, container: container });
41
- };
42
- Storage.prototype.deleteFile = function (id) {
43
- return this.client.deleteFile({ id: id });
44
- };
45
- Storage.prototype.createFileByUrl = function (name, folder, container, mimeType, size, isPublic) {
46
- if (isPublic === void 0) { isPublic = false; }
4
+ const ConduitModule_1 = require("../../classes/ConduitModule");
5
+ const storage_1 = require("../../protoUtils/storage");
6
+ class Storage extends ConduitModule_1.ConduitModule {
7
+ constructor(moduleName, url, grpcToken) {
8
+ super(moduleName, 'storage', url, grpcToken);
9
+ this.moduleName = moduleName;
10
+ this.initializeClient(storage_1.StorageDefinition);
11
+ }
12
+ getFile(id, userId, scope) {
13
+ return this.client.getFile({ id, userId, scope });
14
+ }
15
+ getFileData(id, userId, scope) {
16
+ return this.client.getFileData({ id, userId, scope });
17
+ }
18
+ createFile(name, data, folder, container, mimeType, isPublic = false, userId, scope) {
19
+ return this.client.createFile({
20
+ name,
21
+ mimeType,
22
+ data,
23
+ folder,
24
+ isPublic,
25
+ container,
26
+ userId,
27
+ scope,
28
+ });
29
+ }
30
+ updateFile(id, data, name, folder, container, mimeType, userId, scope) {
31
+ return this.client.updateFile({
32
+ name,
33
+ mimeType,
34
+ data,
35
+ folder,
36
+ id,
37
+ container,
38
+ userId,
39
+ scope,
40
+ });
41
+ }
42
+ deleteFile(id, userId, scope) {
43
+ return this.client.deleteFile({ id, userId, scope });
44
+ }
45
+ createFileByUrl(name, folder, container, mimeType, size, isPublic = false, userId, scope) {
47
46
  return this.client.createFileByUrl({
48
- name: name,
49
- mimeType: mimeType,
50
- folder: folder,
51
- container: container,
52
- size: size,
53
- isPublic: isPublic,
47
+ name,
48
+ mimeType,
49
+ folder,
50
+ container,
51
+ size,
52
+ isPublic,
53
+ userId,
54
+ scope,
54
55
  });
55
- };
56
- Storage.prototype.updateFileByUrl = function (id, name, folder, container, mimeType, size) {
57
- return this.client.updateFileByUrl({ id: id, name: name, folder: folder, container: container, mimeType: mimeType, size: size });
58
- };
59
- return Storage;
60
- }(ConduitModule_1.ConduitModule));
56
+ }
57
+ updateFileByUrl(id, name, folder, container, mimeType, size, userId, scope) {
58
+ return this.client.updateFileByUrl({
59
+ id,
60
+ name,
61
+ folder,
62
+ container,
63
+ mimeType,
64
+ size,
65
+ userId,
66
+ scope,
67
+ });
68
+ }
69
+ }
61
70
  exports.Storage = Storage;
62
71
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/storage/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,6DAA4D;AAC5D,oDAKkC;AAElC;IAA6B,2BAAuC;IAClE,iBAA6B,UAAkB,EAAE,GAAW,EAAE,SAAkB;QAAhF,YACE,kBAAM,UAAU,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,CAAC,SAE7C;QAH4B,gBAAU,GAAV,UAAU,CAAQ;QAE7C,KAAI,CAAC,gBAAgB,CAAC,2BAAiB,CAAC,CAAC;;IAC3C,CAAC;IAED,yBAAO,GAAP,UAAQ,EAAU;QAChB,OAAO,IAAI,CAAC,MAAO,CAAC,OAAO,CAAC,EAAE,EAAE,IAAA,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