@itentialopensource/adapter-google_drive 0.2.0 → 0.4.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 (42) hide show
  1. package/CALLS.md +276 -0
  2. package/CHANGELOG.md +16 -0
  3. package/CONTRIBUTING.md +1 -160
  4. package/ENHANCE.md +2 -2
  5. package/README.md +32 -23
  6. package/adapter.js +155 -162
  7. package/adapterBase.js +549 -879
  8. package/changelogs/changelog.md +24 -0
  9. package/metadata.json +49 -0
  10. package/package.json +23 -25
  11. package/pronghorn.json +981 -642
  12. package/propertiesSchema.json +431 -31
  13. package/refs?service=git-upload-pack +0 -0
  14. package/report/adapter-openapi.json +6538 -0
  15. package/report/adapter-openapi.yaml +6788 -0
  16. package/report/adapterInfo.json +8 -8
  17. package/report/updateReport1691508599508.json +120 -0
  18. package/report/updateReport1692203033260.json +120 -0
  19. package/report/updateReport1694467047127.json +120 -0
  20. package/report/updateReport1698422138556.json +120 -0
  21. package/sampleProperties.json +72 -11
  22. package/test/integration/adapterTestBasicGet.js +2 -4
  23. package/test/integration/adapterTestConnectivity.js +91 -42
  24. package/test/integration/adapterTestIntegration.js +130 -2
  25. package/test/unit/adapterBaseTestUnit.js +388 -313
  26. package/test/unit/adapterTestUnit.js +338 -112
  27. package/utils/adapterInfo.js +1 -1
  28. package/utils/addAuth.js +1 -1
  29. package/utils/artifactize.js +1 -1
  30. package/utils/checkMigrate.js +1 -1
  31. package/utils/entitiesToDB.js +2 -2
  32. package/utils/findPath.js +1 -1
  33. package/utils/methodDocumentor.js +273 -0
  34. package/utils/modify.js +13 -15
  35. package/utils/packModificationScript.js +1 -1
  36. package/utils/pre-commit.sh +2 -0
  37. package/utils/taskMover.js +309 -0
  38. package/utils/tbScript.js +89 -34
  39. package/utils/tbUtils.js +41 -21
  40. package/utils/testRunner.js +1 -1
  41. package/utils/troubleshootingAdapter.js +9 -6
  42. package/workflows/README.md +0 -3
@@ -1,10 +1,10 @@
1
1
  {
2
- "version": "0.1.1",
3
- "configLines": 12504,
4
- "scriptLines": 1707,
5
- "codeLines": 7025,
6
- "testLines": 6500,
7
- "testCases": 264,
8
- "totalCodeLines": 15232,
9
- "wfTasks": 63
2
+ "version": "0.3.0",
3
+ "configLines": 13243,
4
+ "scriptLines": 1783,
5
+ "codeLines": 6688,
6
+ "testLines": 6976,
7
+ "testCases": 294,
8
+ "totalCodeLines": 15447,
9
+ "wfTasks": 71
10
10
  }
@@ -0,0 +1,120 @@
1
+ {
2
+ "errors": [],
3
+ "statistics": [
4
+ {
5
+ "owner": "errorJson",
6
+ "description": "New adapter errors available for use",
7
+ "value": 0
8
+ },
9
+ {
10
+ "owner": "errorJson",
11
+ "description": "Adapter errors no longer available for use",
12
+ "value": 0
13
+ },
14
+ {
15
+ "owner": "errorJson",
16
+ "description": "Adapter errors that have been updated (e.g. recommendation changes)",
17
+ "value": 31
18
+ },
19
+ {
20
+ "owner": "packageJson",
21
+ "description": "Number of production dependencies",
22
+ "value": 17
23
+ },
24
+ {
25
+ "owner": "packageJson",
26
+ "description": "Number of development dependencies",
27
+ "value": 6
28
+ },
29
+ {
30
+ "owner": "packageJson",
31
+ "description": "Number of npm scripts",
32
+ "value": 22
33
+ },
34
+ {
35
+ "owner": "packageJson",
36
+ "description": "Runtime Library dependency",
37
+ "value": "^5.1.0"
38
+ },
39
+ {
40
+ "owner": "propertiesSchemaJson",
41
+ "description": "Adapter properties defined in the propertiesSchema file",
42
+ "value": 76
43
+ },
44
+ {
45
+ "owner": "markdown",
46
+ "description": "Number of lines in the README.md",
47
+ "value": 343
48
+ },
49
+ {
50
+ "owner": "markdown",
51
+ "description": "Number of lines in the SUMMARY.md",
52
+ "value": 9
53
+ },
54
+ {
55
+ "owner": "markdown",
56
+ "description": "Number of lines in the PROPERTIES.md",
57
+ "value": 642
58
+ },
59
+ {
60
+ "owner": "markdown",
61
+ "description": "Number of lines in the TROUBLESHOOT.md",
62
+ "value": 48
63
+ },
64
+ {
65
+ "owner": "markdown",
66
+ "description": "Number of lines in the ENHANCE.md",
67
+ "value": 70
68
+ },
69
+ {
70
+ "owner": "markdown",
71
+ "description": "Number of lines in the BROKER.md",
72
+ "value": 70
73
+ },
74
+ {
75
+ "owner": "unitTestJS",
76
+ "description": "Number of lines of code in unit tests",
77
+ "value": 2990
78
+ },
79
+ {
80
+ "owner": "unitTestJS",
81
+ "description": "Number of unit tests",
82
+ "value": 169
83
+ },
84
+ {
85
+ "owner": "integrationTestJS",
86
+ "description": "Number of lines of code in integration tests",
87
+ "value": 2728
88
+ },
89
+ {
90
+ "owner": "integrationTestJS",
91
+ "description": "Number of integration tests",
92
+ "value": 55
93
+ },
94
+ {
95
+ "owner": "staticFile",
96
+ "description": "Number of lines of code in adapterBase.js",
97
+ "value": 1350
98
+ },
99
+ {
100
+ "owner": "staticFile",
101
+ "description": "Number of static files added",
102
+ "value": 36
103
+ },
104
+ {
105
+ "owner": "Overall",
106
+ "description": "Total lines of Code",
107
+ "value": 7068
108
+ },
109
+ {
110
+ "owner": "Overall",
111
+ "description": "Total Tests",
112
+ "value": 224
113
+ },
114
+ {
115
+ "owner": "Overall",
116
+ "description": "Total Files",
117
+ "value": 6
118
+ }
119
+ ]
120
+ }
@@ -0,0 +1,120 @@
1
+ {
2
+ "errors": [],
3
+ "statistics": [
4
+ {
5
+ "owner": "errorJson",
6
+ "description": "New adapter errors available for use",
7
+ "value": 0
8
+ },
9
+ {
10
+ "owner": "errorJson",
11
+ "description": "Adapter errors no longer available for use",
12
+ "value": 0
13
+ },
14
+ {
15
+ "owner": "errorJson",
16
+ "description": "Adapter errors that have been updated (e.g. recommendation changes)",
17
+ "value": 31
18
+ },
19
+ {
20
+ "owner": "packageJson",
21
+ "description": "Number of production dependencies",
22
+ "value": 17
23
+ },
24
+ {
25
+ "owner": "packageJson",
26
+ "description": "Number of development dependencies",
27
+ "value": 6
28
+ },
29
+ {
30
+ "owner": "packageJson",
31
+ "description": "Number of npm scripts",
32
+ "value": 22
33
+ },
34
+ {
35
+ "owner": "packageJson",
36
+ "description": "Runtime Library dependency",
37
+ "value": "^5.1.0"
38
+ },
39
+ {
40
+ "owner": "propertiesSchemaJson",
41
+ "description": "Adapter properties defined in the propertiesSchema file",
42
+ "value": 76
43
+ },
44
+ {
45
+ "owner": "markdown",
46
+ "description": "Number of lines in the README.md",
47
+ "value": 343
48
+ },
49
+ {
50
+ "owner": "markdown",
51
+ "description": "Number of lines in the SUMMARY.md",
52
+ "value": 9
53
+ },
54
+ {
55
+ "owner": "markdown",
56
+ "description": "Number of lines in the PROPERTIES.md",
57
+ "value": 642
58
+ },
59
+ {
60
+ "owner": "markdown",
61
+ "description": "Number of lines in the TROUBLESHOOT.md",
62
+ "value": 48
63
+ },
64
+ {
65
+ "owner": "markdown",
66
+ "description": "Number of lines in the ENHANCE.md",
67
+ "value": 70
68
+ },
69
+ {
70
+ "owner": "markdown",
71
+ "description": "Number of lines in the BROKER.md",
72
+ "value": 70
73
+ },
74
+ {
75
+ "owner": "unitTestJS",
76
+ "description": "Number of lines of code in unit tests",
77
+ "value": 2990
78
+ },
79
+ {
80
+ "owner": "unitTestJS",
81
+ "description": "Number of unit tests",
82
+ "value": 169
83
+ },
84
+ {
85
+ "owner": "integrationTestJS",
86
+ "description": "Number of lines of code in integration tests",
87
+ "value": 2728
88
+ },
89
+ {
90
+ "owner": "integrationTestJS",
91
+ "description": "Number of integration tests",
92
+ "value": 55
93
+ },
94
+ {
95
+ "owner": "staticFile",
96
+ "description": "Number of lines of code in adapterBase.js",
97
+ "value": 1350
98
+ },
99
+ {
100
+ "owner": "staticFile",
101
+ "description": "Number of static files added",
102
+ "value": 36
103
+ },
104
+ {
105
+ "owner": "Overall",
106
+ "description": "Total lines of Code",
107
+ "value": 7068
108
+ },
109
+ {
110
+ "owner": "Overall",
111
+ "description": "Total Tests",
112
+ "value": 224
113
+ },
114
+ {
115
+ "owner": "Overall",
116
+ "description": "Total Files",
117
+ "value": 6
118
+ }
119
+ ]
120
+ }
@@ -0,0 +1,120 @@
1
+ {
2
+ "errors": [],
3
+ "statistics": [
4
+ {
5
+ "owner": "errorJson",
6
+ "description": "New adapter errors available for use",
7
+ "value": 0
8
+ },
9
+ {
10
+ "owner": "errorJson",
11
+ "description": "Adapter errors no longer available for use",
12
+ "value": 0
13
+ },
14
+ {
15
+ "owner": "errorJson",
16
+ "description": "Adapter errors that have been updated (e.g. recommendation changes)",
17
+ "value": 31
18
+ },
19
+ {
20
+ "owner": "packageJson",
21
+ "description": "Number of production dependencies",
22
+ "value": 17
23
+ },
24
+ {
25
+ "owner": "packageJson",
26
+ "description": "Number of development dependencies",
27
+ "value": 6
28
+ },
29
+ {
30
+ "owner": "packageJson",
31
+ "description": "Number of npm scripts",
32
+ "value": 22
33
+ },
34
+ {
35
+ "owner": "packageJson",
36
+ "description": "Runtime Library dependency",
37
+ "value": "^5.1.7"
38
+ },
39
+ {
40
+ "owner": "propertiesSchemaJson",
41
+ "description": "Adapter properties defined in the propertiesSchema file",
42
+ "value": 76
43
+ },
44
+ {
45
+ "owner": "markdown",
46
+ "description": "Number of lines in the README.md",
47
+ "value": 347
48
+ },
49
+ {
50
+ "owner": "markdown",
51
+ "description": "Number of lines in the SUMMARY.md",
52
+ "value": 9
53
+ },
54
+ {
55
+ "owner": "markdown",
56
+ "description": "Number of lines in the PROPERTIES.md",
57
+ "value": 642
58
+ },
59
+ {
60
+ "owner": "markdown",
61
+ "description": "Number of lines in the TROUBLESHOOT.md",
62
+ "value": 48
63
+ },
64
+ {
65
+ "owner": "markdown",
66
+ "description": "Number of lines in the ENHANCE.md",
67
+ "value": 70
68
+ },
69
+ {
70
+ "owner": "markdown",
71
+ "description": "Number of lines in the BROKER.md",
72
+ "value": 70
73
+ },
74
+ {
75
+ "owner": "unitTestJS",
76
+ "description": "Number of lines of code in unit tests",
77
+ "value": 2996
78
+ },
79
+ {
80
+ "owner": "unitTestJS",
81
+ "description": "Number of unit tests",
82
+ "value": 169
83
+ },
84
+ {
85
+ "owner": "integrationTestJS",
86
+ "description": "Number of lines of code in integration tests",
87
+ "value": 2728
88
+ },
89
+ {
90
+ "owner": "integrationTestJS",
91
+ "description": "Number of integration tests",
92
+ "value": 55
93
+ },
94
+ {
95
+ "owner": "staticFile",
96
+ "description": "Number of lines of code in adapterBase.js",
97
+ "value": 1453
98
+ },
99
+ {
100
+ "owner": "staticFile",
101
+ "description": "Number of static files added",
102
+ "value": 36
103
+ },
104
+ {
105
+ "owner": "Overall",
106
+ "description": "Total lines of Code",
107
+ "value": 7177
108
+ },
109
+ {
110
+ "owner": "Overall",
111
+ "description": "Total Tests",
112
+ "value": 224
113
+ },
114
+ {
115
+ "owner": "Overall",
116
+ "description": "Total Files",
117
+ "value": 6
118
+ }
119
+ ]
120
+ }
@@ -0,0 +1,120 @@
1
+ {
2
+ "errors": [],
3
+ "statistics": [
4
+ {
5
+ "owner": "errorJson",
6
+ "description": "New adapter errors available for use",
7
+ "value": 0
8
+ },
9
+ {
10
+ "owner": "errorJson",
11
+ "description": "Adapter errors no longer available for use",
12
+ "value": 0
13
+ },
14
+ {
15
+ "owner": "errorJson",
16
+ "description": "Adapter errors that have been updated (e.g. recommendation changes)",
17
+ "value": 31
18
+ },
19
+ {
20
+ "owner": "packageJson",
21
+ "description": "Number of production dependencies",
22
+ "value": 17
23
+ },
24
+ {
25
+ "owner": "packageJson",
26
+ "description": "Number of development dependencies",
27
+ "value": 6
28
+ },
29
+ {
30
+ "owner": "packageJson",
31
+ "description": "Number of npm scripts",
32
+ "value": 22
33
+ },
34
+ {
35
+ "owner": "packageJson",
36
+ "description": "Runtime Library dependency",
37
+ "value": "^5.3.0"
38
+ },
39
+ {
40
+ "owner": "propertiesSchemaJson",
41
+ "description": "Adapter properties defined in the propertiesSchema file",
42
+ "value": 77
43
+ },
44
+ {
45
+ "owner": "markdown",
46
+ "description": "Number of lines in the README.md",
47
+ "value": 347
48
+ },
49
+ {
50
+ "owner": "markdown",
51
+ "description": "Number of lines in the SUMMARY.md",
52
+ "value": 9
53
+ },
54
+ {
55
+ "owner": "markdown",
56
+ "description": "Number of lines in the PROPERTIES.md",
57
+ "value": 642
58
+ },
59
+ {
60
+ "owner": "markdown",
61
+ "description": "Number of lines in the TROUBLESHOOT.md",
62
+ "value": 48
63
+ },
64
+ {
65
+ "owner": "markdown",
66
+ "description": "Number of lines in the ENHANCE.md",
67
+ "value": 70
68
+ },
69
+ {
70
+ "owner": "markdown",
71
+ "description": "Number of lines in the BROKER.md",
72
+ "value": 70
73
+ },
74
+ {
75
+ "owner": "unitTestJS",
76
+ "description": "Number of lines of code in unit tests",
77
+ "value": 2996
78
+ },
79
+ {
80
+ "owner": "unitTestJS",
81
+ "description": "Number of unit tests",
82
+ "value": 169
83
+ },
84
+ {
85
+ "owner": "integrationTestJS",
86
+ "description": "Number of lines of code in integration tests",
87
+ "value": 2728
88
+ },
89
+ {
90
+ "owner": "integrationTestJS",
91
+ "description": "Number of integration tests",
92
+ "value": 55
93
+ },
94
+ {
95
+ "owner": "staticFile",
96
+ "description": "Number of lines of code in adapterBase.js",
97
+ "value": 1453
98
+ },
99
+ {
100
+ "owner": "staticFile",
101
+ "description": "Number of static files added",
102
+ "value": 36
103
+ },
104
+ {
105
+ "owner": "Overall",
106
+ "description": "Total lines of Code",
107
+ "value": 7177
108
+ },
109
+ {
110
+ "owner": "Overall",
111
+ "description": "Total Tests",
112
+ "value": 224
113
+ },
114
+ {
115
+ "owner": "Overall",
116
+ "description": "Total Files",
117
+ "value": 6
118
+ }
119
+ ]
120
+ }
@@ -4,6 +4,7 @@
4
4
  "properties": {
5
5
  "host": "www.googleapis.com",
6
6
  "port": 443,
7
+ "choosepath": "",
7
8
  "base_path": "/drive/v3",
8
9
  "version": "",
9
10
  "cache_location": "none",
@@ -17,6 +18,29 @@
17
18
  "username": "username",
18
19
  "password": "password",
19
20
  "token": "",
21
+ "token_timeout": 600000,
22
+ "token_cache": "local",
23
+ "invalid_token_error": 401,
24
+ "auth_field": "header.headers.Authorization",
25
+ "auth_field_format": "Bearer {token}",
26
+ "auth_logging": false,
27
+ "client_id": "",
28
+ "client_secret": "",
29
+ "grant_type": "",
30
+ "sensitive": [],
31
+ "sso": {
32
+ "protocol": "",
33
+ "host": "",
34
+ "port": 0
35
+ },
36
+ "multiStepAuthCalls": [
37
+ {
38
+ "name": "",
39
+ "requestFields": {},
40
+ "responseFields": {},
41
+ "successfullResponseCode": 200
42
+ }
43
+ ],
20
44
  "service_account": {
21
45
  "type": "service_account",
22
46
  "project_id": "",
@@ -32,21 +56,13 @@
32
56
  "token_uri": "https://oauth2.googleapis.com/token",
33
57
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
34
58
  "client_x509_cert_url": ""
35
- },
36
- "token_timeout": 600000,
37
- "token_cache": "local",
38
- "invalid_token_error": 401,
39
- "auth_field": "header.headers.Authorization",
40
- "auth_field_format": "Bearer {token}",
41
- "auth_logging": false,
42
- "client_id": "",
43
- "client_secret": "",
44
- "grant_type": ""
59
+ }
45
60
  },
46
61
  "healthcheck": {
47
62
  "type": "intermittent",
48
63
  "frequency": 600000,
49
- "query_object": {}
64
+ "query_object": {},
65
+ "addlHeaders": {}
50
66
  },
51
67
  "throttle": {
52
68
  "throttle_enabled": false,
@@ -141,6 +157,12 @@
141
157
  {
142
158
  "path": "/get/devices",
143
159
  "method": "GET",
160
+ "pagination": {
161
+ "offsetVar": "",
162
+ "limitVar": "",
163
+ "incrementBy": "limit",
164
+ "requestLocation": "query"
165
+ },
144
166
  "query": {},
145
167
  "body": {},
146
168
  "headers": {},
@@ -202,6 +224,45 @@
202
224
  "responseFields": {}
203
225
  }
204
226
  ]
227
+ },
228
+ "cache": {
229
+ "enabled": false,
230
+ "entities": [
231
+ {
232
+ "entityType": "",
233
+ "frequency": 1440,
234
+ "flushOnFail": false,
235
+ "limit": 1000,
236
+ "retryAttempts": 5,
237
+ "sort": true,
238
+ "populate": [
239
+ {
240
+ "path": "",
241
+ "method": "GET",
242
+ "pagination": {
243
+ "offsetVar": "",
244
+ "limitVar": "",
245
+ "incrementBy": "limit",
246
+ "requestLocation": "query"
247
+ },
248
+ "query": {},
249
+ "body": {},
250
+ "headers": {},
251
+ "handleFailure": "ignore",
252
+ "requestFields": {},
253
+ "responseDatakey": "",
254
+ "responseFields": {}
255
+ }
256
+ ],
257
+ "cachedTasks": [
258
+ {
259
+ "name": "",
260
+ "filterField": "",
261
+ "filterLoc": ""
262
+ }
263
+ ]
264
+ }
265
+ ]
205
266
  }
206
267
  },
207
268
  "brokers": [],
@@ -7,9 +7,9 @@
7
7
  /* eslint import/no-dynamic-require: warn */
8
8
  /* eslint import/no-unresolved: warn */
9
9
 
10
- const mocha = require('mocha');
11
10
  const path = require('path');
12
11
  const assert = require('assert');
12
+ const mocha = require('mocha');
13
13
  const itParam = require('mocha-param');
14
14
 
15
15
  const utils = require('../../utils/tbUtils');
@@ -18,12 +18,10 @@ const { name } = require('../../package.json');
18
18
  const { methods } = require('../../pronghorn.json');
19
19
 
20
20
  const getPronghornProps = (iapDir) => {
21
- const { Discovery } = require('@itential/itential-utils');
22
21
  console.log('Retrieving properties.json file...');
23
22
  const rawProps = require(path.join(iapDir, 'properties.json'));
24
23
  console.log('Decrypting properties...');
25
- const discovery = new Discovery();
26
- const pronghornProps = utils.decryptProperties(rawProps, path.join(__dirname, '..'), discovery);
24
+ const pronghornProps = utils.decryptProperties(rawProps, iapDir);
27
25
  console.log('Found properties.\n');
28
26
  return pronghornProps;
29
27
  };