@elastic/elasticsearch 8.0.0-alpha.0 → 8.0.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.
- package/README.md +13 -62
- package/free-report-junit.xml +13 -0
- package/index.d.ts +4 -3
- package/index.js +31 -3
- package/lib/api/api/async_search.js +28 -40
- package/lib/api/api/async_search.js.map +1 -1
- package/lib/api/api/autoscaling.js +13 -37
- package/lib/api/api/autoscaling.js.map +1 -1
- package/lib/api/api/bulk.d.ts +3 -3
- package/lib/api/api/bulk.js +6 -10
- package/lib/api/api/bulk.js.map +1 -1
- package/lib/api/api/cat.js +75 -275
- package/lib/api/api/cat.js.map +1 -1
- package/lib/api/api/ccr.js +79 -127
- package/lib/api/api/ccr.js.map +1 -1
- package/lib/api/api/clear_scroll.js +13 -7
- package/lib/api/api/clear_scroll.js.map +1 -1
- package/lib/api/api/close_point_in_time.js +13 -7
- package/lib/api/api/close_point_in_time.js.map +1 -1
- package/lib/api/api/cluster.js +85 -149
- package/lib/api/api/cluster.js.map +1 -1
- package/lib/api/api/count.js +13 -7
- package/lib/api/api/count.js.map +1 -1
- package/lib/api/api/create.js +5 -5
- package/lib/api/api/create.js.map +1 -1
- package/lib/api/api/dangling_indices.js +9 -33
- package/lib/api/api/dangling_indices.js.map +1 -1
- package/lib/api/api/delete.js +4 -12
- package/lib/api/api/delete.js.map +1 -1
- package/lib/api/api/delete_by_query.js +13 -7
- package/lib/api/api/delete_by_query.js.map +1 -1
- package/lib/api/api/delete_by_query_rethrottle.js +3 -11
- package/lib/api/api/delete_by_query_rethrottle.js.map +1 -1
- package/lib/api/api/delete_script.js +3 -11
- package/lib/api/api/delete_script.js.map +1 -1
- package/lib/api/api/enrich.js +25 -51
- package/lib/api/api/enrich.js.map +1 -1
- package/lib/api/api/eql.js +22 -40
- package/lib/api/api/eql.js.map +1 -1
- package/lib/api/api/exists.js +3 -11
- package/lib/api/api/exists.js.map +1 -1
- package/lib/api/api/exists_source.js +4 -12
- package/lib/api/api/exists_source.js.map +1 -1
- package/lib/api/api/explain.js +13 -7
- package/lib/api/api/explain.js.map +1 -1
- package/lib/api/api/features.js +6 -22
- package/lib/api/api/features.js.map +1 -1
- package/lib/api/api/field_caps.js +13 -7
- package/lib/api/api/field_caps.js.map +1 -1
- package/lib/api/api/fleet.d.ts +9 -3
- package/lib/api/api/fleet.js +64 -7
- package/lib/api/api/fleet.js.map +1 -1
- package/lib/api/api/get.js +3 -11
- package/lib/api/api/get.js.map +1 -1
- package/lib/api/api/get_script.js +3 -11
- package/lib/api/api/get_script.js.map +1 -1
- package/lib/api/api/get_script_context.js +3 -11
- package/lib/api/api/get_script_context.js.map +1 -1
- package/lib/api/api/get_script_languages.js +3 -11
- package/lib/api/api/get_script_languages.js.map +1 -1
- package/lib/api/api/get_source.js +3 -11
- package/lib/api/api/get_source.js.map +1 -1
- package/lib/api/api/graph.js +13 -7
- package/lib/api/api/graph.js.map +1 -1
- package/lib/api/api/ilm.d.ts +3 -3
- package/lib/api/api/ilm.js +73 -116
- package/lib/api/api/ilm.js.map +1 -1
- package/lib/api/api/index.js +4 -4
- package/lib/api/api/index.js.map +1 -1
- package/lib/api/api/indices.d.ts +9 -6
- package/lib/api/api/indices.js +320 -519
- package/lib/api/api/indices.js.map +1 -1
- package/lib/api/api/info.js +3 -11
- package/lib/api/api/info.js.map +1 -1
- package/lib/api/api/ingest.js +38 -58
- package/lib/api/api/ingest.js.map +1 -1
- package/lib/api/api/knn_search.d.ts +10 -0
- package/lib/api/api/knn_search.js +53 -0
- package/lib/api/api/knn_search.js.map +1 -0
- package/lib/api/api/license.d.ts +3 -3
- package/lib/api/api/license.js +31 -74
- package/lib/api/api/license.js.map +1 -1
- package/lib/api/api/logstash.js +10 -26
- package/lib/api/api/logstash.js.map +1 -1
- package/lib/api/api/mget.js +13 -7
- package/lib/api/api/mget.js.map +1 -1
- package/lib/api/api/migration.d.ts +6 -0
- package/lib/api/api/migration.js +39 -11
- package/lib/api/api/migration.js.map +1 -1
- package/lib/api/api/ml.d.ts +24 -24
- package/lib/api/api/ml.js +601 -626
- package/lib/api/api/ml.js.map +1 -1
- package/lib/api/api/monitoring.d.ts +3 -3
- package/lib/api/api/monitoring.js +4 -4
- package/lib/api/api/monitoring.js.map +1 -1
- package/lib/api/api/msearch.d.ts +3 -3
- package/lib/api/api/msearch.js +4 -4
- package/lib/api/api/msearch.js.map +1 -1
- package/lib/api/api/msearch_template.d.ts +3 -3
- package/lib/api/api/msearch_template.js +4 -4
- package/lib/api/api/msearch_template.js.map +1 -1
- package/lib/api/api/mtermvectors.js +13 -7
- package/lib/api/api/mtermvectors.js.map +1 -1
- package/lib/api/api/nodes.d.ts +6 -6
- package/lib/api/api/nodes.js +33 -71
- package/lib/api/api/nodes.js.map +1 -1
- package/lib/api/api/open_point_in_time.js +3 -11
- package/lib/api/api/open_point_in_time.js.map +1 -1
- package/lib/api/api/ping.js +3 -11
- package/lib/api/api/ping.js.map +1 -1
- package/lib/api/api/put_script.js +13 -7
- package/lib/api/api/put_script.js.map +1 -1
- package/lib/api/api/rank_eval.js +13 -7
- package/lib/api/api/rank_eval.js.map +1 -1
- package/lib/api/api/reindex.js +13 -7
- package/lib/api/api/reindex.js.map +1 -1
- package/lib/api/api/reindex_rethrottle.js +3 -11
- package/lib/api/api/reindex_rethrottle.js.map +1 -1
- package/lib/api/api/render_search_template.js +13 -7
- package/lib/api/api/render_search_template.js.map +1 -1
- package/lib/api/api/rollup.d.ts +3 -3
- package/lib/api/api/rollup.js +49 -85
- package/lib/api/api/rollup.js.map +1 -1
- package/lib/api/api/scripts_painless_execute.js +13 -7
- package/lib/api/api/scripts_painless_execute.js.map +1 -1
- package/lib/api/api/scroll.d.ts +3 -3
- package/lib/api/api/scroll.js +13 -7
- package/lib/api/api/scroll.js.map +1 -1
- package/lib/api/api/search.d.ts +3 -3
- package/lib/api/api/search.js +19 -7
- package/lib/api/api/search.js.map +1 -1
- package/lib/api/api/search_mvt.js +13 -7
- package/lib/api/api/search_mvt.js.map +1 -1
- package/lib/api/api/search_shards.js +3 -11
- package/lib/api/api/search_shards.js.map +1 -1
- package/lib/api/api/search_template.js +13 -7
- package/lib/api/api/search_template.js.map +1 -1
- package/lib/api/api/searchable_snapshots.d.ts +3 -3
- package/lib/api/api/searchable_snapshots.js +23 -38
- package/lib/api/api/searchable_snapshots.js.map +1 -1
- package/lib/api/api/security.d.ts +27 -27
- package/lib/api/api/security.js +311 -401
- package/lib/api/api/security.js.map +1 -1
- package/lib/api/api/shutdown.js +9 -33
- package/lib/api/api/shutdown.js.map +1 -1
- package/lib/api/api/slm.js +37 -95
- package/lib/api/api/slm.js.map +1 -1
- package/lib/api/api/snapshot.js +87 -125
- package/lib/api/api/snapshot.js.map +1 -1
- package/lib/api/api/sql.d.ts +9 -9
- package/lib/api/api/sql.js +51 -51
- package/lib/api/api/sql.js.map +1 -1
- package/lib/api/api/ssl.js +3 -11
- package/lib/api/api/ssl.js.map +1 -1
- package/lib/api/api/tasks.js +9 -33
- package/lib/api/api/tasks.js.map +1 -1
- package/lib/api/api/terms_enum.js +13 -7
- package/lib/api/api/terms_enum.js.map +1 -1
- package/lib/api/api/termvectors.js +13 -7
- package/lib/api/api/termvectors.js.map +1 -1
- package/lib/api/api/text_structure.js +4 -4
- package/lib/api/api/text_structure.js.map +1 -1
- package/lib/api/api/transform.d.ts +3 -0
- package/lib/api/api/transform.js +74 -78
- package/lib/api/api/transform.js.map +1 -1
- package/lib/api/api/update.js +14 -8
- package/lib/api/api/update.js.map +1 -1
- package/lib/api/api/update_by_query.js +13 -7
- package/lib/api/api/update_by_query.js.map +1 -1
- package/lib/api/api/update_by_query_rethrottle.js +3 -11
- package/lib/api/api/update_by_query_rethrottle.js.map +1 -1
- package/lib/api/api/watcher.js +63 -109
- package/lib/api/api/watcher.js.map +1 -1
- package/lib/api/api/xpack.js +6 -22
- package/lib/api/api/xpack.js.map +1 -1
- package/lib/api/index.d.ts +2 -0
- package/lib/api/index.js +2 -0
- package/lib/api/index.js.map +1 -1
- package/lib/api/types.d.ts +2945 -1413
- package/lib/api/typesWithBodyKey.d.ts +3076 -1437
- package/lib/{Client.d.ts → client.d.ts} +3 -4
- package/lib/{Client.js → client.js} +11 -6
- package/lib/{Client.js.map → client.js.map} +1 -1
- package/lib/{Helpers.d.ts → helpers.d.ts} +2 -2
- package/lib/{Helpers.js → helpers.js} +2 -4
- package/lib/helpers.js.map +1 -0
- package/lib/{SniffingTransport.d.ts → sniffingTransport.d.ts} +0 -0
- package/lib/{SniffingTransport.js → sniffingTransport.js} +1 -1
- package/lib/{SniffingTransport.js.map → sniffingTransport.js.map} +1 -1
- package/package.json +3 -3
- package/platinum-report-junit.xml +13 -0
- package/tsconfig.json +1 -1
- package/lib/Helpers.js.map +0 -1
package/lib/api/api/security.js
CHANGED
|
@@ -29,25 +29,17 @@ class Security {
|
|
|
29
29
|
this.transport = transport;
|
|
30
30
|
}
|
|
31
31
|
async authenticate(params, options) {
|
|
32
|
-
var _a;
|
|
33
32
|
const acceptedPath = [];
|
|
34
|
-
const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
35
33
|
const querystring = {};
|
|
36
|
-
|
|
37
|
-
let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
34
|
+
const body = undefined;
|
|
38
35
|
params = params !== null && params !== void 0 ? params : {};
|
|
39
36
|
for (const key in params) {
|
|
40
|
-
if (
|
|
41
|
-
// @ts-expect-error
|
|
42
|
-
querystring[key] = params[key];
|
|
43
|
-
}
|
|
44
|
-
else if (acceptedPath.includes(key)) {
|
|
37
|
+
if (acceptedPath.includes(key)) {
|
|
45
38
|
continue;
|
|
46
39
|
}
|
|
47
40
|
else if (key !== 'body') {
|
|
48
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
49
41
|
// @ts-expect-error
|
|
50
|
-
|
|
42
|
+
querystring[key] = params[key];
|
|
51
43
|
}
|
|
52
44
|
}
|
|
53
45
|
const method = 'GET';
|
|
@@ -55,25 +47,31 @@ class Security {
|
|
|
55
47
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
56
48
|
}
|
|
57
49
|
async changePassword(params, options) {
|
|
58
|
-
var _a;
|
|
59
50
|
const acceptedPath = ['username'];
|
|
60
|
-
const
|
|
51
|
+
const acceptedBody = ['password', 'password_hash'];
|
|
61
52
|
const querystring = {};
|
|
62
53
|
// @ts-expect-error
|
|
63
|
-
|
|
54
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
55
|
+
let body;
|
|
56
|
+
if (typeof userBody === 'string') {
|
|
57
|
+
body = userBody;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
61
|
+
}
|
|
64
62
|
params = params !== null && params !== void 0 ? params : {};
|
|
65
63
|
for (const key in params) {
|
|
66
|
-
if (
|
|
64
|
+
if (acceptedBody.includes(key)) {
|
|
65
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
67
66
|
// @ts-expect-error
|
|
68
|
-
|
|
67
|
+
body[key] = params[key];
|
|
69
68
|
}
|
|
70
69
|
else if (acceptedPath.includes(key)) {
|
|
71
70
|
continue;
|
|
72
71
|
}
|
|
73
72
|
else if (key !== 'body') {
|
|
74
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
75
73
|
// @ts-expect-error
|
|
76
|
-
|
|
74
|
+
querystring[key] = params[key];
|
|
77
75
|
}
|
|
78
76
|
}
|
|
79
77
|
let method = '';
|
|
@@ -89,24 +87,16 @@ class Security {
|
|
|
89
87
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
90
88
|
}
|
|
91
89
|
async clearApiKeyCache(params, options) {
|
|
92
|
-
var _a;
|
|
93
90
|
const acceptedPath = ['ids'];
|
|
94
|
-
const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
95
91
|
const querystring = {};
|
|
96
|
-
|
|
97
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
92
|
+
const body = undefined;
|
|
98
93
|
for (const key in params) {
|
|
99
|
-
if (
|
|
100
|
-
// @ts-expect-error
|
|
101
|
-
querystring[key] = params[key];
|
|
102
|
-
}
|
|
103
|
-
else if (acceptedPath.includes(key)) {
|
|
94
|
+
if (acceptedPath.includes(key)) {
|
|
104
95
|
continue;
|
|
105
96
|
}
|
|
106
97
|
else if (key !== 'body') {
|
|
107
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
108
98
|
// @ts-expect-error
|
|
109
|
-
|
|
99
|
+
querystring[key] = params[key];
|
|
110
100
|
}
|
|
111
101
|
}
|
|
112
102
|
const method = 'POST';
|
|
@@ -114,24 +104,16 @@ class Security {
|
|
|
114
104
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
115
105
|
}
|
|
116
106
|
async clearCachedPrivileges(params, options) {
|
|
117
|
-
var _a;
|
|
118
107
|
const acceptedPath = ['application'];
|
|
119
|
-
const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
120
108
|
const querystring = {};
|
|
121
|
-
|
|
122
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
109
|
+
const body = undefined;
|
|
123
110
|
for (const key in params) {
|
|
124
|
-
if (
|
|
125
|
-
// @ts-expect-error
|
|
126
|
-
querystring[key] = params[key];
|
|
127
|
-
}
|
|
128
|
-
else if (acceptedPath.includes(key)) {
|
|
111
|
+
if (acceptedPath.includes(key)) {
|
|
129
112
|
continue;
|
|
130
113
|
}
|
|
131
114
|
else if (key !== 'body') {
|
|
132
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
133
115
|
// @ts-expect-error
|
|
134
|
-
|
|
116
|
+
querystring[key] = params[key];
|
|
135
117
|
}
|
|
136
118
|
}
|
|
137
119
|
const method = 'POST';
|
|
@@ -139,24 +121,16 @@ class Security {
|
|
|
139
121
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
140
122
|
}
|
|
141
123
|
async clearCachedRealms(params, options) {
|
|
142
|
-
var _a;
|
|
143
124
|
const acceptedPath = ['realms'];
|
|
144
|
-
const acceptedQuery = ['usernames', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
145
125
|
const querystring = {};
|
|
146
|
-
|
|
147
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
126
|
+
const body = undefined;
|
|
148
127
|
for (const key in params) {
|
|
149
|
-
if (
|
|
150
|
-
// @ts-expect-error
|
|
151
|
-
querystring[key] = params[key];
|
|
152
|
-
}
|
|
153
|
-
else if (acceptedPath.includes(key)) {
|
|
128
|
+
if (acceptedPath.includes(key)) {
|
|
154
129
|
continue;
|
|
155
130
|
}
|
|
156
131
|
else if (key !== 'body') {
|
|
157
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
158
132
|
// @ts-expect-error
|
|
159
|
-
|
|
133
|
+
querystring[key] = params[key];
|
|
160
134
|
}
|
|
161
135
|
}
|
|
162
136
|
const method = 'POST';
|
|
@@ -164,24 +138,16 @@ class Security {
|
|
|
164
138
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
165
139
|
}
|
|
166
140
|
async clearCachedRoles(params, options) {
|
|
167
|
-
var _a;
|
|
168
141
|
const acceptedPath = ['name'];
|
|
169
|
-
const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
170
142
|
const querystring = {};
|
|
171
|
-
|
|
172
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
143
|
+
const body = undefined;
|
|
173
144
|
for (const key in params) {
|
|
174
|
-
if (
|
|
175
|
-
// @ts-expect-error
|
|
176
|
-
querystring[key] = params[key];
|
|
177
|
-
}
|
|
178
|
-
else if (acceptedPath.includes(key)) {
|
|
145
|
+
if (acceptedPath.includes(key)) {
|
|
179
146
|
continue;
|
|
180
147
|
}
|
|
181
148
|
else if (key !== 'body') {
|
|
182
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
183
149
|
// @ts-expect-error
|
|
184
|
-
|
|
150
|
+
querystring[key] = params[key];
|
|
185
151
|
}
|
|
186
152
|
}
|
|
187
153
|
const method = 'POST';
|
|
@@ -189,24 +155,16 @@ class Security {
|
|
|
189
155
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
190
156
|
}
|
|
191
157
|
async clearCachedServiceTokens(params, options) {
|
|
192
|
-
var _a;
|
|
193
158
|
const acceptedPath = ['namespace', 'service', 'name'];
|
|
194
|
-
const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
195
159
|
const querystring = {};
|
|
196
|
-
|
|
197
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
160
|
+
const body = undefined;
|
|
198
161
|
for (const key in params) {
|
|
199
|
-
if (
|
|
200
|
-
// @ts-expect-error
|
|
201
|
-
querystring[key] = params[key];
|
|
202
|
-
}
|
|
203
|
-
else if (acceptedPath.includes(key)) {
|
|
162
|
+
if (acceptedPath.includes(key)) {
|
|
204
163
|
continue;
|
|
205
164
|
}
|
|
206
165
|
else if (key !== 'body') {
|
|
207
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
208
166
|
// @ts-expect-error
|
|
209
|
-
|
|
167
|
+
querystring[key] = params[key];
|
|
210
168
|
}
|
|
211
169
|
}
|
|
212
170
|
const method = 'POST';
|
|
@@ -214,25 +172,31 @@ class Security {
|
|
|
214
172
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
215
173
|
}
|
|
216
174
|
async createApiKey(params, options) {
|
|
217
|
-
var _a;
|
|
218
175
|
const acceptedPath = [];
|
|
219
|
-
const
|
|
176
|
+
const acceptedBody = ['expiration', 'name', 'role_descriptors', 'metadata'];
|
|
220
177
|
const querystring = {};
|
|
221
178
|
// @ts-expect-error
|
|
222
|
-
|
|
179
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
180
|
+
let body;
|
|
181
|
+
if (typeof userBody === 'string') {
|
|
182
|
+
body = userBody;
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
186
|
+
}
|
|
223
187
|
params = params !== null && params !== void 0 ? params : {};
|
|
224
188
|
for (const key in params) {
|
|
225
|
-
if (
|
|
189
|
+
if (acceptedBody.includes(key)) {
|
|
190
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
226
191
|
// @ts-expect-error
|
|
227
|
-
|
|
192
|
+
body[key] = params[key];
|
|
228
193
|
}
|
|
229
194
|
else if (acceptedPath.includes(key)) {
|
|
230
195
|
continue;
|
|
231
196
|
}
|
|
232
197
|
else if (key !== 'body') {
|
|
233
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
234
198
|
// @ts-expect-error
|
|
235
|
-
|
|
199
|
+
querystring[key] = params[key];
|
|
236
200
|
}
|
|
237
201
|
}
|
|
238
202
|
const method = 'PUT';
|
|
@@ -240,24 +204,16 @@ class Security {
|
|
|
240
204
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
241
205
|
}
|
|
242
206
|
async createServiceToken(params, options) {
|
|
243
|
-
var _a;
|
|
244
207
|
const acceptedPath = ['namespace', 'service', 'name'];
|
|
245
|
-
const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
246
208
|
const querystring = {};
|
|
247
|
-
|
|
248
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
209
|
+
const body = undefined;
|
|
249
210
|
for (const key in params) {
|
|
250
|
-
if (
|
|
251
|
-
// @ts-expect-error
|
|
252
|
-
querystring[key] = params[key];
|
|
253
|
-
}
|
|
254
|
-
else if (acceptedPath.includes(key)) {
|
|
211
|
+
if (acceptedPath.includes(key)) {
|
|
255
212
|
continue;
|
|
256
213
|
}
|
|
257
214
|
else if (key !== 'body') {
|
|
258
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
259
215
|
// @ts-expect-error
|
|
260
|
-
|
|
216
|
+
querystring[key] = params[key];
|
|
261
217
|
}
|
|
262
218
|
}
|
|
263
219
|
let method = '';
|
|
@@ -273,24 +229,16 @@ class Security {
|
|
|
273
229
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
274
230
|
}
|
|
275
231
|
async deletePrivileges(params, options) {
|
|
276
|
-
var _a;
|
|
277
232
|
const acceptedPath = ['application', 'name'];
|
|
278
|
-
const acceptedQuery = ['refresh', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
279
233
|
const querystring = {};
|
|
280
|
-
|
|
281
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
234
|
+
const body = undefined;
|
|
282
235
|
for (const key in params) {
|
|
283
|
-
if (
|
|
284
|
-
// @ts-expect-error
|
|
285
|
-
querystring[key] = params[key];
|
|
286
|
-
}
|
|
287
|
-
else if (acceptedPath.includes(key)) {
|
|
236
|
+
if (acceptedPath.includes(key)) {
|
|
288
237
|
continue;
|
|
289
238
|
}
|
|
290
239
|
else if (key !== 'body') {
|
|
291
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
292
240
|
// @ts-expect-error
|
|
293
|
-
|
|
241
|
+
querystring[key] = params[key];
|
|
294
242
|
}
|
|
295
243
|
}
|
|
296
244
|
const method = 'DELETE';
|
|
@@ -298,24 +246,16 @@ class Security {
|
|
|
298
246
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
299
247
|
}
|
|
300
248
|
async deleteRole(params, options) {
|
|
301
|
-
var _a;
|
|
302
249
|
const acceptedPath = ['name'];
|
|
303
|
-
const acceptedQuery = ['refresh', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
304
250
|
const querystring = {};
|
|
305
|
-
|
|
306
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
251
|
+
const body = undefined;
|
|
307
252
|
for (const key in params) {
|
|
308
|
-
if (
|
|
309
|
-
// @ts-expect-error
|
|
310
|
-
querystring[key] = params[key];
|
|
311
|
-
}
|
|
312
|
-
else if (acceptedPath.includes(key)) {
|
|
253
|
+
if (acceptedPath.includes(key)) {
|
|
313
254
|
continue;
|
|
314
255
|
}
|
|
315
256
|
else if (key !== 'body') {
|
|
316
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
317
257
|
// @ts-expect-error
|
|
318
|
-
|
|
258
|
+
querystring[key] = params[key];
|
|
319
259
|
}
|
|
320
260
|
}
|
|
321
261
|
const method = 'DELETE';
|
|
@@ -323,24 +263,16 @@ class Security {
|
|
|
323
263
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
324
264
|
}
|
|
325
265
|
async deleteRoleMapping(params, options) {
|
|
326
|
-
var _a;
|
|
327
266
|
const acceptedPath = ['name'];
|
|
328
|
-
const acceptedQuery = ['refresh', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
329
267
|
const querystring = {};
|
|
330
|
-
|
|
331
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
268
|
+
const body = undefined;
|
|
332
269
|
for (const key in params) {
|
|
333
|
-
if (
|
|
334
|
-
// @ts-expect-error
|
|
335
|
-
querystring[key] = params[key];
|
|
336
|
-
}
|
|
337
|
-
else if (acceptedPath.includes(key)) {
|
|
270
|
+
if (acceptedPath.includes(key)) {
|
|
338
271
|
continue;
|
|
339
272
|
}
|
|
340
273
|
else if (key !== 'body') {
|
|
341
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
342
274
|
// @ts-expect-error
|
|
343
|
-
|
|
275
|
+
querystring[key] = params[key];
|
|
344
276
|
}
|
|
345
277
|
}
|
|
346
278
|
const method = 'DELETE';
|
|
@@ -348,24 +280,16 @@ class Security {
|
|
|
348
280
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
349
281
|
}
|
|
350
282
|
async deleteServiceToken(params, options) {
|
|
351
|
-
var _a;
|
|
352
283
|
const acceptedPath = ['namespace', 'service', 'name'];
|
|
353
|
-
const acceptedQuery = ['refresh', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
354
284
|
const querystring = {};
|
|
355
|
-
|
|
356
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
285
|
+
const body = undefined;
|
|
357
286
|
for (const key in params) {
|
|
358
|
-
if (
|
|
359
|
-
// @ts-expect-error
|
|
360
|
-
querystring[key] = params[key];
|
|
361
|
-
}
|
|
362
|
-
else if (acceptedPath.includes(key)) {
|
|
287
|
+
if (acceptedPath.includes(key)) {
|
|
363
288
|
continue;
|
|
364
289
|
}
|
|
365
290
|
else if (key !== 'body') {
|
|
366
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
367
291
|
// @ts-expect-error
|
|
368
|
-
|
|
292
|
+
querystring[key] = params[key];
|
|
369
293
|
}
|
|
370
294
|
}
|
|
371
295
|
const method = 'DELETE';
|
|
@@ -373,24 +297,16 @@ class Security {
|
|
|
373
297
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
374
298
|
}
|
|
375
299
|
async deleteUser(params, options) {
|
|
376
|
-
var _a;
|
|
377
300
|
const acceptedPath = ['username'];
|
|
378
|
-
const acceptedQuery = ['refresh', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
379
301
|
const querystring = {};
|
|
380
|
-
|
|
381
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
302
|
+
const body = undefined;
|
|
382
303
|
for (const key in params) {
|
|
383
|
-
if (
|
|
384
|
-
// @ts-expect-error
|
|
385
|
-
querystring[key] = params[key];
|
|
386
|
-
}
|
|
387
|
-
else if (acceptedPath.includes(key)) {
|
|
304
|
+
if (acceptedPath.includes(key)) {
|
|
388
305
|
continue;
|
|
389
306
|
}
|
|
390
307
|
else if (key !== 'body') {
|
|
391
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
392
308
|
// @ts-expect-error
|
|
393
|
-
|
|
309
|
+
querystring[key] = params[key];
|
|
394
310
|
}
|
|
395
311
|
}
|
|
396
312
|
const method = 'DELETE';
|
|
@@ -398,24 +314,16 @@ class Security {
|
|
|
398
314
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
399
315
|
}
|
|
400
316
|
async disableUser(params, options) {
|
|
401
|
-
var _a;
|
|
402
317
|
const acceptedPath = ['username'];
|
|
403
|
-
const acceptedQuery = ['refresh', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
404
318
|
const querystring = {};
|
|
405
|
-
|
|
406
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
319
|
+
const body = undefined;
|
|
407
320
|
for (const key in params) {
|
|
408
|
-
if (
|
|
409
|
-
// @ts-expect-error
|
|
410
|
-
querystring[key] = params[key];
|
|
411
|
-
}
|
|
412
|
-
else if (acceptedPath.includes(key)) {
|
|
321
|
+
if (acceptedPath.includes(key)) {
|
|
413
322
|
continue;
|
|
414
323
|
}
|
|
415
324
|
else if (key !== 'body') {
|
|
416
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
417
325
|
// @ts-expect-error
|
|
418
|
-
|
|
326
|
+
querystring[key] = params[key];
|
|
419
327
|
}
|
|
420
328
|
}
|
|
421
329
|
const method = 'PUT';
|
|
@@ -423,24 +331,16 @@ class Security {
|
|
|
423
331
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
424
332
|
}
|
|
425
333
|
async enableUser(params, options) {
|
|
426
|
-
var _a;
|
|
427
334
|
const acceptedPath = ['username'];
|
|
428
|
-
const acceptedQuery = ['refresh', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
429
335
|
const querystring = {};
|
|
430
|
-
|
|
431
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
336
|
+
const body = undefined;
|
|
432
337
|
for (const key in params) {
|
|
433
|
-
if (
|
|
434
|
-
// @ts-expect-error
|
|
435
|
-
querystring[key] = params[key];
|
|
436
|
-
}
|
|
437
|
-
else if (acceptedPath.includes(key)) {
|
|
338
|
+
if (acceptedPath.includes(key)) {
|
|
438
339
|
continue;
|
|
439
340
|
}
|
|
440
341
|
else if (key !== 'body') {
|
|
441
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
442
342
|
// @ts-expect-error
|
|
443
|
-
|
|
343
|
+
querystring[key] = params[key];
|
|
444
344
|
}
|
|
445
345
|
}
|
|
446
346
|
const method = 'PUT';
|
|
@@ -448,22 +348,17 @@ class Security {
|
|
|
448
348
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
449
349
|
}
|
|
450
350
|
async enrollKibana(params, options) {
|
|
451
|
-
var _a;
|
|
452
351
|
const acceptedPath = [];
|
|
453
|
-
const acceptedQuery = [];
|
|
454
352
|
const querystring = {};
|
|
455
|
-
|
|
353
|
+
const body = undefined;
|
|
456
354
|
params = params !== null && params !== void 0 ? params : {};
|
|
457
355
|
for (const key in params) {
|
|
458
|
-
if (
|
|
459
|
-
querystring[key] = params[key];
|
|
460
|
-
}
|
|
461
|
-
else if (acceptedPath.includes(key)) {
|
|
356
|
+
if (acceptedPath.includes(key)) {
|
|
462
357
|
continue;
|
|
463
358
|
}
|
|
464
359
|
else if (key !== 'body') {
|
|
465
|
-
|
|
466
|
-
|
|
360
|
+
// @ts-expect-error
|
|
361
|
+
querystring[key] = params[key];
|
|
467
362
|
}
|
|
468
363
|
}
|
|
469
364
|
const method = 'GET';
|
|
@@ -471,22 +366,17 @@ class Security {
|
|
|
471
366
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
472
367
|
}
|
|
473
368
|
async enrollNode(params, options) {
|
|
474
|
-
var _a;
|
|
475
369
|
const acceptedPath = [];
|
|
476
|
-
const acceptedQuery = [];
|
|
477
370
|
const querystring = {};
|
|
478
|
-
|
|
371
|
+
const body = undefined;
|
|
479
372
|
params = params !== null && params !== void 0 ? params : {};
|
|
480
373
|
for (const key in params) {
|
|
481
|
-
if (
|
|
482
|
-
querystring[key] = params[key];
|
|
483
|
-
}
|
|
484
|
-
else if (acceptedPath.includes(key)) {
|
|
374
|
+
if (acceptedPath.includes(key)) {
|
|
485
375
|
continue;
|
|
486
376
|
}
|
|
487
377
|
else if (key !== 'body') {
|
|
488
|
-
|
|
489
|
-
|
|
378
|
+
// @ts-expect-error
|
|
379
|
+
querystring[key] = params[key];
|
|
490
380
|
}
|
|
491
381
|
}
|
|
492
382
|
const method = 'GET';
|
|
@@ -494,25 +384,17 @@ class Security {
|
|
|
494
384
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
495
385
|
}
|
|
496
386
|
async getApiKey(params, options) {
|
|
497
|
-
var _a;
|
|
498
387
|
const acceptedPath = [];
|
|
499
|
-
const acceptedQuery = ['id', 'name', 'owner', 'realm_name', 'username', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
500
388
|
const querystring = {};
|
|
501
|
-
|
|
502
|
-
let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
389
|
+
const body = undefined;
|
|
503
390
|
params = params !== null && params !== void 0 ? params : {};
|
|
504
391
|
for (const key in params) {
|
|
505
|
-
if (
|
|
506
|
-
// @ts-expect-error
|
|
507
|
-
querystring[key] = params[key];
|
|
508
|
-
}
|
|
509
|
-
else if (acceptedPath.includes(key)) {
|
|
392
|
+
if (acceptedPath.includes(key)) {
|
|
510
393
|
continue;
|
|
511
394
|
}
|
|
512
395
|
else if (key !== 'body') {
|
|
513
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
514
396
|
// @ts-expect-error
|
|
515
|
-
|
|
397
|
+
querystring[key] = params[key];
|
|
516
398
|
}
|
|
517
399
|
}
|
|
518
400
|
const method = 'GET';
|
|
@@ -520,25 +402,17 @@ class Security {
|
|
|
520
402
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
521
403
|
}
|
|
522
404
|
async getBuiltinPrivileges(params, options) {
|
|
523
|
-
var _a;
|
|
524
405
|
const acceptedPath = [];
|
|
525
|
-
const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
526
406
|
const querystring = {};
|
|
527
|
-
|
|
528
|
-
let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
407
|
+
const body = undefined;
|
|
529
408
|
params = params !== null && params !== void 0 ? params : {};
|
|
530
409
|
for (const key in params) {
|
|
531
|
-
if (
|
|
532
|
-
// @ts-expect-error
|
|
533
|
-
querystring[key] = params[key];
|
|
534
|
-
}
|
|
535
|
-
else if (acceptedPath.includes(key)) {
|
|
410
|
+
if (acceptedPath.includes(key)) {
|
|
536
411
|
continue;
|
|
537
412
|
}
|
|
538
413
|
else if (key !== 'body') {
|
|
539
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
540
414
|
// @ts-expect-error
|
|
541
|
-
|
|
415
|
+
querystring[key] = params[key];
|
|
542
416
|
}
|
|
543
417
|
}
|
|
544
418
|
const method = 'GET';
|
|
@@ -546,25 +420,17 @@ class Security {
|
|
|
546
420
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
547
421
|
}
|
|
548
422
|
async getPrivileges(params, options) {
|
|
549
|
-
var _a;
|
|
550
423
|
const acceptedPath = ['application', 'name'];
|
|
551
|
-
const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
552
424
|
const querystring = {};
|
|
553
|
-
|
|
554
|
-
let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
425
|
+
const body = undefined;
|
|
555
426
|
params = params !== null && params !== void 0 ? params : {};
|
|
556
427
|
for (const key in params) {
|
|
557
|
-
if (
|
|
558
|
-
// @ts-expect-error
|
|
559
|
-
querystring[key] = params[key];
|
|
560
|
-
}
|
|
561
|
-
else if (acceptedPath.includes(key)) {
|
|
428
|
+
if (acceptedPath.includes(key)) {
|
|
562
429
|
continue;
|
|
563
430
|
}
|
|
564
431
|
else if (key !== 'body') {
|
|
565
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
566
432
|
// @ts-expect-error
|
|
567
|
-
|
|
433
|
+
querystring[key] = params[key];
|
|
568
434
|
}
|
|
569
435
|
}
|
|
570
436
|
let method = '';
|
|
@@ -584,25 +450,17 @@ class Security {
|
|
|
584
450
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
585
451
|
}
|
|
586
452
|
async getRole(params, options) {
|
|
587
|
-
var _a;
|
|
588
453
|
const acceptedPath = ['name'];
|
|
589
|
-
const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
590
454
|
const querystring = {};
|
|
591
|
-
|
|
592
|
-
let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
455
|
+
const body = undefined;
|
|
593
456
|
params = params !== null && params !== void 0 ? params : {};
|
|
594
457
|
for (const key in params) {
|
|
595
|
-
if (
|
|
596
|
-
// @ts-expect-error
|
|
597
|
-
querystring[key] = params[key];
|
|
598
|
-
}
|
|
599
|
-
else if (acceptedPath.includes(key)) {
|
|
458
|
+
if (acceptedPath.includes(key)) {
|
|
600
459
|
continue;
|
|
601
460
|
}
|
|
602
461
|
else if (key !== 'body') {
|
|
603
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
604
462
|
// @ts-expect-error
|
|
605
|
-
|
|
463
|
+
querystring[key] = params[key];
|
|
606
464
|
}
|
|
607
465
|
}
|
|
608
466
|
let method = '';
|
|
@@ -618,25 +476,17 @@ class Security {
|
|
|
618
476
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
619
477
|
}
|
|
620
478
|
async getRoleMapping(params, options) {
|
|
621
|
-
var _a;
|
|
622
479
|
const acceptedPath = ['name'];
|
|
623
|
-
const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
624
480
|
const querystring = {};
|
|
625
|
-
|
|
626
|
-
let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
481
|
+
const body = undefined;
|
|
627
482
|
params = params !== null && params !== void 0 ? params : {};
|
|
628
483
|
for (const key in params) {
|
|
629
|
-
if (
|
|
630
|
-
// @ts-expect-error
|
|
631
|
-
querystring[key] = params[key];
|
|
632
|
-
}
|
|
633
|
-
else if (acceptedPath.includes(key)) {
|
|
484
|
+
if (acceptedPath.includes(key)) {
|
|
634
485
|
continue;
|
|
635
486
|
}
|
|
636
487
|
else if (key !== 'body') {
|
|
637
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
638
488
|
// @ts-expect-error
|
|
639
|
-
|
|
489
|
+
querystring[key] = params[key];
|
|
640
490
|
}
|
|
641
491
|
}
|
|
642
492
|
let method = '';
|
|
@@ -652,25 +502,17 @@ class Security {
|
|
|
652
502
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
653
503
|
}
|
|
654
504
|
async getServiceAccounts(params, options) {
|
|
655
|
-
var _a;
|
|
656
505
|
const acceptedPath = ['namespace', 'service'];
|
|
657
|
-
const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
658
506
|
const querystring = {};
|
|
659
|
-
|
|
660
|
-
let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
507
|
+
const body = undefined;
|
|
661
508
|
params = params !== null && params !== void 0 ? params : {};
|
|
662
509
|
for (const key in params) {
|
|
663
|
-
if (
|
|
664
|
-
// @ts-expect-error
|
|
665
|
-
querystring[key] = params[key];
|
|
666
|
-
}
|
|
667
|
-
else if (acceptedPath.includes(key)) {
|
|
510
|
+
if (acceptedPath.includes(key)) {
|
|
668
511
|
continue;
|
|
669
512
|
}
|
|
670
513
|
else if (key !== 'body') {
|
|
671
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
672
514
|
// @ts-expect-error
|
|
673
|
-
|
|
515
|
+
querystring[key] = params[key];
|
|
674
516
|
}
|
|
675
517
|
}
|
|
676
518
|
let method = '';
|
|
@@ -690,24 +532,16 @@ class Security {
|
|
|
690
532
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
691
533
|
}
|
|
692
534
|
async getServiceCredentials(params, options) {
|
|
693
|
-
var _a;
|
|
694
535
|
const acceptedPath = ['namespace', 'service'];
|
|
695
|
-
const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
696
536
|
const querystring = {};
|
|
697
|
-
|
|
698
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
537
|
+
const body = undefined;
|
|
699
538
|
for (const key in params) {
|
|
700
|
-
if (
|
|
701
|
-
// @ts-expect-error
|
|
702
|
-
querystring[key] = params[key];
|
|
703
|
-
}
|
|
704
|
-
else if (acceptedPath.includes(key)) {
|
|
539
|
+
if (acceptedPath.includes(key)) {
|
|
705
540
|
continue;
|
|
706
541
|
}
|
|
707
542
|
else if (key !== 'body') {
|
|
708
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
709
543
|
// @ts-expect-error
|
|
710
|
-
|
|
544
|
+
querystring[key] = params[key];
|
|
711
545
|
}
|
|
712
546
|
}
|
|
713
547
|
const method = 'GET';
|
|
@@ -715,25 +549,31 @@ class Security {
|
|
|
715
549
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
716
550
|
}
|
|
717
551
|
async getToken(params, options) {
|
|
718
|
-
var _a;
|
|
719
552
|
const acceptedPath = [];
|
|
720
|
-
const
|
|
553
|
+
const acceptedBody = ['grant_type', 'scope', 'password', 'kerberos_ticket', 'refresh_token', 'username'];
|
|
721
554
|
const querystring = {};
|
|
722
555
|
// @ts-expect-error
|
|
723
|
-
|
|
556
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
557
|
+
let body;
|
|
558
|
+
if (typeof userBody === 'string') {
|
|
559
|
+
body = userBody;
|
|
560
|
+
}
|
|
561
|
+
else {
|
|
562
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
563
|
+
}
|
|
724
564
|
params = params !== null && params !== void 0 ? params : {};
|
|
725
565
|
for (const key in params) {
|
|
726
|
-
if (
|
|
566
|
+
if (acceptedBody.includes(key)) {
|
|
567
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
727
568
|
// @ts-expect-error
|
|
728
|
-
|
|
569
|
+
body[key] = params[key];
|
|
729
570
|
}
|
|
730
571
|
else if (acceptedPath.includes(key)) {
|
|
731
572
|
continue;
|
|
732
573
|
}
|
|
733
574
|
else if (key !== 'body') {
|
|
734
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
735
575
|
// @ts-expect-error
|
|
736
|
-
|
|
576
|
+
querystring[key] = params[key];
|
|
737
577
|
}
|
|
738
578
|
}
|
|
739
579
|
const method = 'POST';
|
|
@@ -741,25 +581,17 @@ class Security {
|
|
|
741
581
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
742
582
|
}
|
|
743
583
|
async getUser(params, options) {
|
|
744
|
-
var _a;
|
|
745
584
|
const acceptedPath = ['username'];
|
|
746
|
-
const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
747
585
|
const querystring = {};
|
|
748
|
-
|
|
749
|
-
let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
586
|
+
const body = undefined;
|
|
750
587
|
params = params !== null && params !== void 0 ? params : {};
|
|
751
588
|
for (const key in params) {
|
|
752
|
-
if (
|
|
753
|
-
// @ts-expect-error
|
|
754
|
-
querystring[key] = params[key];
|
|
755
|
-
}
|
|
756
|
-
else if (acceptedPath.includes(key)) {
|
|
589
|
+
if (acceptedPath.includes(key)) {
|
|
757
590
|
continue;
|
|
758
591
|
}
|
|
759
592
|
else if (key !== 'body') {
|
|
760
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
761
593
|
// @ts-expect-error
|
|
762
|
-
|
|
594
|
+
querystring[key] = params[key];
|
|
763
595
|
}
|
|
764
596
|
}
|
|
765
597
|
let method = '';
|
|
@@ -775,25 +607,17 @@ class Security {
|
|
|
775
607
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
776
608
|
}
|
|
777
609
|
async getUserPrivileges(params, options) {
|
|
778
|
-
var _a;
|
|
779
610
|
const acceptedPath = [];
|
|
780
|
-
const acceptedQuery = ['application', 'priviledge', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
781
611
|
const querystring = {};
|
|
782
|
-
|
|
783
|
-
let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
612
|
+
const body = undefined;
|
|
784
613
|
params = params !== null && params !== void 0 ? params : {};
|
|
785
614
|
for (const key in params) {
|
|
786
|
-
if (
|
|
787
|
-
// @ts-expect-error
|
|
788
|
-
querystring[key] = params[key];
|
|
789
|
-
}
|
|
790
|
-
else if (acceptedPath.includes(key)) {
|
|
615
|
+
if (acceptedPath.includes(key)) {
|
|
791
616
|
continue;
|
|
792
617
|
}
|
|
793
618
|
else if (key !== 'body') {
|
|
794
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
795
619
|
// @ts-expect-error
|
|
796
|
-
|
|
620
|
+
querystring[key] = params[key];
|
|
797
621
|
}
|
|
798
622
|
}
|
|
799
623
|
const method = 'GET';
|
|
@@ -801,24 +625,30 @@ class Security {
|
|
|
801
625
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
802
626
|
}
|
|
803
627
|
async grantApiKey(params, options) {
|
|
804
|
-
var _a;
|
|
805
628
|
const acceptedPath = [];
|
|
806
|
-
const
|
|
629
|
+
const acceptedBody = ['api_key', 'grant_type', 'access_token', 'username', 'password'];
|
|
807
630
|
const querystring = {};
|
|
808
631
|
// @ts-expect-error
|
|
809
|
-
|
|
632
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
633
|
+
let body;
|
|
634
|
+
if (typeof userBody === 'string') {
|
|
635
|
+
body = userBody;
|
|
636
|
+
}
|
|
637
|
+
else {
|
|
638
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
639
|
+
}
|
|
810
640
|
for (const key in params) {
|
|
811
|
-
if (
|
|
641
|
+
if (acceptedBody.includes(key)) {
|
|
642
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
812
643
|
// @ts-expect-error
|
|
813
|
-
|
|
644
|
+
body[key] = params[key];
|
|
814
645
|
}
|
|
815
646
|
else if (acceptedPath.includes(key)) {
|
|
816
647
|
continue;
|
|
817
648
|
}
|
|
818
649
|
else if (key !== 'body') {
|
|
819
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
820
650
|
// @ts-expect-error
|
|
821
|
-
|
|
651
|
+
querystring[key] = params[key];
|
|
822
652
|
}
|
|
823
653
|
}
|
|
824
654
|
const method = 'POST';
|
|
@@ -826,25 +656,31 @@ class Security {
|
|
|
826
656
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
827
657
|
}
|
|
828
658
|
async hasPrivileges(params, options) {
|
|
829
|
-
var _a;
|
|
830
659
|
const acceptedPath = ['user'];
|
|
831
|
-
const
|
|
660
|
+
const acceptedBody = ['application', 'cluster', 'index'];
|
|
832
661
|
const querystring = {};
|
|
833
662
|
// @ts-expect-error
|
|
834
|
-
|
|
663
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
664
|
+
let body;
|
|
665
|
+
if (typeof userBody === 'string') {
|
|
666
|
+
body = userBody;
|
|
667
|
+
}
|
|
668
|
+
else {
|
|
669
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
670
|
+
}
|
|
835
671
|
params = params !== null && params !== void 0 ? params : {};
|
|
836
672
|
for (const key in params) {
|
|
837
|
-
if (
|
|
673
|
+
if (acceptedBody.includes(key)) {
|
|
674
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
838
675
|
// @ts-expect-error
|
|
839
|
-
|
|
676
|
+
body[key] = params[key];
|
|
840
677
|
}
|
|
841
678
|
else if (acceptedPath.includes(key)) {
|
|
842
679
|
continue;
|
|
843
680
|
}
|
|
844
681
|
else if (key !== 'body') {
|
|
845
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
846
682
|
// @ts-expect-error
|
|
847
|
-
|
|
683
|
+
querystring[key] = params[key];
|
|
848
684
|
}
|
|
849
685
|
}
|
|
850
686
|
let method = '';
|
|
@@ -860,25 +696,31 @@ class Security {
|
|
|
860
696
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
861
697
|
}
|
|
862
698
|
async invalidateApiKey(params, options) {
|
|
863
|
-
var _a;
|
|
864
699
|
const acceptedPath = [];
|
|
865
|
-
const
|
|
700
|
+
const acceptedBody = ['id', 'ids', 'name', 'owner', 'realm_name', 'username'];
|
|
866
701
|
const querystring = {};
|
|
867
702
|
// @ts-expect-error
|
|
868
|
-
|
|
703
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
704
|
+
let body;
|
|
705
|
+
if (typeof userBody === 'string') {
|
|
706
|
+
body = userBody;
|
|
707
|
+
}
|
|
708
|
+
else {
|
|
709
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
710
|
+
}
|
|
869
711
|
params = params !== null && params !== void 0 ? params : {};
|
|
870
712
|
for (const key in params) {
|
|
871
|
-
if (
|
|
713
|
+
if (acceptedBody.includes(key)) {
|
|
714
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
872
715
|
// @ts-expect-error
|
|
873
|
-
|
|
716
|
+
body[key] = params[key];
|
|
874
717
|
}
|
|
875
718
|
else if (acceptedPath.includes(key)) {
|
|
876
719
|
continue;
|
|
877
720
|
}
|
|
878
721
|
else if (key !== 'body') {
|
|
879
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
880
722
|
// @ts-expect-error
|
|
881
|
-
|
|
723
|
+
querystring[key] = params[key];
|
|
882
724
|
}
|
|
883
725
|
}
|
|
884
726
|
const method = 'DELETE';
|
|
@@ -886,25 +728,31 @@ class Security {
|
|
|
886
728
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
887
729
|
}
|
|
888
730
|
async invalidateToken(params, options) {
|
|
889
|
-
var _a;
|
|
890
731
|
const acceptedPath = [];
|
|
891
|
-
const
|
|
732
|
+
const acceptedBody = ['token', 'refresh_token', 'realm_name', 'username'];
|
|
892
733
|
const querystring = {};
|
|
893
734
|
// @ts-expect-error
|
|
894
|
-
|
|
735
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
736
|
+
let body;
|
|
737
|
+
if (typeof userBody === 'string') {
|
|
738
|
+
body = userBody;
|
|
739
|
+
}
|
|
740
|
+
else {
|
|
741
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
742
|
+
}
|
|
895
743
|
params = params !== null && params !== void 0 ? params : {};
|
|
896
744
|
for (const key in params) {
|
|
897
|
-
if (
|
|
745
|
+
if (acceptedBody.includes(key)) {
|
|
746
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
898
747
|
// @ts-expect-error
|
|
899
|
-
|
|
748
|
+
body[key] = params[key];
|
|
900
749
|
}
|
|
901
750
|
else if (acceptedPath.includes(key)) {
|
|
902
751
|
continue;
|
|
903
752
|
}
|
|
904
753
|
else if (key !== 'body') {
|
|
905
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
906
754
|
// @ts-expect-error
|
|
907
|
-
|
|
755
|
+
querystring[key] = params[key];
|
|
908
756
|
}
|
|
909
757
|
}
|
|
910
758
|
const method = 'DELETE';
|
|
@@ -914,21 +762,21 @@ class Security {
|
|
|
914
762
|
async putPrivileges(params, options) {
|
|
915
763
|
var _a;
|
|
916
764
|
const acceptedPath = [];
|
|
917
|
-
const
|
|
765
|
+
const acceptedBody = ['privileges'];
|
|
918
766
|
const querystring = {};
|
|
919
767
|
// @ts-expect-error
|
|
920
768
|
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
921
769
|
for (const key in params) {
|
|
922
|
-
if (
|
|
770
|
+
if (acceptedBody.includes(key)) {
|
|
923
771
|
// @ts-expect-error
|
|
924
|
-
|
|
772
|
+
body = params[key];
|
|
925
773
|
}
|
|
926
774
|
else if (acceptedPath.includes(key)) {
|
|
927
775
|
continue;
|
|
928
776
|
}
|
|
929
777
|
else if (key !== 'body') {
|
|
930
778
|
// @ts-expect-error
|
|
931
|
-
|
|
779
|
+
querystring[key] = params[key];
|
|
932
780
|
}
|
|
933
781
|
}
|
|
934
782
|
const method = 'PUT';
|
|
@@ -936,24 +784,30 @@ class Security {
|
|
|
936
784
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
937
785
|
}
|
|
938
786
|
async putRole(params, options) {
|
|
939
|
-
var _a;
|
|
940
787
|
const acceptedPath = ['name'];
|
|
941
|
-
const
|
|
788
|
+
const acceptedBody = ['applications', 'cluster', 'global', 'indices', 'metadata', 'run_as', 'transient_metadata'];
|
|
942
789
|
const querystring = {};
|
|
943
790
|
// @ts-expect-error
|
|
944
|
-
|
|
791
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
792
|
+
let body;
|
|
793
|
+
if (typeof userBody === 'string') {
|
|
794
|
+
body = userBody;
|
|
795
|
+
}
|
|
796
|
+
else {
|
|
797
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
798
|
+
}
|
|
945
799
|
for (const key in params) {
|
|
946
|
-
if (
|
|
800
|
+
if (acceptedBody.includes(key)) {
|
|
801
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
947
802
|
// @ts-expect-error
|
|
948
|
-
|
|
803
|
+
body[key] = params[key];
|
|
949
804
|
}
|
|
950
805
|
else if (acceptedPath.includes(key)) {
|
|
951
806
|
continue;
|
|
952
807
|
}
|
|
953
808
|
else if (key !== 'body') {
|
|
954
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
955
809
|
// @ts-expect-error
|
|
956
|
-
|
|
810
|
+
querystring[key] = params[key];
|
|
957
811
|
}
|
|
958
812
|
}
|
|
959
813
|
const method = 'PUT';
|
|
@@ -961,24 +815,30 @@ class Security {
|
|
|
961
815
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
962
816
|
}
|
|
963
817
|
async putRoleMapping(params, options) {
|
|
964
|
-
var _a;
|
|
965
818
|
const acceptedPath = ['name'];
|
|
966
|
-
const
|
|
819
|
+
const acceptedBody = ['enabled', 'metadata', 'roles', 'rules', 'run_as'];
|
|
967
820
|
const querystring = {};
|
|
968
821
|
// @ts-expect-error
|
|
969
|
-
|
|
822
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
823
|
+
let body;
|
|
824
|
+
if (typeof userBody === 'string') {
|
|
825
|
+
body = userBody;
|
|
826
|
+
}
|
|
827
|
+
else {
|
|
828
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
829
|
+
}
|
|
970
830
|
for (const key in params) {
|
|
971
|
-
if (
|
|
831
|
+
if (acceptedBody.includes(key)) {
|
|
832
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
972
833
|
// @ts-expect-error
|
|
973
|
-
|
|
834
|
+
body[key] = params[key];
|
|
974
835
|
}
|
|
975
836
|
else if (acceptedPath.includes(key)) {
|
|
976
837
|
continue;
|
|
977
838
|
}
|
|
978
839
|
else if (key !== 'body') {
|
|
979
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
980
840
|
// @ts-expect-error
|
|
981
|
-
|
|
841
|
+
querystring[key] = params[key];
|
|
982
842
|
}
|
|
983
843
|
}
|
|
984
844
|
const method = 'PUT';
|
|
@@ -986,24 +846,30 @@ class Security {
|
|
|
986
846
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
987
847
|
}
|
|
988
848
|
async putUser(params, options) {
|
|
989
|
-
var _a;
|
|
990
849
|
const acceptedPath = [];
|
|
991
|
-
const
|
|
850
|
+
const acceptedBody = ['username', 'email', 'full_name', 'metadata', 'password', 'password_hash', 'roles', 'enabled'];
|
|
992
851
|
const querystring = {};
|
|
993
852
|
// @ts-expect-error
|
|
994
|
-
|
|
853
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
854
|
+
let body;
|
|
855
|
+
if (typeof userBody === 'string') {
|
|
856
|
+
body = userBody;
|
|
857
|
+
}
|
|
858
|
+
else {
|
|
859
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
860
|
+
}
|
|
995
861
|
for (const key in params) {
|
|
996
|
-
if (
|
|
862
|
+
if (acceptedBody.includes(key)) {
|
|
863
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
997
864
|
// @ts-expect-error
|
|
998
|
-
|
|
865
|
+
body[key] = params[key];
|
|
999
866
|
}
|
|
1000
867
|
else if (acceptedPath.includes(key)) {
|
|
1001
868
|
continue;
|
|
1002
869
|
}
|
|
1003
870
|
else if (key !== 'body') {
|
|
1004
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
1005
871
|
// @ts-expect-error
|
|
1006
|
-
|
|
872
|
+
querystring[key] = params[key];
|
|
1007
873
|
}
|
|
1008
874
|
}
|
|
1009
875
|
const method = 'PUT';
|
|
@@ -1011,22 +877,31 @@ class Security {
|
|
|
1011
877
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
1012
878
|
}
|
|
1013
879
|
async queryApiKeys(params, options) {
|
|
1014
|
-
var _a;
|
|
1015
880
|
const acceptedPath = [];
|
|
1016
|
-
const
|
|
881
|
+
const acceptedBody = ['query', 'from', 'sort', 'size', 'search_after'];
|
|
1017
882
|
const querystring = {};
|
|
1018
|
-
|
|
883
|
+
// @ts-expect-error
|
|
884
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
885
|
+
let body;
|
|
886
|
+
if (typeof userBody === 'string') {
|
|
887
|
+
body = userBody;
|
|
888
|
+
}
|
|
889
|
+
else {
|
|
890
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
891
|
+
}
|
|
1019
892
|
params = params !== null && params !== void 0 ? params : {};
|
|
1020
893
|
for (const key in params) {
|
|
1021
|
-
if (
|
|
1022
|
-
|
|
894
|
+
if (acceptedBody.includes(key)) {
|
|
895
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
896
|
+
// @ts-expect-error
|
|
897
|
+
body[key] = params[key];
|
|
1023
898
|
}
|
|
1024
899
|
else if (acceptedPath.includes(key)) {
|
|
1025
900
|
continue;
|
|
1026
901
|
}
|
|
1027
902
|
else if (key !== 'body') {
|
|
1028
|
-
|
|
1029
|
-
|
|
903
|
+
// @ts-expect-error
|
|
904
|
+
querystring[key] = params[key];
|
|
1030
905
|
}
|
|
1031
906
|
}
|
|
1032
907
|
const method = body != null ? 'POST' : 'GET';
|
|
@@ -1034,22 +909,30 @@ class Security {
|
|
|
1034
909
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
1035
910
|
}
|
|
1036
911
|
async samlAuthenticate(params, options) {
|
|
1037
|
-
var _a;
|
|
1038
912
|
const acceptedPath = [];
|
|
1039
|
-
const
|
|
913
|
+
const acceptedBody = ['content', 'ids', 'realm'];
|
|
1040
914
|
const querystring = {};
|
|
1041
|
-
|
|
1042
|
-
|
|
915
|
+
// @ts-expect-error
|
|
916
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
917
|
+
let body;
|
|
918
|
+
if (typeof userBody === 'string') {
|
|
919
|
+
body = userBody;
|
|
920
|
+
}
|
|
921
|
+
else {
|
|
922
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
923
|
+
}
|
|
1043
924
|
for (const key in params) {
|
|
1044
|
-
if (
|
|
1045
|
-
|
|
925
|
+
if (acceptedBody.includes(key)) {
|
|
926
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
927
|
+
// @ts-expect-error
|
|
928
|
+
body[key] = params[key];
|
|
1046
929
|
}
|
|
1047
930
|
else if (acceptedPath.includes(key)) {
|
|
1048
931
|
continue;
|
|
1049
932
|
}
|
|
1050
933
|
else if (key !== 'body') {
|
|
1051
|
-
|
|
1052
|
-
|
|
934
|
+
// @ts-expect-error
|
|
935
|
+
querystring[key] = params[key];
|
|
1053
936
|
}
|
|
1054
937
|
}
|
|
1055
938
|
const method = 'POST';
|
|
@@ -1057,22 +940,30 @@ class Security {
|
|
|
1057
940
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
1058
941
|
}
|
|
1059
942
|
async samlCompleteLogout(params, options) {
|
|
1060
|
-
var _a;
|
|
1061
943
|
const acceptedPath = [];
|
|
1062
|
-
const
|
|
944
|
+
const acceptedBody = ['realm', 'ids', 'query_string', 'content'];
|
|
1063
945
|
const querystring = {};
|
|
1064
|
-
|
|
1065
|
-
|
|
946
|
+
// @ts-expect-error
|
|
947
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
948
|
+
let body;
|
|
949
|
+
if (typeof userBody === 'string') {
|
|
950
|
+
body = userBody;
|
|
951
|
+
}
|
|
952
|
+
else {
|
|
953
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
954
|
+
}
|
|
1066
955
|
for (const key in params) {
|
|
1067
|
-
if (
|
|
1068
|
-
|
|
956
|
+
if (acceptedBody.includes(key)) {
|
|
957
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
958
|
+
// @ts-expect-error
|
|
959
|
+
body[key] = params[key];
|
|
1069
960
|
}
|
|
1070
961
|
else if (acceptedPath.includes(key)) {
|
|
1071
962
|
continue;
|
|
1072
963
|
}
|
|
1073
964
|
else if (key !== 'body') {
|
|
1074
|
-
|
|
1075
|
-
|
|
965
|
+
// @ts-expect-error
|
|
966
|
+
querystring[key] = params[key];
|
|
1076
967
|
}
|
|
1077
968
|
}
|
|
1078
969
|
const method = 'POST';
|
|
@@ -1080,22 +971,30 @@ class Security {
|
|
|
1080
971
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
1081
972
|
}
|
|
1082
973
|
async samlInvalidate(params, options) {
|
|
1083
|
-
var _a;
|
|
1084
974
|
const acceptedPath = [];
|
|
1085
|
-
const
|
|
975
|
+
const acceptedBody = ['acs', 'query_string', 'realm'];
|
|
1086
976
|
const querystring = {};
|
|
1087
|
-
|
|
1088
|
-
|
|
977
|
+
// @ts-expect-error
|
|
978
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
979
|
+
let body;
|
|
980
|
+
if (typeof userBody === 'string') {
|
|
981
|
+
body = userBody;
|
|
982
|
+
}
|
|
983
|
+
else {
|
|
984
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
985
|
+
}
|
|
1089
986
|
for (const key in params) {
|
|
1090
|
-
if (
|
|
1091
|
-
|
|
987
|
+
if (acceptedBody.includes(key)) {
|
|
988
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
989
|
+
// @ts-expect-error
|
|
990
|
+
body[key] = params[key];
|
|
1092
991
|
}
|
|
1093
992
|
else if (acceptedPath.includes(key)) {
|
|
1094
993
|
continue;
|
|
1095
994
|
}
|
|
1096
995
|
else if (key !== 'body') {
|
|
1097
|
-
|
|
1098
|
-
|
|
996
|
+
// @ts-expect-error
|
|
997
|
+
querystring[key] = params[key];
|
|
1099
998
|
}
|
|
1100
999
|
}
|
|
1101
1000
|
const method = 'POST';
|
|
@@ -1103,22 +1002,30 @@ class Security {
|
|
|
1103
1002
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
1104
1003
|
}
|
|
1105
1004
|
async samlLogout(params, options) {
|
|
1106
|
-
var _a;
|
|
1107
1005
|
const acceptedPath = [];
|
|
1108
|
-
const
|
|
1006
|
+
const acceptedBody = ['token', 'refresh_token'];
|
|
1109
1007
|
const querystring = {};
|
|
1110
|
-
|
|
1111
|
-
|
|
1008
|
+
// @ts-expect-error
|
|
1009
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
1010
|
+
let body;
|
|
1011
|
+
if (typeof userBody === 'string') {
|
|
1012
|
+
body = userBody;
|
|
1013
|
+
}
|
|
1014
|
+
else {
|
|
1015
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
1016
|
+
}
|
|
1112
1017
|
for (const key in params) {
|
|
1113
|
-
if (
|
|
1114
|
-
|
|
1018
|
+
if (acceptedBody.includes(key)) {
|
|
1019
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
1020
|
+
// @ts-expect-error
|
|
1021
|
+
body[key] = params[key];
|
|
1115
1022
|
}
|
|
1116
1023
|
else if (acceptedPath.includes(key)) {
|
|
1117
1024
|
continue;
|
|
1118
1025
|
}
|
|
1119
1026
|
else if (key !== 'body') {
|
|
1120
|
-
|
|
1121
|
-
|
|
1027
|
+
// @ts-expect-error
|
|
1028
|
+
querystring[key] = params[key];
|
|
1122
1029
|
}
|
|
1123
1030
|
}
|
|
1124
1031
|
const method = 'POST';
|
|
@@ -1126,22 +1033,31 @@ class Security {
|
|
|
1126
1033
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
1127
1034
|
}
|
|
1128
1035
|
async samlPrepareAuthentication(params, options) {
|
|
1129
|
-
var _a;
|
|
1130
1036
|
const acceptedPath = [];
|
|
1131
|
-
const
|
|
1037
|
+
const acceptedBody = ['acs', 'realm', 'relay_state'];
|
|
1132
1038
|
const querystring = {};
|
|
1133
|
-
|
|
1039
|
+
// @ts-expect-error
|
|
1040
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
1041
|
+
let body;
|
|
1042
|
+
if (typeof userBody === 'string') {
|
|
1043
|
+
body = userBody;
|
|
1044
|
+
}
|
|
1045
|
+
else {
|
|
1046
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
1047
|
+
}
|
|
1134
1048
|
params = params !== null && params !== void 0 ? params : {};
|
|
1135
1049
|
for (const key in params) {
|
|
1136
|
-
if (
|
|
1137
|
-
|
|
1050
|
+
if (acceptedBody.includes(key)) {
|
|
1051
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
1052
|
+
// @ts-expect-error
|
|
1053
|
+
body[key] = params[key];
|
|
1138
1054
|
}
|
|
1139
1055
|
else if (acceptedPath.includes(key)) {
|
|
1140
1056
|
continue;
|
|
1141
1057
|
}
|
|
1142
1058
|
else if (key !== 'body') {
|
|
1143
|
-
|
|
1144
|
-
|
|
1059
|
+
// @ts-expect-error
|
|
1060
|
+
querystring[key] = params[key];
|
|
1145
1061
|
}
|
|
1146
1062
|
}
|
|
1147
1063
|
const method = 'POST';
|
|
@@ -1149,22 +1065,16 @@ class Security {
|
|
|
1149
1065
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
1150
1066
|
}
|
|
1151
1067
|
async samlServiceProviderMetadata(params, options) {
|
|
1152
|
-
var _a;
|
|
1153
1068
|
const acceptedPath = ['realm_name'];
|
|
1154
|
-
const acceptedQuery = [];
|
|
1155
1069
|
const querystring = {};
|
|
1156
|
-
|
|
1157
|
-
params = params !== null && params !== void 0 ? params : {};
|
|
1070
|
+
const body = undefined;
|
|
1158
1071
|
for (const key in params) {
|
|
1159
|
-
if (
|
|
1160
|
-
querystring[key] = params[key];
|
|
1161
|
-
}
|
|
1162
|
-
else if (acceptedPath.includes(key)) {
|
|
1072
|
+
if (acceptedPath.includes(key)) {
|
|
1163
1073
|
continue;
|
|
1164
1074
|
}
|
|
1165
1075
|
else if (key !== 'body') {
|
|
1166
|
-
|
|
1167
|
-
|
|
1076
|
+
// @ts-expect-error
|
|
1077
|
+
querystring[key] = params[key];
|
|
1168
1078
|
}
|
|
1169
1079
|
}
|
|
1170
1080
|
const method = 'GET';
|