@digipair/skill-s3 0.92.1 → 0.93.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 +7 -0
- package/dist/index.cjs.js +22 -0
- package/dist/index.cjs10.js +1581 -0
- package/dist/index.cjs11.js +2639 -0
- package/dist/index.cjs2.js +25 -0
- package/dist/index.cjs3.js +39239 -0
- package/dist/index.cjs4.js +450 -0
- package/dist/index.cjs5.js +3698 -0
- package/dist/index.cjs6.js +433 -0
- package/dist/index.cjs7.js +706 -0
- package/dist/index.cjs8.js +1691 -0
- package/dist/index.cjs9.js +1515 -0
- package/dist/index.esm.js +13 -0
- package/dist/index.esm10.js +1577 -0
- package/dist/index.esm11.js +2619 -0
- package/dist/index.esm2.js +13 -0
- package/dist/index.esm3.js +39118 -0
- package/dist/index.esm4.js +447 -0
- package/dist/index.esm5.js +3676 -0
- package/dist/index.esm6.js +431 -0
- package/dist/index.esm7.js +704 -0
- package/dist/index.esm8.js +1689 -0
- package/dist/index.esm9.js +1504 -0
- package/dist/loadSso.cjs.js +2092 -0
- package/dist/loadSso.esm.js +2089 -0
- package/dist/noAuth.cjs.js +167 -0
- package/dist/noAuth.esm.js +165 -0
- package/dist/package.cjs.js +187 -0
- package/dist/package.esm.js +184 -0
- package/dist/parseJsonBody.cjs.js +257 -0
- package/dist/parseJsonBody.esm.js +252 -0
- package/dist/parseKnownFiles.cjs.js +250 -0
- package/dist/parseKnownFiles.esm.js +248 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -0
- package/{libs/skill-s3 → dist}/src/lib/skill-s3.d.ts +1 -0
- package/dist/src/lib/skill-s3.d.ts.map +1 -0
- package/dist/src/lib/skill-s3.spec.d.ts +2 -0
- package/dist/src/lib/skill-s3.spec.d.ts.map +1 -0
- package/package.json +20 -6
- package/index.cjs.js +0 -72
- package/index.d.ts +0 -1
- package/index.esm.js +0 -65
- package/libs/skill-s3/src/index.d.ts +0 -1
- /package/{index.cjs.d.ts → dist/index.d.ts} +0 -0
- /package/{schema.fr.json → dist/schema.fr.json} +0 -0
- /package/{schema.json → dist/schema.json} +0 -0
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index.cjs3.js');
|
|
4
|
+
|
|
5
|
+
function _type_of$1(obj) {
|
|
6
|
+
"@swc/helpers - typeof";
|
|
7
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
8
|
+
}
|
|
9
|
+
var _json = function(obj) {
|
|
10
|
+
if (obj == null) {
|
|
11
|
+
return {};
|
|
12
|
+
}
|
|
13
|
+
if (Array.isArray(obj)) {
|
|
14
|
+
return obj.filter(function(_) {
|
|
15
|
+
return _ != null;
|
|
16
|
+
}).map(_json);
|
|
17
|
+
}
|
|
18
|
+
if ((typeof obj === "undefined" ? "undefined" : _type_of$1(obj)) === "object") {
|
|
19
|
+
var target = {};
|
|
20
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
21
|
+
try {
|
|
22
|
+
for(var _iterator = Object.keys(obj)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
23
|
+
var key = _step.value;
|
|
24
|
+
if (obj[key] == null) {
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
target[key] = _json(obj[key]);
|
|
28
|
+
}
|
|
29
|
+
} catch (err) {
|
|
30
|
+
_didIteratorError = true;
|
|
31
|
+
_iteratorError = err;
|
|
32
|
+
} finally{
|
|
33
|
+
try {
|
|
34
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
35
|
+
_iterator.return();
|
|
36
|
+
}
|
|
37
|
+
} finally{
|
|
38
|
+
if (_didIteratorError) {
|
|
39
|
+
throw _iteratorError;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return target;
|
|
44
|
+
}
|
|
45
|
+
return obj;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
49
|
+
try {
|
|
50
|
+
var info = gen[key](arg);
|
|
51
|
+
var value = info.value;
|
|
52
|
+
} catch (error) {
|
|
53
|
+
reject(error);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (info.done) {
|
|
57
|
+
resolve(value);
|
|
58
|
+
} else {
|
|
59
|
+
Promise.resolve(value).then(_next, _throw);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function _async_to_generator(fn) {
|
|
63
|
+
return function() {
|
|
64
|
+
var self = this, args = arguments;
|
|
65
|
+
return new Promise(function(resolve, reject) {
|
|
66
|
+
var gen = fn.apply(self, args);
|
|
67
|
+
function _next(value) {
|
|
68
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
69
|
+
}
|
|
70
|
+
function _throw(err) {
|
|
71
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
72
|
+
}
|
|
73
|
+
_next(undefined);
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function _type_of(obj) {
|
|
78
|
+
"@swc/helpers - typeof";
|
|
79
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
80
|
+
}
|
|
81
|
+
function _ts_generator(thisArg, body) {
|
|
82
|
+
var f, y, t, g, _ = {
|
|
83
|
+
label: 0,
|
|
84
|
+
sent: function() {
|
|
85
|
+
if (t[0] & 1) throw t[1];
|
|
86
|
+
return t[1];
|
|
87
|
+
},
|
|
88
|
+
trys: [],
|
|
89
|
+
ops: []
|
|
90
|
+
};
|
|
91
|
+
return g = {
|
|
92
|
+
next: verb(0),
|
|
93
|
+
"throw": verb(1),
|
|
94
|
+
"return": verb(2)
|
|
95
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
96
|
+
return this;
|
|
97
|
+
}), g;
|
|
98
|
+
function verb(n) {
|
|
99
|
+
return function(v) {
|
|
100
|
+
return step([
|
|
101
|
+
n,
|
|
102
|
+
v
|
|
103
|
+
]);
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
function step(op) {
|
|
107
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
108
|
+
while(_)try {
|
|
109
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
110
|
+
if (y = 0, t) op = [
|
|
111
|
+
op[0] & 2,
|
|
112
|
+
t.value
|
|
113
|
+
];
|
|
114
|
+
switch(op[0]){
|
|
115
|
+
case 0:
|
|
116
|
+
case 1:
|
|
117
|
+
t = op;
|
|
118
|
+
break;
|
|
119
|
+
case 4:
|
|
120
|
+
_.label++;
|
|
121
|
+
return {
|
|
122
|
+
value: op[1],
|
|
123
|
+
done: false
|
|
124
|
+
};
|
|
125
|
+
case 5:
|
|
126
|
+
_.label++;
|
|
127
|
+
y = op[1];
|
|
128
|
+
op = [
|
|
129
|
+
0
|
|
130
|
+
];
|
|
131
|
+
continue;
|
|
132
|
+
case 7:
|
|
133
|
+
op = _.ops.pop();
|
|
134
|
+
_.trys.pop();
|
|
135
|
+
continue;
|
|
136
|
+
default:
|
|
137
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
138
|
+
_ = 0;
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
142
|
+
_.label = op[1];
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
146
|
+
_.label = t[1];
|
|
147
|
+
t = op;
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
if (t && _.label < t[2]) {
|
|
151
|
+
_.label = t[2];
|
|
152
|
+
_.ops.push(op);
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
if (t[2]) _.ops.pop();
|
|
156
|
+
_.trys.pop();
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
op = body.call(thisArg, _);
|
|
160
|
+
} catch (e) {
|
|
161
|
+
op = [
|
|
162
|
+
6,
|
|
163
|
+
e
|
|
164
|
+
];
|
|
165
|
+
y = 0;
|
|
166
|
+
} finally{
|
|
167
|
+
f = t = 0;
|
|
168
|
+
}
|
|
169
|
+
if (op[0] & 5) throw op[1];
|
|
170
|
+
return {
|
|
171
|
+
value: op[0] ? op[1] : void 0,
|
|
172
|
+
done: true
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
var parseJsonBody = function(streamBody, context) {
|
|
177
|
+
return index.collectBodyString(streamBody, context).then(function(encoded) {
|
|
178
|
+
if (encoded.length) {
|
|
179
|
+
try {
|
|
180
|
+
return JSON.parse(encoded);
|
|
181
|
+
} catch (e) {
|
|
182
|
+
if ((e === null || e === void 0 ? void 0 : e.name) === "SyntaxError") {
|
|
183
|
+
Object.defineProperty(e, "$responseBodyText", {
|
|
184
|
+
value: encoded
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
throw e;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return {};
|
|
191
|
+
});
|
|
192
|
+
};
|
|
193
|
+
var parseJsonErrorBody = function() {
|
|
194
|
+
var _ref = _async_to_generator(function(errorBody, context) {
|
|
195
|
+
var value, _value_message;
|
|
196
|
+
return _ts_generator(this, function(_state) {
|
|
197
|
+
switch(_state.label){
|
|
198
|
+
case 0:
|
|
199
|
+
return [
|
|
200
|
+
4,
|
|
201
|
+
parseJsonBody(errorBody, context)
|
|
202
|
+
];
|
|
203
|
+
case 1:
|
|
204
|
+
value = _state.sent();
|
|
205
|
+
value.message = (_value_message = value.message) !== null && _value_message !== void 0 ? _value_message : value.Message;
|
|
206
|
+
return [
|
|
207
|
+
2,
|
|
208
|
+
value
|
|
209
|
+
];
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
return function parseJsonErrorBody(errorBody, context) {
|
|
214
|
+
return _ref.apply(this, arguments);
|
|
215
|
+
};
|
|
216
|
+
}();
|
|
217
|
+
var loadRestJsonErrorCode = function(output, data) {
|
|
218
|
+
var findKey = function(object, key) {
|
|
219
|
+
return Object.keys(object).find(function(k) {
|
|
220
|
+
return k.toLowerCase() === key.toLowerCase();
|
|
221
|
+
});
|
|
222
|
+
};
|
|
223
|
+
var sanitizeErrorCode = function(rawValue) {
|
|
224
|
+
var cleanValue = rawValue;
|
|
225
|
+
if (typeof cleanValue === "number") {
|
|
226
|
+
cleanValue = cleanValue.toString();
|
|
227
|
+
}
|
|
228
|
+
if (cleanValue.indexOf(",") >= 0) {
|
|
229
|
+
cleanValue = cleanValue.split(",")[0];
|
|
230
|
+
}
|
|
231
|
+
if (cleanValue.indexOf(":") >= 0) {
|
|
232
|
+
cleanValue = cleanValue.split(":")[0];
|
|
233
|
+
}
|
|
234
|
+
if (cleanValue.indexOf("#") >= 0) {
|
|
235
|
+
cleanValue = cleanValue.split("#")[1];
|
|
236
|
+
}
|
|
237
|
+
return cleanValue;
|
|
238
|
+
};
|
|
239
|
+
var headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
240
|
+
if (headerKey !== undefined) {
|
|
241
|
+
return sanitizeErrorCode(output.headers[headerKey]);
|
|
242
|
+
}
|
|
243
|
+
if (data && (typeof data === "undefined" ? "undefined" : _type_of(data)) === "object") {
|
|
244
|
+
var codeKey = findKey(data, "code");
|
|
245
|
+
if (codeKey && data[codeKey] !== undefined) {
|
|
246
|
+
return sanitizeErrorCode(data[codeKey]);
|
|
247
|
+
}
|
|
248
|
+
if (data["__type"] !== undefined) {
|
|
249
|
+
return sanitizeErrorCode(data["__type"]);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
exports._json = _json;
|
|
255
|
+
exports.loadRestJsonErrorCode = loadRestJsonErrorCode;
|
|
256
|
+
exports.parseJsonBody = parseJsonBody;
|
|
257
|
+
exports.parseJsonErrorBody = parseJsonErrorBody;
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { g as collectBodyString } from './index.esm3.js';
|
|
2
|
+
|
|
3
|
+
function _type_of$1(obj) {
|
|
4
|
+
"@swc/helpers - typeof";
|
|
5
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
6
|
+
}
|
|
7
|
+
var _json = function(obj) {
|
|
8
|
+
if (obj == null) {
|
|
9
|
+
return {};
|
|
10
|
+
}
|
|
11
|
+
if (Array.isArray(obj)) {
|
|
12
|
+
return obj.filter(function(_) {
|
|
13
|
+
return _ != null;
|
|
14
|
+
}).map(_json);
|
|
15
|
+
}
|
|
16
|
+
if ((typeof obj === "undefined" ? "undefined" : _type_of$1(obj)) === "object") {
|
|
17
|
+
var target = {};
|
|
18
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
19
|
+
try {
|
|
20
|
+
for(var _iterator = Object.keys(obj)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
21
|
+
var key = _step.value;
|
|
22
|
+
if (obj[key] == null) {
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
target[key] = _json(obj[key]);
|
|
26
|
+
}
|
|
27
|
+
} catch (err) {
|
|
28
|
+
_didIteratorError = true;
|
|
29
|
+
_iteratorError = err;
|
|
30
|
+
} finally{
|
|
31
|
+
try {
|
|
32
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
33
|
+
_iterator.return();
|
|
34
|
+
}
|
|
35
|
+
} finally{
|
|
36
|
+
if (_didIteratorError) {
|
|
37
|
+
throw _iteratorError;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return target;
|
|
42
|
+
}
|
|
43
|
+
return obj;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
47
|
+
try {
|
|
48
|
+
var info = gen[key](arg);
|
|
49
|
+
var value = info.value;
|
|
50
|
+
} catch (error) {
|
|
51
|
+
reject(error);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (info.done) {
|
|
55
|
+
resolve(value);
|
|
56
|
+
} else {
|
|
57
|
+
Promise.resolve(value).then(_next, _throw);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function _async_to_generator(fn) {
|
|
61
|
+
return function() {
|
|
62
|
+
var self = this, args = arguments;
|
|
63
|
+
return new Promise(function(resolve, reject) {
|
|
64
|
+
var gen = fn.apply(self, args);
|
|
65
|
+
function _next(value) {
|
|
66
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
67
|
+
}
|
|
68
|
+
function _throw(err) {
|
|
69
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
70
|
+
}
|
|
71
|
+
_next(undefined);
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function _type_of(obj) {
|
|
76
|
+
"@swc/helpers - typeof";
|
|
77
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
78
|
+
}
|
|
79
|
+
function _ts_generator(thisArg, body) {
|
|
80
|
+
var f, y, t, g, _ = {
|
|
81
|
+
label: 0,
|
|
82
|
+
sent: function() {
|
|
83
|
+
if (t[0] & 1) throw t[1];
|
|
84
|
+
return t[1];
|
|
85
|
+
},
|
|
86
|
+
trys: [],
|
|
87
|
+
ops: []
|
|
88
|
+
};
|
|
89
|
+
return g = {
|
|
90
|
+
next: verb(0),
|
|
91
|
+
"throw": verb(1),
|
|
92
|
+
"return": verb(2)
|
|
93
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
94
|
+
return this;
|
|
95
|
+
}), g;
|
|
96
|
+
function verb(n) {
|
|
97
|
+
return function(v) {
|
|
98
|
+
return step([
|
|
99
|
+
n,
|
|
100
|
+
v
|
|
101
|
+
]);
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
function step(op) {
|
|
105
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
106
|
+
while(_)try {
|
|
107
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
108
|
+
if (y = 0, t) op = [
|
|
109
|
+
op[0] & 2,
|
|
110
|
+
t.value
|
|
111
|
+
];
|
|
112
|
+
switch(op[0]){
|
|
113
|
+
case 0:
|
|
114
|
+
case 1:
|
|
115
|
+
t = op;
|
|
116
|
+
break;
|
|
117
|
+
case 4:
|
|
118
|
+
_.label++;
|
|
119
|
+
return {
|
|
120
|
+
value: op[1],
|
|
121
|
+
done: false
|
|
122
|
+
};
|
|
123
|
+
case 5:
|
|
124
|
+
_.label++;
|
|
125
|
+
y = op[1];
|
|
126
|
+
op = [
|
|
127
|
+
0
|
|
128
|
+
];
|
|
129
|
+
continue;
|
|
130
|
+
case 7:
|
|
131
|
+
op = _.ops.pop();
|
|
132
|
+
_.trys.pop();
|
|
133
|
+
continue;
|
|
134
|
+
default:
|
|
135
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
136
|
+
_ = 0;
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
140
|
+
_.label = op[1];
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
144
|
+
_.label = t[1];
|
|
145
|
+
t = op;
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
if (t && _.label < t[2]) {
|
|
149
|
+
_.label = t[2];
|
|
150
|
+
_.ops.push(op);
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
if (t[2]) _.ops.pop();
|
|
154
|
+
_.trys.pop();
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
op = body.call(thisArg, _);
|
|
158
|
+
} catch (e) {
|
|
159
|
+
op = [
|
|
160
|
+
6,
|
|
161
|
+
e
|
|
162
|
+
];
|
|
163
|
+
y = 0;
|
|
164
|
+
} finally{
|
|
165
|
+
f = t = 0;
|
|
166
|
+
}
|
|
167
|
+
if (op[0] & 5) throw op[1];
|
|
168
|
+
return {
|
|
169
|
+
value: op[0] ? op[1] : void 0,
|
|
170
|
+
done: true
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
var parseJsonBody = function(streamBody, context) {
|
|
175
|
+
return collectBodyString(streamBody, context).then(function(encoded) {
|
|
176
|
+
if (encoded.length) {
|
|
177
|
+
try {
|
|
178
|
+
return JSON.parse(encoded);
|
|
179
|
+
} catch (e) {
|
|
180
|
+
if ((e === null || e === void 0 ? void 0 : e.name) === "SyntaxError") {
|
|
181
|
+
Object.defineProperty(e, "$responseBodyText", {
|
|
182
|
+
value: encoded
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
throw e;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return {};
|
|
189
|
+
});
|
|
190
|
+
};
|
|
191
|
+
var parseJsonErrorBody = function() {
|
|
192
|
+
var _ref = _async_to_generator(function(errorBody, context) {
|
|
193
|
+
var value, _value_message;
|
|
194
|
+
return _ts_generator(this, function(_state) {
|
|
195
|
+
switch(_state.label){
|
|
196
|
+
case 0:
|
|
197
|
+
return [
|
|
198
|
+
4,
|
|
199
|
+
parseJsonBody(errorBody, context)
|
|
200
|
+
];
|
|
201
|
+
case 1:
|
|
202
|
+
value = _state.sent();
|
|
203
|
+
value.message = (_value_message = value.message) !== null && _value_message !== void 0 ? _value_message : value.Message;
|
|
204
|
+
return [
|
|
205
|
+
2,
|
|
206
|
+
value
|
|
207
|
+
];
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
return function parseJsonErrorBody(errorBody, context) {
|
|
212
|
+
return _ref.apply(this, arguments);
|
|
213
|
+
};
|
|
214
|
+
}();
|
|
215
|
+
var loadRestJsonErrorCode = function(output, data) {
|
|
216
|
+
var findKey = function(object, key) {
|
|
217
|
+
return Object.keys(object).find(function(k) {
|
|
218
|
+
return k.toLowerCase() === key.toLowerCase();
|
|
219
|
+
});
|
|
220
|
+
};
|
|
221
|
+
var sanitizeErrorCode = function(rawValue) {
|
|
222
|
+
var cleanValue = rawValue;
|
|
223
|
+
if (typeof cleanValue === "number") {
|
|
224
|
+
cleanValue = cleanValue.toString();
|
|
225
|
+
}
|
|
226
|
+
if (cleanValue.indexOf(",") >= 0) {
|
|
227
|
+
cleanValue = cleanValue.split(",")[0];
|
|
228
|
+
}
|
|
229
|
+
if (cleanValue.indexOf(":") >= 0) {
|
|
230
|
+
cleanValue = cleanValue.split(":")[0];
|
|
231
|
+
}
|
|
232
|
+
if (cleanValue.indexOf("#") >= 0) {
|
|
233
|
+
cleanValue = cleanValue.split("#")[1];
|
|
234
|
+
}
|
|
235
|
+
return cleanValue;
|
|
236
|
+
};
|
|
237
|
+
var headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
238
|
+
if (headerKey !== undefined) {
|
|
239
|
+
return sanitizeErrorCode(output.headers[headerKey]);
|
|
240
|
+
}
|
|
241
|
+
if (data && (typeof data === "undefined" ? "undefined" : _type_of(data)) === "object") {
|
|
242
|
+
var codeKey = findKey(data, "code");
|
|
243
|
+
if (codeKey && data[codeKey] !== undefined) {
|
|
244
|
+
return sanitizeErrorCode(data[codeKey]);
|
|
245
|
+
}
|
|
246
|
+
if (data["__type"] !== undefined) {
|
|
247
|
+
return sanitizeErrorCode(data["__type"]);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
export { _json as _, parseJsonErrorBody as a, loadRestJsonErrorCode as l, parseJsonBody as p };
|