@cloudnux/aws-cloud-provider 0.4.0 → 0.6.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.
@@ -1,39 +1,3 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/router/index.ts
31
- var index_exports = {};
32
- __export(index_exports, {
33
- createRouter: () => createRouter
34
- });
35
- module.exports = __toCommonJS(index_exports);
36
-
37
1
  // ../../../node_modules/lodash-es/_freeGlobal.js
38
2
  var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
39
3
  var freeGlobal_default = freeGlobal;
@@ -1043,16 +1007,16 @@ var ansiStyles = assembleStyles();
1043
1007
  var ansi_styles_default = ansiStyles;
1044
1008
 
1045
1009
  // ../../../node_modules/chalk/source/vendor/supports-color/index.js
1046
- var import_node_process = __toESM(require("process"), 1);
1047
- var import_node_os = __toESM(require("os"), 1);
1048
- var import_node_tty = __toESM(require("tty"), 1);
1049
- function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process.default.argv) {
1010
+ import process2 from "process";
1011
+ import os from "os";
1012
+ import tty from "tty";
1013
+ function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
1050
1014
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
1051
1015
  const position = argv.indexOf(prefix + flag);
1052
1016
  const terminatorPosition = argv.indexOf("--");
1053
1017
  return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
1054
1018
  }
1055
- var { env: env2 } = import_node_process.default;
1019
+ var { env: env2 } = process2;
1056
1020
  var flagForceColor;
1057
1021
  if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
1058
1022
  flagForceColor = 0;
@@ -1108,8 +1072,8 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
1108
1072
  if (env2.TERM === "dumb") {
1109
1073
  return min;
1110
1074
  }
