@digipair/skill-s3 0.114.1 → 0.114.3
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/dist/externalDataInterceptor.esm.js +19 -0
- package/dist/getSSOTokenFromFile.esm.js +169 -0
- package/dist/index.esm.js +14 -65
- package/dist/index.esm10.js +1603 -0
- package/dist/index.esm11.js +2635 -0
- package/dist/index.esm2.js +14 -0
- package/dist/index.esm3.js +40088 -0
- package/dist/index.esm4.js +450 -0
- package/dist/index.esm5.js +3677 -0
- package/dist/index.esm6.js +434 -0
- package/dist/index.esm7.js +705 -0
- package/dist/index.esm8.js +1690 -0
- package/dist/index.esm9.js +1519 -0
- package/dist/loadSso.esm.js +2090 -0
- package/dist/noAuth.esm.js +165 -0
- package/dist/package.esm.js +184 -0
- package/dist/parseJsonBody.esm.js +252 -0
- package/dist/parseKnownFiles.esm.js +248 -0
- package/package.json +4 -2
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
2
|
+
try {
|
|
3
|
+
var info = gen[key](arg);
|
|
4
|
+
var value = info.value;
|
|
5
|
+
} catch (error) {
|
|
6
|
+
reject(error);
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
if (info.done) {
|
|
10
|
+
resolve(value);
|
|
11
|
+
} else {
|
|
12
|
+
Promise.resolve(value).then(_next, _throw);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function _async_to_generator(fn) {
|
|
16
|
+
return function() {
|
|
17
|
+
var self = this, args = arguments;
|
|
18
|
+
return new Promise(function(resolve, reject) {
|
|
19
|
+
var gen = fn.apply(self, args);
|
|
20
|
+
function _next(value) {
|
|
21
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
22
|
+
}
|
|
23
|
+
function _throw(err) {
|
|
24
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
25
|
+
}
|
|
26
|
+
_next(undefined);
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function _class_call_check(instance, Constructor) {
|
|
31
|
+
if (!(instance instanceof Constructor)) {
|
|
32
|
+
throw new TypeError("Cannot call a class as a function");
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function _defineProperties(target, props) {
|
|
36
|
+
for(var i = 0; i < props.length; i++){
|
|
37
|
+
var descriptor = props[i];
|
|
38
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
39
|
+
descriptor.configurable = true;
|
|
40
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
41
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
45
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
46
|
+
return Constructor;
|
|
47
|
+
}
|
|
48
|
+
function _ts_generator(thisArg, body) {
|
|
49
|
+
var f, y, t, g, _ = {
|
|
50
|
+
label: 0,
|
|
51
|
+
sent: function() {
|
|
52
|
+
if (t[0] & 1) throw t[1];
|
|
53
|
+
return t[1];
|
|
54
|
+
},
|
|
55
|
+
trys: [],
|
|
56
|
+
ops: []
|
|
57
|
+
};
|
|
58
|
+
return g = {
|
|
59
|
+
next: verb(0),
|
|
60
|
+
"throw": verb(1),
|
|
61
|
+
"return": verb(2)
|
|
62
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
63
|
+
return this;
|
|
64
|
+
}), g;
|
|
65
|
+
function verb(n) {
|
|
66
|
+
return function(v) {
|
|
67
|
+
return step([
|
|
68
|
+
n,
|
|
69
|
+
v
|
|
70
|
+
]);
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function step(op) {
|
|
74
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
75
|
+
while(_)try {
|
|
76
|
+
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;
|
|
77
|
+
if (y = 0, t) op = [
|
|
78
|
+
op[0] & 2,
|
|
79
|
+
t.value
|
|
80
|
+
];
|
|
81
|
+
switch(op[0]){
|
|
82
|
+
case 0:
|
|
83
|
+
case 1:
|
|
84
|
+
t = op;
|
|
85
|
+
break;
|
|
86
|
+
case 4:
|
|
87
|
+
_.label++;
|
|
88
|
+
return {
|
|
89
|
+
value: op[1],
|
|
90
|
+
done: false
|
|
91
|
+
};
|
|
92
|
+
case 5:
|
|
93
|
+
_.label++;
|
|
94
|
+
y = op[1];
|
|
95
|
+
op = [
|
|
96
|
+
0
|
|
97
|
+
];
|
|
98
|
+
continue;
|
|
99
|
+
case 7:
|
|
100
|
+
op = _.ops.pop();
|
|
101
|
+
_.trys.pop();
|
|
102
|
+
continue;
|
|
103
|
+
default:
|
|
104
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
105
|
+
_ = 0;
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
109
|
+
_.label = op[1];
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
113
|
+
_.label = t[1];
|
|
114
|
+
t = op;
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
if (t && _.label < t[2]) {
|
|
118
|
+
_.label = t[2];
|
|
119
|
+
_.ops.push(op);
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
if (t[2]) _.ops.pop();
|
|
123
|
+
_.trys.pop();
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
op = body.call(thisArg, _);
|
|
127
|
+
} catch (e) {
|
|
128
|
+
op = [
|
|
129
|
+
6,
|
|
130
|
+
e
|
|
131
|
+
];
|
|
132
|
+
y = 0;
|
|
133
|
+
} finally{
|
|
134
|
+
f = t = 0;
|
|
135
|
+
}
|
|
136
|
+
if (op[0] & 5) throw op[1];
|
|
137
|
+
return {
|
|
138
|
+
value: op[0] ? op[1] : void 0,
|
|
139
|
+
done: true
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
var NoAuthSigner = /*#__PURE__*/ function() {
|
|
144
|
+
function NoAuthSigner() {
|
|
145
|
+
_class_call_check(this, NoAuthSigner);
|
|
146
|
+
}
|
|
147
|
+
_create_class(NoAuthSigner, [
|
|
148
|
+
{
|
|
149
|
+
key: "sign",
|
|
150
|
+
value: function sign(httpRequest, identity, signingProperties) {
|
|
151
|
+
return _async_to_generator(function() {
|
|
152
|
+
return _ts_generator(this, function(_state) {
|
|
153
|
+
return [
|
|
154
|
+
2,
|
|
155
|
+
httpRequest
|
|
156
|
+
];
|
|
157
|
+
});
|
|
158
|
+
})();
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
]);
|
|
162
|
+
return NoAuthSigner;
|
|
163
|
+
}();
|
|
164
|
+
|
|
165
|
+
export { NoAuthSigner as N };
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
2
|
+
try {
|
|
3
|
+
var info = gen[key](arg);
|
|
4
|
+
var value = info.value;
|
|
5
|
+
} catch (error) {
|
|
6
|
+
reject(error);
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
if (info.done) {
|
|
10
|
+
resolve(value);
|
|
11
|
+
} else {
|
|
12
|
+
Promise.resolve(value).then(_next, _throw);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function _async_to_generator(fn) {
|
|
16
|
+
return function() {
|
|
17
|
+
var self = this, args = arguments;
|
|
18
|
+
return new Promise(function(resolve, reject) {
|
|
19
|
+
var gen = fn.apply(self, args);
|
|
20
|
+
function _next(value) {
|
|
21
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
22
|
+
}
|
|
23
|
+
function _throw(err) {
|
|
24
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
25
|
+
}
|
|
26
|
+
_next(undefined);
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function _type_of(obj) {
|
|
31
|
+
"@swc/helpers - typeof";
|
|
32
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
33
|
+
}
|
|
34
|
+
function _ts_generator(thisArg, body) {
|
|
35
|
+
var f, y, t, g, _ = {
|
|
36
|
+
label: 0,
|
|
37
|
+
sent: function() {
|
|
38
|
+
if (t[0] & 1) throw t[1];
|
|
39
|
+
return t[1];
|
|
40
|
+
},
|
|
41
|
+
trys: [],
|
|
42
|
+
ops: []
|
|
43
|
+
};
|
|
44
|
+
return g = {
|
|
45
|
+
next: verb(0),
|
|
46
|
+
"throw": verb(1),
|
|
47
|
+
"return": verb(2)
|
|
48
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
49
|
+
return this;
|
|
50
|
+
}), g;
|
|
51
|
+
function verb(n) {
|
|
52
|
+
return function(v) {
|
|
53
|
+
return step([
|
|
54
|
+
n,
|
|
55
|
+
v
|
|
56
|
+
]);
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function step(op) {
|
|
60
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
61
|
+
while(_)try {
|
|
62
|
+
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;
|
|
63
|
+
if (y = 0, t) op = [
|
|
64
|
+
op[0] & 2,
|
|
65
|
+
t.value
|
|
66
|
+
];
|
|
67
|
+
switch(op[0]){
|
|
68
|
+
case 0:
|
|
69
|
+
case 1:
|
|
70
|
+
t = op;
|
|
71
|
+
break;
|
|
72
|
+
case 4:
|
|
73
|
+
_.label++;
|
|
74
|
+
return {
|
|
75
|
+
value: op[1],
|
|
76
|
+
done: false
|
|
77
|
+
};
|
|
78
|
+
case 5:
|
|
79
|
+
_.label++;
|
|
80
|
+
y = op[1];
|
|
81
|
+
op = [
|
|
82
|
+
0
|
|
83
|
+
];
|
|
84
|
+
continue;
|
|
85
|
+
case 7:
|
|
86
|
+
op = _.ops.pop();
|
|
87
|
+
_.trys.pop();
|
|
88
|
+
continue;
|
|
89
|
+
default:
|
|
90
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
91
|
+
_ = 0;
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
95
|
+
_.label = op[1];
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
99
|
+
_.label = t[1];
|
|
100
|
+
t = op;
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
if (t && _.label < t[2]) {
|
|
104
|
+
_.label = t[2];
|
|
105
|
+
_.ops.push(op);
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
if (t[2]) _.ops.pop();
|
|
109
|
+
_.trys.pop();
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
op = body.call(thisArg, _);
|
|
113
|
+
} catch (e) {
|
|
114
|
+
op = [
|
|
115
|
+
6,
|
|
116
|
+
e
|
|
117
|
+
];
|
|
118
|
+
y = 0;
|
|
119
|
+
} finally{
|
|
120
|
+
f = t = 0;
|
|
121
|
+
}
|
|
122
|
+
if (op[0] & 5) throw op[1];
|
|
123
|
+
return {
|
|
124
|
+
value: op[0] ? op[1] : void 0,
|
|
125
|
+
done: true
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
var createAggregatedClient = function(commands, Client) {
|
|
130
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
131
|
+
try {
|
|
132
|
+
var _loop = function() {
|
|
133
|
+
var command = _step.value;
|
|
134
|
+
var CommandCtor = commands[command];
|
|
135
|
+
var methodImpl = function() {
|
|
136
|
+
var _ref = _async_to_generator(function(args, optionsOrCb, cb) {
|
|
137
|
+
var command;
|
|
138
|
+
return _ts_generator(this, function(_state) {
|
|
139
|
+
command = new CommandCtor(args);
|
|
140
|
+
if (typeof optionsOrCb === "function") {
|
|
141
|
+
this.send(command, optionsOrCb);
|
|
142
|
+
} else if (typeof cb === "function") {
|
|
143
|
+
if ((typeof optionsOrCb === "undefined" ? "undefined" : _type_of(optionsOrCb)) !== "object") throw new Error("Expected http options but got ".concat(typeof optionsOrCb === "undefined" ? "undefined" : _type_of(optionsOrCb)));
|
|
144
|
+
this.send(command, optionsOrCb || {}, cb);
|
|
145
|
+
} else {
|
|
146
|
+
return [
|
|
147
|
+
2,
|
|
148
|
+
this.send(command, optionsOrCb)
|
|
149
|
+
];
|
|
150
|
+
}
|
|
151
|
+
return [
|
|
152
|
+
2
|
|
153
|
+
];
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
return function methodImpl(args, optionsOrCb, cb) {
|
|
157
|
+
return _ref.apply(this, arguments);
|
|
158
|
+
};
|
|
159
|
+
}();
|
|
160
|
+
var methodName = (command[0].toLowerCase() + command.slice(1)).replace(/Command$/, "");
|
|
161
|
+
Client.prototype[methodName] = methodImpl;
|
|
162
|
+
};
|
|
163
|
+
for(var _iterator = Object.keys(commands)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
|
|
164
|
+
} catch (err) {
|
|
165
|
+
_didIteratorError = true;
|
|
166
|
+
_iteratorError = err;
|
|
167
|
+
} finally{
|
|
168
|
+
try {
|
|
169
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
170
|
+
_iterator.return();
|
|
171
|
+
}
|
|
172
|
+
} finally{
|
|
173
|
+
if (_didIteratorError) {
|
|
174
|
+
throw _iteratorError;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
var version = "3.911.0";
|
|
181
|
+
var packageInfo = {
|
|
182
|
+
version: version};
|
|
183
|
+
|
|
184
|
+
export { createAggregatedClient as c, packageInfo as p };
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { i 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 };
|