k2hr3-api 1.0.37 → 1.0.39

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 (65) hide show
  1. package/ChangeLog +12 -0
  2. package/README.md +31 -31
  3. package/app.js +6 -10
  4. package/bin/run.sh +21 -21
  5. package/bin/www +1 -1
  6. package/config/k2hr3-init.sh.templ +5 -5
  7. package/eslint.config.mjs +68 -0
  8. package/lib/cacerts.js +8 -7
  9. package/lib/dummyuserapi.js +1 -1
  10. package/lib/ipwatch.js +1 -1
  11. package/lib/k2hr3acrutil.js +12 -14
  12. package/lib/k2hr3apiutil.js +5 -5
  13. package/lib/k2hr3cryptutil.js +2 -0
  14. package/lib/k2hr3dkc.js +25 -28
  15. package/lib/k2hr3template.js +54 -52
  16. package/lib/k2hr3tokens.js +4 -4
  17. package/lib/k8soidc.js +3 -3
  18. package/lib/openstackapiv2.js +51 -52
  19. package/lib/openstackapiv3.js +86 -87
  20. package/lib/openstackep.js +46 -46
  21. package/package.json +8 -8
  22. package/routes/acr.js +66 -110
  23. package/routes/debugVerify.js +12 -14
  24. package/routes/extdata.js +24 -40
  25. package/routes/list.js +24 -36
  26. package/routes/policy.js +72 -120
  27. package/routes/resource.js +110 -165
  28. package/routes/role.js +177 -295
  29. package/routes/service.js +54 -90
  30. package/routes/userTokens.js +1 -1
  31. package/routes/userdata.js +12 -20
  32. package/routes/version.js +39 -23
  33. package/tests/auto_control_subprocess.sh +9 -9
  34. package/tests/auto_init_config_json.sh +3 -3
  35. package/tests/auto_resource.js +417 -478
  36. package/tests/auto_role.js +55 -71
  37. package/tests/auto_template.sh +4 -4
  38. package/tests/auto_version.js +39 -23
  39. package/tests/k2hdkc_test_load.sh +9 -9
  40. package/tests/k2hr3template_test.sh +12 -12
  41. package/tests/k2hr3template_test_vars.js +60 -62
  42. package/tests/manual_acr_delete.js +11 -12
  43. package/tests/manual_acr_get.js +9 -10
  44. package/tests/manual_acr_postput.js +12 -13
  45. package/tests/manual_extdata_get.js +5 -6
  46. package/tests/manual_list_gethead.js +12 -13
  47. package/tests/manual_policy_delete.js +12 -13
  48. package/tests/manual_policy_gethead.js +27 -27
  49. package/tests/manual_policy_postput.js +21 -23
  50. package/tests/manual_resource_delete.js +11 -15
  51. package/tests/manual_resource_gethead.js +11 -14
  52. package/tests/manual_resource_postput.js +18 -21
  53. package/tests/manual_role_delete.js +22 -28
  54. package/tests/manual_role_gethead.js +53 -53
  55. package/tests/manual_role_postput.js +28 -31
  56. package/tests/manual_service_delete.js +11 -13
  57. package/tests/manual_service_gethead.js +13 -15
  58. package/tests/manual_service_postput.js +10 -11
  59. package/tests/manual_test.sh +10 -10
  60. package/tests/manual_userdata_get.js +14 -15
  61. package/tests/manual_usertoken_gethead.js +12 -14
  62. package/tests/manual_usertoken_postput.js +23 -26
  63. package/tests/manual_version_get.js +12 -13
  64. package/tests/run_local_test_k2hdkc.sh +4 -4
  65. package/tests/test.sh +12 -12
@@ -27,32 +27,31 @@
27
27
  // for testing. You can specify these files for k2hr3template_test.sh
28
28
  //
29
29
 
30
- /* eslint-disable indent */
31
30
  module.exports = {
32
31
  'statement_print_test_00': 'value_00',
33
32
  'formula_variable_00': 'value_name_00',
34
- 'formula_variable_01': [
35
- 'value_01[0]'
36
- ],
37
- 'formula_variable_02': {
38
- 'value_name_00': 'value_02{value_name_00}'
39
- },
40
- 'formula_variable_array_01': [
41
- 'array_value_00',
42
- 'array_value_01'
43
- ],
44
- 'formula_variable_object_01': {
45
- 'object_key_00': 'object_value_00',
46
- 'object_key_01': 'object_value_01',
47
- 'object_key_02': [
48
- 'object_value_02_01',
49
- 'object_value_02_02'
50
- ],
51
- 'object_key_03': {
52
- 'object_valkey_03_00': true,
53
- 'object_valkey_03_01': 'object_valval_03_01'
54
- }
55
- },
33
+ 'formula_variable_01': [
34
+ 'value_01[0]'
35
+ ],
36
+ 'formula_variable_02': {
37
+ 'value_name_00': 'value_02{value_name_00}'
38
+ },
39
+ 'formula_variable_array_01': [
40
+ 'array_value_00',
41
+ 'array_value_01'
42
+ ],
43
+ 'formula_variable_object_01': {
44
+ 'object_key_00': 'object_value_00',
45
+ 'object_key_01': 'object_value_01',
46
+ 'object_key_02': [
47
+ 'object_value_02_01',
48
+ 'object_value_02_02'
49
+ ],
50
+ 'object_key_03': {
51
+ 'object_valkey_03_00': true,
52
+ 'object_valkey_03_01': 'object_valval_03_01'
53
+ }
54
+ },
56
55
  'formula_calculate_not_00': true,
57
56
  'formula_calculate_not_01': false,
58
57
  'formula_calculate_inc_00': 0,
@@ -143,48 +142,47 @@ module.exports = {
143
142
  'formula_syntax_for_03': 0,
144
143
  'formula_syntax_for_04': 1,
145
144
  'formula_syntax_for_05': 'string',
146
- 'formula_syntax_for_06': [
147
- 'string00',
148
- 'string01'
149
- ],
150
- 'formula_syntax_for_07': {
151
- 'key_1': true,
152
- 'key_2': false
153
- },
145
+ 'formula_syntax_for_06': [
146
+ 'string00',
147
+ 'string01'
148
+ ],
149
+ 'formula_syntax_for_07': {
150
+ 'key_1': true,
151
+ 'key_2': false
152
+ },
154
153
  'formula_syntax_foreach_00': [],
155
- 'formula_syntax_foreach_01': [
156
- null
157
- ],
158
- 'formula_syntax_foreach_02': [
159
- true,
160
- false
161
- ],
162
- 'formula_syntax_foreach_03': [
163
- 0,
164
- 1
165
- ],
166
- 'formula_syntax_foreach_04': [
167
- 'string00',
168
- 'string01'
169
- ],
154
+ 'formula_syntax_foreach_01': [
155
+ null
156
+ ],
157
+ 'formula_syntax_foreach_02': [
158
+ true,
159
+ false
160
+ ],
161
+ 'formula_syntax_foreach_03': [
162
+ 0,
163
+ 1
164
+ ],
165
+ 'formula_syntax_foreach_04': [
166
+ 'string00',
167
+ 'string01'
168
+ ],
170
169
  'formula_syntax_foreach_10': {},
171
- 'formula_syntax_foreach_11': {
172
- 'key': null
173
- },
174
- 'formula_syntax_foreach_12': {
175
- 'key_1': true,
176
- 'key_2': false
177
- },
178
- 'formula_syntax_foreach_13': {
179
- 'key_1': 0,
180
- 'key_2': 1
181
- },
182
- 'formula_syntax_foreach_14': {
183
- 'key_1': 'string00',
184
- 'key_2': 'string01'
185
- }
170
+ 'formula_syntax_foreach_11': {
171
+ 'key': null
172
+ },
173
+ 'formula_syntax_foreach_12': {
174
+ 'key_1': true,
175
+ 'key_2': false
176
+ },
177
+ 'formula_syntax_foreach_13': {
178
+ 'key_1': 0,
179
+ 'key_2': 1
180
+ },
181
+ 'formula_syntax_foreach_14': {
182
+ 'key_1': 'string00',
183
+ 'key_2': 'string01'
184
+ }
186
185
  };
187
- /* eslint-enable indent */
188
186
 
189
187
  /*
190
188
  * Local variables:
@@ -42,18 +42,17 @@ var is_https = apiutil.compareCaseString('yes', process.env.HTTPS_ENV);
42
42
  //
43
43
  function rawDeleteV1Acr(token, service)
44
44
  {
45
- /* eslint-disable indent, no-mixed-spaces-and-tabs */
46
- var headers = {
47
- 'Content-Type': 'application/json',
48
- 'X-Auth-Token': token
49
- };
50
- var options = { 'host': hostname,
51
- 'port': hostport,
52
- 'path': '/v1/acr/' + service,
53
- 'method': 'DELETE',
54
- 'headers': headers
55
- };
56
- /* eslint-enable indent, no-mixed-spaces-and-tabs */
45
+ var headers = {
46
+ 'Content-Type': 'application/json',
47
+ 'X-Auth-Token': token
48
+ };
49
+ var options = {
50
+ 'host': hostname,
51
+ 'port': hostport,
52
+ 'path': '/v1/acr/' + service,
53
+ 'method': 'DELETE',
54
+ 'headers': headers
55
+ };
57
56
 
58
57
  r3logger.dlog('request options = ' + JSON.stringify(options));
59
58
  r3logger.dlog('request headers = ' + JSON.stringify(headers));
@@ -62,16 +62,15 @@ function rawGetV1Acr(token, service, inputdata)
62
62
  urlarg = encodeURI(urlarg);
63
63
  }
