@digipair/skill-s3 0.136.0 → 0.136.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/AwsRestJsonProtocol.esm.js +1773 -0
- package/dist/create-aggregated-client.esm.js +366 -0
- package/dist/getSSOTokenFromFile.esm.js +4 -4
- package/dist/index.esm.js +8 -10
- package/dist/index.esm10.js +89 -81
- package/dist/index.esm11.js +1416 -1014
- package/dist/index.esm12.js +790 -3214
- package/dist/index.esm13.js +1600 -896
- package/dist/index.esm2.js +8 -10
- package/dist/index.esm3.js +40820 -47659
- package/dist/index.esm4.js +275 -780
- package/dist/index.esm5.js +4925 -113
- package/dist/index.esm6.js +865 -4383
- package/dist/index.esm7.js +10 -13
- package/dist/index.esm8.js +320 -1273
- package/dist/index.esm9.js +1367 -2081
- package/dist/loadSso.esm.js +1115 -1939
- package/dist/package.esm.js +316 -0
- package/package.json +1 -1
- package/dist/index.esm14.js +0 -7181
- package/dist/noAuth.esm.js +0 -165
- package/dist/parseJsonBody.esm.js +0 -216
- package/dist/src/index.d.ts +0 -2
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/lib/skill-s3.d.ts +0 -6
- package/dist/src/lib/skill-s3.d.ts.map +0 -1
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
2
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
3
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
|
+
return arr2;
|
|
5
|
+
}
|
|
6
|
+
function _array_with_holes(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return arr;
|
|
8
|
+
}
|
|
9
|
+
function _array_without_holes(arr) {
|
|
10
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
11
|
+
}
|
|
12
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
13
|
+
try {
|
|
14
|
+
var info = gen[key](arg);
|
|
15
|
+
var value = info.value;
|
|
16
|
+
} catch (error) {
|
|
17
|
+
reject(error);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (info.done) {
|
|
21
|
+
resolve(value);
|
|
22
|
+
} else {
|
|
23
|
+
Promise.resolve(value).then(_next, _throw);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function _async_to_generator(fn) {
|
|
27
|
+
return function() {
|
|
28
|
+
var self = this, args = arguments;
|
|
29
|
+
return new Promise(function(resolve, reject) {
|
|
30
|
+
var gen = fn.apply(self, args);
|
|
31
|
+
function _next(value) {
|
|
32
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
33
|
+
}
|
|
34
|
+
function _throw(err) {
|
|
35
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
36
|
+
}
|
|
37
|
+
_next(undefined);
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function _define_property(obj, key, value) {
|
|
42
|
+
if (key in obj) {
|
|
43
|
+
Object.defineProperty(obj, key, {
|
|
44
|
+
value: value,
|
|
45
|
+
enumerable: true,
|
|
46
|
+
configurable: true,
|
|
47
|
+
writable: true
|
|
48
|
+
});
|
|
49
|
+
} else {
|
|
50
|
+
obj[key] = value;
|
|
51
|
+
}
|
|
52
|
+
return obj;
|
|
53
|
+
}
|
|
54
|
+
function _iterable_to_array(iter) {
|
|
55
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
56
|
+
}
|
|
57
|
+
function _iterable_to_array_limit(arr, i) {
|
|
58
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
59
|
+
if (_i == null) return;
|
|
60
|
+
var _arr = [];
|
|
61
|
+
var _n = true;
|
|
62
|
+
var _d = false;
|
|
63
|
+
var _s, _e;
|
|
64
|
+
try {
|
|
65
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
66
|
+
_arr.push(_s.value);
|
|
67
|
+
if (i && _arr.length === i) break;
|
|
68
|
+
}
|
|
69
|
+
} catch (err) {
|
|
70
|
+
_d = true;
|
|
71
|
+
_e = err;
|
|
72
|
+
} finally{
|
|
73
|
+
try {
|
|
74
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
75
|
+
} finally{
|
|
76
|
+
if (_d) throw _e;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return _arr;
|
|
80
|
+
}
|
|
81
|
+
function _non_iterable_rest() {
|
|
82
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
83
|
+
}
|
|
84
|
+
function _non_iterable_spread() {
|
|
85
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
86
|
+
}
|
|
87
|
+
function _object_spread(target) {
|
|
88
|
+
for(var i = 1; i < arguments.length; i++){
|
|
89
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
90
|
+
var ownKeys = Object.keys(source);
|
|
91
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
92
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
93
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
94
|
+
}));
|
|
95
|
+
}
|
|
96
|
+
ownKeys.forEach(function(key) {
|
|
97
|
+
_define_property(target, key, source[key]);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
return target;
|
|
101
|
+
}
|
|
102
|
+
function ownKeys(object, enumerableOnly) {
|
|
103
|
+
var keys = Object.keys(object);
|
|
104
|
+
if (Object.getOwnPropertySymbols) {
|
|
105
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
106
|
+
keys.push.apply(keys, symbols);
|
|
107
|
+
}
|
|
108
|
+
return keys;
|
|
109
|
+
}
|
|
110
|
+
function _object_spread_props(target, source) {
|
|
111
|
+
source = source != null ? source : {};
|
|
112
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
113
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
114
|
+
} else {
|
|
115
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
116
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
return target;
|
|
120
|
+
}
|
|
121
|
+
function _sliced_to_array(arr, i) {
|
|
122
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
123
|
+
}
|
|
124
|
+
function _to_consumable_array(arr) {
|
|
125
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
126
|
+
}
|
|
127
|
+
function _type_of(obj) {
|
|
128
|
+
"@swc/helpers - typeof";
|
|
129
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
130
|
+
}
|
|
131
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
132
|
+
if (!o) return;
|
|
133
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
134
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
135
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
136
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
137
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
138
|
+
}
|
|
139
|
+
function _ts_generator(thisArg, body) {
|
|
140
|
+
var f, y, t, g, _ = {
|
|
141
|
+
label: 0,
|
|
142
|
+
sent: function() {
|
|
143
|
+
if (t[0] & 1) throw t[1];
|
|
144
|
+
return t[1];
|
|
145
|
+
},
|
|
146
|
+
trys: [],
|
|
147
|
+
ops: []
|
|
148
|
+
};
|
|
149
|
+
return g = {
|
|
150
|
+
next: verb(0),
|
|
151
|
+
"throw": verb(1),
|
|
152
|
+
"return": verb(2)
|
|
153
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
154
|
+
return this;
|
|
155
|
+
}), g;
|
|
156
|
+
function verb(n) {
|
|
157
|
+
return function(v) {
|
|
158
|
+
return step([
|
|
159
|
+
n,
|
|
160
|
+
v
|
|
161
|
+
]);
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
function step(op) {
|
|
165
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
166
|
+
while(_)try {
|
|
167
|
+
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;
|
|
168
|
+
if (y = 0, t) op = [
|
|
169
|
+
op[0] & 2,
|
|
170
|
+
t.value
|
|
171
|
+
];
|
|
172
|
+
switch(op[0]){
|
|
173
|
+
case 0:
|
|
174
|
+
case 1:
|
|
175
|
+
t = op;
|
|
176
|
+
break;
|
|
177
|
+
case 4:
|
|
178
|
+
_.label++;
|
|
179
|
+
return {
|
|
180
|
+
value: op[1],
|
|
181
|
+
done: false
|
|
182
|
+
};
|
|
183
|
+
case 5:
|
|
184
|
+
_.label++;
|
|
185
|
+
y = op[1];
|
|
186
|
+
op = [
|
|
187
|
+
0
|
|
188
|
+
];
|
|
189
|
+
continue;
|
|
190
|
+
case 7:
|
|
191
|
+
op = _.ops.pop();
|
|
192
|
+
_.trys.pop();
|
|
193
|
+
continue;
|
|
194
|
+
default:
|
|
195
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
196
|
+
_ = 0;
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
200
|
+
_.label = op[1];
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
204
|
+
_.label = t[1];
|
|
205
|
+
t = op;
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
if (t && _.label < t[2]) {
|
|
209
|
+
_.label = t[2];
|
|
210
|
+
_.ops.push(op);
|
|
211
|
+
break;
|
|
212
|
+
}
|
|
213
|
+
if (t[2]) _.ops.pop();
|
|
214
|
+
_.trys.pop();
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
op = body.call(thisArg, _);
|
|
218
|
+
} catch (e) {
|
|
219
|
+
op = [
|
|
220
|
+
6,
|
|
221
|
+
e
|
|
222
|
+
];
|
|
223
|
+
y = 0;
|
|
224
|
+
} finally{
|
|
225
|
+
f = t = 0;
|
|
226
|
+
}
|
|
227
|
+
if (op[0] & 5) throw op[1];
|
|
228
|
+
return {
|
|
229
|
+
value: op[0] ? op[1] : void 0,
|
|
230
|
+
done: true
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
var createAggregatedClient = function(commands, Client, options) {
|
|
235
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
236
|
+
try {
|
|
237
|
+
var _loop = function() {
|
|
238
|
+
var _step_value = _sliced_to_array(_step.value, 2), command = _step_value[0], CommandCtor = _step_value[1];
|
|
239
|
+
var methodImpl = function() {
|
|
240
|
+
var _ref = _async_to_generator(function(args, optionsOrCb, cb) {
|
|
241
|
+
var command;
|
|
242
|
+
return _ts_generator(this, function(_state) {
|
|
243
|
+
command = new CommandCtor(args);
|
|
244
|
+
if (typeof optionsOrCb === "function") {
|
|
245
|
+
this.send(command, optionsOrCb);
|
|
246
|
+
} else if (typeof cb === "function") {
|
|
247
|
+
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)));
|
|
248
|
+
this.send(command, optionsOrCb || {}, cb);
|
|
249
|
+
} else {
|
|
250
|
+
return [
|
|
251
|
+
2,
|
|
252
|
+
this.send(command, optionsOrCb)
|
|
253
|
+
];
|
|
254
|
+
}
|
|
255
|
+
return [
|
|
256
|
+
2
|
|
257
|
+
];
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
return function methodImpl(args, optionsOrCb, cb) {
|
|
261
|
+
return _ref.apply(this, arguments);
|
|
262
|
+
};
|
|
263
|
+
}();
|
|
264
|
+
var methodName = (command[0].toLowerCase() + command.slice(1)).replace(/Command$/, "");
|
|
265
|
+
Client.prototype[methodName] = methodImpl;
|
|
266
|
+
};
|
|
267
|
+
for(var _iterator = Object.entries(commands)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
|
|
268
|
+
} catch (err) {
|
|
269
|
+
_didIteratorError = true;
|
|
270
|
+
_iteratorError = err;
|
|
271
|
+
} finally{
|
|
272
|
+
try {
|
|
273
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
274
|
+
_iterator.return();
|
|
275
|
+
}
|
|
276
|
+
} finally{
|
|
277
|
+
if (_didIteratorError) {
|
|
278
|
+
throw _iteratorError;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
var _ref = {}, _ref_paginators = _ref.paginators, paginators = _ref_paginators === void 0 ? {} : _ref_paginators, _ref_waiters = _ref.waiters, waiters = _ref_waiters === void 0 ? {} : _ref_waiters;
|
|
283
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
284
|
+
try {
|
|
285
|
+
var _loop1 = function() {
|
|
286
|
+
var _step_value = _sliced_to_array(_step1.value, 2), paginatorName = _step_value[0], paginatorFn = _step_value[1];
|
|
287
|
+
if (Client.prototype[paginatorName] === void 0) {
|
|
288
|
+
Client.prototype[paginatorName] = function createAggregatedClient() {
|
|
289
|
+
var commandInput = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, paginationConfiguration = arguments.length > 1 ? arguments[1] : void 0;
|
|
290
|
+
for(var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
|
|
291
|
+
rest[_key - 2] = arguments[_key];
|
|
292
|
+
}
|
|
293
|
+
return paginatorFn.apply(void 0, [
|
|
294
|
+
_object_spread_props(_object_spread({}, paginationConfiguration), {
|
|
295
|
+
client: this
|
|
296
|
+
}),
|
|
297
|
+
commandInput
|
|
298
|
+
].concat(_to_consumable_array(rest)));
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
for(var _iterator1 = Object.entries(paginators)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true)_loop1();
|
|
303
|
+
} catch (err) {
|
|
304
|
+
_didIteratorError1 = true;
|
|
305
|
+
_iteratorError1 = err;
|
|
306
|
+
} finally{
|
|
307
|
+
try {
|
|
308
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
309
|
+
_iterator1.return();
|
|
310
|
+
}
|
|
311
|
+
} finally{
|
|
312
|
+
if (_didIteratorError1) {
|
|
313
|
+
throw _iteratorError1;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = undefined;
|
|
318
|
+
try {
|
|
319
|
+
var _loop2 = function() {
|
|
320
|
+
var _step_value = _sliced_to_array(_step2.value, 2), waiterName = _step_value[0], waiterFn = _step_value[1];
|
|
321
|
+
if (Client.prototype[waiterName] === void 0) {
|
|
322
|
+
Client.prototype[waiterName] = /*#__PURE__*/ _async_to_generator(function() {
|
|
323
|
+
var commandInput, waiterConfiguration, _len, rest, _key, config;
|
|
324
|
+
var _arguments = arguments;
|
|
325
|
+
return _ts_generator(this, function(_state) {
|
|
326
|
+
commandInput = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : {}, waiterConfiguration = _arguments.length > 1 ? _arguments[1] : void 0;
|
|
327
|
+
for(_len = _arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
|
|
328
|
+
rest[_key - 2] = _arguments[_key];
|
|
329
|
+
}
|
|
330
|
+
config = waiterConfiguration;
|
|
331
|
+
if (typeof waiterConfiguration === "number") {
|
|
332
|
+
config = {
|
|
333
|
+
maxWaitTime: waiterConfiguration
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
return [
|
|
337
|
+
2,
|
|
338
|
+
waiterFn.apply(void 0, [
|
|
339
|
+
_object_spread_props(_object_spread({}, config), {
|
|
340
|
+
client: this
|
|
341
|
+
}),
|
|
342
|
+
commandInput
|
|
343
|
+
].concat(_to_consumable_array(rest)))
|
|
344
|
+
];
|
|
345
|
+
});
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
for(var _iterator2 = Object.entries(waiters)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true)_loop2();
|
|
350
|
+
} catch (err) {
|
|
351
|
+
_didIteratorError2 = true;
|
|
352
|
+
_iteratorError2 = err;
|
|
353
|
+
} finally{
|
|
354
|
+
try {
|
|
355
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
|
|
356
|
+
_iterator2.return();
|
|
357
|
+
}
|
|
358
|
+
} finally{
|
|
359
|
+
if (_didIteratorError2) {
|
|
360
|
+
throw _iteratorError2;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
export { createAggregatedClient as c };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { readFile } from 'fs/promises';
|
|
2
|
-
import { createHash } from 'crypto';
|
|
3
|
-
import { join } from 'path';
|
|
4
|
-
import {
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { createHash } from 'node:crypto';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { h as getHomeDir } from './index.esm3.js';
|
|
5
5
|
|
|
6
6
|
var getSSOTokenFilepath = function(id) {
|
|
7
7
|
var hasher = createHash("sha1");
|
package/dist/index.esm.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
export {
|
|
2
|
-
import '
|
|
3
|
-
import 'path';
|
|
4
|
-
import 'os';
|
|
1
|
+
export { b9 as download, ba as list, bb as remove, bc as upload } from './index.esm3.js';
|
|
2
|
+
import 'node:crypto';
|
|
3
|
+
import 'node:path';
|
|
4
|
+
import 'node:os';
|
|
5
5
|
import 'node:fs/promises';
|
|
6
|
-
import 'stream';
|
|
7
|
-
import 'crypto';
|
|
8
6
|
import 'node:stream';
|
|
9
|
-
import '
|
|
10
|
-
import '
|
|
11
|
-
import 'process';
|
|
7
|
+
import 'node:process';
|
|
8
|
+
import 'buffer';
|
|
12
9
|
import 'node:fs';
|
|
13
|
-
import '
|
|
10
|
+
import 'node:https';
|
|
11
|
+
import 'node:zlib';
|
package/dist/index.esm10.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import '
|
|
6
|
-
import 'os';
|
|
1
|
+
import node_http from 'node:http';
|
|
2
|
+
import { aX as ProviderError, C as CredentialsProviderError, ae as parseUrl, ak as loadConfig } from './index.esm3.js';
|
|
3
|
+
import 'node:crypto';
|
|
4
|
+
import 'node:path';
|
|
5
|
+
import 'node:os';
|
|
7
6
|
import 'node:fs/promises';
|
|
8
|
-
import 'stream';
|
|
9
|
-
import 'crypto';
|
|
10
7
|
import 'node:stream';
|
|
11
|
-
import '
|
|
12
|
-
import '
|
|
8
|
+
import 'node:process';
|
|
9
|
+
import 'buffer';
|
|
13
10
|
import 'node:fs';
|
|
14
|
-
import '
|
|
11
|
+
import 'node:https';
|
|
12
|
+
import 'node:zlib';
|
|
15
13
|
|
|
16
14
|
function _define_property$5(obj, key, value) {
|
|
17
15
|
if (key in obj) {
|
|
@@ -41,6 +39,62 @@ function _object_spread$4(target) {
|
|
|
41
39
|
}
|
|
42
40
|
return target;
|
|
43
41
|
}
|
|
42
|
+
function _type_of$1(obj) {
|
|
43
|
+
"@swc/helpers - typeof";
|
|
44
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
45
|
+
}
|
|
46
|
+
var isImdsCredentials = function(arg) {
|
|
47
|
+
return Boolean(arg) && (typeof arg === "undefined" ? "undefined" : _type_of$1(arg)) === "object" && typeof arg.AccessKeyId === "string" && typeof arg.SecretAccessKey === "string" && typeof arg.Token === "string" && typeof arg.Expiration === "string";
|
|
48
|
+
};
|
|
49
|
+
var fromImdsCredentials = function(creds) {
|
|
50
|
+
return _object_spread$4({
|
|
51
|
+
accessKeyId: creds.AccessKeyId,
|
|
52
|
+
secretAccessKey: creds.SecretAccessKey,
|
|
53
|
+
sessionToken: creds.Token,
|
|
54
|
+
expiration: new Date(creds.Expiration)
|
|
55
|
+
}, creds.AccountId && {
|
|
56
|
+
accountId: creds.AccountId
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
var DEFAULT_TIMEOUT = 1000;
|
|
61
|
+
var DEFAULT_MAX_RETRIES = 0;
|
|
62
|
+
var providerConfigFromInit = function(param) {
|
|
63
|
+
var _param_maxRetries = param.maxRetries, maxRetries = _param_maxRetries === void 0 ? DEFAULT_MAX_RETRIES : _param_maxRetries, _param_timeout = param.timeout, timeout = _param_timeout === void 0 ? DEFAULT_TIMEOUT : _param_timeout;
|
|
64
|
+
return {
|
|
65
|
+
maxRetries: maxRetries,
|
|
66
|
+
timeout: timeout
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
function _define_property$4(obj, key, value) {
|
|
71
|
+
if (key in obj) {
|
|
72
|
+
Object.defineProperty(obj, key, {
|
|
73
|
+
value: value,
|
|
74
|
+
enumerable: true,
|
|
75
|
+
configurable: true,
|
|
76
|
+
writable: true
|
|
77
|
+
});
|
|
78
|
+
} else {
|
|
79
|
+
obj[key] = value;
|
|
80
|
+
}
|
|
81
|
+
return obj;
|
|
82
|
+
}
|
|
83
|
+
function _object_spread$3(target) {
|
|
84
|
+
for(var i = 1; i < arguments.length; i++){
|
|
85
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
86
|
+
var ownKeys = Object.keys(source);
|
|
87
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
88
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
89
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
92
|
+
ownKeys.forEach(function(key) {
|
|
93
|
+
_define_property$4(target, key, source[key]);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
return target;
|
|
97
|
+
}
|
|
44
98
|
function ownKeys$3(object, enumerableOnly) {
|
|
45
99
|
var keys = Object.keys(object);
|
|
46
100
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -63,7 +117,7 @@ function _object_spread_props$3(target, source) {
|
|
|
63
117
|
function httpRequest(options) {
|
|
64
118
|
return new Promise(function(resolve, reject) {
|
|
65
119
|
var _options_hostname;
|
|
66
|
-
var req = request(_object_spread_props$3(_object_spread$
|
|
120
|
+
var req = node_http.request(_object_spread_props$3(_object_spread$3({
|
|
67
121
|
method: "GET"
|
|
68
122
|
}, options), {
|
|
69
123
|
hostname: (_options_hostname = options.hostname) === null || _options_hostname === void 0 ? void 0 : _options_hostname.replace(/^\[(.+)\]$/, "$1")
|
|
@@ -97,62 +151,6 @@ function httpRequest(options) {
|
|
|
97
151
|
});
|
|
98
152
|
}
|
|
99
153
|
|
|
100
|
-
function _define_property$4(obj, key, value) {
|
|
101
|
-
if (key in obj) {
|
|
102
|
-
Object.defineProperty(obj, key, {
|
|
103
|
-
value: value,
|
|
104
|
-
enumerable: true,
|
|
105
|
-
configurable: true,
|
|
106
|
-
writable: true
|
|
107
|
-
});
|
|
108
|
-
} else {
|
|
109
|
-
obj[key] = value;
|
|
110
|
-
}
|
|
111
|
-
return obj;
|
|
112
|
-
}
|
|
113
|
-
function _object_spread$3(target) {
|
|
114
|
-
for(var i = 1; i < arguments.length; i++){
|
|
115
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
116
|
-
var ownKeys = Object.keys(source);
|
|
117
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
118
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
119
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
120
|
-
}));
|
|
121
|
-
}
|
|
122
|
-
ownKeys.forEach(function(key) {
|
|
123
|
-
_define_property$4(target, key, source[key]);
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
return target;
|
|
127
|
-
}
|
|
128
|
-
function _type_of$1(obj) {
|
|
129
|
-
"@swc/helpers - typeof";
|
|
130
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
131
|
-
}
|
|
132
|
-
var isImdsCredentials = function(arg) {
|
|
133
|
-
return Boolean(arg) && (typeof arg === "undefined" ? "undefined" : _type_of$1(arg)) === "object" && typeof arg.AccessKeyId === "string" && typeof arg.SecretAccessKey === "string" && typeof arg.Token === "string" && typeof arg.Expiration === "string";
|
|
134
|
-
};
|
|
135
|
-
var fromImdsCredentials = function(creds) {
|
|
136
|
-
return _object_spread$3({
|
|
137
|
-
accessKeyId: creds.AccessKeyId,
|
|
138
|
-
secretAccessKey: creds.SecretAccessKey,
|
|
139
|
-
sessionToken: creds.Token,
|
|
140
|
-
expiration: new Date(creds.Expiration)
|
|
141
|
-
}, creds.AccountId && {
|
|
142
|
-
accountId: creds.AccountId
|
|
143
|
-
});
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
var DEFAULT_TIMEOUT = 1000;
|
|
147
|
-
var DEFAULT_MAX_RETRIES = 0;
|
|
148
|
-
var providerConfigFromInit = function(param) {
|
|
149
|
-
var _param_maxRetries = param.maxRetries, maxRetries = _param_maxRetries === void 0 ? DEFAULT_MAX_RETRIES : _param_maxRetries, _param_timeout = param.timeout, timeout = _param_timeout === void 0 ? DEFAULT_TIMEOUT : _param_timeout;
|
|
150
|
-
return {
|
|
151
|
-
maxRetries: maxRetries,
|
|
152
|
-
timeout: timeout
|
|
153
|
-
};
|
|
154
|
-
};
|
|
155
|
-
|
|
156
154
|
var retry = function(toRetry, maxRetries) {
|
|
157
155
|
var promise = toRetry();
|
|
158
156
|
for(var i = 0; i < maxRetries; i++){
|
|
@@ -406,14 +404,14 @@ var requestFromEcsImds = function() {
|
|
|
406
404
|
};
|
|
407
405
|
}();
|
|
408
406
|
var CMDS_IP = "169.254.170.2";
|
|
409
|
-
var GREENGRASS_HOSTS =
|
|
410
|
-
localhost
|
|
411
|
-
"127.0.0.1"
|
|
412
|
-
|
|
413
|
-
var GREENGRASS_PROTOCOLS =
|
|
414
|
-
"http:"
|
|
415
|
-
"https:"
|
|
416
|
-
|
|
407
|
+
var GREENGRASS_HOSTS = new Set([
|
|
408
|
+
"localhost",
|
|
409
|
+
"127.0.0.1"
|
|
410
|
+
]);
|
|
411
|
+
var GREENGRASS_PROTOCOLS = new Set([
|
|
412
|
+
"http:",
|
|
413
|
+
"https:"
|
|
414
|
+
]);
|
|
417
415
|
var getCmdsUri = function() {
|
|
418
416
|
var _ref = _async_to_generator$3(function(param) {
|
|
419
417
|
var logger, parsed;
|
|
@@ -429,14 +427,21 @@ var getCmdsUri = function() {
|
|
|
429
427
|
];
|
|
430
428
|
}
|
|
431
429
|
if (process.env[ENV_CMDS_FULL_URI]) {
|
|
432
|
-
|
|
433
|
-
|
|
430
|
+
try {
|
|
431
|
+
parsed = new URL(process.env[ENV_CMDS_FULL_URI]);
|
|
432
|
+
} catch (e) {
|
|
433
|
+
throw new CredentialsProviderError("".concat(process.env[ENV_CMDS_FULL_URI], " is not a valid container metadata service URL"), {
|
|
434
|
+
tryNextLink: false,
|
|
435
|
+
logger: logger
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
if (!parsed.hostname || !GREENGRASS_HOSTS.has(parsed.hostname)) {
|
|
434
439
|
throw new CredentialsProviderError("".concat(parsed.hostname, " is not a valid container metadata service hostname"), {
|
|
435
440
|
tryNextLink: false,
|
|
436
441
|
logger: logger
|
|
437
442
|
});
|
|
438
443
|
}
|
|
439
|
-
if (!parsed.protocol || !(parsed.protocol
|
|
444
|
+
if (!parsed.protocol || !GREENGRASS_PROTOCOLS.has(parsed.protocol)) {
|
|
440
445
|
throw new CredentialsProviderError("".concat(parsed.protocol, " is not a valid container metadata service protocol"), {
|
|
441
446
|
tryNextLink: false,
|
|
442
447
|
logger: logger
|
|
@@ -444,9 +449,12 @@ var getCmdsUri = function() {
|
|
|
444
449
|
}
|
|
445
450
|
return [
|
|
446
451
|
2,
|
|
447
|
-
|
|
452
|
+
{
|
|
453
|
+
protocol: parsed.protocol,
|
|
454
|
+
hostname: parsed.hostname,
|
|
455
|
+
path: parsed.pathname + parsed.search,
|
|
448
456
|
port: parsed.port ? parseInt(parsed.port, 10) : undefined
|
|
449
|
-
}
|
|
457
|
+
}
|
|
450
458
|
];
|
|
451
459
|
}
|
|
452
460
|
throw new CredentialsProviderError("The container metadata credential provider cannot be used unless" + " the ".concat(ENV_CMDS_RELATIVE_URI, " or ").concat(ENV_CMDS_FULL_URI, " environment") + " variable is set", {
|