@jjrawlins/cdk-iam-policy-builder-helper 0.0.0 → 0.0.1
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/.jsii +373 -22
- package/README.md +1 -1
- package/{layerborncdkiampolicybuilderhelper → jjrawlinscdkiampolicybuilderhelper}/go.mod +1 -1
- package/{layerborncdkiampolicybuilderhelper → jjrawlinscdkiampolicybuilderhelper}/jsii/jsii.go +2 -2
- package/jjrawlinscdkiampolicybuilderhelper/version +1 -0
- package/lib/bin/create-actions-json.js +1 -1
- package/lib/bin/download-actions-json.js +1 -1
- package/lib/bin/download-managed-policies-json.js +1 -1
- package/lib/constructs/Actions.d.ts +1151 -0
- package/lib/constructs/Actions.js +1165 -14
- package/methods_list.txt +1118 -1
- package/node_modules/axios/CHANGELOG.md +880 -774
- package/node_modules/axios/README.md +60 -15
- package/node_modules/axios/dist/axios.js +1108 -294
- package/node_modules/axios/dist/axios.js.map +1 -1
- package/node_modules/axios/dist/axios.min.js +1 -1
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +764 -308
- package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
- package/node_modules/axios/dist/esm/axios.js +764 -308
- package/node_modules/axios/dist/esm/axios.js.map +1 -1
- package/node_modules/axios/dist/esm/axios.min.js +1 -1
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +777 -388
- package/node_modules/axios/dist/node/axios.cjs.map +1 -1
- package/node_modules/axios/index.d.cts +5 -2
- package/node_modules/axios/index.d.ts +5 -2
- package/node_modules/axios/lib/adapters/adapters.js +3 -1
- package/node_modules/axios/lib/adapters/fetch.js +229 -0
- package/node_modules/axios/lib/adapters/http.js +26 -16
- package/node_modules/axios/lib/adapters/xhr.js +36 -99
- package/node_modules/axios/lib/core/Axios.js +9 -6
- package/node_modules/axios/lib/core/AxiosHeaders.js +4 -0
- package/node_modules/axios/lib/defaults/index.js +7 -2
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/AxiosTransformStream.js +3 -51
- package/node_modules/axios/lib/helpers/composeSignals.js +46 -0
- package/node_modules/axios/lib/helpers/progressEventReducer.js +44 -0
- package/node_modules/axios/lib/helpers/resolveConfig.js +57 -0
- package/node_modules/axios/lib/helpers/throttle.js +30 -19
- package/node_modules/axios/lib/helpers/trackStream.js +67 -0
- package/node_modules/axios/lib/platform/common/utils.js +4 -1
- package/node_modules/axios/lib/utils.js +40 -3
- package/node_modules/axios/package.json +4 -3
- package/package.json +24 -20
- package/layerborncdkiampolicybuilderhelper/version +0 -1
- package/node_modules/@aws-sdk/util-utf8-browser/dist-cjs/index.js +0 -9
- package/node_modules/@aws-sdk/util-utf8-browser/dist-cjs/pureJs.js +0 -47
- package/node_modules/@aws-sdk/util-utf8-browser/dist-cjs/whatwgEncodingApi.js +0 -11
- package/node_modules/@aws-sdk/util-utf8-browser/dist-es/index.js +0 -4
- package/node_modules/@aws-sdk/util-utf8-browser/dist-es/pureJs.js +0 -42
- package/node_modules/@aws-sdk/util-utf8-browser/dist-es/whatwgEncodingApi.js +0 -6
- package/node_modules/@aws-sdk/util-utf8-browser/dist-types/index.d.ts +0 -2
- package/node_modules/@aws-sdk/util-utf8-browser/dist-types/pureJs.d.ts +0 -17
- package/node_modules/@aws-sdk/util-utf8-browser/dist-types/ts3.4/index.d.ts +0 -2
- package/node_modules/@aws-sdk/util-utf8-browser/dist-types/ts3.4/pureJs.d.ts +0 -2
- package/node_modules/@aws-sdk/util-utf8-browser/dist-types/ts3.4/whatwgEncodingApi.d.ts +0 -2
- package/node_modules/@aws-sdk/util-utf8-browser/dist-types/whatwgEncodingApi.d.ts +0 -2
- package/node_modules/combined-stream/yarn.lock +0 -17
- /package/{layerborncdkiampolicybuilderhelper → jjrawlinscdkiampolicybuilderhelper}/LICENSE +0 -0
- /package/{layerborncdkiampolicybuilderhelper → jjrawlinscdkiampolicybuilderhelper}/README.md +0 -0
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import stream from 'stream';
|
|
4
4
|
import utils from '../utils.js';
|
|
5
|
-
import throttle from './throttle.js';
|
|
6
|
-
import speedometer from './speedometer.js';
|
|
7
5
|
|
|
8
6
|
const kInternals = Symbol('internals');
|
|
9
7
|
|
|
@@ -24,12 +22,8 @@ class AxiosTransformStream extends stream.Transform{
|
|
|
24
22
|
readableHighWaterMark: options.chunkSize
|
|
25
23
|
});
|
|
26
24
|
|
|
27
|
-
const self = this;
|
|
28
|
-
|
|
29
25
|
const internals = this[kInternals] = {
|
|
30
|
-
length: options.length,
|
|
31
26
|
timeWindow: options.timeWindow,
|
|
32
|
-
ticksRate: options.ticksRate,
|
|
33
27
|
chunkSize: options.chunkSize,
|
|
34
28
|
maxRate: options.maxRate,
|
|
35
29
|
minChunkSize: options.minChunkSize,
|
|
@@ -41,8 +35,6 @@ class AxiosTransformStream extends stream.Transform{
|
|
|
41
35
|
onReadCallback: null
|
|
42
36
|
};
|
|
43
37
|
|
|
44
|
-
const _speedometer = speedometer(internals.ticksRate * options.samplesCount, internals.timeWindow);
|
|
45
|
-
|
|
46
38
|
this.on('newListener', event => {
|
|
47
39
|
if (event === 'progress') {
|
|
48
40
|
if (!internals.isCaptured) {
|
|
@@ -50,38 +42,6 @@ class AxiosTransformStream extends stream.Transform{
|
|
|
50
42
|
}
|
|
51
43
|
}
|
|
52
44
|
});
|
|
53
|
-
|
|
54
|
-
let bytesNotified = 0;
|
|
55
|
-
|
|
56
|
-
internals.updateProgress = throttle(function throttledHandler() {
|
|
57
|
-
const totalBytes = internals.length;
|
|
58
|
-
const bytesTransferred = internals.bytesSeen;
|
|
59
|
-
const progressBytes = bytesTransferred - bytesNotified;
|
|
60
|
-
if (!progressBytes || self.destroyed) return;
|
|
61
|
-
|
|
62
|
-
const rate = _speedometer(progressBytes);
|
|
63
|
-
|
|
64
|
-
bytesNotified = bytesTransferred;
|
|
65
|
-
|
|
66
|
-
process.nextTick(() => {
|
|
67
|
-
self.emit('progress', {
|
|
68
|
-
'loaded': bytesTransferred,
|
|
69
|
-
'total': totalBytes,
|
|
70
|
-
'progress': totalBytes ? (bytesTransferred / totalBytes) : undefined,
|
|
71
|
-
'bytes': progressBytes,
|
|
72
|
-
'rate': rate ? rate : undefined,
|
|
73
|
-
'estimated': rate && totalBytes && bytesTransferred <= totalBytes ?
|
|
74
|
-
(totalBytes - bytesTransferred) / rate : undefined
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
}, internals.ticksRate);
|
|
78
|
-
|
|
79
|
-
const onFinish = () => {
|
|
80
|
-
internals.updateProgress(true);
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
this.once('end', onFinish);
|
|
84
|
-
this.once('error', onFinish);
|
|
85
45
|
}
|
|
86
46
|
|
|
87
47
|
_read(size) {
|
|
@@ -95,7 +55,6 @@ class AxiosTransformStream extends stream.Transform{
|
|
|
95
55
|
}
|
|
96
56
|
|
|
97
57
|
_transform(chunk, encoding, callback) {
|
|
98
|
-
const self = this;
|
|
99
58
|
const internals = this[kInternals];
|
|
100
59
|
const maxRate = internals.maxRate;
|
|
101
60
|
|
|
@@ -107,16 +66,14 @@ class AxiosTransformStream extends stream.Transform{
|
|
|
107
66
|
const bytesThreshold = (maxRate / divider);
|
|
108
67
|
const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
|
|
109
68
|
|
|
110
|
-
|
|
69
|
+
const pushChunk = (_chunk, _callback) => {
|
|
111
70
|
const bytes = Buffer.byteLength(_chunk);
|
|
112
71
|
internals.bytesSeen += bytes;
|
|
113
72
|
internals.bytes += bytes;
|
|
114
73
|
|
|
115
|
-
|
|
116
|
-
internals.updateProgress();
|
|
117
|
-
}
|
|
74
|
+
internals.isCaptured && this.emit('progress', internals.bytesSeen);
|
|
118
75
|
|
|
119
|
-
if (
|
|
76
|
+
if (this.push(_chunk)) {
|
|
120
77
|
process.nextTick(_callback);
|
|
121
78
|
} else {
|
|
122
79
|
internals.onReadCallback = () => {
|
|
@@ -181,11 +138,6 @@ class AxiosTransformStream extends stream.Transform{
|
|
|
181
138
|
}
|
|
182
139
|
});
|
|
183
140
|
}
|
|
184
|
-
|
|
185
|
-
setLength(length) {
|
|
186
|
-
this[kInternals].length = +length;
|
|
187
|
-
return this;
|
|
188
|
-
}
|
|
189
141
|
}
|
|
190
142
|
|
|
191
143
|
export default AxiosTransformStream;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import CanceledError from "../cancel/CanceledError.js";
|
|
2
|
+
import AxiosError from "../core/AxiosError.js";
|
|
3
|
+
|
|
4
|
+
const composeSignals = (signals, timeout) => {
|
|
5
|
+
let controller = new AbortController();
|
|
6
|
+
|
|
7
|
+
let aborted;
|
|
8
|
+
|
|
9
|
+
const onabort = function (cancel) {
|
|
10
|
+
if (!aborted) {
|
|
11
|
+
aborted = true;
|
|
12
|
+
unsubscribe();
|
|
13
|
+
const err = cancel instanceof Error ? cancel : this.reason;
|
|
14
|
+
controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let timer = timeout && setTimeout(() => {
|
|
19
|
+
onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT))
|
|
20
|
+
}, timeout)
|
|
21
|
+
|
|
22
|
+
const unsubscribe = () => {
|
|
23
|
+
if (signals) {
|
|
24
|
+
timer && clearTimeout(timer);
|
|
25
|
+
timer = null;
|
|
26
|
+
signals.forEach(signal => {
|
|
27
|
+
signal &&
|
|
28
|
+
(signal.removeEventListener ? signal.removeEventListener('abort', onabort) : signal.unsubscribe(onabort));
|
|
29
|
+
});
|
|
30
|
+
signals = null;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
signals.forEach((signal) => signal && signal.addEventListener && signal.addEventListener('abort', onabort));
|
|
35
|
+
|
|
36
|
+
const {signal} = controller;
|
|
37
|
+
|
|
38
|
+
signal.unsubscribe = unsubscribe;
|
|
39
|
+
|
|
40
|
+
return [signal, () => {
|
|
41
|
+
timer && clearTimeout(timer);
|
|
42
|
+
timer = null;
|
|
43
|
+
}];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export default composeSignals;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import speedometer from "./speedometer.js";
|
|
2
|
+
import throttle from "./throttle.js";
|
|
3
|
+
import utils from "../utils.js";
|
|
4
|
+
|
|
5
|
+
export const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
6
|
+
let bytesNotified = 0;
|
|
7
|
+
const _speedometer = speedometer(50, 250);
|
|
8
|
+
|
|
9
|
+
return throttle(e => {
|
|
10
|
+
const loaded = e.loaded;
|
|
11
|
+
const total = e.lengthComputable ? e.total : undefined;
|
|
12
|
+
const progressBytes = loaded - bytesNotified;
|
|
13
|
+
const rate = _speedometer(progressBytes);
|
|
14
|
+
const inRange = loaded <= total;
|
|
15
|
+
|
|
16
|
+
bytesNotified = loaded;
|
|
17
|
+
|
|
18
|
+
const data = {
|
|
19
|
+
loaded,
|
|
20
|
+
total,
|
|
21
|
+
progress: total ? (loaded / total) : undefined,
|
|
22
|
+
bytes: progressBytes,
|
|
23
|
+
rate: rate ? rate : undefined,
|
|
24
|
+
estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
|
|
25
|
+
event: e,
|
|
26
|
+
lengthComputable: total != null,
|
|
27
|
+
[isDownloadStream ? 'download' : 'upload']: true
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
listener(data);
|
|
31
|
+
}, freq);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const progressEventDecorator = (total, throttled) => {
|
|
35
|
+
const lengthComputable = total != null;
|
|
36
|
+
|
|
37
|
+
return [(loaded) => throttled[0]({
|
|
38
|
+
lengthComputable,
|
|
39
|
+
total,
|
|
40
|
+
loaded
|
|
41
|
+
}), throttled[1]];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args));
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import platform from "../platform/index.js";
|
|
2
|
+
import utils from "../utils.js";
|
|
3
|
+
import isURLSameOrigin from "./isURLSameOrigin.js";
|
|
4
|
+
import cookies from "./cookies.js";
|
|
5
|
+
import buildFullPath from "../core/buildFullPath.js";
|
|
6
|
+
import mergeConfig from "../core/mergeConfig.js";
|
|
7
|
+
import AxiosHeaders from "../core/AxiosHeaders.js";
|
|
8
|
+
import buildURL from "./buildURL.js";
|
|
9
|
+
|
|
10
|
+
export default (config) => {
|
|
11
|
+
const newConfig = mergeConfig({}, config);
|
|
12
|
+
|
|
13
|
+
let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;
|
|
14
|
+
|
|
15
|
+
newConfig.headers = headers = AxiosHeaders.from(headers);
|
|
16
|
+
|
|
17
|
+
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
|
|
18
|
+
|
|
19
|
+
// HTTP basic authentication
|
|
20
|
+
if (auth) {
|
|
21
|
+
headers.set('Authorization', 'Basic ' +
|
|
22
|
+
btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
let contentType;
|
|
27
|
+
|
|
28
|
+
if (utils.isFormData(data)) {
|
|
29
|
+
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
|
30
|
+
headers.setContentType(undefined); // Let the browser set it
|
|
31
|
+
} else if ((contentType = headers.getContentType()) !== false) {
|
|
32
|
+
// fix semicolon duplication issue for ReactNative FormData implementation
|
|
33
|
+
const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
|
|
34
|
+
headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Add xsrf header
|
|
39
|
+
// This is only done if running in a standard browser environment.
|
|
40
|
+
// Specifically not if we're in a web worker, or react-native.
|
|
41
|
+
|
|
42
|
+
if (platform.hasStandardBrowserEnv) {
|
|
43
|
+
withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
|
|
44
|
+
|
|
45
|
+
if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {
|
|
46
|
+
// Add xsrf header
|
|
47
|
+
const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
|
|
48
|
+
|
|
49
|
+
if (xsrfValue) {
|
|
50
|
+
headers.set(xsrfHeaderName, xsrfValue);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return newConfig;
|
|
56
|
+
}
|
|
57
|
+
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* Throttle decorator
|
|
5
3
|
* @param {Function} fn
|
|
@@ -8,26 +6,39 @@
|
|
|
8
6
|
*/
|
|
9
7
|
function throttle(fn, freq) {
|
|
10
8
|
let timestamp = 0;
|
|
11
|
-
|
|
12
|
-
let
|
|
13
|
-
|
|
9
|
+
let threshold = 1000 / freq;
|
|
10
|
+
let lastArgs;
|
|
11
|
+
let timer;
|
|
12
|
+
|
|
13
|
+
const invoke = (args, now = Date.now()) => {
|
|
14
|
+
timestamp = now;
|
|
15
|
+
lastArgs = null;
|
|
16
|
+
if (timer) {
|
|
17
|
+
clearTimeout(timer);
|
|
18
|
+
timer = null;
|
|
19
|
+
}
|
|
20
|
+
fn.apply(null, args);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const throttled = (...args) => {
|
|
14
24
|
const now = Date.now();
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
25
|
+
const passed = now - timestamp;
|
|
26
|
+
if ( passed >= threshold) {
|
|
27
|
+
invoke(args, now);
|
|
28
|
+
} else {
|
|
29
|
+
lastArgs = args;
|
|
30
|
+
if (!timer) {
|
|
31
|
+
timer = setTimeout(() => {
|
|
32
|
+
timer = null;
|
|
33
|
+
invoke(lastArgs)
|
|
34
|
+
}, threshold - passed);
|
|
19
35
|
}
|
|
20
|
-
timestamp = now;
|
|
21
|
-
return fn.apply(null, args);
|
|
22
36
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}, threshold - (now - timestamp));
|
|
29
|
-
}
|
|
30
|
-
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const flush = () => lastArgs && invoke(lastArgs);
|
|
40
|
+
|
|
41
|
+
return [throttled, flush];
|
|
31
42
|
}
|
|
32
43
|
|
|
33
44
|
export default throttle;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
|
|
2
|
+
export const streamChunk = function* (chunk, chunkSize) {
|
|
3
|
+
let len = chunk.byteLength;
|
|
4
|
+
|
|
5
|
+
if (!chunkSize || len < chunkSize) {
|
|
6
|
+
yield chunk;
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let pos = 0;
|
|
11
|
+
let end;
|
|
12
|
+
|
|
13
|
+
while (pos < len) {
|
|
14
|
+
end = pos + chunkSize;
|
|
15
|
+
yield chunk.slice(pos, end);
|
|
16
|
+
pos = end;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const readBytes = async function* (iterable, chunkSize, encode) {
|
|
21
|
+
for await (const chunk of iterable) {
|
|
22
|
+
yield* streamChunk(ArrayBuffer.isView(chunk) ? chunk : (await encode(String(chunk))), chunkSize);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const trackStream = (stream, chunkSize, onProgress, onFinish, encode) => {
|
|
27
|
+
const iterator = readBytes(stream, chunkSize, encode);
|
|
28
|
+
|
|
29
|
+
let bytes = 0;
|
|
30
|
+
let done;
|
|
31
|
+
let _onFinish = (e) => {
|
|
32
|
+
if (!done) {
|
|
33
|
+
done = true;
|
|
34
|
+
onFinish && onFinish(e);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return new ReadableStream({
|
|
39
|
+
async pull(controller) {
|
|
40
|
+
try {
|
|
41
|
+
const {done, value} = await iterator.next();
|
|
42
|
+
|
|
43
|
+
if (done) {
|
|
44
|
+
_onFinish();
|
|
45
|
+
controller.close();
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
let len = value.byteLength;
|
|
50
|
+
if (onProgress) {
|
|
51
|
+
let loadedBytes = bytes += len;
|
|
52
|
+
onProgress(loadedBytes);
|
|
53
|
+
}
|
|
54
|
+
controller.enqueue(new Uint8Array(value));
|
|
55
|
+
} catch (err) {
|
|
56
|
+
_onFinish(err);
|
|
57
|
+
throw err;
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
cancel(reason) {
|
|
61
|
+
_onFinish(reason);
|
|
62
|
+
return iterator.return();
|
|
63
|
+
}
|
|
64
|
+
}, {
|
|
65
|
+
highWaterMark: 2
|
|
66
|
+
})
|
|
67
|
+
}
|
|
@@ -40,8 +40,11 @@ const hasStandardBrowserWebWorkerEnv = (() => {
|
|
|
40
40
|
);
|
|
41
41
|
})();
|
|
42
42
|
|
|
43
|
+
const origin = hasBrowserEnv && window.location.href || 'http://localhost';
|
|
44
|
+
|
|
43
45
|
export {
|
|
44
46
|
hasBrowserEnv,
|
|
45
47
|
hasStandardBrowserWebWorkerEnv,
|
|
46
|
-
hasStandardBrowserEnv
|
|
48
|
+
hasStandardBrowserEnv,
|
|
49
|
+
origin
|
|
47
50
|
}
|
|
@@ -209,6 +209,8 @@ const isFormData = (thing) => {
|
|
|
209
209
|
*/
|
|
210
210
|
const isURLSearchParams = kindOfTest('URLSearchParams');
|
|
211
211
|
|
|
212
|
+
const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);
|
|
213
|
+
|
|
212
214
|
/**
|
|
213
215
|
* Trim excess whitespace off the beginning and end of a string
|
|
214
216
|
*
|
|
@@ -597,8 +599,7 @@ const toObjectSet = (arrayOrString, delimiter) => {
|
|
|
597
599
|
const noop = () => {}
|
|
598
600
|
|
|
599
601
|
const toFiniteNumber = (value, defaultValue) => {
|
|
600
|
-
value = +value;
|
|
601
|
-
return Number.isFinite(value) ? value : defaultValue;
|
|
602
|
+
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
602
603
|
}
|
|
603
604
|
|
|
604
605
|
const ALPHA = 'abcdefghijklmnopqrstuvwxyz'
|
|
@@ -668,6 +669,36 @@ const isAsyncFn = kindOfTest('AsyncFunction');
|
|
|
668
669
|
const isThenable = (thing) =>
|
|
669
670
|
thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
|
670
671
|
|
|
672
|
+
// original code
|
|
673
|
+
// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
|
|
674
|
+
|
|
675
|
+
const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
676
|
+
if (setImmediateSupported) {
|
|
677
|
+
return setImmediate;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
return postMessageSupported ? ((token, callbacks) => {
|
|
681
|
+
_global.addEventListener("message", ({source, data}) => {
|
|
682
|
+
if (source === _global && data === token) {
|
|
683
|
+
callbacks.length && callbacks.shift()();
|
|
684
|
+
}
|
|
685
|
+
}, false);
|
|
686
|
+
|
|
687
|
+
return (cb) => {
|
|
688
|
+
callbacks.push(cb);
|
|
689
|
+
_global.postMessage(token, "*");
|
|
690
|
+
}
|
|
691
|
+
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
|
|
692
|
+
})(
|
|
693
|
+
typeof setImmediate === 'function',
|
|
694
|
+
isFunction(_global.postMessage)
|
|
695
|
+
);
|
|
696
|
+
|
|
697
|
+
const asap = typeof queueMicrotask !== 'undefined' ?
|
|
698
|
+
queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);
|
|
699
|
+
|
|
700
|
+
// *********************
|
|
701
|
+
|
|
671
702
|
export default {
|
|
672
703
|
isArray,
|
|
673
704
|
isArrayBuffer,
|
|
@@ -679,6 +710,10 @@ export default {
|
|
|
679
710
|
isBoolean,
|
|
680
711
|
isObject,
|
|
681
712
|
isPlainObject,
|
|
713
|
+
isReadableStream,
|
|
714
|
+
isRequest,
|
|
715
|
+
isResponse,
|
|
716
|
+
isHeaders,
|
|
682
717
|
isUndefined,
|
|
683
718
|
isDate,
|
|
684
719
|
isFile,
|
|
@@ -719,5 +754,7 @@ export default {
|
|
|
719
754
|
isSpecCompliantForm,
|
|
720
755
|
toJSONObject,
|
|
721
756
|
isAsyncFn,
|
|
722
|
-
isThenable
|
|
757
|
+
isThenable,
|
|
758
|
+
setImmediate: _setImmediate,
|
|
759
|
+
asap
|
|
723
760
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "axios",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.4",
|
|
4
4
|
"description": "Promise based HTTP client for the browser and node.js",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"exports": {
|
|
@@ -135,7 +135,8 @@
|
|
|
135
135
|
"stream-throttle": "^0.1.3",
|
|
136
136
|
"string-replace-async": "^3.0.2",
|
|
137
137
|
"terser-webpack-plugin": "^4.2.3",
|
|
138
|
-
"typescript": "^4.9.5"
|
|
138
|
+
"typescript": "^4.9.5",
|
|
139
|
+
"@rollup/plugin-alias": "^5.1.0"
|
|
139
140
|
},
|
|
140
141
|
"browser": {
|
|
141
142
|
"./lib/adapters/http.js": "./lib/helpers/null.js",
|
|
@@ -159,8 +160,8 @@
|
|
|
159
160
|
"contributors": [
|
|
160
161
|
"Matt Zabriskie (https://github.com/mzabriskie)",
|
|
161
162
|
"Nick Uraltsev (https://github.com/nickuraltsev)",
|
|
162
|
-
"Jay (https://github.com/jasonsaayman)",
|
|
163
163
|
"Dmitriy Mozgovoy (https://github.com/DigitalBrainJS)",
|
|
164
|
+
"Jay (https://github.com/jasonsaayman)",
|
|
164
165
|
"Emily Morehouse (https://github.com/emilyemorehouse)",
|
|
165
166
|
"Rubén Norte (https://github.com/rubennorte)",
|
|
166
167
|
"Justin Beckwith (https://github.com/JustinBeckwith)",
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "A CDK construct that helps build IAM policies using the AWS IAM Policy Builder dump. Normally it is better to use cdk-iam-floyd, However, I found that cdk-iam-floyd currently is not jsii compliant so I wasn't able to use it in my jsii compliant projects in languages that are not typescript or python.",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
|
-
"url": "https://github.com/jjrawlins/cdk-iam-policy-builder-helper
|
|
6
|
+
"url": "https://github.com/jjrawlins/cdk-iam-policy-builder-helper.git"
|
|
7
7
|
},
|
|
8
8
|
"scripts": {
|
|
9
9
|
"build": "npx projen build",
|
|
@@ -36,37 +36,38 @@
|
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@aws-sdk/types": "^3.535.0",
|
|
39
|
+
"@stylistic/eslint-plugin": "^2",
|
|
39
40
|
"@types/axios": "^0.14.0",
|
|
40
41
|
"@types/jest": "^29.5.12",
|
|
41
|
-
"@types/node": "^
|
|
42
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
43
|
-
"@typescript-eslint/parser": "^
|
|
44
|
-
"aws-cdk-lib": "2.
|
|
45
|
-
"
|
|
46
|
-
"eslint": "^
|
|
42
|
+
"@types/node": "^20",
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "^8",
|
|
44
|
+
"@typescript-eslint/parser": "^8",
|
|
45
|
+
"aws-cdk-lib": "2.150.0",
|
|
46
|
+
"commit-and-tag-version": "^12",
|
|
47
|
+
"eslint": "^9",
|
|
47
48
|
"eslint-import-resolver-typescript": "^3.6.1",
|
|
48
49
|
"eslint-plugin-import": "^2.29.1",
|
|
49
50
|
"jest": "^29.7.0",
|
|
50
|
-
"jest-junit": "^
|
|
51
|
-
"jsii": "~5.
|
|
51
|
+
"jest-junit": "^16",
|
|
52
|
+
"jsii": "~5.4.0",
|
|
52
53
|
"jsii-diff": "^1.98.0",
|
|
53
|
-
"jsii-docgen": "^10.
|
|
54
|
+
"jsii-docgen": "^10.5.0",
|
|
54
55
|
"jsii-pacmak": "^1.98.0",
|
|
55
|
-
"jsii-rosetta": "~5.
|
|
56
|
-
"standard-version": "^9",
|
|
56
|
+
"jsii-rosetta": "~5.4.0",
|
|
57
57
|
"ts-jest": "^29.1.2",
|
|
58
58
|
"ts-node": "^10.9.2",
|
|
59
59
|
"typescript": "^5.4.5"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
|
-
"aws-cdk-lib": "^2.
|
|
63
|
-
"constructs": "^10.3.
|
|
62
|
+
"aws-cdk-lib": "^2.150.0",
|
|
63
|
+
"constructs": "^10.3.5"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"@aws-sdk/client-iam": "^3.565.0",
|
|
67
|
-
"axios": "
|
|
67
|
+
"axios": "1.7.4",
|
|
68
|
+
"constructs": "^10.4.2",
|
|
68
69
|
"jsonc-parser": "^3.2.1",
|
|
69
|
-
"projen": "^0.
|
|
70
|
+
"projen": "^0.91.1"
|
|
70
71
|
},
|
|
71
72
|
"bundledDependencies": [
|
|
72
73
|
"@aws-sdk/client-iam",
|
|
@@ -80,18 +81,21 @@
|
|
|
80
81
|
"iam-policy"
|
|
81
82
|
],
|
|
82
83
|
"engines": {
|
|
83
|
-
"node": ">=
|
|
84
|
+
"node": ">= 20.9.0"
|
|
84
85
|
},
|
|
85
86
|
"main": "lib/index.js",
|
|
86
87
|
"license": "Apache-2.0",
|
|
87
88
|
"publishConfig": {
|
|
88
89
|
"access": "public"
|
|
89
90
|
},
|
|
90
|
-
"version": "0.0.
|
|
91
|
+
"version": "0.0.1",
|
|
91
92
|
"jest": {
|
|
93
|
+
"coverageProvider": "v8",
|
|
92
94
|
"testMatch": [
|
|
93
|
-
"<rootDir
|
|
94
|
-
"<rootDir
|
|
95
|
+
"<rootDir>/@(src|test)/**/*(*.)@(spec|test).ts?(x)",
|
|
96
|
+
"<rootDir>/@(src|test)/**/__tests__/**/*.ts?(x)",
|
|
97
|
+
"<rootDir>/@(projenrc)/**/*(*.)@(spec|test).ts?(x)",
|
|
98
|
+
"<rootDir>/@(projenrc)/**/__tests__/**/*.ts?(x)"
|
|
95
99
|
],
|
|
96
100
|
"clearMocks": true,
|
|
97
101
|
"collectCoverage": true,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.0.8
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toUtf8 = exports.fromUtf8 = void 0;
|
|
4
|
-
const pureJs_1 = require("./pureJs");
|
|
5
|
-
const whatwgEncodingApi_1 = require("./whatwgEncodingApi");
|
|
6
|
-
const fromUtf8 = (input) => typeof TextEncoder === "function" ? (0, whatwgEncodingApi_1.fromUtf8)(input) : (0, pureJs_1.fromUtf8)(input);
|
|
7
|
-
exports.fromUtf8 = fromUtf8;
|
|
8
|
-
const toUtf8 = (input) => typeof TextDecoder === "function" ? (0, whatwgEncodingApi_1.toUtf8)(input) : (0, pureJs_1.toUtf8)(input);
|
|
9
|
-
exports.toUtf8 = toUtf8;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toUtf8 = exports.fromUtf8 = void 0;
|
|
4
|
-
const fromUtf8 = (input) => {
|
|
5
|
-
const bytes = [];
|
|
6
|
-
for (let i = 0, len = input.length; i < len; i++) {
|
|
7
|
-
const value = input.charCodeAt(i);
|
|
8
|
-
if (value < 0x80) {
|
|
9
|
-
bytes.push(value);
|
|
10
|
-
}
|
|
11
|
-
else if (value < 0x800) {
|
|
12
|
-
bytes.push((value >> 6) | 0b11000000, (value & 0b111111) | 0b10000000);
|
|
13
|
-
}
|
|
14
|
-
else if (i + 1 < input.length && (value & 0xfc00) === 0xd800 && (input.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {
|
|
15
|
-
const surrogatePair = 0x10000 + ((value & 0b1111111111) << 10) + (input.charCodeAt(++i) & 0b1111111111);
|
|
16
|
-
bytes.push((surrogatePair >> 18) | 0b11110000, ((surrogatePair >> 12) & 0b111111) | 0b10000000, ((surrogatePair >> 6) & 0b111111) | 0b10000000, (surrogatePair & 0b111111) | 0b10000000);
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
bytes.push((value >> 12) | 0b11100000, ((value >> 6) & 0b111111) | 0b10000000, (value & 0b111111) | 0b10000000);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return Uint8Array.from(bytes);
|
|
23
|
-
};
|
|
24
|
-
exports.fromUtf8 = fromUtf8;
|
|
25
|
-
const toUtf8 = (input) => {
|
|
26
|
-
let decoded = "";
|
|
27
|
-
for (let i = 0, len = input.length; i < len; i++) {
|
|
28
|
-
const byte = input[i];
|
|
29
|
-
if (byte < 0x80) {
|
|
30
|
-
decoded += String.fromCharCode(byte);
|
|
31
|
-
}
|
|
32
|
-
else if (0b11000000 <= byte && byte < 0b11100000) {
|
|
33
|
-
const nextByte = input[++i];
|
|
34
|
-
decoded += String.fromCharCode(((byte & 0b11111) << 6) | (nextByte & 0b111111));
|
|
35
|
-
}
|
|
36
|
-
else if (0b11110000 <= byte && byte < 0b101101101) {
|
|
37
|
-
const surrogatePair = [byte, input[++i], input[++i], input[++i]];
|
|
38
|
-
const encoded = "%" + surrogatePair.map((byteValue) => byteValue.toString(16)).join("%");
|
|
39
|
-
decoded += decodeURIComponent(encoded);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
decoded += String.fromCharCode(((byte & 0b1111) << 12) | ((input[++i] & 0b111111) << 6) | (input[++i] & 0b111111));
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return decoded;
|
|
46
|
-
};
|
|
47
|
-
exports.toUtf8 = toUtf8;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toUtf8 = exports.fromUtf8 = void 0;
|
|
4
|
-
function fromUtf8(input) {
|
|
5
|
-
return new TextEncoder().encode(input);
|
|
6
|
-
}
|
|
7
|
-
exports.fromUtf8 = fromUtf8;
|
|
8
|
-
function toUtf8(input) {
|
|
9
|
-
return new TextDecoder("utf-8").decode(input);
|
|
10
|
-
}
|
|
11
|
-
exports.toUtf8 = toUtf8;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { fromUtf8 as jsFromUtf8, toUtf8 as jsToUtf8 } from "./pureJs";
|
|
2
|
-
import { fromUtf8 as textEncoderFromUtf8, toUtf8 as textEncoderToUtf8 } from "./whatwgEncodingApi";
|
|
3
|
-
export const fromUtf8 = (input) => typeof TextEncoder === "function" ? textEncoderFromUtf8(input) : jsFromUtf8(input);
|
|
4
|
-
export const toUtf8 = (input) => typeof TextDecoder === "function" ? textEncoderToUtf8(input) : jsToUtf8(input);
|