64
64
 
65
- /* eslint-disable indent, no-mixed-spaces-and-tabs */
66
- var headers = {
67
- 'Content-Type': 'application/json'
68
- };
69
- var options = { 'host': hostname,
70
- 'port': hostport,
71
- 'path': '/v1/acr/' + service + urlarg,
72
- 'method': 'GET'
73
- };
74
- /* eslint-enable indent, no-mixed-spaces-and-tabs */
65
+ var headers = {
66
+ 'Content-Type': 'application/json'
67
+ };
68
+ var options = {
69
+ 'host': hostname,
70
+ 'port': hostport,
71
+ 'path': '/v1/acr/' + service + urlarg,
72
+ 'method': 'GET'
73
+ };
75
74
 
76
75
  if(apiutil.isSafeString(token)){
77
76
  headers['X-Auth-Token'] = token;
@@ -55,19 +55,18 @@ function rawPutPostV1Acr(method, tenant, token, service)
55
55
  }
56
56
  }
57
57
 
58
- /* eslint-disable indent, no-mixed-spaces-and-tabs */
59
- var headers = {
60
- 'Content-Type': 'application/json',
61
- 'Content-Length': strbody.length,
62
- 'X-Auth-Token': 'U=' + token
63
- };
64
- var options = { 'host': hostname,
65
- 'port': hostport,
66
- 'path': '/v1/acr/' + service + urlarg,
67
- 'method': method,
68
- 'headers': headers
69
- };
70
- /* eslint-enable indent, no-mixed-spaces-and-tabs */
58
+ var headers = {
59
+ 'Content-Type': 'application/json',
60
+ 'Content-Length': strbody.length,
61
+ 'X-Auth-Token': 'U=' + token
62
+ };
63
+ var options = {
64
+ 'host': hostname,
65
+ 'port': hostport,
66
+ 'path': '/v1/acr/' + service + urlarg,
67
+ 'method': method,
68
+ 'headers': headers
69
+ };
71
70
 
72
71
  r3logger.dlog('request options = ' + JSON.stringify(options));
73
72
  r3logger.dlog('request headers = ' + JSON.stringify(headers));
@@ -43,7 +43,6 @@ var is_https = apiutil.compareCaseString('yes', process.env.HTTPS_ENV);
43
43
  //
44
44
  function getV1ExtData(uri, path, ua, is_gzip)
45
45
  {
46
- /* eslint-disable indent, no-mixed-spaces-and-tabs */
47
46
  var headers = {};
48
47
  var typehead = 'Content-Type';
49
48
  var uahead = 'User-Agent';
@@ -56,11 +55,11 @@ function getV1ExtData(uri, path, ua, is_gzip)
56
55
  if(is_gzip){
57
56
  headers[gziphead] = 'gzip';
58
57
  }
59
- var options = { 'host': hostname,
60
- 'port': hostport,
61
- 'method': 'GET'
62
- };
63
- /* eslint-enable indent, no-mixed-spaces-and-tabs */
58
+ var options = {
59
+ 'host': hostname,
60
+ 'port': hostport,
61
+ 'method': 'GET'
62
+ };
64
63
 
65
64
  options.headers = headers;
66
65
  options.path = '/v1/extdata/' + uri + '/' + path;
@@ -60,19 +60,18 @@ function getV1ChildrenList(method, token, type, service, path, is_expand)
60
60
  }
61
61
  }
62
62
 
