@friggframework/core 1.0.1-v1-alpha.3 → 1.0.1-v1-alpha.5
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/database/index.js +14 -8
- package/encrypt/index.js +2 -1
- package/index.js +119 -19
- package/package.json +3 -3
- package/syncs/manager.js +0 -2
package/database/index.js
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
const
|
|
2
|
-
const {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const {
|
|
1
|
+
const { mongoose} = require('./mongoose');
|
|
2
|
+
const {
|
|
3
|
+
connectToDatabase,
|
|
4
|
+
disconnectFromDatabase,
|
|
5
|
+
createObjectId,
|
|
6
|
+
} = require('./mongo');
|
|
7
|
+
const {IndividualUser} = require('./models/IndividualUser');
|
|
8
|
+
const {OrganizationUser} = require('./models/OrganizationUser');
|
|
9
|
+
const {State} = require('./models/State');
|
|
10
|
+
const {Token} = require('./models/Token');
|
|
11
|
+
const {UserModel} = require('./models/UserModel');
|
|
8
12
|
|
|
9
13
|
module.exports = {
|
|
10
|
-
...mongo,
|
|
11
14
|
mongoose,
|
|
15
|
+
connectToDatabase,
|
|
16
|
+
disconnectFromDatabase,
|
|
17
|
+
createObjectId,
|
|
12
18
|
IndividualUser,
|
|
13
19
|
OrganizationUser,
|
|
14
20
|
State,
|
package/encrypt/index.js
CHANGED
package/index.js
CHANGED
|
@@ -1,24 +1,124 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
1
|
+
const {
|
|
2
|
+
expectShallowEqualDbObject,
|
|
3
|
+
get,
|
|
4
|
+
getAll,
|
|
5
|
+
verifyType,
|
|
6
|
+
getParamAndVerifyParamType,
|
|
7
|
+
getArrayParamAndVerifyParamType,
|
|
8
|
+
getAndVerifyType,
|
|
9
|
+
} = require('./assertions/index');
|
|
10
|
+
const { Delegate, Worker, loadInstalledModules, createHandler } = require('./core/index');
|
|
11
|
+
const {
|
|
12
|
+
mongoose,
|
|
13
|
+
connectToDatabase,
|
|
14
|
+
disconnectFromDatabase,
|
|
15
|
+
createObjectId,
|
|
16
|
+
IndividualUser,
|
|
17
|
+
OrganizationUser,
|
|
18
|
+
State,
|
|
19
|
+
Token,
|
|
20
|
+
UserModel
|
|
21
|
+
} = require('./database/index');
|
|
22
|
+
const { Encrypt, Cryptor } = require('./encrypt/encrypt');
|
|
23
|
+
const {
|
|
24
|
+
BaseError,
|
|
25
|
+
FetchError,
|
|
26
|
+
HaltError,
|
|
27
|
+
RequiredPropertyError,
|
|
28
|
+
ParameterTypeError,
|
|
29
|
+
} = require('./errors/index');
|
|
30
|
+
const {
|
|
31
|
+
IntegrationBase,
|
|
32
|
+
IntegrationModel,
|
|
33
|
+
Options,
|
|
34
|
+
IntegrationMapping,
|
|
35
|
+
IntegrationFactory,
|
|
36
|
+
IntegrationHelper,
|
|
37
|
+
createIntegrationRouter,
|
|
38
|
+
checkRequiredParams,
|
|
39
|
+
createFriggBackend
|
|
40
|
+
} = require('./integrations/index');
|
|
41
|
+
const { TimeoutCatcher } = require('./lambda/index');
|
|
42
|
+
const {
|
|
43
|
+
debug,
|
|
44
|
+
initDebugLog,
|
|
45
|
+
flushDebugLog
|
|
46
|
+
} = require('./logs/index');
|
|
47
|
+
const {
|
|
48
|
+
Credential,
|
|
49
|
+
EntityManager,
|
|
50
|
+
Entity,
|
|
51
|
+
ModuleManager,
|
|
52
|
+
ApiKeyRequester,
|
|
53
|
+
BasicAuthRequester,
|
|
54
|
+
OAuth2Requester,
|
|
55
|
+
Requester,
|
|
56
|
+
ModuleConstants,
|
|
57
|
+
ModuleFactory,
|
|
58
|
+
Auther
|
|
59
|
+
} = require('./module-plugin/index');
|
|
11
60
|
|
|
12
61
|
// const {Sync } = require('./syncs/model');
|
|
13
62
|
|
|
14
63
|
module.exports = {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
64
|
+
// assertions
|
|
65
|
+
expectShallowEqualDbObject,
|
|
66
|
+
get,
|
|
67
|
+
getAll,
|
|
68
|
+
verifyType,
|
|
69
|
+
getParamAndVerifyParamType,
|
|
70
|
+
getArrayParamAndVerifyParamType,
|
|
71
|
+
getAndVerifyType,
|
|
72
|
+
// core
|
|
73
|
+
Delegate,
|
|
74
|
+
Worker,
|
|
75
|
+
loadInstalledModules,
|
|
76
|
+
createHandler,
|
|
77
|
+
// database
|
|
78
|
+
mongoose,
|
|
79
|
+
connectToDatabase,
|
|
80
|
+
disconnectFromDatabase,
|
|
81
|
+
createObjectId,
|
|
82
|
+
IndividualUser,
|
|
83
|
+
OrganizationUser,
|
|
84
|
+
State,
|
|
85
|
+
Token,
|
|
86
|
+
UserModel,
|
|
87
|
+
// encrypt
|
|
88
|
+
Encrypt,
|
|
89
|
+
Cryptor,
|
|
90
|
+
// errors
|
|
91
|
+
BaseError,
|
|
92
|
+
FetchError,
|
|
93
|
+
HaltError,
|
|
94
|
+
RequiredPropertyError,
|
|
95
|
+
ParameterTypeError,
|
|
96
|
+
// integrations
|
|
97
|
+
IntegrationBase,
|
|
98
|
+
IntegrationModel,
|
|
99
|
+
Options,
|
|
100
|
+
IntegrationMapping,
|
|
101
|
+
IntegrationFactory,
|
|
102
|
+
IntegrationHelper,
|
|
103
|
+
checkRequiredParams,
|
|
104
|
+
createIntegrationRouter,
|
|
105
|
+
createFriggBackend,
|
|
106
|
+
// lambda
|
|
107
|
+
TimeoutCatcher,
|
|
108
|
+
// logs
|
|
109
|
+
debug,
|
|
110
|
+
initDebugLog,
|
|
111
|
+
flushDebugLog,
|
|
112
|
+
// module plugin
|
|
113
|
+
Credential,
|
|
114
|
+
EntityManager,
|
|
115
|
+
Entity,
|
|
116
|
+
ModuleManager,
|
|
117
|
+
ApiKeyRequester,
|
|
118
|
+
BasicAuthRequester,
|
|
119
|
+
OAuth2Requester,
|
|
120
|
+
Requester,
|
|
121
|
+
ModuleConstants,
|
|
122
|
+
ModuleFactory,
|
|
123
|
+
Auther
|
|
24
124
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/core",
|
|
3
3
|
"prettier": "@friggframework/prettier-config",
|
|
4
|
-
"version": "1.0.1-v1-alpha.
|
|
4
|
+
"version": "1.0.1-v1-alpha.5",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@hapi/boom": "^10.0.1",
|
|
7
7
|
"aws-sdk": "^2.1200.0",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"node-fetch": "^2.6.7"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@friggframework/devtools": "1.0.1-v1-alpha.
|
|
18
|
+
"@friggframework/devtools": "1.0.1-v1-alpha.5",
|
|
19
19
|
"@types/lodash": "^4.14.191",
|
|
20
20
|
"@typescript-eslint/eslint-plugin": "^5.55.0",
|
|
21
21
|
"chai": "^4.3.6",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
},
|
|
48
48
|
"homepage": "https://github.com/friggframework/frigg#readme",
|
|
49
49
|
"description": "",
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "866cdecac7b599ec734f8772a5774112da1e8f7a"
|
|
51
51
|
}
|
package/syncs/manager.js
CHANGED
|
@@ -8,7 +8,6 @@ const { Sync } = require("./model");
|
|
|
8
8
|
|
|
9
9
|
class SyncManager {
|
|
10
10
|
constructor(params) {
|
|
11
|
-
super(params);
|
|
12
11
|
// TODO verify type????????
|
|
13
12
|
// this.primaryModule = getAndVerifyType(params, 'primary', ModuleManager);
|
|
14
13
|
// this.secondaryModule = getAndVerifyType(
|
|
@@ -36,7 +35,6 @@ class SyncManager {
|
|
|
36
35
|
|
|
37
36
|
this.integration = get(params, "integration", null); // TODO Change to type validation
|
|
38
37
|
|
|
39
|
-
Sync = new Sync();
|
|
40
38
|
}
|
|
41
39
|
|
|
42
40
|
// calls getAllSyncObjects() on the modules and then finds the difference between each. The Primary Module
|