@gradientedge/cdk-utils 6.8.0 → 6.10.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/app/api-destined-function/layers/nodejs/node_modules/.yarn-integrity +22 -12
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/README.md +30 -73
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/commonjs-browser/index.js +79 -0
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/commonjs-browser/md5.js +223 -0
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/commonjs-browser/native.js +11 -0
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/commonjs-browser/nil.js +8 -0
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/commonjs-browser/parse.js +45 -0
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/commonjs-browser/regex.js +8 -0
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/commonjs-browser/rng.js +25 -0
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/commonjs-browser/sha1.js +104 -0
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/commonjs-browser/stringify.js +44 -0
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/commonjs-browser/v1.js +107 -0
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/commonjs-browser/v3.js +16 -0
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/commonjs-browser/v35.js +80 -0
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/commonjs-browser/v4.js +43 -0
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/commonjs-browser/v5.js +16 -0
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/commonjs-browser/validate.js +17 -0
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/commonjs-browser/version.js +21 -0
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/md5.js +23 -23
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/native.js +4 -0
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/parse.js +2 -2
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/rng.js +4 -5
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/sha1.js +26 -26
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/stringify.js +9 -6
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/v1.js +17 -17
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/v3.js +1 -1
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/v35.js +12 -10
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/v4.js +9 -4
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/v5.js +1 -1
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/version.js +1 -1
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/native.js +4 -0
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/stringify.js +7 -3
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/v1.js +2 -2
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/v35.js +6 -4
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/v4.js +7 -2
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/version.js +1 -1
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/index.js +18 -18
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/native-browser.js +11 -0
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/native.js +15 -0
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/rng-browser.js +2 -3
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/stringify.js +8 -3
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/v1.js +2 -2
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/v35.js +7 -5
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/v4.js +8 -2
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/version.js +1 -1
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/package.json +37 -41
- package/app/api-destined-function/layers/nodejs/package.json +1 -1
- package/app/api-destined-function/node_modules/.yarn-integrity +22 -12
- package/app/api-destined-function/node_modules/uuid/README.md +30 -73
- package/app/api-destined-function/node_modules/uuid/dist/commonjs-browser/index.js +79 -0
- package/app/api-destined-function/node_modules/uuid/dist/commonjs-browser/md5.js +223 -0
- package/app/api-destined-function/node_modules/uuid/dist/commonjs-browser/native.js +11 -0
- package/app/api-destined-function/node_modules/uuid/dist/commonjs-browser/nil.js +8 -0
- package/app/api-destined-function/node_modules/uuid/dist/commonjs-browser/parse.js +45 -0
- package/app/api-destined-function/node_modules/uuid/dist/commonjs-browser/regex.js +8 -0
- package/app/api-destined-function/node_modules/uuid/dist/commonjs-browser/rng.js +25 -0
- package/app/api-destined-function/node_modules/uuid/dist/commonjs-browser/sha1.js +104 -0
- package/app/api-destined-function/node_modules/uuid/dist/commonjs-browser/stringify.js +44 -0
- package/app/api-destined-function/node_modules/uuid/dist/commonjs-browser/v1.js +107 -0
- package/app/api-destined-function/node_modules/uuid/dist/commonjs-browser/v3.js +16 -0
- package/app/api-destined-function/node_modules/uuid/dist/commonjs-browser/v35.js +80 -0
- package/app/api-destined-function/node_modules/uuid/dist/commonjs-browser/v4.js +43 -0
- package/app/api-destined-function/node_modules/uuid/dist/commonjs-browser/v5.js +16 -0
- package/app/api-destined-function/node_modules/uuid/dist/commonjs-browser/validate.js +17 -0
- package/app/api-destined-function/node_modules/uuid/dist/commonjs-browser/version.js +21 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-browser/md5.js +23 -23
- package/app/api-destined-function/node_modules/uuid/dist/esm-browser/native.js +4 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-browser/parse.js +2 -2
- package/app/api-destined-function/node_modules/uuid/dist/esm-browser/rng.js +4 -5
- package/app/api-destined-function/node_modules/uuid/dist/esm-browser/sha1.js +26 -26
- package/app/api-destined-function/node_modules/uuid/dist/esm-browser/stringify.js +9 -6
- package/app/api-destined-function/node_modules/uuid/dist/esm-browser/v1.js +17 -17
- package/app/api-destined-function/node_modules/uuid/dist/esm-browser/v3.js +1 -1
- package/app/api-destined-function/node_modules/uuid/dist/esm-browser/v35.js +12 -10
- package/app/api-destined-function/node_modules/uuid/dist/esm-browser/v4.js +9 -4
- package/app/api-destined-function/node_modules/uuid/dist/esm-browser/v5.js +1 -1
- package/app/api-destined-function/node_modules/uuid/dist/esm-browser/version.js +1 -1
- package/app/api-destined-function/node_modules/uuid/dist/esm-node/native.js +4 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-node/stringify.js +7 -3
- package/app/api-destined-function/node_modules/uuid/dist/esm-node/v1.js +2 -2
- package/app/api-destined-function/node_modules/uuid/dist/esm-node/v35.js +6 -4
- package/app/api-destined-function/node_modules/uuid/dist/esm-node/v4.js +7 -2
- package/app/api-destined-function/node_modules/uuid/dist/esm-node/version.js +1 -1
- package/app/api-destined-function/node_modules/uuid/dist/index.js +18 -18
- package/app/api-destined-function/node_modules/uuid/dist/native-browser.js +11 -0
- package/app/api-destined-function/node_modules/uuid/dist/native.js +15 -0
- package/app/api-destined-function/node_modules/uuid/dist/rng-browser.js +2 -3
- package/app/api-destined-function/node_modules/uuid/dist/stringify.js +8 -3
- package/app/api-destined-function/node_modules/uuid/dist/v1.js +2 -2
- package/app/api-destined-function/node_modules/uuid/dist/v35.js +7 -5
- package/app/api-destined-function/node_modules/uuid/dist/v4.js +8 -2
- package/app/api-destined-function/node_modules/uuid/dist/version.js +1 -1
- package/app/api-destined-function/node_modules/uuid/package.json +37 -41
- package/app/api-destined-function/package.json +1 -1
- package/dist/src/lib/construct/api-to-lambda-target/index.d.ts +1 -0
- package/dist/src/lib/construct/api-to-lambda-target/index.js +17 -0
- package/dist/src/lib/construct/api-to-lambda-target/main.d.ts +48 -0
- package/dist/src/lib/construct/api-to-lambda-target/main.js +156 -0
- package/dist/src/lib/helper/api-to-lambda-target-rest-api.d.ts +36 -0
- package/dist/src/lib/helper/api-to-lambda-target-rest-api.js +30 -0
- package/dist/src/lib/helper/index.d.ts +1 -0
- package/dist/src/lib/helper/index.js +1 -0
- package/dist/src/lib/manager/aws/api-manager.d.ts +1 -1
- package/dist/src/lib/types/aws/index.d.ts +55 -0
- package/package.json +4 -4
- package/src/lib/construct/api-to-lambda-target/index.ts +1 -0
- package/src/lib/construct/api-to-lambda-target/main.ts +189 -0
- package/src/lib/helper/api-to-lambda-target-rest-api.ts +33 -0
- package/src/lib/helper/index.ts +1 -0
- package/src/lib/manager/aws/api-manager.ts +1 -1
- package/src/lib/types/aws/index.ts +54 -0
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuid.min.js +0 -1
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidNIL.min.js +0 -1
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidParse.min.js +0 -1
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidStringify.min.js +0 -1
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidValidate.min.js +0 -1
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidVersion.min.js +0 -1
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidv1.min.js +0 -1
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidv3.min.js +0 -1
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidv4.min.js +0 -1
- package/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidv5.min.js +0 -1
- package/app/api-destined-function/node_modules/uuid/dist/umd/uuid.min.js +0 -1
- package/app/api-destined-function/node_modules/uuid/dist/umd/uuidNIL.min.js +0 -1
- package/app/api-destined-function/node_modules/uuid/dist/umd/uuidParse.min.js +0 -1
- package/app/api-destined-function/node_modules/uuid/dist/umd/uuidStringify.min.js +0 -1
- package/app/api-destined-function/node_modules/uuid/dist/umd/uuidValidate.min.js +0 -1
- package/app/api-destined-function/node_modules/uuid/dist/umd/uuidVersion.min.js +0 -1
- package/app/api-destined-function/node_modules/uuid/dist/umd/uuidv1.min.js +0 -1
- package/app/api-destined-function/node_modules/uuid/dist/umd/uuidv3.min.js +0 -1
- package/app/api-destined-function/node_modules/uuid/dist/umd/uuidv4.min.js +0 -1
- package/app/api-destined-function/node_modules/uuid/dist/umd/uuidv5.min.js +0 -1
|
@@ -3,58 +3,58 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "
|
|
6
|
+
Object.defineProperty(exports, "NIL", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function () {
|
|
9
|
-
return
|
|
9
|
+
return _nil.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "
|
|
12
|
+
Object.defineProperty(exports, "parse", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function () {
|
|
15
|
-
return
|
|
15
|
+
return _parse.default;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
Object.defineProperty(exports, "
|
|
18
|
+
Object.defineProperty(exports, "stringify", {
|
|
19
19
|
enumerable: true,
|
|
20
20
|
get: function () {
|
|
21
|
-
return
|
|
21
|
+
return _stringify.default;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
Object.defineProperty(exports, "
|
|
24
|
+
Object.defineProperty(exports, "v1", {
|
|
25
25
|
enumerable: true,
|
|
26
26
|
get: function () {
|
|
27
|
-
return
|
|
27
|
+
return _v.default;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
Object.defineProperty(exports, "
|
|
30
|
+
Object.defineProperty(exports, "v3", {
|
|
31
31
|
enumerable: true,
|
|
32
32
|
get: function () {
|
|
33
|
-
return
|
|
33
|
+
return _v2.default;
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
-
Object.defineProperty(exports, "
|
|
36
|
+
Object.defineProperty(exports, "v4", {
|
|
37
37
|
enumerable: true,
|
|
38
38
|
get: function () {
|
|
39
|
-
return
|
|
39
|
+
return _v3.default;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
-
Object.defineProperty(exports, "
|
|
42
|
+
Object.defineProperty(exports, "v5", {
|
|
43
43
|
enumerable: true,
|
|
44
44
|
get: function () {
|
|
45
|
-
return
|
|
45
|
+
return _v4.default;
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
-
Object.defineProperty(exports, "
|
|
48
|
+
Object.defineProperty(exports, "validate", {
|
|
49
49
|
enumerable: true,
|
|
50
50
|
get: function () {
|
|
51
|
-
return
|
|
51
|
+
return _validate.default;
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
-
Object.defineProperty(exports, "
|
|
54
|
+
Object.defineProperty(exports, "version", {
|
|
55
55
|
enumerable: true,
|
|
56
56
|
get: function () {
|
|
57
|
-
return
|
|
57
|
+
return _version.default;
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
8
|
+
var _default = {
|
|
9
|
+
randomUUID
|
|
10
|
+
};
|
|
11
|
+
exports.default = _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _crypto = _interopRequireDefault(require("crypto"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
var _default = {
|
|
13
|
+
randomUUID: _crypto.default.randomUUID
|
|
14
|
+
};
|
|
15
|
+
exports.default = _default;
|
|
@@ -13,9 +13,8 @@ const rnds8 = new Uint8Array(16);
|
|
|
13
13
|
function rng() {
|
|
14
14
|
// lazy load so that environments that need to polyfill have a chance to do so
|
|
15
15
|
if (!getRandomValues) {
|
|
16
|
-
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
|
17
|
-
|
|
18
|
-
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
|
|
16
|
+
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
|
17
|
+
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
|
19
18
|
|
|
20
19
|
if (!getRandomValues) {
|
|
21
20
|
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
exports.unsafeStringify = unsafeStringify;
|
|
7
8
|
|
|
8
9
|
var _validate = _interopRequireDefault(require("./validate.js"));
|
|
9
10
|
|
|
@@ -16,13 +17,17 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
16
17
|
const byteToHex = [];
|
|
17
18
|
|
|
18
19
|
for (let i = 0; i < 256; ++i) {
|
|
19
|
-
byteToHex.push((i + 0x100).toString(16).
|
|
20
|
+
byteToHex.push((i + 0x100).toString(16).slice(1));
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
function
|
|
23
|
+
function unsafeStringify(arr, offset = 0) {
|
|
23
24
|
// Note: Be careful editing this code! It's been tuned for performance
|
|
24
25
|
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
25
|
-
|
|
26
|
+
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function stringify(arr, offset = 0) {
|
|
30
|
+
const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
|
|
26
31
|
// of the following:
|
|
27
32
|
// - One or more input array values don't map to a hex octet (leading to
|
|
28
33
|
// "undefined" in the uuid)
|
|
@@ -7,7 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _rng = _interopRequireDefault(require("./rng.js"));
|
|
9
9
|
|
|
10
|
-
var _stringify =
|
|
10
|
+
var _stringify = require("./stringify.js");
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
|
|
@@ -100,7 +100,7 @@ function v1(options, buf, offset) {
|
|
|
100
100
|
b[i + n] = node[n];
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
return buf || (0, _stringify.
|
|
103
|
+
return buf || (0, _stringify.unsafeStringify)(b);
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
var _default = v1;
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = _default;
|
|
7
6
|
exports.URL = exports.DNS = void 0;
|
|
7
|
+
exports.default = v35;
|
|
8
8
|
|
|
9
|
-
var _stringify =
|
|
9
|
+
var _stringify = require("./stringify.js");
|
|
10
10
|
|
|
11
11
|
var _parse = _interopRequireDefault(require("./parse.js"));
|
|
12
12
|
|
|
@@ -29,8 +29,10 @@ exports.DNS = DNS;
|
|
|
29
29
|
const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
|
|
30
30
|
exports.URL = URL;
|
|
31
31
|
|
|
32
|
-
function
|
|
32
|
+
function v35(name, version, hashfunc) {
|
|
33
33
|
function generateUUID(value, namespace, buf, offset) {
|
|
34
|
+
var _namespace;
|
|
35
|
+
|
|
34
36
|
if (typeof value === 'string') {
|
|
35
37
|
value = stringToBytes(value);
|
|
36
38
|
}
|
|
@@ -39,7 +41,7 @@ function _default(name, version, hashfunc) {
|
|
|
39
41
|
namespace = (0, _parse.default)(namespace);
|
|
40
42
|
}
|
|
41
43
|
|
|
42
|
-
if (namespace.length !== 16) {
|
|
44
|
+
if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
|
|
43
45
|
throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
|
|
44
46
|
} // Compute hash of namespace and value, Per 4.3
|
|
45
47
|
// Future: Use spread syntax when supported on all platforms, e.g. `bytes =
|
|
@@ -63,7 +65,7 @@ function _default(name, version, hashfunc) {
|
|
|
63
65
|
return buf;
|
|
64
66
|
}
|
|
65
67
|
|
|
66
|
-
return (0, _stringify.
|
|
68
|
+
return (0, _stringify.unsafeStringify)(bytes);
|
|
67
69
|
} // Function#name is not settable on some platforms (#270)
|
|
68
70
|
|
|
69
71
|
|
|
@@ -5,13 +5,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
+
var _native = _interopRequireDefault(require("./native.js"));
|
|
9
|
+
|
|
8
10
|
var _rng = _interopRequireDefault(require("./rng.js"));
|
|
9
11
|
|
|
10
|
-
var _stringify =
|
|
12
|
+
var _stringify = require("./stringify.js");
|
|
11
13
|
|
|
12
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
15
|
|
|
14
16
|
function v4(options, buf, offset) {
|
|
17
|
+
if (_native.default.randomUUID && !buf && !options) {
|
|
18
|
+
return _native.default.randomUUID();
|
|
19
|
+
}
|
|
20
|
+
|
|
15
21
|
options = options || {};
|
|
16
22
|
|
|
17
23
|
const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
@@ -30,7 +36,7 @@ function v4(options, buf, offset) {
|
|
|
30
36
|
return buf;
|
|
31
37
|
}
|
|
32
38
|
|
|
33
|
-
return (0, _stringify.
|
|
39
|
+
return (0, _stringify.unsafeStringify)(rnds);
|
|
34
40
|
}
|
|
35
41
|
|
|
36
42
|
var _default = v4;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uuid",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"description": "RFC4122 (v1, v4, and v5) UUIDs",
|
|
5
5
|
"commitlint": {
|
|
6
6
|
"extends": [
|
|
@@ -25,6 +25,10 @@
|
|
|
25
25
|
"require": "./dist/index.js",
|
|
26
26
|
"import": "./wrapper.mjs"
|
|
27
27
|
},
|
|
28
|
+
"browser": {
|
|
29
|
+
"import": "./dist/esm-browser/index.js",
|
|
30
|
+
"require": "./dist/commonjs-browser/index.js"
|
|
31
|
+
},
|
|
28
32
|
"default": "./dist/esm-browser/index.js"
|
|
29
33
|
},
|
|
30
34
|
"./package.json": "./package.json"
|
|
@@ -32,6 +36,7 @@
|
|
|
32
36
|
"module": "./dist/esm-node/index.js",
|
|
33
37
|
"browser": {
|
|
34
38
|
"./dist/md5.js": "./dist/md5-browser.js",
|
|
39
|
+
"./dist/native.js": "./dist/native-browser.js",
|
|
35
40
|
"./dist/rng.js": "./dist/rng-browser.js",
|
|
36
41
|
"./dist/sha1.js": "./dist/sha1-browser.js",
|
|
37
42
|
"./dist/esm-node/index.js": "./dist/esm-browser/index.js"
|
|
@@ -45,53 +50,50 @@
|
|
|
45
50
|
"wrapper.mjs"
|
|
46
51
|
],
|
|
47
52
|
"devDependencies": {
|
|
48
|
-
"@babel/cli": "7.
|
|
49
|
-
"@babel/core": "7.
|
|
50
|
-
"@babel/
|
|
51
|
-
"@
|
|
52
|
-
"@commitlint/
|
|
53
|
-
"@
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"eslint": "
|
|
57
|
-
"eslint-config-
|
|
58
|
-
"eslint-
|
|
59
|
-
"eslint-plugin-import": "2.22.1",
|
|
53
|
+
"@babel/cli": "7.18.10",
|
|
54
|
+
"@babel/core": "7.18.10",
|
|
55
|
+
"@babel/eslint-parser": "7.18.9",
|
|
56
|
+
"@babel/preset-env": "7.18.10",
|
|
57
|
+
"@commitlint/cli": "17.0.3",
|
|
58
|
+
"@commitlint/config-conventional": "17.0.3",
|
|
59
|
+
"bundlewatch": "0.3.3",
|
|
60
|
+
"eslint": "8.21.0",
|
|
61
|
+
"eslint-config-prettier": "8.5.0",
|
|
62
|
+
"eslint-config-standard": "17.0.0",
|
|
63
|
+
"eslint-plugin-import": "2.26.0",
|
|
60
64
|
"eslint-plugin-node": "11.1.0",
|
|
61
|
-
"eslint-plugin-prettier": "
|
|
62
|
-
"eslint-plugin-promise": "
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"lint-staged": "10.4.0",
|
|
65
|
+
"eslint-plugin-prettier": "4.2.1",
|
|
66
|
+
"eslint-plugin-promise": "6.0.0",
|
|
67
|
+
"husky": "8.0.1",
|
|
68
|
+
"jest": "28.1.3",
|
|
69
|
+
"lint-staged": "13.0.3",
|
|
67
70
|
"npm-run-all": "4.1.5",
|
|
68
71
|
"optional-dev-dependency": "2.0.1",
|
|
69
|
-
"prettier": "2.1
|
|
72
|
+
"prettier": "2.7.1",
|
|
70
73
|
"random-seed": "0.3.0",
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"runmd": "1.3.2",
|
|
74
|
-
"standard-version": "9.0.0"
|
|
74
|
+
"runmd": "1.3.6",
|
|
75
|
+
"standard-version": "9.5.0"
|
|
75
76
|
},
|
|
76
77
|
"optionalDevDependencies": {
|
|
77
|
-
"@wdio/browserstack-service": "
|
|
78
|
-
"@wdio/cli": "
|
|
79
|
-
"@wdio/jasmine-framework": "
|
|
80
|
-
"@wdio/local-runner": "
|
|
81
|
-
"@wdio/spec-reporter": "
|
|
82
|
-
"@wdio/static-server-service": "
|
|
83
|
-
"@wdio/sync": "6.4.0"
|
|
78
|
+
"@wdio/browserstack-service": "7.16.10",
|
|
79
|
+
"@wdio/cli": "7.16.10",
|
|
80
|
+
"@wdio/jasmine-framework": "7.16.6",
|
|
81
|
+
"@wdio/local-runner": "7.16.10",
|
|
82
|
+
"@wdio/spec-reporter": "7.16.9",
|
|
83
|
+
"@wdio/static-server-service": "7.16.6"
|
|
84
84
|
},
|
|
85
85
|
"scripts": {
|
|
86
86
|
"examples:browser:webpack:build": "cd examples/browser-webpack && npm install && npm run build",
|
|
87
87
|
"examples:browser:rollup:build": "cd examples/browser-rollup && npm install && npm run build",
|
|
88
88
|
"examples:node:commonjs:test": "cd examples/node-commonjs && npm install && npm test",
|
|
89
89
|
"examples:node:esmodules:test": "cd examples/node-esmodules && npm install && npm test",
|
|
90
|
+
"examples:node:jest:test": "cd examples/node-jest && npm install && npm test",
|
|
91
|
+
"prepare": "cd $( git rev-parse --show-toplevel ) && husky install",
|
|
90
92
|
"lint": "npm run eslint:check && npm run prettier:check",
|
|
91
93
|
"eslint:check": "eslint src/ test/ examples/ *.js",
|
|
92
94
|
"eslint:fix": "eslint --fix src/ test/ examples/ *.js",
|
|
93
95
|
"pretest": "[ -n $CI ] || npm run build",
|
|
94
|
-
"test": "BABEL_ENV=
|
|
96
|
+
"test": "BABEL_ENV=commonjsNode node --throw-deprecation node_modules/.bin/jest test/unit/",
|
|
95
97
|
"pretest:browser": "optional-dev-dependency && npm run build && npm-run-all --parallel examples:browser:**",
|
|
96
98
|
"test:browser": "wdio run ./wdio.conf.js",
|
|
97
99
|
"pretest:node": "npm run build",
|
|
@@ -99,11 +101,11 @@
|
|
|
99
101
|
"test:pack": "./scripts/testpack.sh",
|
|
100
102
|
"pretest:benchmark": "npm run build",
|
|
101
103
|
"test:benchmark": "cd examples/benchmark && npm install && npm test",
|
|
102
|
-
"prettier:check": "prettier --
|
|
103
|
-
"prettier:fix": "prettier --
|
|
104
|
+
"prettier:check": "prettier --check '**/*.{js,jsx,json,md}'",
|
|
105
|
+
"prettier:fix": "prettier --write '**/*.{js,jsx,json,md}'",
|
|
104
106
|
"bundlewatch": "npm run pretest:browser && bundlewatch --config bundlewatch.config.json",
|
|
105
107
|
"md": "runmd --watch --output=README.md README_js.md",
|
|
106
|
-
"docs": "( node --version | grep -q '
|
|
108
|
+
"docs": "( node --version | grep -q 'v16' ) && ( npm run build && runmd --output=README.md README_js.md )",
|
|
107
109
|
"docs:diff": "npm run docs && git diff --quiet README.md",
|
|
108
110
|
"build": "./scripts/build.sh",
|
|
109
111
|
"prepack": "npm run build",
|
|
@@ -113,12 +115,6 @@
|
|
|
113
115
|
"type": "git",
|
|
114
116
|
"url": "https://github.com/uuidjs/uuid.git"
|
|
115
117
|
},
|
|
116
|
-
"husky": {
|
|
117
|
-
"hooks": {
|
|
118
|
-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
|
|
119
|
-
"pre-commit": "lint-staged"
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
118
|
"lint-staged": {
|
|
123
119
|
"*.{js,jsx,json,md}": [
|
|
124
120
|
"prettier --write"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './main';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./main"), exports);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as secretsmanager from 'aws-cdk-lib/aws-secretsmanager';
|
|
2
|
+
import { Construct } from 'constructs';
|
|
3
|
+
import { CommonConstruct } from '../../common';
|
|
4
|
+
import * as types from '../../types/aws';
|
|
5
|
+
export declare class ApiToLambdaTarget extends CommonConstruct {
|
|
6
|
+
props: types.ApiToLambdaTargetProps;
|
|
7
|
+
id: string;
|
|
8
|
+
applicationSecrets: secretsmanager.ISecret[];
|
|
9
|
+
apiToLambdaTargetRestApi: types.ApiToLambdaTargetRestApiType;
|
|
10
|
+
constructor(parent: Construct, id: string, props: types.ApiToLambdaTargetProps);
|
|
11
|
+
protected initResources(): void;
|
|
12
|
+
/**
|
|
13
|
+
* @summary Method to resolve secrets from SecretsManager
|
|
14
|
+
* - To be implemented in the overriding method in the implementation class
|
|
15
|
+
* @protected
|
|
16
|
+
*/
|
|
17
|
+
protected resolveSecrets(): void;
|
|
18
|
+
/**
|
|
19
|
+
* @summary Method to resolve a hosted zone based on domain attributes
|
|
20
|
+
* @protected
|
|
21
|
+
*/
|
|
22
|
+
protected resolveHostedZone(): void;
|
|
23
|
+
/**
|
|
24
|
+
* @summary Method to resolve a certificate based on attributes
|
|
25
|
+
* @protected
|
|
26
|
+
*/
|
|
27
|
+
protected resolveCertificate(): void;
|
|
28
|
+
/**
|
|
29
|
+
* @summary Method to create rest restApi for Api
|
|
30
|
+
* @protected
|
|
31
|
+
*/
|
|
32
|
+
protected createApiToLambdaTargetRestApi(): void;
|
|
33
|
+
/**
|
|
34
|
+
* @summary Method to create custom restApi domain for Api API
|
|
35
|
+
* @protected
|
|
36
|
+
*/
|
|
37
|
+
protected createApiDomain(): void;
|
|
38
|
+
/**
|
|
39
|
+
* @summary Method to create base path mappings for GraphQL API
|
|
40
|
+
* @protected
|
|
41
|
+
*/
|
|
42
|
+
protected createApiBasePathMapping(): void;
|
|
43
|
+
/**
|
|
44
|
+
* @summary Method to create route53 records for Api
|
|
45
|
+
* @protected
|
|
46
|
+
*/
|
|
47
|
+
protected createApiRouteAssets(): void;
|
|
48
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.ApiToLambdaTarget = void 0;
|
|
27
|
+
const cdk = __importStar(require("aws-cdk-lib"));
|
|
28
|
+
const apig = __importStar(require("aws-cdk-lib/aws-apigateway"));
|
|
29
|
+
const lambda = __importStar(require("aws-cdk-lib/aws-lambda"));
|
|
30
|
+
const common_1 = require("../../common");
|
|
31
|
+
const helper = __importStar(require("../../helper"));
|
|
32
|
+
class ApiToLambdaTarget extends common_1.CommonConstruct {
|
|
33
|
+
props;
|
|
34
|
+
id;
|
|
35
|
+
/* application related resources */
|
|
36
|
+
applicationSecrets;
|
|
37
|
+
/* rest restApi related resources */
|
|
38
|
+
apiToLambdaTargetRestApi;
|
|
39
|
+
constructor(parent, id, props) {
|
|
40
|
+
super(parent, id, props);
|
|
41
|
+
this.props = props;
|
|
42
|
+
this.id = id;
|
|
43
|
+
this.apiToLambdaTargetRestApi = new helper.ApiToLambdaTargetRestApi();
|
|
44
|
+
}
|
|
45
|
+
initResources() {
|
|
46
|
+
/* application related resources */
|
|
47
|
+
this.resolveSecrets();
|
|
48
|
+
/* core resources */
|
|
49
|
+
this.resolveHostedZone();
|
|
50
|
+
this.resolveCertificate();
|
|
51
|
+
/* restApi related resources */
|
|
52
|
+
this.createApiToLambdaTargetRestApi();
|
|
53
|
+
this.createApiDomain();
|
|
54
|
+
this.createApiBasePathMapping();
|
|
55
|
+
this.createApiRouteAssets();
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* @summary Method to resolve secrets from SecretsManager
|
|
59
|
+
* - To be implemented in the overriding method in the implementation class
|
|
60
|
+
* @protected
|
|
61
|
+
*/
|
|
62
|
+
resolveSecrets() {
|
|
63
|
+
this.applicationSecrets = [];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* @summary Method to resolve a hosted zone based on domain attributes
|
|
67
|
+
* @protected
|
|
68
|
+
*/
|
|
69
|
+
resolveHostedZone() {
|
|
70
|
+
this.apiToLambdaTargetRestApi.hostedZone = this.route53Manager.withHostedZoneFromFullyQualifiedDomainName(`${this.id}-hosted-zone`, this, this.props.useExistingHostedZone);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* @summary Method to resolve a certificate based on attributes
|
|
74
|
+
* @protected
|
|
75
|
+
*/
|
|
76
|
+
resolveCertificate() {
|
|
77
|
+
if (this.props.api.useExisting)
|
|
78
|
+
return;
|
|
79
|
+
if (this.props.api.certificate.useExistingCertificate &&
|
|
80
|
+
this.props.api.certificate.certificateSsmName &&
|
|
81
|
+
this.props.api.certificate.certificateRegion) {
|
|
82
|
+
this.props.api.certificate.certificateArn = this.ssmManager.readStringParameterFromRegion(`${this.id}-certificate-param`, this, this.props.api.certificate.certificateSsmName, this.props.api.certificate.certificateRegion);
|
|
83
|
+
}
|
|
84
|
+
this.apiToLambdaTargetRestApi.certificate = this.acmManager.resolveCertificate(`${this.id}-certificate`, this, this.props.api.certificate);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* @summary Method to create rest restApi for Api
|
|
88
|
+
* @protected
|
|
89
|
+
*/
|
|
90
|
+
createApiToLambdaTargetRestApi() {
|
|
91
|
+
if (this.props.api.useExisting && this.props.api.importedRestApiRef) {
|
|
92
|
+
this.apiToLambdaTargetRestApi.api = apig.RestApi.fromRestApiId(this, `${this.id}-rest-api`, cdk.Fn.importValue(this.props.api.importedRestApiRef));
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const accessLogGroup = this.logManager.createLogGroup(`${this.id}-rest-api-access-log`, this, {
|
|
96
|
+
logGroupName: `/custom/api/${this.id}-rest-api-access`,
|
|
97
|
+
removalPolicy: cdk.RemovalPolicy.DESTROY,
|
|
98
|
+
});
|
|
99
|
+
this.props.api.restApi = {
|
|
100
|
+
...this.props.api.restApi,
|
|
101
|
+
...{
|
|
102
|
+
deployOptions: {
|
|
103
|
+
accessLogDestination: new apig.LogGroupLogDestination(accessLogGroup),
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
this.apiToLambdaTargetRestApi.api = this.apiManager.createLambdaRestApi(`${this.id}-lambda-rest-api`, this, this.props.api.restApi, lambda.Function.fromFunctionName(this, `${this.id}-lambda`, this.props.lambdaFunctionName));
|
|
108
|
+
this.addCfnOutput(`${this.id}-restApiId`, this.apiToLambdaTargetRestApi.api.restApiId);
|
|
109
|
+
this.addCfnOutput(`${this.id}-restApiRootResourceId`, this.apiToLambdaTargetRestApi.api.root.resourceId);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* @summary Method to create custom restApi domain for Api API
|
|
113
|
+
* @protected
|
|
114
|
+
*/
|
|
115
|
+
createApiDomain() {
|
|
116
|
+
if (this.props.api.useExisting)
|
|
117
|
+
return;
|
|
118
|
+
this.apiToLambdaTargetRestApi.domain = this.apiManager.createApiDomain(`${this.id}-api-domain`, this, this.isProductionStage() || this.props.skipStageForARecords
|
|
119
|
+
? `${this.props.apiSubDomain}.${this.fullyQualifiedDomainName}`
|
|
120
|
+
: `${this.props.apiSubDomain}-${this.props.stage}.${this.fullyQualifiedDomainName}`, this.apiToLambdaTargetRestApi.certificate);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* @summary Method to create base path mappings for GraphQL API
|
|
124
|
+
* @protected
|
|
125
|
+
*/
|
|
126
|
+
createApiBasePathMapping() {
|
|
127
|
+
const apiRootPaths = this.props.apiRootPaths;
|
|
128
|
+
if (apiRootPaths && apiRootPaths.length > 0) {
|
|
129
|
+
apiRootPaths.forEach((apiRootPath) => {
|
|
130
|
+
this.apiToLambdaTargetRestApi.basePathMappings.push(new apig.BasePathMapping(this, `${this.id}-base-bath-mapping-${apiRootPath}`, {
|
|
131
|
+
basePath: apiRootPath,
|
|
132
|
+
domainName: this.apiToLambdaTargetRestApi.domain,
|
|
133
|
+
restApi: this.apiToLambdaTargetRestApi.api,
|
|
134
|
+
stage: this.apiToLambdaTargetRestApi.api.deploymentStage,
|
|
135
|
+
}));
|
|
136
|
+
});
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
// add default mapping if apiRootPaths not set
|
|
140
|
+
new apig.BasePathMapping(this, `${this.id}-base-bath-mapping`, {
|
|
141
|
+
domainName: this.apiToLambdaTargetRestApi.domain,
|
|
142
|
+
restApi: this.apiToLambdaTargetRestApi.api,
|
|
143
|
+
stage: this.apiToLambdaTargetRestApi.api.deploymentStage,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* @summary Method to create route53 records for Api
|
|
148
|
+
* @protected
|
|
149
|
+
*/
|
|
150
|
+
createApiRouteAssets() {
|
|
151
|
+
if (this.props.api.useExisting)
|
|
152
|
+
return;
|
|
153
|
+
this.route53Manager.createApiGatewayARecord(`${this.id}-custom-domain-a-record`, this, this.props.apiSubDomain, this.apiToLambdaTargetRestApi.domain, this.apiToLambdaTargetRestApi.hostedZone, this.props.skipStageForARecords);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
exports.ApiToLambdaTarget = ApiToLambdaTarget;
|