63
- /* eslint-disable indent, no-mixed-spaces-and-tabs */
64
- var headers = {
65
- 'Content-Type': 'application/json',
66
- 'Content-Length': 0,
67
- 'X-Auth-Token': token
68
- };
69
- var options = { 'host': hostname,
70
- 'port': hostport,
71
- 'path': entrypath,
72
- 'method': method,
73
- 'headers': headers
74
- };
75
- /* eslint-enable indent, no-mixed-spaces-and-tabs */
63
+ var headers = {
64
+ 'Content-Type': 'application/json',
65
+ 'Content-Length': 0,
66
+ 'X-Auth-Token': token
67
+ };
68
+ var options = {
69
+ 'host': hostname,
70
+ 'port': hostport,
71
+ 'path': entrypath,
72
+ 'method': method,
73
+ 'headers': headers
74
+ };
76
75
 
77
76
  r3logger.dlog('request options = ' + JSON.stringify(options));
78
77
  r3logger.dlog('request headers = ' + JSON.stringify(headers));
@@ -42,19 +42,18 @@ var is_https = apiutil.compareCaseString('yes', process.env.HTTPS_ENV);
42
42
  //
43
43
  function deleteV1Policy(token, name)
44
44
  {
45
- /* eslint-disable indent, no-mixed-spaces-and-tabs */
46
- var headers = {
47
- 'Content-Type': 'application/json',
48
- 'Content-Length': 0,
49
- 'X-Auth-Token': token
50
- };
51
- var options = { 'host': hostname,
52
- 'port': hostport,
53
- 'path': '/v1/policy/' + name,
54
- 'method': 'DELETE',
55
- 'headers': headers
56
- };
57
- /* eslint-enable indent, no-mixed-spaces-and-tabs */
45
+ var headers = {
46
+ 'Content-Type': 'application/json',
47
+ 'Content-Length': 0,
48
+ 'X-Auth-Token': token
49
+ };
50
+ var options = {
51
+ 'host': hostname,
52
+ 'port': hostport,
53
+ 'path': '/v1/policy/' + name,
54
+ 'method': 'DELETE',
55
+ 'headers': headers
56
+ };
58
57
 
59
58
  r3logger.dlog('request options = ' + JSON.stringify(options));
60
59
  r3logger.dlog('request headers = ' + JSON.stringify(headers));
@@ -48,19 +48,18 @@ function getV1Policy(token, name, service)
48
48
  urlarg = encodeURI('?service=' + service);
49
49
  }
50
50
 
51
- /* eslint-disable indent, no-mixed-spaces-and-tabs */
52
- var headers = {
53
- 'Content-Type': 'application/json',
54
- 'Content-Length': 0,
55
- 'X-Auth-Token': token
56
- };
57
- var options = { 'host': hostname,
58
- 'port': hostport,
59
- 'path': '/v1/policy/' + name + urlarg,
60
- 'method': 'GET',
61
- 'headers': headers
62
- };
63
- /* eslint-enable indent, no-mixed-spaces-and-tabs */
51
+ var headers = {
52
+ 'Content-Type': 'application/json',
53
+ 'Content-Length': 0,
54
+ 'X-Auth-Token': token
55
+ };
56
+ var options = {
57
+ 'host': hostname,
58
+ 'port': hostport,
59
+ 'path': '/v1/policy/' + name + urlarg,
60
+ 'method': 'GET',
61
+ 'headers': headers
62
+ };
64
63
 
65
64
  r3logger.dlog('request options = ' + JSON.stringify(options));
66
65
  r3logger.dlog('request headers = ' + JSON.stringify(headers));
@@ -109,22 +108,23 @@ function getV1Policy(token, name, service)
109
108
 
110
109
  function headV1Policy(tenant, name, action, resource)
