@awsless/cli 0.1.33 → 0.1.34
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/bin.js +432 -272
- package/dist/handlers/pubsub-publisher.js +1 -1
- package/dist/handlers/pubsub-server.js +4 -4
- package/dist/handlers/rolldown-worker.js +3765 -0
- package/dist/stack.json +1 -1
- package/dist/stack.stage.json +1 -1
- package/package.json +25 -25
package/dist/bin.js
CHANGED
|
@@ -4479,7 +4479,7 @@ var require_node_gyp_build_optional_packages = __commonJS(function(exports, modu
|
|
|
4479
4479
|
|
|
4480
4480
|
// ../../node_modules/.pnpm/msgpackr-extract@3.0.4/node_modules/msgpackr-extract/index.js
|
|
4481
4481
|
var require_msgpackr_extract = __commonJS(function(exports, module) {
|
|
4482
|
-
var __dirname = "/Users/
|
|
4482
|
+
var __dirname = "/Users/ivandasilveira/Sites/@awsless/node_modules/.pnpm/msgpackr-extract@3.0.4/node_modules/msgpackr-extract";
|
|
4483
4483
|
module.exports = require_node_gyp_build_optional_packages()(__dirname);
|
|
4484
4484
|
});
|
|
4485
4485
|
|
|
@@ -17343,7 +17343,7 @@ var require_src3 = __commonJS(function(exports) {
|
|
|
17343
17343
|
|
|
17344
17344
|
// ../../node_modules/.pnpm/@grpc+grpc-js@1.12.6/node_modules/@grpc/grpc-js/build/src/channelz.js
|
|
17345
17345
|
var require_channelz = __commonJS(function(exports) {
|
|
17346
|
-
var __dirname = "/Users/
|
|
17346
|
+
var __dirname = "/Users/ivandasilveira/Sites/@awsless/node_modules/.pnpm/@grpc+grpc-js@1.12.6/node_modules/@grpc/grpc-js/build/src";
|
|
17347
17347
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17348
17348
|
exports.registerChannelzSocket = exports.registerChannelzServer = exports.registerChannelzSubchannel = exports.registerChannelzChannel = exports.ChannelzCallTrackerStub = exports.ChannelzCallTracker = exports.ChannelzChildrenTrackerStub = exports.ChannelzChildrenTracker = exports.ChannelzTrace = exports.ChannelzTraceStub = undefined;
|
|
17349
17349
|
exports.unregisterChannelzRef = unregisterChannelzRef;
|
|
@@ -55168,7 +55168,7 @@ var require_replyTransformers = __commonJS(function(exports) {
|
|
|
55168
55168
|
|
|
55169
55169
|
// ../../node_modules/.pnpm/ioredis@6.0.0_supports-color@8.1.1/node_modules/ioredis/built/Command.js
|
|
55170
55170
|
var require_Command = __commonJS(function(exports) {
|
|
55171
|
-
var __dirname = "/Users/
|
|
55171
|
+
var __dirname = "/Users/ivandasilveira/Sites/@awsless/node_modules/.pnpm/ioredis@6.0.0_supports-color@8.1.1/node_modules/ioredis/built";
|
|
55172
55172
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55173
55173
|
var commands_1 = require_built();
|
|
55174
55174
|
var calculateSlot = require_lib4();
|
|
@@ -75677,7 +75677,7 @@ var require_cross_spawn = __commonJS(function(exports, module) {
|
|
|
75677
75677
|
var cp = __require("child_process");
|
|
75678
75678
|
var parse7 = require_parse4();
|
|
75679
75679
|
var enoent = require_enoent();
|
|
75680
|
-
function
|
|
75680
|
+
function spawn3(command, args, options) {
|
|
75681
75681
|
const parsed = parse7(command, args, options);
|
|
75682
75682
|
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
75683
75683
|
enoent.hookChildProcess(spawned, parsed);
|
|
@@ -75689,8 +75689,8 @@ var require_cross_spawn = __commonJS(function(exports, module) {
|
|
|
75689
75689
|
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
75690
75690
|
return result;
|
|
75691
75691
|
}
|
|
75692
|
-
module.exports =
|
|
75693
|
-
module.exports.spawn =
|
|
75692
|
+
module.exports = spawn3;
|
|
75693
|
+
module.exports.spawn = spawn3;
|
|
75694
75694
|
module.exports.sync = spawnSync;
|
|
75695
75695
|
module.exports._parse = parse7;
|
|
75696
75696
|
module.exports._enoent = enoent;
|
|
@@ -75719,7 +75719,7 @@ var require_db_util = __commonJS(function(exports) {
|
|
|
75719
75719
|
|
|
75720
75720
|
// ../../node_modules/.pnpm/redis-memory-server@0.17.1_supports-color@8.1.1/node_modules/redis-memory-server/lib/util/RedisInstance.js
|
|
75721
75721
|
var require_RedisInstance = __commonJS(function(exports) {
|
|
75722
|
-
var __dirname = "/Users/
|
|
75722
|
+
var __dirname = "/Users/ivandasilveira/Sites/@awsless/node_modules/.pnpm/redis-memory-server@0.17.1_supports-color@8.1.1/node_modules/redis-memory-server/lib/util";
|
|
75723
75723
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) {
|
|
75724
75724
|
function adopt(value) {
|
|
75725
75725
|
return value instanceof P2 ? value : new P2(function(resolve3) {
|
|
@@ -76696,7 +76696,7 @@ var require_chunk = __commonJS(function(exports, module) {
|
|
|
76696
76696
|
// ../../node_modules/.pnpm/tree-kill@1.2.2/node_modules/tree-kill/index.js
|
|
76697
76697
|
var require_tree_kill = __commonJS(function(exports, module) {
|
|
76698
76698
|
var childProcess2 = __require("child_process");
|
|
76699
|
-
var
|
|
76699
|
+
var spawn3 = childProcess2.spawn;
|
|
76700
76700
|
var exec3 = childProcess2.exec;
|
|
76701
76701
|
module.exports = function(pid, signal, callback) {
|
|
76702
76702
|
if (typeof signal === "function" && callback === undefined) {
|
|
@@ -76721,14 +76721,14 @@ var require_tree_kill = __commonJS(function(exports, module) {
|
|
|
76721
76721
|
break;
|
|
76722
76722
|
case "darwin":
|
|
76723
76723
|
buildProcessTree(pid, tree, pidsToProcess, function(parentPid) {
|
|
76724
|
-
return
|
|
76724
|
+
return spawn3("pgrep", ["-P", parentPid]);
|
|
76725
76725
|
}, function() {
|
|
76726
76726
|
killAll(tree, signal, callback);
|
|
76727
76727
|
});
|
|
76728
76728
|
break;
|
|
76729
76729
|
default:
|
|
76730
76730
|
buildProcessTree(pid, tree, pidsToProcess, function(parentPid) {
|
|
76731
|
-
return
|
|
76731
|
+
return spawn3("ps", ["-o", "pid", "--no-headers", "--ppid", parentPid]);
|
|
76732
76732
|
}, function() {
|
|
76733
76733
|
killAll(tree, signal, callback);
|
|
76734
76734
|
});
|
|
@@ -78795,7 +78795,7 @@ var require_client2 = __commonJS(function(exports) {
|
|
|
78795
78795
|
// ../../node_modules/.pnpm/@smithy+core@3.33.2/node_modules/@smithy/core/dist-cjs/submodules/config/index.js
|
|
78796
78796
|
var require_config = __commonJS(function(exports) {
|
|
78797
78797
|
var { homedir: homedir2 } = __require("os");
|
|
78798
|
-
var { sep: sep2, join:
|
|
78798
|
+
var { sep: sep2, join: join30 } = __require("path");
|
|
78799
78799
|
var { createHash: createHash15 } = __require("crypto");
|
|
78800
78800
|
var { readFile: readFile$1 } = __require("fs/promises");
|
|
78801
78801
|
var { IniSectionType } = require_dist_cjs();
|
|
@@ -78953,7 +78953,7 @@ var require_config = __commonJS(function(exports) {
|
|
|
78953
78953
|
var getSSOTokenFilepath = (id) => {
|
|
78954
78954
|
const hasher = createHash15("sha1");
|
|
78955
78955
|
const cacheName = hasher.update(id).digest("hex");
|
|
78956
|
-
return
|
|
78956
|
+
return join30(getHomeDir(), ".aws", "sso", "cache", `${cacheName}.json`);
|
|
78957
78957
|
};
|
|
78958
78958
|
var tokenIntercept = {};
|
|
78959
78959
|
var getSSOTokenFromFile = async (id) => {
|
|
@@ -78980,9 +78980,9 @@ var require_config = __commonJS(function(exports) {
|
|
|
78980
78980
|
...data.default && { default: data.default }
|
|
78981
78981
|
});
|
|
78982
78982
|
var ENV_CONFIG_PATH = "AWS_CONFIG_FILE";
|
|
78983
|
-
var getConfigFilepath = () => process.env[ENV_CONFIG_PATH] ||
|
|
78983
|
+
var getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || join30(getHomeDir(), ".aws", "config");
|
|
78984
78984
|
var ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE";
|
|
78985
|
-
var getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] ||
|
|
78985
|
+
var getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || join30(getHomeDir(), ".aws", "credentials");
|
|
78986
78986
|
var prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@+.%:/]+)\2$/;
|
|
78987
78987
|
var profileNameBlockList = ["__proto__", "profile __proto__"];
|
|
78988
78988
|
var parseIni = (iniData) => {
|
|
@@ -79048,11 +79048,11 @@ var require_config = __commonJS(function(exports) {
|
|
|
79048
79048
|
const relativeHomeDirPrefix = "~/";
|
|
79049
79049
|
let resolvedFilepath = filepath;
|
|
79050
79050
|
if (filepath.startsWith(relativeHomeDirPrefix)) {
|
|
79051
|
-
resolvedFilepath =
|
|
79051
|
+
resolvedFilepath = join30(homeDir, filepath.slice(2));
|
|
79052
79052
|
}
|
|
79053
79053
|
let resolvedConfigFilepath = configFilepath;
|
|
79054
79054
|
if (configFilepath.startsWith(relativeHomeDirPrefix)) {
|
|
79055
|
-
resolvedConfigFilepath =
|
|
79055
|
+
resolvedConfigFilepath = join30(homeDir, configFilepath.slice(2));
|
|
79056
79056
|
}
|
|
79057
79057
|
const parsedFiles = await Promise.all([
|
|
79058
79058
|
readFile14(resolvedConfigFilepath, {
|
|
@@ -98880,7 +98880,7 @@ var require_signin = __commonJS(function(exports) {
|
|
|
98880
98880
|
import { createHash as createHash15, createPrivateKey, createPublicKey, sign } from "crypto";
|
|
98881
98881
|
import { promises as fs4 } from "fs";
|
|
98882
98882
|
import { homedir as homedir2 } from "os";
|
|
98883
|
-
import { dirname as
|
|
98883
|
+
import { dirname as dirname17, join as join30 } from "path";
|
|
98884
98884
|
var import_config20, import_protocols3, LoginCredentialsFetcher;
|
|
98885
98885
|
var init_LoginCredentialsFetcher = __esm(() => {
|
|
98886
98886
|
import_config20 = __toESM(require_config(), 1);
|
|
@@ -99040,17 +99040,17 @@ var init_LoginCredentialsFetcher = __esm(() => {
|
|
|
99040
99040
|
}
|
|
99041
99041
|
async saveToken(token) {
|
|
99042
99042
|
const tokenFilePath = this.getTokenFilePath();
|
|
99043
|
-
const directory =
|
|
99043
|
+
const directory = dirname17(tokenFilePath);
|
|
99044
99044
|
try {
|
|
99045
99045
|
await fs4.mkdir(directory, { recursive: true });
|
|
99046
99046
|
} catch (error52) {}
|
|
99047
99047
|
await fs4.writeFile(tokenFilePath, JSON.stringify(token, null, 2), "utf8");
|
|
99048
99048
|
}
|
|
99049
99049
|
getTokenFilePath() {
|
|
99050
|
-
const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ??
|
|
99050
|
+
const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ?? join30(homedir2(), ".aws", "login", "cache");
|
|
99051
99051
|
const loginSessionBytes = Buffer.from(this.loginSession, "utf8");
|
|
99052
99052
|
const loginSessionSha256 = createHash15("sha256").update(loginSessionBytes).digest("hex");
|
|
99053
|
-
return
|
|
99053
|
+
return join30(directory, `${loginSessionSha256}.json`);
|
|
99054
99054
|
}
|
|
99055
99055
|
derToRawSignature(derSignature) {
|
|
99056
99056
|
let offset = 2;
|
|
@@ -107150,7 +107150,7 @@ var require_common_path_prefix = __commonJS(function(exports, module) {
|
|
|
107150
107150
|
|
|
107151
107151
|
// ../../node_modules/.pnpm/find-up-simple@1.0.1/node_modules/find-up-simple/index.js
|
|
107152
107152
|
import process5 from "process";
|
|
107153
|
-
import { fileURLToPath as
|
|
107153
|
+
import { fileURLToPath as fileURLToPath12 } from "url";
|
|
107154
107154
|
import fs5 from "fs";
|
|
107155
107155
|
import path3 from "path";
|
|
107156
107156
|
function findUpSync(name, {
|
|
@@ -107176,7 +107176,7 @@ function findUpSync(name, {
|
|
|
107176
107176
|
directory = path3.dirname(directory);
|
|
107177
107177
|
}
|
|
107178
107178
|
}
|
|
107179
|
-
var toPath = (urlOrPath) => urlOrPath instanceof URL ?
|
|
107179
|
+
var toPath = (urlOrPath) => urlOrPath instanceof URL ? fileURLToPath12(urlOrPath) : urlOrPath;
|
|
107180
107180
|
var init_find_up_simple = () => {};
|
|
107181
107181
|
|
|
107182
107182
|
// ../../node_modules/.pnpm/pkg-dir@8.0.0/node_modules/pkg-dir/index.js
|
|
@@ -107506,8 +107506,8 @@ import { Client as Client2 } from "@opensearch-project/opensearch";
|
|
|
107506
107506
|
import { AwsSigv4Signer } from "@opensearch-project/opensearch/aws";
|
|
107507
107507
|
import { createHash as createHash17 } from "crypto";
|
|
107508
107508
|
import { mkdir as mkdir6, rename as rename3, rm as rm8, stat as stat3 } from "fs/promises";
|
|
107509
|
-
import { join as
|
|
107510
|
-
import { execFile as execFile2, spawn as
|
|
107509
|
+
import { join as join32, resolve as resolve4 } from "path";
|
|
107510
|
+
import { execFile as execFile2, spawn as spawn4 } from "child_process";
|
|
107511
107511
|
import { promisify as promisify3 } from "util";
|
|
107512
107512
|
import { BigFloat, parse as parse10 } from "@awsless/big-float";
|
|
107513
107513
|
var import_decompress, import_sleep_await, mock, searchClient = (options = {}, service = "es") => {
|
|
@@ -107558,9 +107558,9 @@ var import_decompress, import_sleep_await, mock, searchClient = (options = {}, s
|
|
|
107558
107558
|
}
|
|
107559
107559
|
return true;
|
|
107560
107560
|
}, download = async ({ version: version3 }) => {
|
|
107561
|
-
const path6 =
|
|
107561
|
+
const path6 = join32(getDownloadPath(), "min");
|
|
107562
107562
|
const name = `opensearch-${version3}`;
|
|
107563
|
-
const file3 =
|
|
107563
|
+
const file3 = join32(path6, name);
|
|
107564
107564
|
if (await exists$1(file3))
|
|
107565
107565
|
return file3;
|
|
107566
107566
|
console.log(`Downloading OpenSearch ${version3}`);
|
|
@@ -107576,14 +107576,14 @@ var import_decompress, import_sleep_await, mock, searchClient = (options = {}, s
|
|
|
107576
107576
|
const checksum = (await checksumResponse.text()).split(/\s+/)[0];
|
|
107577
107577
|
if (createHash17("sha512").update(buffer).digest("hex") !== checksum)
|
|
107578
107578
|
throw new Error(`The OpenSearch archive doesn't match its published sha512 checksum: ${url2}`);
|
|
107579
|
-
const staging =
|
|
107579
|
+
const staging = join32(path6, `staging-${process.pid}`);
|
|
107580
107580
|
await mkdir6(staging, {
|
|
107581
107581
|
recursive: true,
|
|
107582
107582
|
mode: "0777"
|
|
107583
107583
|
});
|
|
107584
107584
|
await import_decompress.default(buffer, staging);
|
|
107585
107585
|
try {
|
|
107586
|
-
await rename3(
|
|
107586
|
+
await rename3(join32(staging, name), file3);
|
|
107587
107587
|
} catch (error52) {
|
|
107588
107588
|
if (!await exists$1(file3))
|
|
107589
107589
|
throw error52;
|
|
@@ -107595,7 +107595,7 @@ var import_decompress, import_sleep_await, mock, searchClient = (options = {}, s
|
|
|
107595
107595
|
return file3;
|
|
107596
107596
|
}, exec4, MINIMUM_JAVA_VERSION = 21, getJavaVersion = async (home) => {
|
|
107597
107597
|
try {
|
|
107598
|
-
const result = await exec4(
|
|
107598
|
+
const result = await exec4(join32(home, "bin/java"), ["-version"]);
|
|
107599
107599
|
const match2 = `${result.stdout}${result.stderr}`.match(/version "(\d+)/);
|
|
107600
107600
|
if (match2)
|
|
107601
107601
|
return Number(match2[1]);
|
|
@@ -107633,13 +107633,13 @@ var import_decompress, import_sleep_await, mock, searchClient = (options = {}, s
|
|
|
107633
107633
|
return ["-E", `${key}=${value}`];
|
|
107634
107634
|
}).flat();
|
|
107635
107635
|
}, launch = async ({ path: path6, host, port, version: version3, debug: debug4, onExit: onDied, onOutput }) => {
|
|
107636
|
-
const cache3 =
|
|
107636
|
+
const cache3 = join32(path6, "cache", String(port));
|
|
107637
107637
|
const cleanUp = async () => {
|
|
107638
107638
|
if (await exists2(cache3))
|
|
107639
107639
|
await rm8(cache3, { recursive: true });
|
|
107640
107640
|
};
|
|
107641
107641
|
await cleanUp();
|
|
107642
|
-
const binary =
|
|
107642
|
+
const binary = join32(path6, "bin/opensearch");
|
|
107643
107643
|
const env3 = { ...process.env };
|
|
107644
107644
|
if (process.platform === "darwin") {
|
|
107645
107645
|
const javaHome = await findJavaHome();
|
|
@@ -107648,7 +107648,7 @@ var import_decompress, import_sleep_await, mock, searchClient = (options = {}, s
|
|
|
107648
107648
|
env3.OPENSEARCH_JAVA_HOME = javaHome;
|
|
107649
107649
|
}
|
|
107650
107650
|
return new Promise((resolve5, reject) => {
|
|
107651
|
-
const child =
|
|
107651
|
+
const child = spawn4(binary, parseSettings(version3.settings({
|
|
107652
107652
|
host,
|
|
107653
107653
|
port,
|
|
107654
107654
|
cache: cache3
|
|
@@ -108528,7 +108528,7 @@ var require_find_exec = __commonJS(function(exports, module) {
|
|
|
108528
108528
|
var require_play_sound = __commonJS(function(exports, module) {
|
|
108529
108529
|
var fs7 = __require("fs");
|
|
108530
108530
|
var findExec = require_find_exec();
|
|
108531
|
-
var
|
|
108531
|
+
var spawn5 = __require("child_process").spawn;
|
|
108532
108532
|
var players = [
|
|
108533
108533
|
"mplayer",
|
|
108534
108534
|
"afplay",
|
|
@@ -108558,7 +108558,7 @@ var require_play_sound = __commonJS(function(exports, module) {
|
|
|
108558
108558
|
return next(new Error("Couldn't find a suitable audio player"));
|
|
108559
108559
|
}
|
|
108560
108560
|
var args = Array.isArray(options[this.player]) ? options[this.player].concat(what) : [what];
|
|
108561
|
-
var process7 =
|
|
108561
|
+
var process7 = spawn5(this.player, args, options);
|
|
108562
108562
|
if (!process7) {
|
|
108563
108563
|
next(new Error("Unable to spawn process with " + this.player));
|
|
108564
108564
|
return null;
|
|
@@ -140146,7 +140146,7 @@ var authFeature = defineFeature({
|
|
|
140146
140146
|
// src/feature/bundle/index.ts
|
|
140147
140147
|
import { createHash as createHash8 } from "crypto";
|
|
140148
140148
|
import { readdir as readdir3, readFile as readFile7, writeFile as writeFile6 } from "fs/promises";
|
|
140149
|
-
import { join as
|
|
140149
|
+
import { join as join10 } from "path";
|
|
140150
140150
|
import { toDays as toDays3, toSeconds as toSeconds2 } from "@awsless/duration";
|
|
140151
140151
|
|
|
140152
140152
|
// ../size/dist/index.js
|
|
@@ -140767,8 +140767,8 @@ var formatPolicyDocument = (statements) => {
|
|
|
140767
140767
|
// src/feature/function/util.ts
|
|
140768
140768
|
import { createHash as createHash7 } from "crypto";
|
|
140769
140769
|
import { readdir as readdir2, readFile as readFile6, rm as rm6, writeFile as writeFile5 } from "fs/promises";
|
|
140770
|
-
import { dirname as
|
|
140771
|
-
import { fileURLToPath as
|
|
140770
|
+
import { dirname as dirname5, join as join9 } from "path";
|
|
140771
|
+
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
140772
140772
|
import { days, seconds, toDays as toDays2, toSeconds } from "@awsless/duration";
|
|
140773
140773
|
import { generateFileHash as generateFileHash2 } from "@awsless/ts-file-cache";
|
|
140774
140774
|
var import_deepmerge = __toESM(require_cjs2(), 1);
|
|
@@ -144502,9 +144502,12 @@ var createTempFolder = async (name) => {
|
|
|
144502
144502
|
};
|
|
144503
144503
|
|
|
144504
144504
|
// src/feature/bundle/build/rolldown.ts
|
|
144505
|
+
import { spawn as spawn2 } from "child_process";
|
|
144505
144506
|
import { createHash as createHash5 } from "crypto";
|
|
144507
|
+
import { existsSync } from "fs";
|
|
144506
144508
|
import { readFile as readFile4 } from "fs/promises";
|
|
144507
|
-
import { extname as extname4 } from "path";
|
|
144509
|
+
import { dirname as dirname3, extname as extname4, join as join7 } from "path";
|
|
144510
|
+
import { fileURLToPath } from "url";
|
|
144508
144511
|
|
|
144509
144512
|
// ../../node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js
|
|
144510
144513
|
var balanced = (a2, b, str) => {
|
|
@@ -146344,6 +146347,55 @@ var createModuleMatcher = (patterns = []) => {
|
|
|
146344
146347
|
};
|
|
146345
146348
|
};
|
|
146346
146349
|
var bundleTypeScriptWithRolldown = async (props) => {
|
|
146350
|
+
const worker = findBuildWorker();
|
|
146351
|
+
if (!worker || process.env.AWSLESS_BUILD_IN_PROCESS) {
|
|
146352
|
+
return bundleTypeScriptInProcess(props);
|
|
146353
|
+
}
|
|
146354
|
+
return new Promise((resolve3, reject) => {
|
|
146355
|
+
const child = spawn2("bun", [worker], {
|
|
146356
|
+
cwd: directories.root,
|
|
146357
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
146358
|
+
});
|
|
146359
|
+
const stdout2 = [];
|
|
146360
|
+
const stderr = [];
|
|
146361
|
+
child.stdout.on("data", (chunk) => stdout2.push(chunk));
|
|
146362
|
+
child.stderr.on("data", (chunk) => stderr.push(chunk));
|
|
146363
|
+
child.on("error", reject);
|
|
146364
|
+
child.on("close", () => {
|
|
146365
|
+
try {
|
|
146366
|
+
const result = JSON.parse(Buffer.concat(stdout2).toString());
|
|
146367
|
+
if (!result.ok) {
|
|
146368
|
+
reject(result.expected ? new ExpectedError(result.message) : new Error(result.message));
|
|
146369
|
+
return;
|
|
146370
|
+
}
|
|
146371
|
+
resolve3({
|
|
146372
|
+
hash: result.hash,
|
|
146373
|
+
files: result.files.map((file3) => ({
|
|
146374
|
+
name: file3.name,
|
|
146375
|
+
code: Buffer.from(file3.code, "base64"),
|
|
146376
|
+
map: file3.map ? Buffer.from(file3.map, "base64") : undefined
|
|
146377
|
+
}))
|
|
146378
|
+
});
|
|
146379
|
+
} catch {
|
|
146380
|
+
reject(new Error(`The build worker failed:
|
|
146381
|
+
${Buffer.concat(stderr).toString().slice(-2000)}`));
|
|
146382
|
+
}
|
|
146383
|
+
});
|
|
146384
|
+
child.stdin.end(JSON.stringify({ root: directories.root, props }));
|
|
146385
|
+
});
|
|
146386
|
+
};
|
|
146387
|
+
var workerPath;
|
|
146388
|
+
var findBuildWorker = () => {
|
|
146389
|
+
if (workerPath === undefined) {
|
|
146390
|
+
const base = dirname3(fileURLToPath(import.meta.url));
|
|
146391
|
+
workerPath = [
|
|
146392
|
+
join7(base, "handlers/rolldown-worker.js"),
|
|
146393
|
+
join7(base, "../../../../dist/handlers/rolldown-worker.js")
|
|
146394
|
+
].find((candidate) => existsSync(candidate)) ?? false;
|
|
146395
|
+
}
|
|
146396
|
+
return workerPath;
|
|
146397
|
+
};
|
|
146398
|
+
var bundleTypeScriptInProcess = async (props) => {
|
|
146347
146399
|
const { format: format3 = "esm", minify = true } = props;
|
|
146348
146400
|
const hasModuleSideEffects = createModuleMatcher(props.moduleSideEffects);
|
|
146349
146401
|
const bundle = await rolldown({
|
|
@@ -146457,8 +146509,8 @@ var zipFiles = (files) => {
|
|
|
146457
146509
|
// src/feature/bundle/util.ts
|
|
146458
146510
|
import { createHash as createHash6 } from "crypto";
|
|
146459
146511
|
import { readFile as readFile5, rm as rm5, writeFile as writeFile4 } from "fs/promises";
|
|
146460
|
-
import { dirname as
|
|
146461
|
-
import { fileURLToPath } from "url";
|
|
146512
|
+
import { dirname as dirname4, join as join8 } from "path";
|
|
146513
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
146462
146514
|
import { generateDependencyHash, generateFileHash } from "@awsless/ts-file-cache";
|
|
146463
146515
|
import { formatRouteKey, ROUTE_HEADER } from "awsless";
|
|
146464
146516
|
var parseExportName = (handler) => {
|
|
@@ -146478,7 +146530,7 @@ var registerBundleFunction = (ctx, routeKey, props) => {
|
|
|
146478
146530
|
};
|
|
146479
146531
|
var buildBundle = (props) => {
|
|
146480
146532
|
return async (build2, { workspace }) => {
|
|
146481
|
-
const runtime = props.runtime ??
|
|
146533
|
+
const runtime = props.runtime ?? join8(dirname4(fileURLToPath2(import.meta.url)), "/handlers/bundle.js");
|
|
146482
146534
|
const handlers = [...props.handlers].toSorted((a2, b) => a2.routeKey.localeCompare(b.routeKey));
|
|
146483
146535
|
const entries2 = handlers.map(({ routeKey, file: file3, exportName }) => {
|
|
146484
146536
|
const virtualFile = JSON.stringify(formatRouteModuleId(file3, routeKey));
|
|
@@ -146507,7 +146559,7 @@ ${entries2.join(`
|
|
|
146507
146559
|
`;
|
|
146508
146560
|
const hashes = await Promise.all([
|
|
146509
146561
|
readFile5(runtime),
|
|
146510
|
-
...handlers.map((handler) =>
|
|
146562
|
+
...handlers.map((handler) => dirname4(handler.file) === dirname4(runtime) ? readFile5(handler.file) : generateFileHash(workspace, handler.file))
|
|
146511
146563
|
]);
|
|
146512
146564
|
const hash3 = createHash6("sha1").update(entry).update(JSON.stringify([
|
|
146513
146565
|
props.external,
|
|
@@ -146521,7 +146573,7 @@ ${entries2.join(`
|
|
|
146521
146573
|
const fingerprint = hash3.digest("hex");
|
|
146522
146574
|
return build2(fingerprint, async (write2) => {
|
|
146523
146575
|
const temp = await createTempFolder(`bundle--${props.name}`);
|
|
146524
|
-
const entryFile =
|
|
146576
|
+
const entryFile = join8(temp.path, "entry.ts");
|
|
146525
146577
|
await writeFile4(entryFile, entry);
|
|
146526
146578
|
const importAsString2 = handlers.flatMap((handler) => handler.importAsString ?? []);
|
|
146527
146579
|
const moduleSideEffects = handlers.flatMap((handler) => handler.moduleSideEffects ?? []);
|
|
@@ -146657,7 +146709,7 @@ export default (event, context) => {
|
|
|
146657
146709
|
}
|
|
146658
146710
|
`;
|
|
146659
146711
|
const temp = await createTempFolder(name);
|
|
146660
|
-
const entryFile =
|
|
146712
|
+
const entryFile = join9(temp.path, "entry.ts");
|
|
146661
146713
|
await writeFile5(entryFile, entry);
|
|
146662
146714
|
const result = await bundleTypeScriptWithRolldown({
|
|
146663
146715
|
file: entryFile,
|
|
@@ -146700,7 +146752,7 @@ export default (event, context) => {
|
|
|
146700
146752
|
const dir = getBuildPath("function", name, "files");
|
|
146701
146753
|
const files = await readdir2(dir);
|
|
146702
146754
|
const archive = await zipFiles([
|
|
146703
|
-
...files.filter((file3) => !file3.endsWith(".map")).map((file3) => ({ name: file3, path:
|
|
146755
|
+
...files.filter((file3) => !file3.endsWith(".map")).map((file3) => ({ name: file3, path: join9(dir, file3) })),
|
|
146704
146756
|
{ name: "awsless-env.mjs", code: Buffer.from(envFile, "utf8") }
|
|
146705
146757
|
]);
|
|
146706
146758
|
await writeFile5(zipFile, archive);
|
|
@@ -146944,10 +146996,10 @@ var createLambdaFunction = (ctx, id, local) => {
|
|
|
146944
146996
|
];
|
|
146945
146997
|
if (routes.length > 0) {
|
|
146946
146998
|
const bundle = ctx.shared.get("bundle", "main");
|
|
146947
|
-
const distDir =
|
|
146999
|
+
const distDir = dirname5(fileURLToPath3(import.meta.url));
|
|
146948
147000
|
const proxy = createLambdaFunctionFromZip(group, ctx, "function", `${id}-proxy`, {
|
|
146949
|
-
zipFile:
|
|
146950
|
-
sourceHash: $file(
|
|
147001
|
+
zipFile: join9(distDir, "/prebuild/sandbox-proxy/bundle.zip"),
|
|
147002
|
+
sourceHash: $file(join9(distDir, "/prebuild/sandbox-proxy/HASH")),
|
|
146951
147003
|
runtime: "nodejs24.x",
|
|
146952
147004
|
handler: "index.default",
|
|
146953
147005
|
publish: true,
|
|
@@ -147282,7 +147334,7 @@ var bundleFeature = defineFeature({
|
|
|
147282
147334
|
const dir = getBuildPath("bundle", name, "files");
|
|
147283
147335
|
const files = await readdir3(dir);
|
|
147284
147336
|
const archive = await zipFiles([
|
|
147285
|
-
...files.filter((file3) => !file3.endsWith(".map")).map((file3) => ({ name: file3, path:
|
|
147337
|
+
...files.filter((file3) => !file3.endsWith(".map")).map((file3) => ({ name: file3, path: join10(dir, file3) })),
|
|
147286
147338
|
{ name: "awsless-env.mjs", code: Buffer.from(envFile, "utf8") }
|
|
147287
147339
|
]);
|
|
147288
147340
|
await writeFile6(getBuildPath("bundle", name, "bundle.zip"), archive);
|
|
@@ -147765,7 +147817,7 @@ var commandFeature = defineFeature({
|
|
|
147765
147817
|
});
|
|
147766
147818
|
|
|
147767
147819
|
// src/feature/config/index.ts
|
|
147768
|
-
import { join as
|
|
147820
|
+
import { join as join13 } from "path";
|
|
147769
147821
|
|
|
147770
147822
|
// src/dev/servers/ssm.ts
|
|
147771
147823
|
import { readFile as readFile9 } from "fs/promises";
|
|
@@ -147774,25 +147826,25 @@ import { createServer as createServer2 } from "http";
|
|
|
147774
147826
|
// src/dev/util.ts
|
|
147775
147827
|
import { randomBytes } from "crypto";
|
|
147776
147828
|
import { createServer } from "net";
|
|
147777
|
-
import { join as
|
|
147829
|
+
import { join as join12 } from "path";
|
|
147778
147830
|
|
|
147779
147831
|
// src/dev/children.ts
|
|
147780
147832
|
var import_tree_kill = __toESM(require_tree_kill(), 1);
|
|
147781
|
-
import { execFile, spawn as
|
|
147833
|
+
import { execFile, spawn as spawn3 } from "child_process";
|
|
147782
147834
|
import { mkdir as mkdir5, readFile as readFile8, rm as rm7, writeFile as writeFile7 } from "fs/promises";
|
|
147783
|
-
import { dirname as
|
|
147835
|
+
import { dirname as dirname6, join as join11 } from "path";
|
|
147784
147836
|
import { promisify } from "util";
|
|
147785
147837
|
var tracked = new Map;
|
|
147786
147838
|
var childrenFile = () => {
|
|
147787
|
-
return
|
|
147839
|
+
return join11(directories.output, "dev", "children.json");
|
|
147788
147840
|
};
|
|
147789
147841
|
var persist = async () => {
|
|
147790
147842
|
const file3 = childrenFile();
|
|
147791
|
-
await mkdir5(
|
|
147843
|
+
await mkdir5(dirname6(file3), { recursive: true });
|
|
147792
147844
|
await writeFile7(file3, JSON.stringify([...tracked.values()]));
|
|
147793
147845
|
};
|
|
147794
147846
|
var spawnDevChild = (command, args, options = {}) => {
|
|
147795
|
-
const child =
|
|
147847
|
+
const child = spawn3(command, args, options);
|
|
147796
147848
|
if (child.pid) {
|
|
147797
147849
|
tracked.set(child.pid, { pid: child.pid, command: [command, ...args].join(" ") });
|
|
147798
147850
|
persist().catch(() => {});
|
|
@@ -147864,7 +147916,7 @@ if (typeof Bun === 'undefined') {
|
|
|
147864
147916
|
}
|
|
147865
147917
|
`;
|
|
147866
147918
|
var watchdogPath = () => {
|
|
147867
|
-
return
|
|
147919
|
+
return join12(directories.output, "local", WATCHDOG_FILE);
|
|
147868
147920
|
};
|
|
147869
147921
|
var TRACE_HEADER = "x-awsless-trace";
|
|
147870
147922
|
var traceId = () => randomBytes(4).toString("hex");
|
|
@@ -148093,7 +148145,7 @@ var configFeature = defineFeature({
|
|
|
148093
148145
|
for (const name of names) {
|
|
148094
148146
|
ctx.registerResource({ kind: "config", id: name });
|
|
148095
148147
|
}
|
|
148096
|
-
const file3 =
|
|
148148
|
+
const file3 = join13(directories.output, "local", "config.json");
|
|
148097
148149
|
const { server, port } = await ctx.keep("shim:ssm", file3, async () => {
|
|
148098
148150
|
const server2 = createSsmServer({ file: file3 });
|
|
148099
148151
|
const port2 = await server2.listen();
|
|
@@ -148456,6 +148508,75 @@ var formatFullDomainName = (config2, id, subDomain) => {
|
|
|
148456
148508
|
// src/feature/domain/index.ts
|
|
148457
148509
|
var domainFeature = defineFeature({
|
|
148458
148510
|
name: "domain",
|
|
148511
|
+
onValidate(ctx) {
|
|
148512
|
+
const domains = ctx.appConfig.domains ?? {};
|
|
148513
|
+
const fqdn = (name, domain2) => {
|
|
148514
|
+
const clean = (name ?? domain2).replace(/\.$/, "");
|
|
148515
|
+
return clean === domain2 || clean.endsWith(`.${domain2}`) ? clean : `${clean}.${domain2}`;
|
|
148516
|
+
};
|
|
148517
|
+
const seen = new Map;
|
|
148518
|
+
for (const [id, props] of Object.entries(domains)) {
|
|
148519
|
+
seen.set(`${id}:_amazonses.${props.domain}:TXT`, "the mail verification of the domain");
|
|
148520
|
+
seen.set(`${id}:mail.${props.domain}:MX`, "the mail setup of the domain");
|
|
148521
|
+
seen.set(`${id}:mail.${props.domain}:TXT`, "the mail setup of the domain");
|
|
148522
|
+
seen.set(`${id}:_dmarc.${props.domain}:TXT`, "the mail setup of the domain");
|
|
148523
|
+
}
|
|
148524
|
+
for (const [routerId, router] of Object.entries(ctx.appConfig.router ?? {})) {
|
|
148525
|
+
if (!router.domain) {
|
|
148526
|
+
continue;
|
|
148527
|
+
}
|
|
148528
|
+
const names = [formatFullDomainName(ctx.appConfig, router.domain, router.subDomain)];
|
|
148529
|
+
if (router.redirectWww) {
|
|
148530
|
+
names.push(`www.${names[0]}`);
|
|
148531
|
+
}
|
|
148532
|
+
for (const name of names) {
|
|
148533
|
+
seen.set(`${router.domain}:${name}:A`, `the "${routerId}" router`);
|
|
148534
|
+
seen.set(`${router.domain}:${name}:AAAA`, `the "${routerId}" router`);
|
|
148535
|
+
}
|
|
148536
|
+
}
|
|
148537
|
+
for (const [id, props] of Object.entries(domains)) {
|
|
148538
|
+
for (const record2 of props.dns ?? []) {
|
|
148539
|
+
seen.set(`${id}:${fqdn(record2.name, props.domain)}:${record2.type}`, "the app config");
|
|
148540
|
+
}
|
|
148541
|
+
}
|
|
148542
|
+
for (const stack of ctx.stackConfigs) {
|
|
148543
|
+
for (const [id, records] of Object.entries(stack.dns ?? {})) {
|
|
148544
|
+
const domain2 = domains[id];
|
|
148545
|
+
if (!domain2) {
|
|
148546
|
+
throw new FileError(stack.file, `Dns records for a non existent domain "${id}"`);
|
|
148547
|
+
}
|
|
148548
|
+
for (const record2 of records) {
|
|
148549
|
+
const name = fqdn(record2.name, domain2.domain);
|
|
148550
|
+
const key = `${id}:${name}:${record2.type}`;
|
|
148551
|
+
const owner = seen.get(key);
|
|
148552
|
+
if (owner) {
|
|
148553
|
+
throw new FileError(stack.file, `Conflicting dns record "${name} ${record2.type}" on domain "${id}" - already defined in ${owner}`);
|
|
148554
|
+
}
|
|
148555
|
+
seen.set(key, `"${stack.file}"`);
|
|
148556
|
+
}
|
|
148557
|
+
}
|
|
148558
|
+
}
|
|
148559
|
+
},
|
|
148560
|
+
onStack(ctx) {
|
|
148561
|
+
const entries2 = Object.entries(ctx.stackConfig.dns ?? {});
|
|
148562
|
+
for (const [id, records] of entries2) {
|
|
148563
|
+
const group = new Group(ctx.stack, "dns", id);
|
|
148564
|
+
const domain2 = ctx.appConfig.domains[id].domain;
|
|
148565
|
+
const zoneId = ctx.shared.entry("domain", "zone-id", id);
|
|
148566
|
+
for (const record2 of records) {
|
|
148567
|
+
const name = record2.name ?? domain2;
|
|
148568
|
+
new aws.route53.Record(group, `${name}-${record2.type}`, {
|
|
148569
|
+
zoneId,
|
|
148570
|
+
name,
|
|
148571
|
+
ttl: toSeconds4(record2.ttl),
|
|
148572
|
+
type: record2.type,
|
|
148573
|
+
records: record2.records
|
|
148574
|
+
}, {
|
|
148575
|
+
replaceOnChanges: ["name", "type", "zoneId"]
|
|
148576
|
+
});
|
|
148577
|
+
}
|
|
148578
|
+
}
|
|
148579
|
+
},
|
|
148459
148580
|
onApp(ctx) {
|
|
148460
148581
|
const domains = Object.entries(ctx.appConfig.domains ?? {});
|
|
148461
148582
|
if (domains.length === 0) {
|
|
@@ -148783,14 +148904,14 @@ var functionFeature = defineFeature({
|
|
|
148783
148904
|
});
|
|
148784
148905
|
|
|
148785
148906
|
// src/feature/icon/index.ts
|
|
148786
|
-
import { dirname as
|
|
148787
|
-
import { fileURLToPath as
|
|
148907
|
+
import { dirname as dirname7, join as join15 } from "path";
|
|
148908
|
+
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
148788
148909
|
import { toDays as toDays4 } from "@awsless/duration";
|
|
148789
148910
|
import { formatRouteEnvName as formatRouteEnvName2 } from "awsless";
|
|
148790
148911
|
|
|
148791
148912
|
// src/feature/icon/dev.ts
|
|
148792
148913
|
import { cp } from "fs/promises";
|
|
148793
|
-
import { isAbsolute as isAbsolute2, join as
|
|
148914
|
+
import { isAbsolute as isAbsolute2, join as join14 } from "path";
|
|
148794
148915
|
import { formatRouteEnvName } from "awsless";
|
|
148795
148916
|
var iconOnDev = async (ctx) => {
|
|
148796
148917
|
const icons = ctx.stackConfigs.flatMap((stack) => Object.keys(stack.icons ?? {}));
|
|
@@ -148829,8 +148950,8 @@ var iconOnDev = async (ctx) => {
|
|
|
148829
148950
|
}
|
|
148830
148951
|
if (props.origin.static) {
|
|
148831
148952
|
ctx.addEnv(formatRouteEnvName(routeKey, "ICON_ORIGIN_S3"), "true");
|
|
148832
|
-
const source = isAbsolute2(props.origin.static) ? props.origin.static :
|
|
148833
|
-
await cp(source,
|
|
148953
|
+
const source = isAbsolute2(props.origin.static) ? props.origin.static : join14(directories.root, props.origin.static);
|
|
148954
|
+
await cp(source, join14(directories.output, "local", "store", bucket, folder, "origin"), {
|
|
148834
148955
|
recursive: true
|
|
148835
148956
|
});
|
|
148836
148957
|
}
|
|
@@ -148877,7 +148998,7 @@ var iconFeature = defineFeature({
|
|
|
148877
148998
|
const serverRouteKey = formatRouteKey(ctx.stack.name, "icon", id);
|
|
148878
148999
|
bundle.addHandler({
|
|
148879
149000
|
routeKey: serverRouteKey,
|
|
148880
|
-
file:
|
|
149001
|
+
file: join15(dirname7(fileURLToPath4(import.meta.url)), "/handlers/icon.js"),
|
|
148881
149002
|
exportName: "default"
|
|
148882
149003
|
});
|
|
148883
149004
|
addRoutes({
|
|
@@ -148917,8 +149038,8 @@ var iconFeature = defineFeature({
|
|
|
148917
149038
|
new aws.s3.BucketObject(group, `static-${file3}`, {
|
|
148918
149039
|
bucket: bucket.name,
|
|
148919
149040
|
key: `${folder}origin/${file3}`,
|
|
148920
|
-
source:
|
|
148921
|
-
sourceHash: $hash(
|
|
149041
|
+
source: join15(props.origin.static, file3),
|
|
149042
|
+
sourceHash: $hash(join15(props.origin.static, file3))
|
|
148922
149043
|
}, {
|
|
148923
149044
|
replaceOnChanges: ["bucket", "key"]
|
|
148924
149045
|
});
|
|
@@ -148934,14 +149055,14 @@ var iconFeature = defineFeature({
|
|
|
148934
149055
|
// src/feature/image/index.ts
|
|
148935
149056
|
import { createHash as createHash9 } from "crypto";
|
|
148936
149057
|
import { readFile as readFile10 } from "fs/promises";
|
|
148937
|
-
import { dirname as
|
|
148938
|
-
import { fileURLToPath as
|
|
149058
|
+
import { dirname as dirname8, join as join17 } from "path";
|
|
149059
|
+
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
148939
149060
|
import { toDays as toDays5 } from "@awsless/duration";
|
|
148940
149061
|
import { formatRouteEnvName as formatRouteEnvName4 } from "awsless";
|
|
148941
149062
|
|
|
148942
149063
|
// src/feature/image/dev.ts
|
|
148943
149064
|
import { cp as cp2 } from "fs/promises";
|
|
148944
|
-
import { isAbsolute as isAbsolute3, join as
|
|
149065
|
+
import { isAbsolute as isAbsolute3, join as join16 } from "path";
|
|
148945
149066
|
import { formatRouteEnvName as formatRouteEnvName3 } from "awsless";
|
|
148946
149067
|
var imageOnDev = async (ctx) => {
|
|
148947
149068
|
const images = ctx.stackConfigs.flatMap((stack) => Object.keys(stack.images ?? {}));
|
|
@@ -148980,8 +149101,8 @@ var imageOnDev = async (ctx) => {
|
|
|
148980
149101
|
}
|
|
148981
149102
|
if (props.origin.static) {
|
|
148982
149103
|
ctx.addEnv(formatRouteEnvName3(routeKey, "IMAGE_ORIGIN_S3"), "true");
|
|
148983
|
-
const source = isAbsolute3(props.origin.static) ? props.origin.static :
|
|
148984
|
-
await cp2(source,
|
|
149104
|
+
const source = isAbsolute3(props.origin.static) ? props.origin.static : join16(directories.root, props.origin.static);
|
|
149105
|
+
await cp2(source, join16(directories.output, "local", "store", bucket, folder, "origin"), {
|
|
148985
149106
|
recursive: true
|
|
148986
149107
|
});
|
|
148987
149108
|
}
|
|
@@ -149011,7 +149132,7 @@ var imageFeature = defineFeature({
|
|
|
149011
149132
|
throw new FileError("app.json", "The image feature requires an arm64 function bundle.");
|
|
149012
149133
|
}
|
|
149013
149134
|
const group = new Group(ctx.base, "image", "layer");
|
|
149014
|
-
const path3 =
|
|
149135
|
+
const path3 = join17(dirname8(fileURLToPath5(import.meta.url)), "/layers/sharp-arm.zip");
|
|
149015
149136
|
const layerId = formatGlobalResourceName({
|
|
149016
149137
|
appName: ctx.appConfig.name,
|
|
149017
149138
|
resourceType: "layer",
|
|
@@ -149091,7 +149212,7 @@ var imageFeature = defineFeature({
|
|
|
149091
149212
|
const serverRouteKey = formatRouteKey(ctx.stack.name, "image", id);
|
|
149092
149213
|
bundle.addHandler({
|
|
149093
149214
|
routeKey: serverRouteKey,
|
|
149094
|
-
file:
|
|
149215
|
+
file: join17(dirname8(fileURLToPath5(import.meta.url)), "/handlers/image.js"),
|
|
149095
149216
|
exportName: "default",
|
|
149096
149217
|
external: ["sharp"]
|
|
149097
149218
|
});
|
|
@@ -149129,8 +149250,8 @@ var imageFeature = defineFeature({
|
|
|
149129
149250
|
new aws.s3.BucketObject(group, `static-${file3}`, {
|
|
149130
149251
|
bucket: bucket.name,
|
|
149131
149252
|
key: `${folder}origin/${file3}`,
|
|
149132
|
-
source:
|
|
149133
|
-
sourceHash: $hash(
|
|
149253
|
+
source: join17(props.origin.static, file3),
|
|
149254
|
+
sourceHash: $hash(join17(props.origin.static, file3))
|
|
149134
149255
|
}, {
|
|
149135
149256
|
replaceOnChanges: ["bucket", "key"]
|
|
149136
149257
|
});
|
|
@@ -149147,14 +149268,14 @@ var imageFeature = defineFeature({
|
|
|
149147
149268
|
import { days as days2, seconds as seconds2, toSeconds as toSeconds6 } from "@awsless/duration";
|
|
149148
149269
|
|
|
149149
149270
|
// src/feature/instance/dev.ts
|
|
149150
|
-
import { dirname as
|
|
149271
|
+
import { dirname as dirname11, join as join20 } from "path";
|
|
149151
149272
|
var import_deepmerge3 = __toESM(require_cjs2(), 1);
|
|
149152
149273
|
|
|
149153
149274
|
// src/feature/site/dev.ts
|
|
149154
|
-
import { delimiter, dirname as
|
|
149275
|
+
import { delimiter, dirname as dirname10, isAbsolute as isAbsolute4, join as join19, normalize as normalize2, relative as relative4 } from "path";
|
|
149155
149276
|
|
|
149156
149277
|
// src/feature/site/static-routes.ts
|
|
149157
|
-
import { basename, dirname as
|
|
149278
|
+
import { basename, dirname as dirname9, join as join18 } from "path";
|
|
149158
149279
|
var isPageFile = (file3) => {
|
|
149159
149280
|
return file3.endsWith(".html") || !basename(file3).includes(".");
|
|
149160
149281
|
};
|
|
@@ -149164,7 +149285,7 @@ var pageUrl = (file3) => {
|
|
|
149164
149285
|
}
|
|
149165
149286
|
const url2 = file3.slice(0, -".html".length);
|
|
149166
149287
|
if (basename(url2) === "index") {
|
|
149167
|
-
return
|
|
149288
|
+
return dirname9(url2);
|
|
149168
149289
|
}
|
|
149169
149290
|
return url2;
|
|
149170
149291
|
};
|
|
@@ -149173,10 +149294,10 @@ var planStaticRoutes = (files, sitePath) => {
|
|
|
149173
149294
|
const pages = files.filter((file3) => isPageFile(file3));
|
|
149174
149295
|
const assets = files.filter((file3) => !isPageFile(file3));
|
|
149175
149296
|
for (const page of pages) {
|
|
149176
|
-
plan.files[
|
|
149297
|
+
plan.files[join18(sitePath, pageUrl(page))] = page;
|
|
149177
149298
|
}
|
|
149178
149299
|
if (sitePath !== "/") {
|
|
149179
|
-
plan.catchAll =
|
|
149300
|
+
plan.catchAll = join18(sitePath, "*.");
|
|
149180
149301
|
return plan;
|
|
149181
149302
|
}
|
|
149182
149303
|
const folders = new Set;
|
|
@@ -149186,9 +149307,9 @@ var planStaticRoutes = (files, sitePath) => {
|
|
|
149186
149307
|
folders.add(folder);
|
|
149187
149308
|
continue;
|
|
149188
149309
|
}
|
|
149189
|
-
plan.files[
|
|
149310
|
+
plan.files[join18(sitePath, asset)] = asset;
|
|
149190
149311
|
}
|
|
149191
|
-
plan.dirs = [...folders].map((folder) =>
|
|
149312
|
+
plan.dirs = [...folders].map((folder) => join18(sitePath, folder, "*."));
|
|
149192
149313
|
return plan;
|
|
149193
149314
|
};
|
|
149194
149315
|
|
|
@@ -149197,8 +149318,8 @@ var binPath = (from) => {
|
|
|
149197
149318
|
const paths = [];
|
|
149198
149319
|
let dir = from;
|
|
149199
149320
|
while (true) {
|
|
149200
|
-
paths.push(
|
|
149201
|
-
const parent =
|
|
149321
|
+
paths.push(join19(dir, "node_modules", ".bin"));
|
|
149322
|
+
const parent = dirname10(dir);
|
|
149202
149323
|
if (parent === dir) {
|
|
149203
149324
|
break;
|
|
149204
149325
|
}
|
|
@@ -149229,7 +149350,7 @@ var siteOnDev = async (ctx) => {
|
|
|
149229
149350
|
async start({ env: env2 }) {
|
|
149230
149351
|
const value = await ctx.keep(key, { command, port, env: env2 }, async () => {
|
|
149231
149352
|
const [bin, ...args] = command.split(" ");
|
|
149232
|
-
const cwd =
|
|
149353
|
+
const cwd = join19(directories.root, dirname10(stackConfig.file));
|
|
149233
149354
|
const sink3 = {
|
|
149234
149355
|
emit: () => {},
|
|
149235
149356
|
stopping: false
|
|
@@ -149308,7 +149429,7 @@ ${tail.join(`
|
|
|
149308
149429
|
hostname: "127.0.0.1",
|
|
149309
149430
|
async fetch(request) {
|
|
149310
149431
|
const pathname = decodeURIComponent(new URL(request.url).pathname);
|
|
149311
|
-
const path3 = normalize2(
|
|
149432
|
+
const path3 = normalize2(join19(staticDir, pathname));
|
|
149312
149433
|
const rel = relative4(normalize2(staticDir), path3);
|
|
149313
149434
|
if (rel.startsWith("..") || isAbsolute4(rel)) {
|
|
149314
149435
|
return new Response("Forbidden", { status: 403 });
|
|
@@ -149386,7 +149507,7 @@ var instanceOnDev = async (ctx) => {
|
|
|
149386
149507
|
const healthPort = await findFreePort();
|
|
149387
149508
|
const merged = import_deepmerge3.default(ctx.appConfig.instance ?? {}, props);
|
|
149388
149509
|
const file3 = merged.code.file;
|
|
149389
|
-
const cwd =
|
|
149510
|
+
const cwd = join20(directories.root, dirname11(stackConfig.file));
|
|
149390
149511
|
let child;
|
|
149391
149512
|
let stopping = false;
|
|
149392
149513
|
let restarting = false;
|
|
@@ -149482,7 +149603,7 @@ ${tail.join(`
|
|
|
149482
149603
|
|
|
149483
149604
|
// src/feature/instance/util.ts
|
|
149484
149605
|
import { createHash as createHash11 } from "crypto";
|
|
149485
|
-
import { join as
|
|
149606
|
+
import { join as join22 } from "path";
|
|
149486
149607
|
import { toDays as toDays6, toSeconds as toSeconds5 } from "@awsless/duration";
|
|
149487
149608
|
import { stringify } from "@awsless/json";
|
|
149488
149609
|
import { generateFileHash as generateFileHash3 } from "@awsless/ts-file-cache";
|
|
@@ -149491,9 +149612,9 @@ var import_deepmerge4 = __toESM(require_cjs2(), 1);
|
|
|
149491
149612
|
// src/feature/instance/build/executable.ts
|
|
149492
149613
|
import { createHash as createHash10 } from "crypto";
|
|
149493
149614
|
import { readFile as readFile11 } from "fs/promises";
|
|
149494
|
-
import { join as
|
|
149615
|
+
import { join as join21 } from "path";
|
|
149495
149616
|
var buildExecutable = async (input, outputPath, architecture) => {
|
|
149496
|
-
const filePath =
|
|
149617
|
+
const filePath = join21(outputPath, "program");
|
|
149497
149618
|
const target2 = architecture === "x86_64" ? "bun-linux-x64" : "bun-linux-arm64";
|
|
149498
149619
|
let result;
|
|
149499
149620
|
try {
|
|
@@ -149739,7 +149860,7 @@ var createFargateTask = (parentGroup, ctx, ns2, id, local) => {
|
|
|
149739
149860
|
healthCheck: props.healthCheck ? {
|
|
149740
149861
|
command: [
|
|
149741
149862
|
"CMD-SHELL",
|
|
149742
|
-
`curl -f http://${
|
|
149863
|
+
`curl -f http://${join22("localhost", props.healthCheck.path)} || exit 1`
|
|
149743
149864
|
],
|
|
149744
149865
|
interval: toSeconds5(props.healthCheck.interval),
|
|
149745
149866
|
retries: props.healthCheck.retries,
|
|
@@ -149952,10 +150073,10 @@ var import_deepmerge5 = __toESM(require_cjs2(), 1);
|
|
|
149952
150073
|
// src/feature/job/build/executable.ts
|
|
149953
150074
|
import { createHash as createHash12 } from "crypto";
|
|
149954
150075
|
import { readFile as readFile12, writeFile as writeFile8 } from "fs/promises";
|
|
149955
|
-
import { join as
|
|
150076
|
+
import { join as join23, resolve as resolve3 } from "path";
|
|
149956
150077
|
var buildJobExecutable = async (input, outputPath, architecture) => {
|
|
149957
|
-
const filePath =
|
|
149958
|
-
const wrapperPath =
|
|
150078
|
+
const filePath = join23(outputPath, "program");
|
|
150079
|
+
const wrapperPath = join23(outputPath, "wrapper.ts");
|
|
149959
150080
|
const handlerPath = resolve3(input);
|
|
149960
150081
|
await writeFile8(wrapperPath, `import { parse } from '@awsless/json'
|
|
149961
150082
|
import { getObject } from '@awsless/s3'
|
|
@@ -150642,8 +150763,8 @@ var metricFeature = defineFeature({
|
|
|
150642
150763
|
});
|
|
150643
150764
|
|
|
150644
150765
|
// src/feature/on-error-log/index.ts
|
|
150645
|
-
import { dirname as
|
|
150646
|
-
import { fileURLToPath as
|
|
150766
|
+
import { dirname as dirname12, join as join24 } from "path";
|
|
150767
|
+
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
150647
150768
|
import { days as days3 } from "@awsless/duration";
|
|
150648
150769
|
var onErrorLogFeature = defineFeature({
|
|
150649
150770
|
name: "on-error-log",
|
|
@@ -150668,7 +150789,7 @@ var onErrorLogFeature = defineFeature({
|
|
|
150668
150789
|
const build2 = registerFunctionBuild(ctx, name, {
|
|
150669
150790
|
code: consumer.code,
|
|
150670
150791
|
handler: consumer.handler,
|
|
150671
|
-
wrapper:
|
|
150792
|
+
wrapper: join24(dirname12(fileURLToPath6(import.meta.url)), "/handlers/on-error-log.js")
|
|
150672
150793
|
});
|
|
150673
150794
|
const handler = createLambdaFunctionFromZip(group, ctx, "on-error-log", "handler", {
|
|
150674
150795
|
zipFile: build2.zipFile,
|
|
@@ -150727,8 +150848,8 @@ var onErrorLogFeature = defineFeature({
|
|
|
150727
150848
|
});
|
|
150728
150849
|
|
|
150729
150850
|
// src/feature/on-failure/index.ts
|
|
150730
|
-
import { dirname as
|
|
150731
|
-
import { fileURLToPath as
|
|
150851
|
+
import { dirname as dirname13, join as join25 } from "path";
|
|
150852
|
+
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
150732
150853
|
import { days as days4, toSeconds as toSeconds9 } from "@awsless/duration";
|
|
150733
150854
|
var onFailureFeature = defineFeature({
|
|
150734
150855
|
name: "on-failure",
|
|
@@ -150911,7 +151032,7 @@ var onFailureFeature = defineFeature({
|
|
|
150911
151032
|
const build2 = registerFunctionBuild(ctx, name, {
|
|
150912
151033
|
code: consumer.code,
|
|
150913
151034
|
handler: consumer.handler,
|
|
150914
|
-
wrapper:
|
|
151035
|
+
wrapper: join25(dirname13(fileURLToPath7(import.meta.url)), "/handlers/on-failure.js")
|
|
150915
151036
|
});
|
|
150916
151037
|
const handler = createLambdaFunctionFromZip(group, ctx, "on-failure", "handler", {
|
|
150917
151038
|
zipFile: build2.zipFile,
|
|
@@ -151002,13 +151123,13 @@ var onFailureFeature = defineFeature({
|
|
|
151002
151123
|
|
|
151003
151124
|
// src/feature/pubsub/index.ts
|
|
151004
151125
|
import { createHmac as createHmac2 } from "crypto";
|
|
151005
|
-
import { fileURLToPath as
|
|
151006
|
-
import { dirname as
|
|
151126
|
+
import { fileURLToPath as fileURLToPath10 } from "url";
|
|
151127
|
+
import { dirname as dirname16, join as join29 } from "path";
|
|
151007
151128
|
import { formatRouteEnvName as formatRouteEnvName6 } from "awsless";
|
|
151008
151129
|
|
|
151009
151130
|
// src/feature/pubsub/dev.ts
|
|
151010
|
-
import { dirname as
|
|
151011
|
-
import { fileURLToPath as
|
|
151131
|
+
import { dirname as dirname14, join as join26 } from "path";
|
|
151132
|
+
import { fileURLToPath as fileURLToPath8 } from "url";
|
|
151012
151133
|
var import_ioredis2 = __toESM(require_built3(), 1);
|
|
151013
151134
|
import { formatRouteEnvName as formatRouteEnvName5 } from "awsless";
|
|
151014
151135
|
|
|
@@ -151262,7 +151383,7 @@ var pubsubOnDev = async (ctx) => {
|
|
|
151262
151383
|
const sink3 = {
|
|
151263
151384
|
stopping: false
|
|
151264
151385
|
};
|
|
151265
|
-
const runtime =
|
|
151386
|
+
const runtime = join26(dirname14(fileURLToPath8(import.meta.url)), "handlers", "pubsub-server.js");
|
|
151266
151387
|
const child = spawnDevChild(process.execPath, ["-r", watchdogPath(), runtime], {
|
|
151267
151388
|
stdio: ["ignore", "ignore", "pipe"],
|
|
151268
151389
|
env: {
|
|
@@ -151338,14 +151459,14 @@ var durationMax = (max) => {
|
|
|
151338
151459
|
import { stat as stat2 } from "fs/promises";
|
|
151339
151460
|
|
|
151340
151461
|
// src/config/schema/relative-path.ts
|
|
151341
|
-
import { join as
|
|
151462
|
+
import { join as join27 } from "path";
|
|
151342
151463
|
var basePath;
|
|
151343
151464
|
var setLocalBasePath = (path3) => {
|
|
151344
151465
|
basePath = path3;
|
|
151345
151466
|
};
|
|
151346
151467
|
var resolvePath = (path3) => {
|
|
151347
151468
|
if (path3.startsWith(".") && basePath) {
|
|
151348
|
-
return
|
|
151469
|
+
return join27(basePath, path3);
|
|
151349
151470
|
}
|
|
151350
151471
|
return path3;
|
|
151351
151472
|
};
|
|
@@ -151871,11 +151992,11 @@ var pubsubEventTypes = ["connected", "disconnected", "subscribed", "unsubscribed
|
|
|
151871
151992
|
// src/feature/pubsub/util.ts
|
|
151872
151993
|
import { createHash as createHash14 } from "crypto";
|
|
151873
151994
|
import { readFile as readFile13 } from "fs/promises";
|
|
151874
|
-
import { fileURLToPath as
|
|
151875
|
-
import { dirname as
|
|
151995
|
+
import { fileURLToPath as fileURLToPath9 } from "url";
|
|
151996
|
+
import { dirname as dirname15, join as join28 } from "path";
|
|
151876
151997
|
import { toDays as toDays10 } from "@awsless/duration";
|
|
151877
151998
|
import { stringify as stringify3 } from "@awsless/json";
|
|
151878
|
-
var __dirname2 =
|
|
151999
|
+
var __dirname2 = dirname15(fileURLToPath9(import.meta.url));
|
|
151879
152000
|
var WS_PORT = 3000;
|
|
151880
152001
|
var ARCHITECTURE = "arm64";
|
|
151881
152002
|
var CPU = "256";
|
|
@@ -151891,7 +152012,7 @@ var createPubSubService = (parentGroup, ctx, id, props, inputs) => {
|
|
|
151891
152012
|
});
|
|
151892
152013
|
const shortName = shortId(`${ctx.app.name}:pubsub:${id}:${ctx.appId}`);
|
|
151893
152014
|
const image = "public.ecr.aws/aws-cli/aws-cli:arm64";
|
|
151894
|
-
const bundleFile =
|
|
152015
|
+
const bundleFile = join28(__dirname2, "handlers/pubsub-server.js");
|
|
151895
152016
|
ctx.registerBuild("pubsub", name, async (build2) => {
|
|
151896
152017
|
const hash3 = createHash14("sha1").update(await readFile13(bundleFile)).digest("hex");
|
|
151897
152018
|
const fingerprint = `${hash3}-${ARCHITECTURE}`;
|
|
@@ -152176,7 +152297,7 @@ var createPubSubService = (parentGroup, ctx, id, props, inputs) => {
|
|
|
152176
152297
|
};
|
|
152177
152298
|
|
|
152178
152299
|
// src/feature/pubsub/index.ts
|
|
152179
|
-
var __dirname3 =
|
|
152300
|
+
var __dirname3 = dirname16(fileURLToPath10(import.meta.url));
|
|
152180
152301
|
var typeGenCode8 = `
|
|
152181
152302
|
import type { Mock } from 'vitest'
|
|
152182
152303
|
|
|
@@ -152426,7 +152547,7 @@ var pubsubFeature = defineFeature({
|
|
|
152426
152547
|
const publisherRouteKey = formatRouteKey("base", "pubsub", `${id}-publisher`);
|
|
152427
152548
|
bundle.addHandler({
|
|
152428
152549
|
routeKey: publisherRouteKey,
|
|
152429
|
-
file:
|
|
152550
|
+
file: join29(__dirname3, "/handlers/pubsub-publisher.js"),
|
|
152430
152551
|
exportName: "default"
|
|
152431
152552
|
});
|
|
152432
152553
|
bundle.addEnv(formatRouteEnvName6(publisherRouteKey, "REDIS_HOST"), redisHost);
|
|
@@ -152690,7 +152811,7 @@ var formatWebEvent = (request, route, body, url2, sourceIp) => {
|
|
|
152690
152811
|
}
|
|
152691
152812
|
const cookie = request.headers.get("cookie");
|
|
152692
152813
|
const contentType2 = request.headers.get("content-type");
|
|
152693
|
-
const textual = typeof contentType2 === "string" && isTextualBody(contentType2);
|
|
152814
|
+
const textual = typeof contentType2 === "string" && isTextualBody(contentType2) && Buffer.from(body.toString()).equals(body);
|
|
152694
152815
|
const now = new Date;
|
|
152695
152816
|
return {
|
|
152696
152817
|
version: "2.0",
|
|
@@ -166224,8 +166345,8 @@ var routerFeature = defineFeature({
|
|
|
166224
166345
|
});
|
|
166225
166346
|
|
|
166226
166347
|
// src/feature/rpc/index.ts
|
|
166227
|
-
import { dirname as
|
|
166228
|
-
import { fileURLToPath as
|
|
166348
|
+
import { dirname as dirname18, join as join31, relative as relative7 } from "path";
|
|
166349
|
+
import { fileURLToPath as fileURLToPath11 } from "url";
|
|
166229
166350
|
import { toSeconds as toSeconds14 } from "@awsless/duration";
|
|
166230
166351
|
import { formatRouteEnvName as formatRouteEnvName8 } from "awsless";
|
|
166231
166352
|
|
|
@@ -166341,7 +166462,7 @@ var rpcFeature = defineFeature({
|
|
|
166341
166462
|
const serverRouteKey = formatRouteKey("base", "rpc", id);
|
|
166342
166463
|
bundle.addHandler({
|
|
166343
166464
|
routeKey: serverRouteKey,
|
|
166344
|
-
file:
|
|
166465
|
+
file: join31(dirname18(fileURLToPath11(import.meta.url)), "/handlers/rpc.js"),
|
|
166345
166466
|
exportName: "default"
|
|
166346
166467
|
});
|
|
166347
166468
|
bundle.addEnv(formatRouteEnvName8(serverRouteKey, "TIMEOUT"), toSeconds14(ctx.appConfig.function.timeout).toString());
|
|
@@ -166784,11 +166905,11 @@ var searchFeature = defineFeature({
|
|
|
166784
166905
|
|
|
166785
166906
|
// src/feature/site/index.ts
|
|
166786
166907
|
import { createHash as createHash18 } from "crypto";
|
|
166787
|
-
import { dirname as
|
|
166908
|
+
import { dirname as dirname19, join as join34 } from "path";
|
|
166788
166909
|
|
|
166789
166910
|
// src/util/cache.ts
|
|
166790
166911
|
import { lstat as lstat2, readdir as readdir4 } from "fs/promises";
|
|
166791
|
-
import { join as
|
|
166912
|
+
import { join as join33 } from "path";
|
|
166792
166913
|
var generateCacheKey = async (directories2) => {
|
|
166793
166914
|
const files = await listAllFiles(directories2);
|
|
166794
166915
|
const sortedFiles = files.toSorted();
|
|
@@ -166815,7 +166936,7 @@ var listAllFiles = async (list2) => {
|
|
|
166815
166936
|
recursive: true,
|
|
166816
166937
|
withFileTypes: true
|
|
166817
166938
|
});
|
|
166818
|
-
files.push(...dirents.filter((d3) => d3.isFile()).map((file3) =>
|
|
166939
|
+
files.push(...dirents.filter((d3) => d3.isFile()).map((file3) => join33(file3.parentPath, file3.name)));
|
|
166819
166940
|
} else if (stat4.isFile()) {
|
|
166820
166941
|
files.push(entry);
|
|
166821
166942
|
}
|
|
@@ -166845,7 +166966,7 @@ var siteFeature = defineFeature({
|
|
|
166845
166966
|
return build2(fingerprint, async (write2) => {
|
|
166846
166967
|
const credentialProvider = await getCredentials(ctx.appConfig.profile);
|
|
166847
166968
|
const credentials2 = await credentialProvider();
|
|
166848
|
-
const cwd2 =
|
|
166969
|
+
const cwd2 = join34(directories.root, dirname19(ctx.stackConfig.file));
|
|
166849
166970
|
const env3 = {
|
|
166850
166971
|
...process.env,
|
|
166851
166972
|
PATH: binPath(cwd2),
|
|
@@ -166930,7 +167051,7 @@ ${(errors4.trim() || output.trim()).slice(-2000)}`);
|
|
|
166930
167051
|
cwd: staticDir,
|
|
166931
167052
|
nodir: true
|
|
166932
167053
|
}).toSorted();
|
|
166933
|
-
const hashes = files.map((file3) => $hash(
|
|
167054
|
+
const hashes = files.map((file3) => $hash(join34(staticDir, file3)));
|
|
166934
167055
|
const version3 = $combine(...hashes).pipe((hashes2) => {
|
|
166935
167056
|
const hash3 = createHash18("sha1");
|
|
166936
167057
|
for (const [index, file3] of files.entries()) {
|
|
@@ -166979,7 +167100,7 @@ ${(errors4.trim() || output.trim()).slice(-2000)}`);
|
|
|
166979
167100
|
|
|
166980
167101
|
// src/feature/store/index.ts
|
|
166981
167102
|
import { cp as cp3 } from "fs/promises";
|
|
166982
|
-
import { join as
|
|
167103
|
+
import { join as join35 } from "path";
|
|
166983
167104
|
import { toDays as toDays11 } from "@awsless/duration";
|
|
166984
167105
|
var typeGenCode11 = `
|
|
166985
167106
|
import { Body, PutObjectProps, BodyStream } from '@awsless/s3'
|
|
@@ -167045,7 +167166,7 @@ var storeFeature = defineFeature({
|
|
|
167045
167166
|
for (const [id, props] of Object.entries(stack.stores ?? {})) {
|
|
167046
167167
|
if (typeof props.static === "string") {
|
|
167047
167168
|
const folder = getFeatureFolder("store", stack.name, id);
|
|
167048
|
-
await cp3(props.static,
|
|
167169
|
+
await cp3(props.static, join35(directories.output, "local", "store", bucket, folder), {
|
|
167049
167170
|
recursive: true,
|
|
167050
167171
|
force: true
|
|
167051
167172
|
});
|
|
@@ -167130,8 +167251,8 @@ var storeFeature = defineFeature({
|
|
|
167130
167251
|
key: `${folder}${file3}`,
|
|
167131
167252
|
cacheControl: getCacheControl(file3),
|
|
167132
167253
|
contentType: getContentType(file3),
|
|
167133
|
-
source:
|
|
167134
|
-
sourceHash: $hash(
|
|
167254
|
+
source: join35(props.static, file3),
|
|
167255
|
+
sourceHash: $hash(join35(props.static, file3))
|
|
167135
167256
|
}, {
|
|
167136
167257
|
replaceOnChanges: ["bucket", "key"]
|
|
167137
167258
|
});
|
|
@@ -167152,14 +167273,14 @@ import { toSeconds as toSeconds15 } from "@awsless/duration";
|
|
|
167152
167273
|
|
|
167153
167274
|
// src/feature/table/dev.ts
|
|
167154
167275
|
import { readFile as readFile14 } from "fs/promises";
|
|
167155
|
-
import { join as
|
|
167276
|
+
import { join as join37 } from "path";
|
|
167156
167277
|
import { CreateTableCommand as CreateTableCommand2, DeleteTableCommand } from "@aws-sdk/client-dynamodb";
|
|
167157
167278
|
import { PutCommand } from "@aws-sdk/lib-dynamodb";
|
|
167158
167279
|
|
|
167159
167280
|
// src/dev/reset.ts
|
|
167160
167281
|
var import_ioredis3 = __toESM(require_built3(), 1);
|
|
167161
167282
|
import { readdir as readdir5, rm as rm9 } from "fs/promises";
|
|
167162
|
-
import { join as
|
|
167283
|
+
import { join as join36 } from "path";
|
|
167163
167284
|
import { DeleteCommand, ScanCommand } from "@aws-sdk/lib-dynamodb";
|
|
167164
167285
|
import { Client as Client5 } from "@opensearch-project/opensearch";
|
|
167165
167286
|
var wiping = false;
|
|
@@ -167215,14 +167336,14 @@ var createDataReset = (props) => {
|
|
|
167215
167336
|
}
|
|
167216
167337
|
}
|
|
167217
167338
|
}
|
|
167218
|
-
const storeRoot =
|
|
167339
|
+
const storeRoot = join36(directories.output, "local", "store");
|
|
167219
167340
|
try {
|
|
167220
167341
|
for (const bucket of await readdir5(storeRoot)) {
|
|
167221
|
-
for (const entry of await readdir5(
|
|
167342
|
+
for (const entry of await readdir5(join36(storeRoot, bucket))) {
|
|
167222
167343
|
if (entry === "image" || entry === "icon") {
|
|
167223
167344
|
continue;
|
|
167224
167345
|
}
|
|
167225
|
-
await rm9(
|
|
167346
|
+
await rm9(join36(storeRoot, bucket, entry), { recursive: true, force: true });
|
|
167226
167347
|
}
|
|
167227
167348
|
}
|
|
167228
167349
|
} catch {}
|
|
@@ -167290,7 +167411,7 @@ var createTableInput = (name, props) => {
|
|
|
167290
167411
|
};
|
|
167291
167412
|
};
|
|
167292
167413
|
var loadSeed = async (stackName, id) => {
|
|
167293
|
-
const file3 =
|
|
167414
|
+
const file3 = join37(directories.output, "local", "seed", "table", stackName, `${id}.json`);
|
|
167294
167415
|
try {
|
|
167295
167416
|
const items = JSON.parse(await readFile14(file3, "utf8"));
|
|
167296
167417
|
return Array.isArray(items) ? items : [];
|
|
@@ -168350,7 +168471,7 @@ var createApp = (props) => {
|
|
|
168350
168471
|
|
|
168351
168472
|
// src/util/workspace.ts
|
|
168352
168473
|
import { mkdir as mkdir7, readFile as readFile15, rm as rm10, writeFile as writeFile10 } from "fs/promises";
|
|
168353
|
-
import { dirname as
|
|
168474
|
+
import { dirname as dirname20, join as join38 } from "path";
|
|
168354
168475
|
var getStateBucketName = (region, accountId) => {
|
|
168355
168476
|
return `awsless-state-${region}-${accountId}`;
|
|
168356
168477
|
};
|
|
@@ -168414,9 +168535,9 @@ var createWorkSpace = async (props) => {
|
|
|
168414
168535
|
};
|
|
168415
168536
|
};
|
|
168416
168537
|
var pullRemoteState = async (app, stateBackend) => {
|
|
168417
|
-
const file3 =
|
|
168538
|
+
const file3 = join38(directories.state, `${app.urn}.json`);
|
|
168418
168539
|
const state = await stateBackend.get(app.urn);
|
|
168419
|
-
await mkdir7(
|
|
168540
|
+
await mkdir7(dirname20(file3), { recursive: true });
|
|
168420
168541
|
if (typeof state === "undefined") {
|
|
168421
168542
|
const exist = await fileExist(file3);
|
|
168422
168543
|
if (exist) {
|
|
@@ -168427,14 +168548,14 @@ var pullRemoteState = async (app, stateBackend) => {
|
|
|
168427
168548
|
}
|
|
168428
168549
|
};
|
|
168429
168550
|
var pushRemoteState = async (app, stateBackend) => {
|
|
168430
|
-
const file3 =
|
|
168551
|
+
const file3 = join38(directories.state, `${app.urn}.json`);
|
|
168431
168552
|
const data = await readFile15(file3, "utf8");
|
|
168432
168553
|
const state = JSON.parse(data);
|
|
168433
168554
|
await stateBackend.update(app.urn, state);
|
|
168434
168555
|
};
|
|
168435
168556
|
|
|
168436
168557
|
// src/config/load/load.ts
|
|
168437
|
-
import { basename as basename3, dirname as
|
|
168558
|
+
import { basename as basename3, dirname as dirname22, join as join40 } from "path";
|
|
168438
168559
|
|
|
168439
168560
|
// src/feature/alert/schema.ts
|
|
168440
168561
|
var AlertNameSchema = exports_external.string().min(3).max(256).regex(/^[a-z0-9-]+$/i, "Invalid alert name").transform((value) => kebabCase(value)).describe("Define alert name.");
|
|
@@ -168471,15 +168592,17 @@ var DomainNameSchema = exports_external.string().regex(/[a-z\-_.]/g, "Invalid do
|
|
|
168471
168592
|
var DNSTypeSchema = exports_external.enum(["A", "AAAA", "CAA", "CNAME", "DS", "MX", "NAPTR", "NS", "PTR", "SOA", "SPF", "SRV", "TXT"]).describe("The DNS record type.");
|
|
168472
168593
|
var TTLSchema = DurationSchema.describe("The resource record cache time to live (TTL).");
|
|
168473
168594
|
var RecordsSchema = exports_external.string().array().describe("One or more values that correspond with the value that you specified for the Type property.");
|
|
168595
|
+
var DnsRecordSchema = exports_external.object({
|
|
168596
|
+
name: DomainNameSchema.optional(),
|
|
168597
|
+
type: DNSTypeSchema,
|
|
168598
|
+
ttl: TTLSchema,
|
|
168599
|
+
records: RecordsSchema
|
|
168600
|
+
});
|
|
168474
168601
|
var DomainsDefaultSchema = exports_external.record(ResourceIdSchema, exports_external.object({
|
|
168475
168602
|
domain: DomainNameSchema.describe("Define the domain name"),
|
|
168476
|
-
dns:
|
|
168477
|
-
name: DomainNameSchema.optional(),
|
|
168478
|
-
type: DNSTypeSchema,
|
|
168479
|
-
ttl: TTLSchema,
|
|
168480
|
-
records: RecordsSchema
|
|
168481
|
-
}).array().optional().describe("Define the domain dns records")
|
|
168603
|
+
dns: DnsRecordSchema.array().optional().describe("Define the domain dns records")
|
|
168482
168604
|
})).optional().describe("Define the domains for your application.");
|
|
168605
|
+
var StackDnsSchema = exports_external.record(ResourceIdSchema, DnsRecordSchema.array().describe("The dns records to add to the domain.")).optional().describe("Define extra dns records on domains from the app config.");
|
|
168483
168606
|
|
|
168484
168607
|
// src/feature/job/schema.ts
|
|
168485
168608
|
import { days as days10, toDays as toDays12 } from "@awsless/duration";
|
|
@@ -169255,6 +169378,7 @@ var StackSchema = exports_external.object({
|
|
|
169255
169378
|
$schema: exports_external.string().optional(),
|
|
169256
169379
|
name: NameSchema,
|
|
169257
169380
|
routes: RoutesSchema,
|
|
169381
|
+
dns: StackDnsSchema,
|
|
169258
169382
|
commands: CommandsSchema,
|
|
169259
169383
|
rest: RestSchema,
|
|
169260
169384
|
rpc: RpcSchema,
|
|
@@ -169279,7 +169403,7 @@ var StackSchema = exports_external.object({
|
|
|
169279
169403
|
|
|
169280
169404
|
// src/config/load/read.ts
|
|
169281
169405
|
import { readFile as readFile16 } from "fs/promises";
|
|
169282
|
-
import { basename as basename2, dirname as
|
|
169406
|
+
import { basename as basename2, dirname as dirname21, extname as extname5, join as join39 } from "path";
|
|
169283
169407
|
|
|
169284
169408
|
// ../../node_modules/.pnpm/fast-json-patch@3.1.1/node_modules/fast-json-patch/module/core.mjs
|
|
169285
169409
|
var exports_core3 = {};
|
|
@@ -170030,7 +170154,7 @@ var readConfigWithStage = async (file3, stage) => {
|
|
|
170030
170154
|
}
|
|
170031
170155
|
const ext2 = extname5(file3);
|
|
170032
170156
|
const stageFileName = basename2(file3, ext2) + "." + stage + ext2;
|
|
170033
|
-
const stageFile =
|
|
170157
|
+
const stageFile = join39(dirname21(file3), stageFileName);
|
|
170034
170158
|
const stageFileExists = await fileExist(stageFile);
|
|
170035
170159
|
if (!stageFileExists) {
|
|
170036
170160
|
return {
|
|
@@ -170050,7 +170174,7 @@ var readConfigWithStage = async (file3, stage) => {
|
|
|
170050
170174
|
// src/config/load/load.ts
|
|
170051
170175
|
var loadAppConfig = async (options) => {
|
|
170052
170176
|
debug("Find the root directory");
|
|
170053
|
-
const cwd2 = options.configFile ?
|
|
170177
|
+
const cwd2 = options.configFile ? dirname22(join40(process.cwd(), options.configFile)) : process.cwd();
|
|
170054
170178
|
const configFileOptions = options.configFile ? [basename3(options.configFile)] : ["app.json", "app.jsonc", "app.json5"];
|
|
170055
170179
|
const [appFileName, root4] = await findRootDir(cwd2, configFileOptions);
|
|
170056
170180
|
setRoot(root4);
|
|
@@ -170078,8 +170202,8 @@ var loadStackConfigs = async (options) => {
|
|
|
170078
170202
|
continue;
|
|
170079
170203
|
}
|
|
170080
170204
|
debug("Load stack file:", color2.info(file3));
|
|
170081
|
-
const stackConfig = await readConfigWithStage(
|
|
170082
|
-
setLocalBasePath(
|
|
170205
|
+
const stackConfig = await readConfigWithStage(join40(directories.root, file3), options.stage);
|
|
170206
|
+
setLocalBasePath(join40(directories.root, dirname22(file3)));
|
|
170083
170207
|
const stack = await validateConfig(StackSchema, stackConfig.file, stackConfig.data);
|
|
170084
170208
|
stacks.push({
|
|
170085
170209
|
...stack,
|
|
@@ -170845,12 +170969,12 @@ var auth = (program3) => {
|
|
|
170845
170969
|
|
|
170846
170970
|
// src/cli/command/bind.ts
|
|
170847
170971
|
import { readFile as readFile17 } from "fs/promises";
|
|
170848
|
-
import { join as
|
|
170972
|
+
import { join as join41 } from "path";
|
|
170849
170973
|
var bind = (program3) => {
|
|
170850
170974
|
program3.command("bind").argument("[command...]", "The command to execute").option("--config <string...>", "List of config values that will be accessable", (v3) => v3.split(",")).option("--local", "Bind against the running local dev environment instead of the deployed app").description(`Bind your site environment variables to a command`).action(async (commands4 = [], opts) => {
|
|
170851
170975
|
await layout("bind", async ({ appConfig, stackConfigs }) => {
|
|
170852
170976
|
if (opts.local) {
|
|
170853
|
-
const file3 =
|
|
170977
|
+
const file3 = join41(directories.output, "local", "env.json");
|
|
170854
170978
|
let env4;
|
|
170855
170979
|
try {
|
|
170856
170980
|
env4 = JSON.parse(await readFile17(file3, "utf8"));
|
|
@@ -173409,12 +173533,12 @@ import { DynamoDBClient as DynamoDBClient4 } from "@awsless/dynamodb";
|
|
|
173409
173533
|
|
|
173410
173534
|
// src/test/environment.ts
|
|
173411
173535
|
import { mkdir as mkdir8, writeFile as writeFile11 } from "fs/promises";
|
|
173412
|
-
import { join as
|
|
173536
|
+
import { join as join43 } from "path";
|
|
173413
173537
|
|
|
173414
173538
|
// src/test/manifest.ts
|
|
173415
|
-
import { isAbsolute as isAbsolute5, join as
|
|
173539
|
+
import { isAbsolute as isAbsolute5, join as join42 } from "path";
|
|
173416
173540
|
var absolute = (file3) => {
|
|
173417
|
-
return isAbsolute5(file3) ? file3 :
|
|
173541
|
+
return isAbsolute5(file3) ? file3 : join42(directories.root, file3);
|
|
173418
173542
|
};
|
|
173419
173543
|
var createTestManifest = (appConfig, stackConfigs) => {
|
|
173420
173544
|
const manifest = {
|
|
@@ -173505,7 +173629,7 @@ var waitForSearch2 = async (port, timeoutMs) => {
|
|
|
173505
173629
|
};
|
|
173506
173630
|
var withTestEnvironment = async (appConfig, stackConfigs, run) => {
|
|
173507
173631
|
const manifest = createTestManifest(appConfig, stackConfigs);
|
|
173508
|
-
const manifestFile =
|
|
173632
|
+
const manifestFile = join43(directories.output, "test", "manifest.json");
|
|
173509
173633
|
let redis;
|
|
173510
173634
|
let killSearch;
|
|
173511
173635
|
let booting;
|
|
@@ -173532,7 +173656,7 @@ var withTestEnvironment = async (appConfig, stackConfigs, run) => {
|
|
|
173532
173656
|
await redis.ping();
|
|
173533
173657
|
manifest.servers.redis = { host: "127.0.0.1", port: await redis.getPort() };
|
|
173534
173658
|
}
|
|
173535
|
-
await mkdir8(
|
|
173659
|
+
await mkdir8(join43(directories.output, "test"), { recursive: true });
|
|
173536
173660
|
await writeFile11(manifestFile, JSON.stringify(manifest));
|
|
173537
173661
|
})();
|
|
173538
173662
|
return booting;
|
|
@@ -173549,15 +173673,15 @@ var withTestEnvironment = async (appConfig, stackConfigs, run) => {
|
|
|
173549
173673
|
import { createHash as createHash19 } from "crypto";
|
|
173550
173674
|
import { mkdir as mkdir9, readdir as readdir6, readFile as readFile18, writeFile as writeFile12 } from "fs/promises";
|
|
173551
173675
|
import { availableParallelism } from "os";
|
|
173552
|
-
import { join as
|
|
173676
|
+
import { join as join45, relative as relative10, sep as sep2 } from "path";
|
|
173553
173677
|
import { inspect } from "util";
|
|
173554
173678
|
var import_wildstring2 = __toESM(require_wildstring(), 1);
|
|
173555
173679
|
import { parse as parse11, stringify as stringify4 } from "@awsless/json";
|
|
173556
173680
|
import { generateFileHash as generateFileHash5, generateFolderHash, loadWorkspace as loadWorkspace2 } from "@awsless/ts-file-cache";
|
|
173557
173681
|
|
|
173558
173682
|
// src/test/start.ts
|
|
173559
|
-
import { dirname as
|
|
173560
|
-
import { fileURLToPath as
|
|
173683
|
+
import { dirname as dirname23, join as join44 } from "path";
|
|
173684
|
+
import { fileURLToPath as fileURLToPath13 } from "url";
|
|
173561
173685
|
import { configDefaults } from "vitest/config";
|
|
173562
173686
|
import { startVitest } from "vitest/node";
|
|
173563
173687
|
|
|
@@ -173608,7 +173732,7 @@ ${statements.join(`
|
|
|
173608
173732
|
|
|
173609
173733
|
// src/test/start.ts
|
|
173610
173734
|
var startProjectsTest = async (props) => {
|
|
173611
|
-
const __dirname4 =
|
|
173735
|
+
const __dirname4 = dirname23(fileURLToPath13(import.meta.url));
|
|
173612
173736
|
const startTime = process.hrtime.bigint();
|
|
173613
173737
|
process.noDeprecation = true;
|
|
173614
173738
|
const nodeEnv = process.env["NODE_ENV"];
|
|
@@ -173650,7 +173774,7 @@ var startProjectsTest = async (props) => {
|
|
|
173650
173774
|
exclude: ["**/_*", "**/_*/**", ...configDefaults.exclude],
|
|
173651
173775
|
globals: true,
|
|
173652
173776
|
env: project.env,
|
|
173653
|
-
setupFiles: [
|
|
173777
|
+
setupFiles: [join44(__dirname4, "test-global-setup.js")]
|
|
173654
173778
|
}
|
|
173655
173779
|
}))
|
|
173656
173780
|
}, {
|
|
@@ -173851,7 +173975,7 @@ var countTestFiles = async (dir) => {
|
|
|
173851
173975
|
if (!entry.isFile() || !/\.(js|jsx|ts|tsx)$/.test(entry.name)) {
|
|
173852
173976
|
return false;
|
|
173853
173977
|
}
|
|
173854
|
-
const relativePath2 = relative10(dir,
|
|
173978
|
+
const relativePath2 = relative10(dir, join45(entry.parentPath, entry.name));
|
|
173855
173979
|
return relativePath2.split(sep2).every((segment) => !segment.startsWith("_"));
|
|
173856
173980
|
}).length;
|
|
173857
173981
|
};
|
|
@@ -173898,7 +174022,7 @@ var runTests = async (tests, stackFilters = [], testFilters = [], opts) => {
|
|
|
173898
174022
|
if (files === 0) {
|
|
173899
174023
|
continue;
|
|
173900
174024
|
}
|
|
173901
|
-
const file3 =
|
|
174025
|
+
const file3 = join45(directories.test, `${test.name}.json`);
|
|
173902
174026
|
const fingerprint = fingerprints.get(dir);
|
|
173903
174027
|
const cached2 = await readCachedResult(file3, fingerprint);
|
|
173904
174028
|
if (cached2) {
|
|
@@ -174439,18 +174563,18 @@ var watchConfig = async (options, resolve5, reject) => {
|
|
|
174439
174563
|
// src/dev/index.ts
|
|
174440
174564
|
import { watch as watch2 } from "fs";
|
|
174441
174565
|
import { mkdir as mkdir12, rm as rm13, writeFile as writeFile16 } from "fs/promises";
|
|
174442
|
-
import { basename as basename5, dirname as
|
|
174566
|
+
import { basename as basename5, dirname as dirname26, join as join52, sep as sep6 } from "path";
|
|
174443
174567
|
import { loadWorkspace as loadWorkspace3 } from "@awsless/ts-file-cache";
|
|
174444
174568
|
|
|
174445
174569
|
// src/dev/context.ts
|
|
174446
|
-
import { join as
|
|
174570
|
+
import { join as join47 } from "path";
|
|
174447
174571
|
import { DynamoDBServer } from "@awsless/dynamodb-server";
|
|
174448
174572
|
|
|
174449
174573
|
// src/dev/servers/s3.ts
|
|
174450
174574
|
import { createHash as createHash20 } from "crypto";
|
|
174451
174575
|
import { mkdir as mkdir10, readdir as readdir7, readFile as readFile19, rm as rm11, stat as stat6, writeFile as writeFile13 } from "fs/promises";
|
|
174452
174576
|
import { createServer as createServer7 } from "http";
|
|
174453
|
-
import { dirname as
|
|
174577
|
+
import { dirname as dirname24, isAbsolute as isAbsolute6, join as join46, relative as relative11, sep as sep4 } from "path";
|
|
174454
174578
|
var escapeXml = (value) => {
|
|
174455
174579
|
return value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
174456
174580
|
};
|
|
@@ -174515,8 +174639,8 @@ var createS3Server = (props) => {
|
|
|
174515
174639
|
res.end(xmlError("InvalidRequest", "Missing bucket name"));
|
|
174516
174640
|
return;
|
|
174517
174641
|
}
|
|
174518
|
-
const bucketDir =
|
|
174519
|
-
const file3 =
|
|
174642
|
+
const bucketDir = join46(props.root, bucket);
|
|
174643
|
+
const file3 = join46(bucketDir, ...keyParts);
|
|
174520
174644
|
const escapes = (base, path6) => {
|
|
174521
174645
|
const rel = relative11(base, path6);
|
|
174522
174646
|
return rel.startsWith("..") || isAbsolute6(rel);
|
|
@@ -174537,7 +174661,7 @@ var createS3Server = (props) => {
|
|
|
174537
174661
|
return;
|
|
174538
174662
|
}
|
|
174539
174663
|
for (const entry of entries2) {
|
|
174540
|
-
const path6 =
|
|
174664
|
+
const path6 = join46(dir, entry.name);
|
|
174541
174665
|
if (entry.isDirectory()) {
|
|
174542
174666
|
await walk2(path6);
|
|
174543
174667
|
} else {
|
|
@@ -174563,7 +174687,7 @@ var createS3Server = (props) => {
|
|
|
174563
174687
|
if (typeof encoding === "string" && encoding.includes("aws-chunked") || typeof sha === "string" && sha.startsWith("STREAMING")) {
|
|
174564
174688
|
body = decodeAwsChunked(body);
|
|
174565
174689
|
}
|
|
174566
|
-
await mkdir10(
|
|
174690
|
+
await mkdir10(dirname24(file3), { recursive: true });
|
|
174567
174691
|
await writeFile13(file3, body);
|
|
174568
174692
|
const eTag = createHash20("md5").update(body).digest("hex");
|
|
174569
174693
|
res.writeHead(200, { etag: `"${eTag}"` });
|
|
@@ -175011,7 +175135,7 @@ var createDevContext = (props) => {
|
|
|
175011
175135
|
const value = await props.pool.keep("store", null, async () => {
|
|
175012
175136
|
const rules = [];
|
|
175013
175137
|
const server = createS3Server({
|
|
175014
|
-
root:
|
|
175138
|
+
root: join47(directories.output, "local", "store"),
|
|
175015
175139
|
region: props.appConfig.region,
|
|
175016
175140
|
rules
|
|
175017
175141
|
});
|
|
@@ -175141,14 +175265,14 @@ var import_ioredis4 = __toESM(require_built3(), 1);
|
|
|
175141
175265
|
import { randomUUID as randomUUID8 } from "crypto";
|
|
175142
175266
|
import { readdir as readdir8, readFile as readFile20, stat as stat7, writeFile as writeFile15 } from "fs/promises";
|
|
175143
175267
|
import { createServer as createServer9 } from "http";
|
|
175144
|
-
import { join as
|
|
175268
|
+
import { join as join49, relative as relative12, sep as sep5 } from "path";
|
|
175145
175269
|
import { DynamoDBClient as DynamoDBClient6 } from "@aws-sdk/client-dynamodb";
|
|
175146
175270
|
import { DynamoDBDocumentClient, ScanCommand as ScanCommand2 } from "@aws-sdk/lib-dynamodb";
|
|
175147
175271
|
|
|
175148
175272
|
// src/dev/worker.ts
|
|
175149
175273
|
import { writeFile as writeFile14 } from "fs/promises";
|
|
175150
175274
|
import { availableParallelism as availableParallelism2 } from "os";
|
|
175151
|
-
import { join as
|
|
175275
|
+
import { join as join48 } from "path";
|
|
175152
175276
|
class WorkerError extends Error {
|
|
175153
175277
|
name;
|
|
175154
175278
|
constructor(name, message3, stack) {
|
|
@@ -175368,7 +175492,7 @@ var createBundleWorker = (props) => {
|
|
|
175368
175492
|
throw new Error("The bundle worker never became ready.");
|
|
175369
175493
|
};
|
|
175370
175494
|
const startWorker = async () => {
|
|
175371
|
-
const entry =
|
|
175495
|
+
const entry = join48(props.buildDir, "worker.mjs");
|
|
175372
175496
|
const port = await findFreePort();
|
|
175373
175497
|
const child = spawnDevChild("node", ["--enable-source-maps", entry], {
|
|
175374
175498
|
cwd: props.buildDir,
|
|
@@ -175429,7 +175553,7 @@ var createBundleWorker = (props) => {
|
|
|
175429
175553
|
return worker;
|
|
175430
175554
|
};
|
|
175431
175555
|
const doStart = async () => {
|
|
175432
|
-
await writeFile14(
|
|
175556
|
+
await writeFile14(join48(props.buildDir, "worker.mjs"), WORKER_ENTRY);
|
|
175433
175557
|
const results = await Promise.allSettled(Array.from({ length: concurrency }, () => startWorker()));
|
|
175434
175558
|
const started = results.filter((result) => result.status === "fulfilled").map((result) => result.value);
|
|
175435
175559
|
const failed = results.find((result) => result.status === "rejected");
|
|
@@ -176409,6 +176533,65 @@ const findRouteResource = route => {
|
|
|
176409
176533
|
return undefined
|
|
176410
176534
|
}
|
|
176411
176535
|
|
|
176536
|
+
// ------------------------------------------------------------------
|
|
176537
|
+
// Live events: every feed on a page shares one EventSource. The
|
|
176538
|
+
// browser only allows 6 connections per origin, so a stream per feed
|
|
176539
|
+
// would lock up the whole dashboard after a couple of open tabs.
|
|
176540
|
+
|
|
176541
|
+
const events = (() => {
|
|
176542
|
+
const handlers = new Map()
|
|
176543
|
+
let source
|
|
176544
|
+
let scheduled = false
|
|
176545
|
+
|
|
176546
|
+
const sync = () => {
|
|
176547
|
+
const channels = Array.from(handlers.keys()).sort().join(',')
|
|
176548
|
+
|
|
176549
|
+
if (source && source.channels === channels) {
|
|
176550
|
+
return
|
|
176551
|
+
}
|
|
176552
|
+
|
|
176553
|
+
source?.close()
|
|
176554
|
+
source = undefined
|
|
176555
|
+
|
|
176556
|
+
if (!channels) {
|
|
176557
|
+
return
|
|
176558
|
+
}
|
|
176559
|
+
|
|
176560
|
+
source = new EventSource('/api/events?channels=' + encodeURIComponent(channels))
|
|
176561
|
+
source.channels = channels
|
|
176562
|
+
source.onmessage = message => {
|
|
176563
|
+
try {
|
|
176564
|
+
const { channel, data } = JSON.parse(message.data)
|
|
176565
|
+
handlers.get(channel)?.forEach(handler => handler(data))
|
|
176566
|
+
} catch (_) {}
|
|
176567
|
+
}
|
|
176568
|
+
}
|
|
176569
|
+
|
|
176570
|
+
// A render pass tears feeds down & builds new ones in one go - the
|
|
176571
|
+
// microtask collapses that churn into a single reconnect.
|
|
176572
|
+
const schedule = () => {
|
|
176573
|
+
if (scheduled) return
|
|
176574
|
+
scheduled = true
|
|
176575
|
+
queueMicrotask(() => {
|
|
176576
|
+
scheduled = false
|
|
176577
|
+
sync()
|
|
176578
|
+
})
|
|
176579
|
+
}
|
|
176580
|
+
|
|
176581
|
+
return (channel, handler) => {
|
|
176582
|
+
let set = handlers.get(channel)
|
|
176583
|
+
if (!set) handlers.set(channel, (set = new Set()))
|
|
176584
|
+
set.add(handler)
|
|
176585
|
+
schedule()
|
|
176586
|
+
|
|
176587
|
+
return () => {
|
|
176588
|
+
set.delete(handler)
|
|
176589
|
+
if (set.size === 0) handlers.delete(channel)
|
|
176590
|
+
schedule()
|
|
176591
|
+
}
|
|
176592
|
+
}
|
|
176593
|
+
})()
|
|
176594
|
+
|
|
176412
176595
|
// A route tag that links through to its resource, shared by the log
|
|
176413
176596
|
// feeds & the activity feed.
|
|
176414
176597
|
const routeTag = route => {
|
|
@@ -176430,11 +176613,7 @@ const attachLogFeed = (main, channel, route, title = 'Logs') => {
|
|
|
176430
176613
|
const feed = $('div', { className: 'logs' }, $('p', { className: 'empty' }, 'Waiting for output...'))
|
|
176431
176614
|
main.append(feed)
|
|
176432
176615
|
|
|
176433
|
-
|
|
176434
|
-
|
|
176435
|
-
source.onmessage = message => {
|
|
176436
|
-
const data = JSON.parse(message.data)
|
|
176437
|
-
|
|
176616
|
+
return events(channel, data => {
|
|
176438
176617
|
// A route filter shows only the lines of one resource, like the
|
|
176439
176618
|
// function panel showing its own console output.
|
|
176440
176619
|
if (route && data.route !== route) {
|
|
@@ -176470,9 +176649,7 @@ const attachLogFeed = (main, channel, route, title = 'Logs') => {
|
|
|
176470
176649
|
}
|
|
176471
176650
|
|
|
176472
176651
|
feed.scrollTop = feed.scrollHeight
|
|
176473
|
-
}
|
|
176474
|
-
|
|
176475
|
-
return () => source.close()
|
|
176652
|
+
})
|
|
176476
176653
|
}
|
|
176477
176654
|
|
|
176478
176655
|
// ------------------------------------------------------------------
|
|
@@ -176489,11 +176666,7 @@ const showEventsFeed = channel => {
|
|
|
176489
176666
|
aside.hidden = false
|
|
176490
176667
|
feed.innerHTML = '<p class="empty">Waiting for events...</p>'
|
|
176491
176668
|
|
|
176492
|
-
const
|
|
176493
|
-
|
|
176494
|
-
source.onmessage = message => {
|
|
176495
|
-
const data = JSON.parse(message.data)
|
|
176496
|
-
|
|
176669
|
+
const unsubscribe = events(channel, data => {
|
|
176497
176670
|
feed.querySelector('.empty')?.remove()
|
|
176498
176671
|
feed.prepend($('div', { className: 'event' }, [
|
|
176499
176672
|
$('div', { className: 'head' }, [
|
|
@@ -176510,10 +176683,10 @@ const showEventsFeed = channel => {
|
|
|
176510
176683
|
while (feed.children.length > 25) {
|
|
176511
176684
|
feed.lastChild.remove()
|
|
176512
176685
|
}
|
|
176513
|
-
}
|
|
176686
|
+
})
|
|
176514
176687
|
|
|
176515
176688
|
return () => {
|
|
176516
|
-
|
|
176689
|
+
unsubscribe()
|
|
176517
176690
|
aside.hidden = true
|
|
176518
176691
|
document.body.classList.remove('with-events')
|
|
176519
176692
|
}
|
|
@@ -177377,12 +177550,7 @@ const renderHome = main => {
|
|
|
177377
177550
|
|
|
177378
177551
|
for (const entry of state.health ?? []) renderChip(entry)
|
|
177379
177552
|
|
|
177380
|
-
const
|
|
177381
|
-
healthSource.onmessage = message => {
|
|
177382
|
-
try {
|
|
177383
|
-
renderChip(JSON.parse(message.data))
|
|
177384
|
-
} catch (_) {}
|
|
177385
|
-
}
|
|
177553
|
+
const unsubHealth = events('health', renderChip)
|
|
177386
177554
|
|
|
177387
177555
|
if ((state.health ?? []).length > 0) {
|
|
177388
177556
|
main.append(chips)
|
|
@@ -177445,12 +177613,7 @@ const renderHome = main => {
|
|
|
177445
177613
|
}
|
|
177446
177614
|
}
|
|
177447
177615
|
|
|
177448
|
-
const
|
|
177449
|
-
problemSource.onmessage = message => {
|
|
177450
|
-
try {
|
|
177451
|
-
problemRow(JSON.parse(message.data))
|
|
177452
|
-
} catch (_) {}
|
|
177453
|
-
}
|
|
177616
|
+
const unsubProblems = events('problems', problemRow)
|
|
177454
177617
|
|
|
177455
177618
|
// ----------------------------------------------------------------
|
|
177456
177619
|
// Activity: every dispatch through the bundle, newest first.
|
|
@@ -177600,12 +177763,7 @@ const renderHome = main => {
|
|
|
177600
177763
|
activityFeed.scrollTop = activityFeed.scrollHeight
|
|
177601
177764
|
}
|
|
177602
177765
|
|
|
177603
|
-
const
|
|
177604
|
-
activitySource.onmessage = message => {
|
|
177605
|
-
try {
|
|
177606
|
-
activityRow(JSON.parse(message.data))
|
|
177607
|
-
} catch (_) {}
|
|
177608
|
-
}
|
|
177766
|
+
const unsubActivity = events('activity', activityRow)
|
|
177609
177767
|
|
|
177610
177768
|
// ----------------------------------------------------------------
|
|
177611
177769
|
// Logs: the handlers' own console output, live - the full feed
|
|
@@ -177616,9 +177774,9 @@ const renderHome = main => {
|
|
|
177616
177774
|
cleanupPanel = () => {
|
|
177617
177775
|
clearInterval(uptimeTimer)
|
|
177618
177776
|
closeTrace()
|
|
177619
|
-
|
|
177620
|
-
|
|
177621
|
-
|
|
177777
|
+
unsubHealth()
|
|
177778
|
+
unsubProblems()
|
|
177779
|
+
unsubActivity()
|
|
177622
177780
|
logsFeed?.()
|
|
177623
177781
|
}
|
|
177624
177782
|
}
|
|
@@ -177848,7 +178006,7 @@ var createDashboardServer = (props) => {
|
|
|
177848
178006
|
return;
|
|
177849
178007
|
}
|
|
177850
178008
|
for (const entry of entries2) {
|
|
177851
|
-
const path6 =
|
|
178009
|
+
const path6 = join49(dir, entry.name);
|
|
177852
178010
|
if (entry.isDirectory()) {
|
|
177853
178011
|
await walk2(path6);
|
|
177854
178012
|
} else {
|
|
@@ -177934,7 +178092,7 @@ var createDashboardServer = (props) => {
|
|
|
177934
178092
|
}
|
|
177935
178093
|
return { status: 404, body: JSON.stringify({ error: `Unknown dashboard path: ${url2.pathname}` }) };
|
|
177936
178094
|
};
|
|
177937
|
-
const streamEvents = (req, res,
|
|
178095
|
+
const streamEvents = (req, res, channels) => {
|
|
177938
178096
|
res.writeHead(200, {
|
|
177939
178097
|
"content-type": "text/event-stream",
|
|
177940
178098
|
"cache-control": "no-cache",
|
|
@@ -177943,17 +178101,19 @@ var createDashboardServer = (props) => {
|
|
|
177943
178101
|
res.write(`:connected
|
|
177944
178102
|
|
|
177945
178103
|
`);
|
|
177946
|
-
const
|
|
177947
|
-
res.write(`data: ${JSON.stringify(data)}
|
|
178104
|
+
const unsubscribes = channels.map((channel) => props.events.subscribe(channel, (data) => {
|
|
178105
|
+
res.write(`data: ${JSON.stringify({ channel, data })}
|
|
177948
178106
|
|
|
177949
178107
|
`);
|
|
177950
|
-
});
|
|
178108
|
+
}));
|
|
177951
178109
|
const heartbeat = setInterval(() => res.write(`:heartbeat
|
|
177952
178110
|
|
|
177953
178111
|
`), 15000);
|
|
177954
178112
|
req.on("close", () => {
|
|
177955
178113
|
clearInterval(heartbeat);
|
|
177956
|
-
unsubscribe
|
|
178114
|
+
for (const unsubscribe of unsubscribes) {
|
|
178115
|
+
unsubscribe();
|
|
178116
|
+
}
|
|
177957
178117
|
});
|
|
177958
178118
|
};
|
|
177959
178119
|
return {
|
|
@@ -177964,7 +178124,7 @@ var createDashboardServer = (props) => {
|
|
|
177964
178124
|
server = createServer9((req, res) => {
|
|
177965
178125
|
const url2 = new URL(req.url ?? "/", "http://localhost");
|
|
177966
178126
|
if (url2.pathname === "/api/events") {
|
|
177967
|
-
streamEvents(req, res, url2.searchParams.get("
|
|
178127
|
+
streamEvents(req, res, (url2.searchParams.get("channels") ?? "").split(",").filter(Boolean));
|
|
177968
178128
|
return;
|
|
177969
178129
|
}
|
|
177970
178130
|
const started = performance.now();
|
|
@@ -178057,15 +178217,15 @@ var createFailureReporter = (props) => {
|
|
|
178057
178217
|
// src/dev/sdk.ts
|
|
178058
178218
|
import { readdir as readdir9, readFile as readFile21, mkdir as mkdir11, rm as rm12, stat as stat8, symlink } from "fs/promises";
|
|
178059
178219
|
import { createRequire } from "module";
|
|
178060
|
-
import { dirname as
|
|
178220
|
+
import { dirname as dirname25, join as join50 } from "path";
|
|
178061
178221
|
var linkSdkPackages = async (workspace, buildDir, onWarn) => {
|
|
178062
|
-
const filesDir =
|
|
178222
|
+
const filesDir = join50(buildDir, "files");
|
|
178063
178223
|
const packages = new Set;
|
|
178064
178224
|
for (const file3 of await readdir9(filesDir)) {
|
|
178065
178225
|
if (!file3.endsWith(".mjs")) {
|
|
178066
178226
|
continue;
|
|
178067
178227
|
}
|
|
178068
|
-
const code = await readFile21(
|
|
178228
|
+
const code = await readFile21(join50(filesDir, file3), "utf8");
|
|
178069
178229
|
for (const match3 of code.matchAll(/(?:from\s*|import\()\s*["'](@aws-sdk\/[a-z0-9-]+|sharp)["']/g)) {
|
|
178070
178230
|
packages.add(match3[1]);
|
|
178071
178231
|
}
|
|
@@ -178073,7 +178233,7 @@ var linkSdkPackages = async (workspace, buildDir, onWarn) => {
|
|
|
178073
178233
|
const ownRequire = createRequire(import.meta.url);
|
|
178074
178234
|
const isProjectDep = async (name) => {
|
|
178075
178235
|
try {
|
|
178076
|
-
await stat8(
|
|
178236
|
+
await stat8(join50(directories.root, "node_modules", name, "package.json"));
|
|
178077
178237
|
return true;
|
|
178078
178238
|
} catch {
|
|
178079
178239
|
return false;
|
|
@@ -178082,19 +178242,19 @@ var linkSdkPackages = async (workspace, buildDir, onWarn) => {
|
|
|
178082
178242
|
const resolveFromDependents = async (name) => {
|
|
178083
178243
|
const roots = Object.values(workspace.packages).flatMap((pkg) => [
|
|
178084
178244
|
pkg.path,
|
|
178085
|
-
...Object.entries(pkg.dependencies).map(([dependency, info2]) => info2.type === "workspace" ? workspace.packages[info2.link]?.path :
|
|
178245
|
+
...Object.entries(pkg.dependencies).map(([dependency, info2]) => info2.type === "workspace" ? workspace.packages[info2.link]?.path : join50(pkg.path, "node_modules", dependency))
|
|
178086
178246
|
]);
|
|
178087
178247
|
for (const root4 of roots.filter((root5) => typeof root5 === "string").toSorted()) {
|
|
178088
|
-
const path6 =
|
|
178248
|
+
const path6 = join50(root4, "node_modules", name);
|
|
178089
178249
|
try {
|
|
178090
|
-
await stat8(
|
|
178250
|
+
await stat8(join50(path6, "package.json"));
|
|
178091
178251
|
return path6;
|
|
178092
178252
|
} catch {}
|
|
178093
178253
|
}
|
|
178094
178254
|
return;
|
|
178095
178255
|
};
|
|
178096
178256
|
for (const name of packages) {
|
|
178097
|
-
const target2 =
|
|
178257
|
+
const target2 = join50(buildDir, "node_modules", name);
|
|
178098
178258
|
try {
|
|
178099
178259
|
if (await isProjectDep(name)) {
|
|
178100
178260
|
await rm12(target2, { recursive: true, force: true });
|
|
@@ -178104,16 +178264,16 @@ var linkSdkPackages = async (workspace, buildDir, onWarn) => {
|
|
|
178104
178264
|
let source = await resolveFromDependents(name);
|
|
178105
178265
|
if (!source) {
|
|
178106
178266
|
try {
|
|
178107
|
-
source =
|
|
178267
|
+
source = dirname25(ownRequire.resolve(`${name}/package.json`));
|
|
178108
178268
|
} catch {
|
|
178109
178269
|
onWarn?.(`The bundle imports "${name}", which is neither a project dependency nor shipped with the cli. Add it to your project dependencies.`);
|
|
178110
178270
|
continue;
|
|
178111
178271
|
}
|
|
178112
178272
|
}
|
|
178113
|
-
await mkdir11(
|
|
178273
|
+
await mkdir11(dirname25(target2), { recursive: true });
|
|
178114
178274
|
await rm12(target2, { recursive: true, force: true });
|
|
178115
178275
|
await symlink(source, target2, "dir");
|
|
178116
|
-
await stat8(
|
|
178276
|
+
await stat8(join50(target2, "package.json"));
|
|
178117
178277
|
debug(`Sdk link ${name}: ${source}`);
|
|
178118
178278
|
} catch (error52) {
|
|
178119
178279
|
onWarn?.(`Linking the "${name}" sdk package failed: ${error52 instanceof Error ? error52.message : String(error52)}`);
|
|
@@ -178122,10 +178282,10 @@ var linkSdkPackages = async (workspace, buildDir, onWarn) => {
|
|
|
178122
178282
|
};
|
|
178123
178283
|
|
|
178124
178284
|
// src/dev/seed.ts
|
|
178125
|
-
import { spawn as
|
|
178126
|
-
import { isAbsolute as isAbsolute7, join as
|
|
178285
|
+
import { spawn as spawn5 } from "child_process";
|
|
178286
|
+
import { isAbsolute as isAbsolute7, join as join51 } from "path";
|
|
178127
178287
|
var createSeedRunner = (props) => {
|
|
178128
|
-
const file3 = props.seed && (isAbsolute7(props.seed) ? props.seed :
|
|
178288
|
+
const file3 = props.seed && (isAbsolute7(props.seed) ? props.seed : join51(directories.root, props.seed));
|
|
178129
178289
|
let running;
|
|
178130
178290
|
const run = () => {
|
|
178131
178291
|
running ??= (async () => {
|
|
@@ -178135,7 +178295,7 @@ var createSeedRunner = (props) => {
|
|
|
178135
178295
|
}
|
|
178136
178296
|
debug(`Seeding from ${props.seed}`);
|
|
178137
178297
|
await new Promise((resolve5, reject) => {
|
|
178138
|
-
const child =
|
|
178298
|
+
const child = spawn5("bun", [file3], {
|
|
178139
178299
|
cwd: directories.root,
|
|
178140
178300
|
stdio: ["ignore", "pipe", "pipe"],
|
|
178141
178301
|
env: { ...process.env, ...props.env }
|
|
@@ -178301,7 +178461,7 @@ var startDev = async (props) => {
|
|
|
178301
178461
|
dev: true
|
|
178302
178462
|
});
|
|
178303
178463
|
ready2();
|
|
178304
|
-
await mkdir12(
|
|
178464
|
+
await mkdir12(join52(directories.output, "local"), { recursive: true });
|
|
178305
178465
|
await writeFile16(watchdogPath(), WATCHDOG_SOURCE);
|
|
178306
178466
|
const routerPorts = {};
|
|
178307
178467
|
Object.keys(appConfig.router ?? {}).forEach((id, index) => {
|
|
@@ -178379,7 +178539,7 @@ var startDev = async (props) => {
|
|
|
178379
178539
|
for (const [id, port] of Object.entries(routerPorts)) {
|
|
178380
178540
|
env4[`ROUTER_${constantCase(id)}_ENDPOINT`] = `localhost:${port}`;
|
|
178381
178541
|
}
|
|
178382
|
-
await writeFile16(
|
|
178542
|
+
await writeFile16(join52(directories.output, "local", "env.json"), JSON.stringify(env4, null, "\t") + `
|
|
178383
178543
|
`);
|
|
178384
178544
|
return { env: env4, lambda: lambda2 };
|
|
178385
178545
|
});
|
|
@@ -178633,8 +178793,8 @@ var startDev = async (props) => {
|
|
|
178633
178793
|
resources: dev.resources,
|
|
178634
178794
|
routes: dev.routes,
|
|
178635
178795
|
env: env3,
|
|
178636
|
-
storeRoot:
|
|
178637
|
-
configFile:
|
|
178796
|
+
storeRoot: join52(directories.output, "local", "store"),
|
|
178797
|
+
configFile: join52(directories.output, "local", "config.json"),
|
|
178638
178798
|
getEmails: () => props.pool.peek("shim:ses-email")?.server.list() ?? [],
|
|
178639
178799
|
getAlerts: () => props.pool.peek("shim:sns")?.alerts ?? [],
|
|
178640
178800
|
getSession: () => ({ startedAt, workers: worker.size() }),
|
|
@@ -178685,8 +178845,8 @@ var startDev = async (props) => {
|
|
|
178685
178845
|
};
|
|
178686
178846
|
const restartWatchers = [];
|
|
178687
178847
|
for (const path6 of dev.restartPaths) {
|
|
178688
|
-
await mkdir12(
|
|
178689
|
-
restartWatchers.push(watch2(
|
|
178848
|
+
await mkdir12(dirname26(path6), { recursive: true });
|
|
178849
|
+
restartWatchers.push(watch2(dirname26(path6), (_event, filename) => {
|
|
178690
178850
|
if (filename === basename5(path6)) {
|
|
178691
178851
|
restartWorker();
|
|
178692
178852
|
}
|
|
@@ -178697,7 +178857,7 @@ var startDev = async (props) => {
|
|
|
178697
178857
|
routerPorts,
|
|
178698
178858
|
async stop() {
|
|
178699
178859
|
stopping = true;
|
|
178700
|
-
await rm13(
|
|
178860
|
+
await rm13(join52(directories.output, "local", "env.json"), { force: true });
|
|
178701
178861
|
clearTimeout(rebuildTimer);
|
|
178702
178862
|
watcher.close();
|
|
178703
178863
|
for (const restartWatcher of restartWatchers) {
|
|
@@ -178765,7 +178925,7 @@ var createServerPool = () => {
|
|
|
178765
178925
|
|
|
178766
178926
|
// src/type-gen/generate.ts
|
|
178767
178927
|
import { mkdir as mkdir13, writeFile as writeFile17 } from "fs/promises";
|
|
178768
|
-
import { dirname as
|
|
178928
|
+
import { dirname as dirname27, join as join53, relative as relative13 } from "path";
|
|
178769
178929
|
var generateTypes = async (props) => {
|
|
178770
178930
|
const files = [];
|
|
178771
178931
|
await Promise.all(features.map(async (feature) => {
|
|
@@ -178773,12 +178933,12 @@ var generateTypes = async (props) => {
|
|
|
178773
178933
|
...props,
|
|
178774
178934
|
async write(file3, data, include = false) {
|
|
178775
178935
|
const code = data?.toString("utf8");
|
|
178776
|
-
const path6 =
|
|
178936
|
+
const path6 = join53(directories.types, file3);
|
|
178777
178937
|
if (code) {
|
|
178778
178938
|
if (include) {
|
|
178779
178939
|
files.push(relative13(directories.root, path6));
|
|
178780
178940
|
}
|
|
178781
|
-
await mkdir13(
|
|
178941
|
+
await mkdir13(dirname27(path6), { recursive: true });
|
|
178782
178942
|
await writeFile17(path6, code);
|
|
178783
178943
|
}
|
|
178784
178944
|
}
|
|
@@ -178787,7 +178947,7 @@ var generateTypes = async (props) => {
|
|
|
178787
178947
|
if (files.length) {
|
|
178788
178948
|
const code = files.map((file3) => `/// <reference path='${file3}' />`).join(`
|
|
178789
178949
|
`);
|
|
178790
|
-
await writeFile17(
|
|
178950
|
+
await writeFile17(join53(directories.root, `awsless.d.ts`), code);
|
|
178791
178951
|
}
|
|
178792
178952
|
};
|
|
178793
178953
|
|
|
@@ -179692,7 +179852,7 @@ var import_config33 = __toESM(require_config(), 1);
|
|
|
179692
179852
|
var import_endpoints7 = __toESM(require_endpoints(), 1);
|
|
179693
179853
|
var import_protocols11 = __toESM(require_protocols(), 1);
|
|
179694
179854
|
var import_retry6 = __toESM(require_retry2(), 1);
|
|
179695
|
-
var
|
|
179855
|
+
var import_schema69 = __toESM(require_schema(), 1);
|
|
179696
179856
|
|
|
179697
179857
|
// ../../node_modules/.pnpm/@aws-sdk+client-iot-data-plane@3.1113.0/node_modules/@aws-sdk/client-iot-data-plane/dist-es/auth/httpAuthSchemeProvider.js
|
|
179698
179858
|
var import_httpAuthSchemes4 = __toESM(require_httpAuthSchemes(), 1);
|
|
@@ -179990,7 +180150,7 @@ var defaultEndpointResolver3 = (endpointParams, context = {}) => {
|
|
|
179990
180150
|
import_endpoints6.customEndpointFunctions.aws = import_client26.awsEndpointFunctions;
|
|
179991
180151
|
|
|
179992
180152
|
// ../../node_modules/.pnpm/@aws-sdk+client-iot-data-plane@3.1113.0/node_modules/@aws-sdk/client-iot-data-plane/dist-es/schemas/schemas_0.js
|
|
179993
|
-
var
|
|
180153
|
+
var import_schema68 = __toESM(require_schema(), 1);
|
|
179994
180154
|
|
|
179995
180155
|
// ../../node_modules/.pnpm/@aws-sdk+client-iot-data-plane@3.1113.0/node_modules/@aws-sdk/client-iot-data-plane/dist-es/models/IoTDataPlaneServiceException.js
|
|
179996
180156
|
var import_client27 = __toESM(require_client2(), 1);
|
|
@@ -180263,10 +180423,10 @@ var _xamcd = "x-amz-mqtt5-correlation-data";
|
|
|
180263
180423
|
var _xampfi = "x-amz-mqtt5-payload-format-indicator";
|
|
180264
180424
|
var _xamup = "x-amz-mqtt5-user-properties";
|
|
180265
180425
|
var n03 = "com.amazonaws.iotdataplane";
|
|
180266
|
-
var _s_registry3 =
|
|
180426
|
+
var _s_registry3 = import_schema68.TypeRegistry.for(_s4);
|
|
180267
180427
|
var IoTDataPlaneServiceException$ = [-3, _s4, "IoTDataPlaneServiceException", 0, [], []];
|
|
180268
180428
|
_s_registry3.registerError(IoTDataPlaneServiceException$, IoTDataPlaneServiceException);
|
|
180269
|
-
var n0_registry3 =
|
|
180429
|
+
var n0_registry3 = import_schema68.TypeRegistry.for(n03);
|
|
180270
180430
|
var ConflictException$ = [
|
|
180271
180431
|
-3,
|
|
180272
180432
|
n03,
|
|
@@ -180807,7 +180967,7 @@ class IoTDataPlaneClient extends import_client34.Client {
|
|
|
180807
180967
|
const _config_7 = resolveHttpAuthSchemeConfig3(_config_6);
|
|
180808
180968
|
const _config_8 = resolveRuntimeExtensions3(_config_7, configuration?.extensions || []);
|
|
180809
180969
|
this.config = _config_8;
|
|
180810
|
-
this.middlewareStack.use(
|
|
180970
|
+
this.middlewareStack.use(import_schema69.getSchemaSerdePlugin(this.config));
|
|
180811
180971
|
this.middlewareStack.use(import_client33.getUserAgentPlugin(this.config));
|
|
180812
180972
|
this.middlewareStack.use(import_retry6.getRetryPlugin(this.config));
|
|
180813
180973
|
this.middlewareStack.use(import_protocols11.getContentLengthPlugin(this.config));
|
|
@@ -180934,7 +181094,7 @@ var sinon;
|
|
|
180934
181094
|
const arraySlice = arrayProto.slice;
|
|
180935
181095
|
const concat = arrayProto.concat;
|
|
180936
181096
|
const forEach = arrayProto.forEach;
|
|
180937
|
-
const
|
|
181097
|
+
const join54 = arrayProto.join;
|
|
180938
181098
|
const splice = arrayProto.splice;
|
|
180939
181099
|
function applyDefaults(obj, defaults2) {
|
|
180940
181100
|
for (const key of Object.keys(defaults2)) {
|
|
@@ -180970,7 +181130,7 @@ var sinon;
|
|
|
180970
181130
|
let actual = "";
|
|
180971
181131
|
if (!calledInOrder(arguments)) {
|
|
180972
181132
|
try {
|
|
180973
|
-
expected =
|
|
181133
|
+
expected = join54(arguments, ", ");
|
|
180974
181134
|
const calls = arraySlice(arguments);
|
|
180975
181135
|
let i5 = calls.length;
|
|
180976
181136
|
while (i5) {
|
|
@@ -180978,7 +181138,7 @@ var sinon;
|
|
|
180978
181138
|
splice(calls, i5, 1);
|
|
180979
181139
|
}
|
|
180980
181140
|
}
|
|
180981
|
-
actual =
|
|
181141
|
+
actual = join54(orderByFirstCall(calls), ", ");
|
|
180982
181142
|
} catch (e5) {}
|
|
180983
181143
|
failAssertion(this, `expected ${expected} to be called in order but were called as ${actual}`);
|
|
180984
181144
|
} else {
|
|
@@ -181023,7 +181183,7 @@ var sinon;
|
|
|
181023
181183
|
` expected = ${inspect2(expectation)}`,
|
|
181024
181184
|
` actual = ${inspect2(actual)}`
|
|
181025
181185
|
];
|
|
181026
|
-
failAssertion(this,
|
|
181186
|
+
failAssertion(this, join54(formatted, `
|
|
181027
181187
|
`));
|
|
181028
181188
|
}
|
|
181029
181189
|
}
|
|
@@ -181128,7 +181288,7 @@ var sinon;
|
|
|
181128
181288
|
const valueToString = require2("@sinonjs/commons").valueToString;
|
|
181129
181289
|
const exportAsyncBehaviors = require2("./util/core/export-async-behaviors");
|
|
181130
181290
|
const concat = arrayProto.concat;
|
|
181131
|
-
const
|
|
181291
|
+
const join54 = arrayProto.join;
|
|
181132
181292
|
const reverse = arrayProto.reverse;
|
|
181133
181293
|
const slice = arrayProto.slice;
|
|
181134
181294
|
const useLeftMostCallback = -1;
|
|
@@ -181165,7 +181325,7 @@ var sinon;
|
|
|
181165
181325
|
msg = `${functionName(behavior.stub)} expected to yield, but no callback was passed.`;
|
|
181166
181326
|
}
|
|
181167
181327
|
if (args.length > 0) {
|
|
181168
|
-
msg += ` Received [${
|
|
181328
|
+
msg += ` Received [${join54(args, ", ")}]`;
|
|
181169
181329
|
}
|
|
181170
181330
|
return msg;
|
|
181171
181331
|
}
|
|
@@ -181975,7 +182135,7 @@ var sinon;
|
|
|
181975
182135
|
const filter2 = arrayProto.filter;
|
|
181976
182136
|
const forEach = arrayProto.forEach;
|
|
181977
182137
|
const every = arrayProto.every;
|
|
181978
|
-
const
|
|
182138
|
+
const join54 = arrayProto.join;
|
|
181979
182139
|
const push = arrayProto.push;
|
|
181980
182140
|
const slice = arrayProto.slice;
|
|
181981
182141
|
const unshift = arrayProto.unshift;
|
|
@@ -182052,10 +182212,10 @@ var sinon;
|
|
|
182052
182212
|
});
|
|
182053
182213
|
this.restore();
|
|
182054
182214
|
if (messages.length > 0) {
|
|
182055
|
-
mockExpectation.fail(
|
|
182215
|
+
mockExpectation.fail(join54(concat(messages, met), `
|
|
182056
182216
|
`));
|
|
182057
182217
|
} else if (met.length > 0) {
|
|
182058
|
-
mockExpectation.pass(
|
|
182218
|
+
mockExpectation.pass(join54(concat(messages, met), `
|
|
182059
182219
|
`));
|
|
182060
182220
|
}
|
|
182061
182221
|
return true;
|
|
@@ -182108,7 +182268,7 @@ var sinon;
|
|
|
182108
182268
|
args,
|
|
182109
182269
|
stack: err.stack
|
|
182110
182270
|
})}`);
|
|
182111
|
-
mockExpectation.fail(
|
|
182271
|
+
mockExpectation.fail(join54(messages, `
|
|
182112
182272
|
`));
|
|
182113
182273
|
}
|
|
182114
182274
|
});
|
|
@@ -182215,14 +182375,14 @@ var sinon;
|
|
|
182215
182375
|
const valueToString = require2("@sinonjs/commons").valueToString;
|
|
182216
182376
|
const concat = arrayProto.concat;
|
|
182217
182377
|
const filter2 = arrayProto.filter;
|
|
182218
|
-
const
|
|
182378
|
+
const join54 = arrayProto.join;
|
|
182219
182379
|
const map2 = arrayProto.map;
|
|
182220
182380
|
const reduce = arrayProto.reduce;
|
|
182221
182381
|
const slice = arrayProto.slice;
|
|
182222
182382
|
function throwYieldError(proxy, text2, args) {
|
|
182223
182383
|
let msg = functionName(proxy) + text2;
|
|
182224
182384
|
if (args.length) {
|
|
182225
|
-
msg += ` Received [${
|
|
182385
|
+
msg += ` Received [${join54(slice(args), ", ")}]`;
|
|
182226
182386
|
}
|
|
182227
182387
|
throw new Error(msg);
|
|
182228
182388
|
}
|
|
@@ -182344,7 +182504,7 @@ var sinon;
|
|
|
182344
182504
|
const formattedArgs = map2(this.args, function(arg) {
|
|
182345
182505
|
return inspect2(arg);
|
|
182346
182506
|
});
|
|
182347
|
-
callStr = `${callStr +
|
|
182507
|
+
callStr = `${callStr + join54(formattedArgs, ", ")})`;
|
|
182348
182508
|
if (typeof this.returnValue !== "undefined") {
|
|
182349
182509
|
callStr += ` => ${inspect2(this.returnValue)}`;
|
|
182350
182510
|
}
|
|
@@ -183075,7 +183235,7 @@ var sinon;
|
|
|
183075
183235
|
const timesInWords = require2("./util/core/times-in-words");
|
|
183076
183236
|
const inspect2 = require2("util").inspect;
|
|
183077
183237
|
const jsDiff = require2("diff");
|
|
183078
|
-
const
|
|
183238
|
+
const join54 = arrayProto.join;
|
|
183079
183239
|
const map2 = arrayProto.map;
|
|
183080
183240
|
const push = arrayProto.push;
|
|
183081
183241
|
const slice = arrayProto.slice;
|
|
@@ -183103,7 +183263,7 @@ var sinon;
|
|
|
183103
183263
|
}
|
|
183104
183264
|
return text2;
|
|
183105
183265
|
});
|
|
183106
|
-
return
|
|
183266
|
+
return join54(objects, "");
|
|
183107
183267
|
}
|
|
183108
183268
|
function quoteStringValue(value) {
|
|
183109
183269
|
if (typeof value === "string") {
|
|
@@ -183161,7 +183321,7 @@ ${stringifiedCall}`;
|
|
|
183161
183321
|
push(calls, stringifiedCall);
|
|
183162
183322
|
}
|
|
183163
183323
|
return calls.length > 0 ? `
|
|
183164
|
-
${
|
|
183324
|
+
${join54(calls, `
|
|
183165
183325
|
`)}` : "";
|
|
183166
183326
|
},
|
|
183167
183327
|
t: function(spyInstance) {
|
|
@@ -183169,10 +183329,10 @@ ${join53(calls, `
|
|
|
183169
183329
|
for (let i5 = 0, l4 = spyInstance.callCount;i5 < l4; ++i5) {
|
|
183170
183330
|
push(objects, inspect2(spyInstance.thisValues[i5]));
|
|
183171
183331
|
}
|
|
183172
|
-
return
|
|
183332
|
+
return join54(objects, ", ");
|
|
183173
183333
|
},
|
|
183174
183334
|
"*": function(spyInstance, args) {
|
|
183175
|
-
return
|
|
183335
|
+
return join54(map2(args, function(arg) {
|
|
183176
183336
|
return inspect2(arg);
|
|
183177
183337
|
}), ", ");
|
|
183178
183338
|
}
|
|
@@ -183504,7 +183664,7 @@ ${join53(calls, `
|
|
|
183504
183664
|
}, { "@sinonjs/commons": 48 }], 26: [function(require2, module, exports) {
|
|
183505
183665
|
const arrayProto = require2("@sinonjs/commons").prototypes.array;
|
|
183506
183666
|
const hasOwnProperty2 = require2("@sinonjs/commons").prototypes.object.hasOwnProperty;
|
|
183507
|
-
const
|
|
183667
|
+
const join54 = arrayProto.join;
|
|
183508
183668
|
const push = arrayProto.push;
|
|
183509
183669
|
const hasDontEnumBug = function() {
|
|
183510
183670
|
const obj = {
|
|
@@ -183545,7 +183705,7 @@ ${join53(calls, `
|
|
|
183545
183705
|
push(result, obj[prop]());
|
|
183546
183706
|
}
|
|
183547
183707
|
}
|
|
183548
|
-
return
|
|
183708
|
+
return join54(result, "") !== "0123456789";
|
|
183549
183709
|
}();
|
|
183550
183710
|
function extendCommon(target2, sources, doCopy) {
|
|
183551
183711
|
let source, i5, prop;
|
|
@@ -185610,7 +185770,7 @@ ${job.error.stack.split(`
|
|
|
185610
185770
|
module.exports = matcherPrototype;
|
|
185611
185771
|
}, { "../create-matcher": 63 }], 71: [function(require2, module, exports) {
|
|
185612
185772
|
var functionName = require2("@sinonjs/commons").functionName;
|
|
185613
|
-
var
|
|
185773
|
+
var join54 = require2("@sinonjs/commons").prototypes.array.join;
|
|
185614
185774
|
var map2 = require2("@sinonjs/commons").prototypes.array.map;
|
|
185615
185775
|
var stringIndexOf = require2("@sinonjs/commons").prototypes.string.indexOf;
|
|
185616
185776
|
var valueToString = require2("@sinonjs/commons").valueToString;
|
|
@@ -185641,7 +185801,7 @@ ${job.error.stack.split(`
|
|
|
185641
185801
|
m4.test = function(actual) {
|
|
185642
185802
|
return matchObject(actual, expectation, match3);
|
|
185643
185803
|
};
|
|
185644
|
-
m4.message = `match(${
|
|
185804
|
+
m4.message = `match(${join54(array3, ", ")})`;
|
|
185645
185805
|
return m4;
|
|
185646
185806
|
},
|
|
185647
185807
|
regexp: function(m4, expectation) {
|
|
@@ -188965,7 +189125,7 @@ ${job.error.stack.split(`
|
|
|
188965
189125
|
tokenize: function tokenize(value) {
|
|
188966
189126
|
return value.split("");
|
|
188967
189127
|
},
|
|
188968
|
-
join: function
|
|
189128
|
+
join: function join54(chars) {
|
|
188969
189129
|
return chars.join("");
|
|
188970
189130
|
}
|
|
188971
189131
|
};
|