@friggframework/core 2.0.0--canary.398.bdb6d27.0 → 2.0.0--canary.397.e634da9.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 (98) hide show
  1. package/README.md +931 -50
  2. package/core/create-handler.js +1 -0
  3. package/credential/credential-repository.js +42 -0
  4. package/credential/use-cases/get-credential-for-user.js +21 -0
  5. package/credential/use-cases/update-authentication-status.js +15 -0
  6. package/database/models/WebsocketConnection.js +0 -5
  7. package/handlers/app-definition-loader.js +38 -0
  8. package/handlers/app-handler-helpers.js +0 -3
  9. package/handlers/backend-utils.js +42 -44
  10. package/handlers/routers/auth.js +3 -14
  11. package/handlers/routers/integration-defined-routers.js +8 -5
  12. package/handlers/routers/user.js +25 -5
  13. package/handlers/workers/integration-defined-workers.js +6 -3
  14. package/index.js +1 -16
  15. package/integrations/index.js +0 -5
  16. package/integrations/integration-base.js +142 -46
  17. package/integrations/integration-repository.js +80 -0
  18. package/integrations/integration-router.js +301 -178
  19. package/integrations/integration.js +246 -0
  20. package/integrations/options.js +1 -1
  21. package/integrations/tests/doubles/dummy-integration-class.js +90 -0
  22. package/integrations/tests/doubles/test-integration-repository.js +89 -0
  23. package/integrations/tests/use-cases/create-integration.test.js +124 -0
  24. package/integrations/tests/use-cases/delete-integration-for-user.test.js +143 -0
  25. package/integrations/tests/use-cases/get-integration-for-user.test.js +143 -0
  26. package/integrations/tests/use-cases/get-integration-instance.test.js +169 -0
  27. package/integrations/tests/use-cases/get-integrations-for-user.test.js +169 -0
  28. package/integrations/tests/use-cases/get-possible-integrations.test.js +188 -0
  29. package/integrations/tests/use-cases/update-integration-messages.test.js +142 -0
  30. package/integrations/tests/use-cases/update-integration-status.test.js +103 -0
  31. package/integrations/tests/use-cases/update-integration.test.js +134 -0
  32. package/integrations/use-cases/create-integration.js +71 -0
  33. package/integrations/use-cases/delete-integration-for-user.js +72 -0
  34. package/integrations/use-cases/get-integration-for-user.js +78 -0
  35. package/integrations/use-cases/get-integration-instance-by-definition.js +67 -0
  36. package/integrations/use-cases/get-integration-instance.js +82 -0
  37. package/integrations/use-cases/get-integrations-for-user.js +76 -0
  38. package/integrations/use-cases/get-possible-integrations.js +27 -0
  39. package/integrations/use-cases/index.js +11 -0
  40. package/integrations/use-cases/update-integration-messages.js +31 -0
  41. package/integrations/use-cases/update-integration-status.js +28 -0
  42. package/integrations/use-cases/update-integration.js +91 -0
  43. package/integrations/utils/map-integration-dto.js +36 -0
  44. package/{module-plugin → modules}/index.js +0 -8
  45. package/modules/module-factory.js +54 -0
  46. package/modules/module-repository.js +107 -0
  47. package/modules/module.js +221 -0
  48. package/{module-plugin → modules}/test/mock-api/api.js +8 -3
  49. package/{module-plugin → modules}/test/mock-api/definition.js +12 -8
  50. package/modules/tests/doubles/test-module-factory.js +16 -0
  51. package/modules/tests/doubles/test-module-repository.js +19 -0
  52. package/modules/use-cases/get-entities-for-user.js +32 -0
  53. package/modules/use-cases/get-entity-options-by-id.js +58 -0
  54. package/modules/use-cases/get-entity-options-by-type.js +34 -0
  55. package/modules/use-cases/get-module-instance-from-type.js +31 -0
  56. package/modules/use-cases/get-module.js +56 -0
  57. package/modules/use-cases/process-authorization-callback.js +114 -0
  58. package/modules/use-cases/refresh-entity-options.js +58 -0
  59. package/modules/use-cases/test-module-auth.js +54 -0
  60. package/modules/utils/map-module-dto.js +18 -0
  61. package/package.json +5 -5
  62. package/syncs/sync.js +0 -1
  63. package/types/integrations/index.d.ts +2 -6
  64. package/types/module-plugin/index.d.ts +4 -56
  65. package/types/syncs/index.d.ts +0 -2
  66. package/user/tests/doubles/test-user-repository.js +72 -0
  67. package/user/tests/use-cases/create-individual-user.test.js +24 -0
  68. package/user/tests/use-cases/create-organization-user.test.js +28 -0
  69. package/user/tests/use-cases/create-token-for-user-id.test.js +19 -0
  70. package/user/tests/use-cases/get-user-from-bearer-token.test.js +64 -0
  71. package/user/tests/use-cases/login-user.test.js +140 -0
  72. package/user/use-cases/create-individual-user.js +61 -0
  73. package/user/use-cases/create-organization-user.js +47 -0
  74. package/user/use-cases/create-token-for-user-id.js +30 -0
  75. package/user/use-cases/get-user-from-bearer-token.js +77 -0
  76. package/user/use-cases/login-user.js +122 -0
  77. package/user/user-repository.js +62 -0
  78. package/user/user.js +77 -0
  79. package/handlers/routers/middleware/loadUser.js +0 -15
  80. package/handlers/routers/middleware/requireLoggedInUser.js +0 -12
  81. package/integrations/create-frigg-backend.js +0 -31
  82. package/integrations/integration-factory.js +0 -251
  83. package/integrations/integration-user.js +0 -144
  84. package/integrations/test/integration-base.test.js +0 -144
  85. package/module-plugin/auther.js +0 -393
  86. package/module-plugin/entity-manager.js +0 -70
  87. package/module-plugin/manager.js +0 -169
  88. package/module-plugin/module-factory.js +0 -61
  89. /package/{module-plugin → modules}/ModuleConstants.js +0 -0
  90. /package/{module-plugin → modules}/credential.js +0 -0
  91. /package/{module-plugin → modules}/entity.js +0 -0
  92. /package/{module-plugin → modules}/requester/api-key.js +0 -0
  93. /package/{module-plugin → modules}/requester/basic.js +0 -0
  94. /package/{module-plugin → modules}/requester/oauth-2.js +0 -0
  95. /package/{module-plugin → modules}/requester/requester.js +0 -0
  96. /package/{module-plugin → modules}/requester/requester.test.js +0 -0
  97. /package/{module-plugin → modules}/test/auther.test.js +0 -0
  98. /package/{module-plugin → modules}/test/mock-api/mocks/hubspot.js +0 -0
@@ -0,0 +1,61 @@
1
+ const { get } = require('../../assertions');
2
+ const Boom = require('@hapi/boom');
3
+ const { User } = require('../user');
4
+
5
+ /**
6
+ * Use case for creating an individual user.
7
+ * @class CreateIndividualUser
8
+ */
9
+ class CreateIndividualUser {
10
+ /**
11
+ * Creates a new CreateIndividualUser instance.
12
+ * @param {Object} params - Configuration parameters.
13
+ * @param {import('../user-repository').UserRepository} params.userRepository - Repository for user data operations.
14
+ * @param {Object} params.userConfig - The user properties inside of the app definition.
15
+ */
16
+ constructor({ userRepository, userConfig }) {
17
+ this.userRepository = userRepository;
18
+ this.userConfig = userConfig;
19
+ }
20
+
21
+ /**
22
+ * Executes the use case.
23
+ * @async
24
+ * @param {Object} params - The parameters for creating the user.
25
+ * @returns {Promise<import('../user').User>} The newly created user object.
26
+ */
27
+ async execute(params) {
28
+ let hashword;
29
+ if (this.userConfig.usePassword) {
30
+ hashword = get(params, 'password');
31
+ }
32
+
33
+ const email = get(params, 'email', null);
34
+ const username = get(params, 'username', null);
35
+ if (!email && !username) {
36
+ throw Boom.badRequest('email or username is required');
37
+ }
38
+
39
+ const appUserId = get(params, 'appUserId', null);
40
+ const organizationUserId = get(params, 'organizationUserId', null);
41
+
42
+ const individualUserData = await this.userRepository.createIndividualUser({
43
+ email,
44
+ username,
45
+ hashword,
46
+ appUserId,
47
+ organizationUser: organizationUserId,
48
+ });
49
+
50
+ return new User(
51
+ individualUserData,
52
+ null,
53
+ this.userConfig.usePassword,
54
+ this.userConfig.primary,
55
+ this.userConfig.individualUserRequired,
56
+ this.userConfig.organizationUserRequired
57
+ );
58
+ }
59
+ }
60
+
61
+ module.exports = { CreateIndividualUser };
@@ -0,0 +1,47 @@
1
+ const { get } = require('../../assertions');
2
+ const { User } = require('../user');
3
+
4
+ /**
5
+ * Use case for creating an organization user.
6
+ * @class CreateOrganizationUser
7
+ */
8
+ class CreateOrganizationUser {
9
+ /**
10
+ * Creates a new CreateOrganizationUser instance.
11
+ * @param {Object} params - Configuration parameters.
12
+ * @param {import('../user-repository').UserRepository} params.userRepository - Repository for user data operations.
13
+ * @param {Object} params.userConfig - The user properties inside of the app definition.
14
+ */
15
+ constructor({ userRepository, userConfig }) {
16
+ this.userRepository = userRepository;
17
+ this.userConfig = userConfig;
18
+ }
19
+
20
+ /**
21
+ * Executes the use case.
22
+ * @async
23
+ * @param {Object} params - The parameters for creating the user.
24
+ * @returns {Promise<import('../user').User>} The newly created user object.
25
+ */
26
+ async execute(params) {
27
+ const name = get(params, 'name');
28
+ const appOrgId = get(params, 'appOrgId');
29
+
30
+ const organizationUserData =
31
+ await this.userRepository.createOrganizationUser({
32
+ name,
33
+ appOrgId,
34
+ });
35
+
36
+ return new User(
37
+ null,
38
+ organizationUserData,
39
+ this.userConfig.usePassword,
40
+ this.userConfig.primary,
41
+ this.userConfig.individualUserRequired,
42
+ this.userConfig.organizationUserRequired
43
+ );
44
+ }
45
+ }
46
+
47
+ module.exports = { CreateOrganizationUser };
@@ -0,0 +1,30 @@
1
+ const crypto = require('crypto');
2
+
3
+ /**
4
+ * Use case for creating a token for a user ID.
5
+ * @class CreateTokenForUserId
6
+ */
7
+ class CreateTokenForUserId {
8
+ /**
9
+ * Creates a new CreateTokenForUserId instance.
10
+ * @param {Object} params - Configuration parameters.
11
+ * @param {import('../user-repository').UserRepository} params.userRepository - Repository for user data operations.
12
+ */
13
+ constructor({ userRepository }) {
14
+ this.userRepository = userRepository;
15
+ }
16
+
17
+ /**
18
+ * Executes the use case.
19
+ * @async
20
+ * @param {string} userId - The ID of the user to create a token for.
21
+ * @param {number} minutes - The number of minutes until the token expires.
22
+ * @returns {Promise<string>} The user token.
23
+ */
24
+ async execute(userId, minutes) {
25
+ const rawToken = crypto.randomBytes(20).toString('hex');
26
+ return this.userRepository.createToken(userId, rawToken, minutes);
27
+ }
28
+ }
29
+
30
+ module.exports = { CreateTokenForUserId };
@@ -0,0 +1,77 @@
1
+ const Boom = require('@hapi/boom');
2
+ const { User } = require('../user');
3
+
4
+ /**
5
+ * Use case for retrieving a user from a bearer token.
6
+ * @class GetUserFromBearerToken
7
+ */
8
+ class GetUserFromBearerToken {
9
+ /**
10
+ * Creates a new GetUserFromBearerToken instance.
11
+ * @param {Object} params - Configuration parameters.
12
+ * @param {import('../user-repository').UserRepository} params.userRepository - Repository for user data operations.
13
+ * @param {Object} params.userConfig - The user config in the app definition.
14
+ */
15
+ constructor({ userRepository, userConfig }) {
16
+ this.userRepository = userRepository;
17
+ this.userConfig = userConfig;
18
+ }
19
+
20
+ /**
21
+ * Executes the use case.
22
+ * @async
23
+ * @param {string} bearerToken - The bearer token from the authorization header.
24
+ * @returns {Promise<import('../user').User>} The authenticated user object.
25
+ * @throws {Boom} 401 Unauthorized if the token is missing, malformed, or invalid.
26
+ */
27
+ async execute(bearerToken) {
28
+ if (!bearerToken) {
29
+ throw Boom.unauthorized('Missing Authorization Header');
30
+ }
31
+
32
+ const token = bearerToken.split(' ')[1]?.trim();
33
+ if (!token) {
34
+ throw Boom.unauthorized('Invalid Token Format');
35
+ }
36
+
37
+ const sessionToken = await this.userRepository.getSessionToken(token);
38
+
39
+ if (!sessionToken) {
40
+ throw Boom.unauthorized('Session Token Not Found');
41
+ }
42
+
43
+ if (this.userConfig.primary === 'organization') {
44
+ const organizationUserData = await this.userRepository.findOrganizationUserById(sessionToken.user);
45
+
46
+ if (!organizationUserData) {
47
+ throw Boom.unauthorized('Organization User Not Found');
48
+ }
49
+
50
+ return new User(
51
+ null,
52
+ organizationUserData,
53
+ this.userConfig.usePassword,
54
+ this.userConfig.primary,
55
+ this.userConfig.individualUserRequired,
56
+ this.userConfig.organizationUserRequired
57
+ );
58
+ }
59
+
60
+ const individualUserData = await this.userRepository.findIndividualUserById(sessionToken.user);
61
+
62
+ if (!individualUserData) {
63
+ throw Boom.unauthorized('Individual User Not Found');
64
+ }
65
+
66
+ return new User(
67
+ individualUserData,
68
+ null,
69
+ this.userConfig.usePassword,
70
+ this.userConfig.primary,
71
+ this.userConfig.individualUserRequired,
72
+ this.userConfig.organizationUserRequired
73
+ );
74
+ }
75
+ }
76
+
77
+ module.exports = { GetUserFromBearerToken };
@@ -0,0 +1,122 @@
1
+ const Boom = require('@hapi/boom');
2
+ const {
3
+ RequiredPropertyError,
4
+ } = require('../../errors');
5
+ const { User } = require('../user');
6
+
7
+ /**
8
+ * Use case for logging in a user.
9
+ * @class LoginUser
10
+ */
11
+ class LoginUser {
12
+ /**
13
+ * Creates a new LoginUser instance.
14
+ * @param {Object} params - Configuration parameters.
15
+ * @param {import('../user-repository').UserRepository} params.userRepository - Repository for user data operations.
16
+ * @param {Object} params.userConfig - The user properties inside of the app definition.
17
+ */
18
+ constructor({ userRepository, userConfig }) {
19
+ this.userRepository = userRepository;
20
+ this.userConfig = userConfig;
21
+ }
22
+
23
+ /**
24
+ * Executes the use case.
25
+ * @async
26
+ * @param {Object} userCredentials - The user's credentials for authentication.
27
+ * @param {string} [userCredentials.username] - The username for authentication.
28
+ * @param {string} [userCredentials.password] - The password for authentication.
29
+ * @param {string} [userCredentials.appUserId] - The app user id for authentication if no username and password are provided.
30
+ * @param {string} [userCredentials.appOrgId] - The app organization id for authentication if no username and password are provided.
31
+ * @returns {Promise<import('../user').User>} The authenticated user object.
32
+ */
33
+ async execute(userCredentials) {
34
+ const { username, password, appUserId, appOrgId } = userCredentials;
35
+ if (this.userConfig.individualUserRequired) {
36
+ if (this.userConfig.usePassword) {
37
+ if (!username) {
38
+ throw new RequiredPropertyError({
39
+ parent: this,
40
+ key: 'username',
41
+ });
42
+ }
43
+ if (!password) {
44
+ throw new RequiredPropertyError({
45
+ parent: this,
46
+ key: 'password',
47
+ });
48
+ }
49
+
50
+ const individualUserData =
51
+ await this.userRepository.findIndividualUserByUsername(
52
+ username
53
+ );
54
+
55
+ if (!individualUserData) {
56
+ throw Boom.unauthorized('user not found');
57
+ }
58
+
59
+ const individualUser = new User(
60
+ individualUserData,
61
+ null,
62
+ this.userConfig.usePassword,
63
+ this.userConfig.primary,
64
+ this.userConfig.individualUserRequired,
65
+ this.userConfig.organizationUserRequired
66
+ );
67
+
68
+ if (!individualUser.isPasswordValid(password)) {
69
+ throw Boom.unauthorized('Incorrect username or password');
70
+ }
71
+
72
+ return individualUser;
73
+ } else {
74
+ const individualUserData =
75
+ await this.userRepository.findIndividualUserByAppUserId(
76
+ appUserId
77
+ );
78
+
79
+ if (!individualUserData) {
80
+ throw Boom.unauthorized('user not found');
81
+ }
82
+
83
+ const individualUser = new User(
84
+ individualUserData,
85
+ null,
86
+ this.userConfig.usePassword,
87
+ this.userConfig.primary,
88
+ this.userConfig.individualUserRequired,
89
+ this.userConfig.organizationUserRequired
90
+ );
91
+
92
+ return individualUser;
93
+ }
94
+ }
95
+
96
+
97
+ if (this.userConfig.organizationUserRequired) {
98
+
99
+ const organizationUserData =
100
+ await this.userRepository.findOrganizationUserByAppOrgId(appOrgId);
101
+
102
+ if (!organizationUserData) {
103
+ throw Boom.unauthorized(`org user ${appOrgId} not found`);
104
+ }
105
+
106
+ const organizationUser = new User(
107
+ null,
108
+ organizationUserData,
109
+ this.userConfig.usePassword,
110
+ this.userConfig.primary,
111
+ this.userConfig.individualUserRequired,
112
+ this.userConfig.organizationUserRequired
113
+ );
114
+
115
+ return organizationUser;
116
+ }
117
+
118
+ return null;
119
+ }
120
+ }
121
+
122
+ module.exports = { LoginUser };
@@ -0,0 +1,62 @@
1
+ const { Token } = require('../database/models/Token');
2
+ const { IndividualUser } = require('../database/models/IndividualUser');
3
+ const { OrganizationUser } = require('../database/models/OrganizationUser');
4
+
5
+ class UserRepository {
6
+ /**
7
+ * @param {Object} userConfig - The user config in the app definition.
8
+ */
9
+ constructor({ userConfig }) {
10
+ this.IndividualUser = IndividualUser;
11
+ this.OrganizationUser = OrganizationUser;
12
+ this.Token = Token;
13
+ this.userConfig = userConfig;
14
+ }
15
+
16
+ async getSessionToken(token) {
17
+ const jsonToken =
18
+ this.Token.getJSONTokenFromBase64BufferToken(token);
19
+ const sessionToken =
20
+ await this.Token.validateAndGetTokenFromJSONToken(jsonToken);
21
+ return sessionToken;
22
+ }
23
+
24
+ async findOrganizationUserById(userId) {
25
+ return this.OrganizationUser.findById(userId);
26
+ }
27
+
28
+ async findIndividualUserById(userId) {
29
+ return this.IndividualUser.findById(userId);
30
+ }
31
+
32
+ async createToken(userId, rawToken, minutes = 120) {
33
+ const createdToken = await this.Token.createTokenWithExpire(
34
+ userId,
35
+ rawToken,
36
+ minutes
37
+ );
38
+ return this.Token.createBase64BufferToken(createdToken, rawToken);
39
+ }
40
+
41
+ async createIndividualUser(params) {
42
+ return this.IndividualUser.create(params);
43
+ }
44
+
45
+ async createOrganizationUser(params) {
46
+ return this.OrganizationUser.create(params);
47
+ }
48
+
49
+ async findIndividualUserByUsername(username) {
50
+ return this.IndividualUser.findOne({ username });
51
+ }
52
+
53
+ async findIndividualUserByAppUserId(appUserId) {
54
+ return this.IndividualUser.getUserByAppUserId(appUserId);
55
+ }
56
+
57
+ async findOrganizationUserByAppOrgId(appOrgId) {
58
+ return this.OrganizationUser.getUserByAppOrgId(appOrgId);
59
+ }
60
+ }
61
+
62
+ module.exports = { UserRepository };
package/user/user.js ADDED
@@ -0,0 +1,77 @@
1
+ const bcrypt = require('bcryptjs');
2
+
3
+ /**
4
+ * Represents a user in the system. The User class is a domain entity,
5
+ * @class User
6
+ */
7
+ class User {
8
+ /**
9
+ * Creates a new User instance.
10
+ * @param {import('../database/models/IndividualUser').IndividualUser} [individualUser=null] - The individual user for the user.
11
+ * @param {import('../database/models/OrganizationUser').OrganizationUser} [organizationUser=null] - The organization user for the user.
12
+ * @param {boolean} [usePassword=false] - Whether the user has a password.
13
+ * @param {string} [primary='individual'] - The primary user type.
14
+ * @param {boolean} [individualUserRequired=true] - Whether the user is required to have an individual user.
15
+ * @param {boolean} [organizationUserRequired=false] - Whether the user is required to have an organization user.
16
+ */
17
+ constructor(individualUser = null, organizationUser = null, usePassword = false, primary = 'individual', individualUserRequired = true, organizationUserRequired = false) {
18
+ this.individualUser = individualUser;
19
+ this.organizationUser = organizationUser;
20
+ this.usePassword = usePassword;
21
+
22
+ this.config = {
23
+ primary,
24
+ individualUserRequired,
25
+ organizationUserRequired,
26
+ };
27
+ }
28
+
29
+ getPrimaryUser() {
30
+ if (this.config.primary === 'organization') {
31
+ return this.organizationUser;
32
+ }
33
+ return this.individualUser;
34
+ }
35
+
36
+ getId() {
37
+ return this.getPrimaryUser()?.id;
38
+ }
39
+
40
+ isPasswordRequired() {
41
+ return this.usePassword;
42
+ }
43
+
44
+ isPasswordValid(password) {
45
+ if (!this.isPasswordRequired()) {
46
+ return true;
47
+ }
48
+
49
+ return bcrypt.compareSync(password, this.getPrimaryUser().hashword);
50
+ }
51
+
52
+ setIndividualUser(individualUser) {
53
+ this.individualUser = individualUser;
54
+ }
55
+
56
+ setOrganizationUser(organizationUser) {
57
+ this.organizationUser = organizationUser;
58
+ }
59
+
60
+ isOrganizationUserRequired() {
61
+ return this.config.organizationUserRequired;
62
+ }
63
+
64
+ isIndividualUserRequired() {
65
+ return this.config.individualUserRequired;
66
+ }
67
+
68
+ getIndividualUser() {
69
+ return this.individualUser;
70
+ }
71
+
72
+ getOrganizationUser() {
73
+ return this.organizationUser;
74
+ }
75
+ }
76
+
77
+ module.exports = { User };
@@ -1,15 +0,0 @@
1
- const catchAsyncError = require('express-async-handler');
2
- const { User } = require('../../backend-utils');
3
-
4
- module.exports = catchAsyncError(async (req, res, next) => {
5
- const authorizationHeader = req.headers.authorization;
6
-
7
- if (authorizationHeader) {
8
- // Removes "Bearer " and trims
9
- const token = authorizationHeader.split(' ')[1].trim();
10
- // Load user for later middleware/routes to use
11
- req.user = await User.newUser({ token });
12
- }
13
-
14
- return next();
15
- });
@@ -1,12 +0,0 @@
1
- const Boom = require('@hapi/boom');
2
-
3
- // CheckLoggedIn Middleware
4
- const requireLoggedInUser = (req, res, next) => {
5
- if (!req.user || !req.user.isLoggedIn()) {
6
- throw Boom.unauthorized('Invalid Token');
7
- }
8
-
9
- next();
10
- };
11
-
12
- module.exports = { requireLoggedInUser };
@@ -1,31 +0,0 @@
1
- const {IntegrationFactory, IntegrationHelper} = require('./integration-factory');
2
- const User = require('./integration-user');
3
-
4
- function createFriggBackend(appDefinition) {
5
- const {integrations = [], user=null} = appDefinition
6
- const integrationFactory = new IntegrationFactory(integrations);
7
- if (user) {
8
- if (user.usePassword) {
9
- User.usePassword = true;
10
- }
11
- if (user.primary === 'organization') {
12
- User.primary = User.OrganizationUser
13
- }
14
- if (user.individualUserRequired !== undefined) {
15
- User.individualUserRequired = user.individualUserRequired
16
- }
17
- if (user.organizationUserRequired !== undefined) {
18
- User.organizationUserRequired = user.organizationUserRequired
19
- }
20
-
21
- }
22
- const backend = {
23
- integrationFactory,
24
- moduleFactory: integrationFactory.moduleFactory,
25
- IntegrationHelper,
26
- User: User
27
- }
28
- return backend
29
- }
30
-
31
- module.exports = { createFriggBackend }