111
110
  {
112
- /* eslint-disable indent, no-mixed-spaces-and-tabs */
113
- var headers = {
114
- 'Content-Type': 'application/json',
115
- 'Content-Length': 0
116
- };
117
- var urlarg = '?resource=' + resource + '&action=' + action;
111
+ var headers = {
112
+ 'Content-Type': 'application/json',
113
+ 'Content-Length': 0
114
+ };
115
+
116
+ var urlarg = '?resource=' + resource + '&action=' + action;
118
117
  if(apiutil.isSafeString(tenant)){
119
- urlarg += '&tenant=' + tenant;
118
+ urlarg += '&tenant=' + tenant;
120
119
  }
121
- var options = { 'host': hostname,
122
- 'port': hostport,
123
- 'path': '/v1/policy/' + name + encodeURI(urlarg),
124
- 'method': 'HEAD',
125
- 'headers': headers
126
- };
127
- /* eslint-enable indent, no-mixed-spaces-and-tabs */
120
+
121
+ var options = {
122
+ 'host': hostname,
123
+ 'port': hostport,
124
+ 'path': '/v1/policy/' + name + encodeURI(urlarg),
125
+ 'method': 'HEAD',
126
+ 'headers': headers
127
+ };
128
128
 
129
129
  r3logger.dlog('request options = ' + JSON.stringify(options));
130
130
  r3logger.dlog('request headers = ' + JSON.stringify(headers));
@@ -43,31 +43,29 @@ var is_https = apiutil.compareCaseString('yes', process.env.HTTPS_ENV);
43
43
  //
44
44
  function postV1Policy(method, token, name, effect, action, resource, alias)
45
45
  {
46
- /* eslint-disable indent, no-mixed-spaces-and-tabs */
47
- var strbody = '';
48
- var headers = {
49
- 'Content-Type': 'application/json',
50
- 'X-Auth-Token': token
51
- };
52
- var options = { 'host': hostname,
53
- 'port': hostport,
54
- 'path': '/v1/policy',
55
- 'method': method
56
- };
57
- /* eslint-enable indent, no-mixed-spaces-and-tabs */
46
+ var strbody = '';
47
+ var headers = {
48
+ 'Content-Type': 'application/json',
49
+ 'X-Auth-Token': token
50
+ };
51
+ var options = {
52
+ 'host': hostname,
53
+ 'port': hostport,
54
+ 'path': '/v1/policy',
55
+ 'method': method
56
+ };
58
57
 
59
58
  if(apiutil.compareCaseString('post', method)){
60
- /* eslint-disable indent, no-mixed-spaces-and-tabs */
61
- var body = { 'policy':
62
- { 'name': name,
63
- 'effect': effect,
64
- 'action': action,
65
- 'resource': resource,
66
- 'condition': null,
67
- 'alias': alias
68
- }
69
- };
70
- /* eslint-enable indent, no-mixed-spaces-and-tabs */
59
+ var body = {
60
+ 'policy': {
61
+ 'name': name,
62
+ 'effect': effect,
63
+ 'action': action,
64
+ 'resource': resource,
65
+ 'condition': null,
66
+ 'alias': alias
67
+ }
68
+ };
71
69
 
72
70
  strbody = JSON.stringify(body);
73
71
  headers['Content-Length'] = strbody.length;
@@ -43,12 +43,10 @@ var is_https = apiutil.compareCaseString('yes', process.env.HTTPS_ENV);
43
43
  //
44
44
  function deleteV1Resource(token_type, token, name, data_type, keynames, aliases, port, cuk, roleyrn)
45
45
  {
46
- /* eslint-disable indent, no-mixed-spaces-and-tabs */
47
- var headers = {
48
- 'Content-Type': 'application/json',
49
- 'Content-Length': 0,
50
- };
51
- /* eslint-enable indent, no-mixed-spaces-and-tabs */
46
+ var headers = {
47
+ 'Content-Type': 'application/json',
48
+ 'Content-Length': 0,
49
+ };
52
50
 
53
51
  if(apiutil.isSafeString(token)){
54
52
  headers['X-Auth-Token'] = token;
@@ -121,15 +119,13 @@ function deleteV1Resource(token_type, token, name, data_type, keynames, aliases,
121
119
  }
122
120
  }
123
121
 
124
- /* eslint-disable indent, no-mixed-spaces-and-tabs */
125
- var options = {
126
- 'host': hostname,
127
- 'port': hostport,
128
- 'path': '/v1/resource/' + name + encodeURI(urlarg),
129
- 'method': 'DELETE',
130
- 'headers': headers
131
- };
132
- /* eslint-enable indent, no-mixed-spaces-and-tabs */
122
+ var options = {
123
+ 'host': hostname,
124
+ 'port': hostport,
125
+ 'path': '/v1/resource/' + name + encodeURI(urlarg),
126
+ 'method': 'DELETE',
127
+ 'headers': headers
128
+ };
133
129
 
134
130
  r3logger.dlog('request options = ' + JSON.stringify(options));
135
131
  r3logger.dlog('request headers = ' + JSON.stringify(headers));
@@ -43,12 +43,10 @@ var is_https = apiutil.compareCaseString('yes', process.env.HTTPS_ENV);
43
43
  //
44
44
  function getV1Resource(is_get_req, token_type, token, name, service, is_expand, data_type, keyname, port, cuk, roleyrn)
45
45
  {
46
- /* eslint-disable indent, no-mixed-spaces-and-tabs */
47
- var headers = {
48
- 'Content-Type': 'application/json',
49
- 'Content-Length': 0,
50
- };
51
- /* eslint-enable indent, no-mixed-spaces-and-tabs */
46
+ var headers = {
47
+ 'Content-Type': 'application/json',
48
+ 'Content-Length': 0,
49
+ };
52
50
 
53
51
  if(apiutil.isSafeString(token)){
54
52
  headers['X-Auth-Token'] = token;
@@ -112,14 +110,13 @@ function getV1Resource(is_get_req, token_type, token, name, service, is_expand,
112
110
  }
113
111
  }
114
112
 
115
- /* eslint-disable indent, no-mixed-spaces-and-tabs */
116
- var options = { 'host': hostname,
117
- 'port': hostport,
118
- 'path': '/v1/resource/' + name + encodeURI(urlarg),
119
- 'method': (is_get_req ? 'GET' : 'HEAD'),
120
- 'headers': headers
121
- };
122
- /* eslint-enable indent, no-mixed-spaces-and-tabs */
113
+ var options = {
114
+ 'host': hostname,
115
+ 'port': hostport,
116
+ 'path': '/v1/resource/' + name + encodeURI(urlarg),
117
+ 'method': (is_get_req ? 'GET' : 'HEAD'),
118
+ 'headers': headers
119
+ };
123
120
 
124
121
  r3logger.dlog('request options = ' + JSON.stringify(options));
125
122
  r3logger.dlog('request headers = ' + JSON.stringify(headers));
@@ -42,20 +42,19 @@ var is_https = apiutil.compareCaseString('yes', process.env.HTTPS_ENV);
42
42
  //
43
43
  function postV1Resource(method, token, querypath, name, datatype, data, reskeys, alias, port, cuk, roleyrn)
44
44
  {
45
- /* eslint-disable indent, no-mixed-spaces-and-tabs */
46
- var strbody = '';
47
- var headers = {
48
- 'Content-Type': 'application/json',
49
- };
45
+ var strbody = '';
46
+ var headers = {
47
+ 'Content-Type': 'application/json',
48
+ };
50
49
  if(apiutil.isSafeString(token)){
51
50
  headers['X-Auth-Token'] = token;
52
51
  }
53
- var options = { 'host': hostname,
54
- 'port': hostport,
55
- 'path': '/v1/resource' + apiutil.getSafeString(querypath),
56
- 'method': method
57
- };
58
- /* eslint-enable indent, no-mixed-spaces-and-tabs */
52
+ var options = {
53
+ 'host': hostname,
54
+ 'port': hostport,
55
+ 'path': '/v1/resource' + apiutil.getSafeString(querypath),
56
+ 'method': method
57
+ };
59
58
 
60
59
  if(!apiutil.compareCaseString('string', datatype) && !apiutil.compareCaseString('object', datatype)){
61
60
  datatype = 'string'; // default data type is string
@@ -68,15 +67,13 @@ function postV1Resource(method, token, querypath, name, datatype, data, reskeys,
68
67
  data = apiutil.parseJSON(data);
69
68
  }
70
69
 
71
- /* eslint-disable indent, no-mixed-spaces-and-tabs */
72
- var body = { 'resource':
73
- {
74
- 'type': datatype,
75
- 'data': data, // if datatype is string, this includes control codes
76
- 'keys': reskeys
77
- }
78
- };
79
- /* eslint-enable indent, no-mixed-spaces-and-tabs */
70
+ var body = {
71
+ 'resource': {
72
+ 'type': datatype,
73
+ 'data': data, // if datatype is string, this includes control codes
74
+ 'keys': reskeys
75
+ }
76
+ };
80
77
 
81
78
  if(apiutil.isSafeString(name)){
82
79
  body.resource.name = name;
@@ -274,7 +271,7 @@ function rawGetInputKeys(str)
274
271
  try{
275
272
  // parse JSON
276
273
  result = JSON.parse(str);
277
- }catch(err){
274
+ }catch(err){ // eslint-disable-line no-unused-vars
278
275
  // key=val,key=val...
279
276
  result = {};
280
277
  // parse ','