1111
- if (import_node_process.default.platform === "win32") {
1112
- const osRelease = import_node_os.default.release().split(".");
1075
+ if (process2.platform === "win32") {
1076
+ const osRelease = os.release().split(".");
1113
1077
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
1114
1078
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
1115
1079
  }
@@ -1163,8 +1127,8 @@ function createSupportsColor(stream, options = {}) {
1163
1127
  return translateLevel(level);
1164
1128
  }
1165
1129
  var supportsColor = {
1166
- stdout: createSupportsColor({ isTTY: import_node_tty.default.isatty(1) }),
1167
- stderr: createSupportsColor({ isTTY: import_node_tty.default.isatty(2) })
1130
+ stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
1131
+ stderr: createSupportsColor({ isTTY: tty.isatty(2) })
1168
1132
  };
1169
1133
  var supports_color_default = supportsColor;
1170
1134
 
@@ -1346,7 +1310,7 @@ var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
1346
1310
  var source_default = chalk;
1347
1311
 
1348
1312
  // ../../utils/src/logging/index.ts
1349
- var import_os = require("os");
1313
+ import { EOL } from "os";
1350
1314
 
1351
1315
  // ../../utils/src/logging/types.ts
1352
1316
  var logLevels = {
@@ -1382,15 +1346,15 @@ var errorToString = (error) => {
1382
1346
  };
1383
1347
 
1384
1348
  // ../../utils/src/logging/index.ts
1385
- var currentLogLevel = env.int("LOG_LEVEL", logLevels.info);
1349
+ var currentLogLevel = logLevels[env("LOG_LEVEL")?.toLowerCase()] ?? logLevels.info;
1386
1350
  var logger = {
1387
1351
  fatal: (message, meta) => {
1388
1352
  if (currentLogLevel >= logLevels.fatal) {
1389
1353
  console.error(
1390
1354
  `[${(/* @__PURE__ */ new Date()).toTimeString()}]`,
1391
- `${source_default.bgRed.white(" fatal ")}${import_os.EOL}`,
1355
+ `${source_default.bgRed.white(" fatal ")}${EOL}`,
1392
1356
  errorToString(message),
1393
- meta ? `${import_os.EOL}${JSON.stringify(meta, null, 2)}` : ""
1357
+ meta ? `${EOL}${JSON.stringify(meta, null, 2)}` : ""
1394
1358
  );
1395
1359
  }
1396
1360
  },
@@ -1398,9 +1362,9 @@ var logger = {
1398
1362
  if (currentLogLevel >= logLevels.error) {
1399
1363
  console.error(
1400
1364
  `[${(/* @__PURE__ */ new Date()).toTimeString()}]`,
1401
- `${source_default.bgRed.white(" error ")}${import_os.EOL}`,
1365
+ `${source_default.bgRed.white(" error ")}${EOL}`,
1402
1366
  errorToString(message),
1403
- meta ? `${import_os.EOL}${JSON.stringify(meta, null, 2)}` : ""
1367
+ meta ? `${EOL}${JSON.stringify(meta, null, 2)}` : ""
1404
1368
  );
1405
1369
  }
1406
1370
  },
@@ -1408,9 +1372,9 @@ var logger = {
1408
1372
  if (currentLogLevel >= logLevels.warn) {
1409
1373
  console.warn(
1410
1374
  `[${(/* @__PURE__ */ new Date()).toTimeString()}]`,
1411
- `${source_default.bgYellow.black(" warn ")}${import_os.EOL}`,
1375
+ `${source_default.bgYellow.black(" warn ")}${EOL}`,
1412
1376
  errorToString(message),
1413
- meta ? `${import_os.EOL}${JSON.stringify(meta, null, 2)}` : ""
1377
+ meta ? `${EOL}${JSON.stringify(meta, null, 2)}` : ""
1414
1378
  );
1415
1379
  }
1416
1380
  },
@@ -1418,9 +1382,9 @@ var logger = {
1418
1382
  if (currentLogLevel >= logLevels.info) {
1419
1383
  console.info(
1420
1384
  `[${(/* @__PURE__ */ new Date()).toTimeString()}]`,
1421
- `${source_default.bgBlue.white(" info ")}${import_os.EOL}`,
1385
+ `${source_default.bgBlue.white(" info ")}${EOL}`,
1422
1386
  message,
1423
- meta ? `${import_os.EOL}${JSON.stringify(meta, null, 2)}` : ""
1387
+ meta ? `${EOL}${JSON.stringify(meta, null, 2)}` : ""
1424
1388
  );
1425
1389
  }
1426
1390
  },
@@ -1428,9 +1392,9 @@ var logger = {
1428
1392
  if (currentLogLevel >= logLevels.debug) {
1429
1393
  console.debug(
1430
1394
  `[${(/* @__PURE__ */ new Date()).toTimeString()}]`,
1431
- `${source_default.bgWhite.black(" debug ")}${import_os.EOL}`,
1395
+ `${source_default.bgWhite.black(" debug ")}${EOL}`,
1432
1396
  message,
1433
- meta ? `${import_os.EOL}${JSON.stringify(meta, null, 2)}` : ""
1397
+ meta ? `${EOL}${JSON.stringify(meta, null, 2)}` : ""
1434
1398
  );
1435
1399
  }
1436
1400
  }
@@ -1443,7 +1407,7 @@ function createRouter() {
1443
1407
  if ("requestContext" in event && "http" in event.requestContext) {
1444
1408
  return "http";
1445
1409
  }
1446
- if ("source" in event && event.source === "aws.events") {
1410
+ if ("source" in event && event.source === "aws.scheduler") {
1447
1411
  return "schedule";
1448
1412
  }
1449
1413
  if ("Records" in event) {
@@ -1575,7 +1539,7 @@ function createRouter() {
1575
1539
  routes.push({
1576
1540
  type: "http",
1577
1541
  method,
1578
- routeKey: route,
1542
+ routeKey: route.toLowerCase(),
1579
1543
  handler
1580
1544
  });
1581
1545
  },
@@ -1613,10 +1577,9 @@ function createRouter() {
1613
1577
  }
1614
1578
  };
1615
1579
  }
1616
- // Annotate the CommonJS export names for ESM import in node:
1617
- 0 && (module.exports = {
1580
+ export {
1618
1581
  createRouter
1619
- });
1582
+ };
1620
1583
  /*! Bundled license information:
1621
1584
 
1622
1585
  lodash-es/lodash.js: