@awsless/cli 0.1.38 → 0.1.40
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 +195 -83
- package/package.json +15 -15
package/dist/bin.js
CHANGED
|
@@ -126322,6 +126322,24 @@ var program = new Command;
|
|
|
126322
126322
|
var isRemoteAgent = () => {
|
|
126323
126323
|
return !!process.env.AWSLESS_REMOTE_AGENT && process.env.AWSLESS_REMOTE_AGENT !== "0";
|
|
126324
126324
|
};
|
|
126325
|
+
var proxyNames = ["HTTP_PROXY", "HTTPS_PROXY", "http_proxy", "https_proxy"];
|
|
126326
|
+
var childPrefix = "AWSLESS_CHILD_";
|
|
126327
|
+
var applyRemoteAgentEnv = () => {
|
|
126328
|
+
if (!isRemoteAgent()) {
|
|
126329
|
+
return;
|
|
126330
|
+
}
|
|
126331
|
+
process.env.SKIP_PROMPT = "1";
|
|
126332
|
+
for (const name of proxyNames) {
|
|
126333
|
+
const value = process.env[name];
|
|
126334
|
+
if (value) {
|
|
126335
|
+
process.env[`${childPrefix}${name}`] ??= value;
|
|
126336
|
+
delete process.env[name];
|
|
126337
|
+
}
|
|
126338
|
+
}
|
|
126339
|
+
};
|
|
126340
|
+
var childProxyEnv = (name) => {
|
|
126341
|
+
return process.env[`${childPrefix}${name}`] ?? process.env[name];
|
|
126342
|
+
};
|
|
126325
126343
|
|
|
126326
126344
|
// src/cli/command/auth/user/create.ts
|
|
126327
126345
|
import {
|
|
@@ -166974,6 +166992,10 @@ var LuaRuntime = class LuaRuntime2 {
|
|
|
166974
166992
|
return this.raiseError("ERR First argument must be a number (log level).");
|
|
166975
166993
|
return 0;
|
|
166976
166994
|
});
|
|
166995
|
+
register("replicate_commands", (L3) => {
|
|
166996
|
+
import_fengari.lua.lua_pushboolean(L3, 1);
|
|
166997
|
+
return 1;
|
|
166998
|
+
});
|
|
166977
166999
|
register("setresp", (L3) => {
|
|
166978
167000
|
if (import_fengari.lua.lua_tonumber(L3, 1) === 2)
|
|
166979
167001
|
return 0;
|
|
@@ -168045,8 +168067,32 @@ var persist = async () => {
|
|
|
168045
168067
|
await mkdir5(dirname6(file3), { recursive: true });
|
|
168046
168068
|
await writeFile7(file3, JSON.stringify([...tracked.values()]));
|
|
168047
168069
|
};
|
|
168070
|
+
var proxyEnvNames = [
|
|
168071
|
+
"NODE_EXTRA_CA_CERTS",
|
|
168072
|
+
"SSL_CERT_FILE",
|
|
168073
|
+
"SSL_CERT_DIR",
|
|
168074
|
+
"HTTP_PROXY",
|
|
168075
|
+
"HTTPS_PROXY",
|
|
168076
|
+
"NO_PROXY",
|
|
168077
|
+
"http_proxy",
|
|
168078
|
+
"https_proxy",
|
|
168079
|
+
"no_proxy"
|
|
168080
|
+
];
|
|
168081
|
+
var proxyEnv = () => {
|
|
168082
|
+
const env2 = {};
|
|
168083
|
+
for (const name of proxyEnvNames) {
|
|
168084
|
+
const value = childProxyEnv(name);
|
|
168085
|
+
if (value) {
|
|
168086
|
+
env2[name] = value;
|
|
168087
|
+
}
|
|
168088
|
+
}
|
|
168089
|
+
return env2;
|
|
168090
|
+
};
|
|
168048
168091
|
var spawnDevChild = (command, args, options2 = {}) => {
|
|
168049
|
-
const child = spawn3(command, args,
|
|
168092
|
+
const child = spawn3(command, args, {
|
|
168093
|
+
...options2,
|
|
168094
|
+
env: options2.env ? { ...proxyEnv(), ...options2.env } : options2.env
|
|
168095
|
+
});
|
|
168050
168096
|
if (child.pid) {
|
|
168051
168097
|
tracked.set(child.pid, { pid: child.pid, command: [command, ...args].join(" ") });
|
|
168052
168098
|
persist().catch(() => {});
|
|
@@ -199957,8 +200003,78 @@ var deployments = (program3) => {
|
|
|
199957
200003
|
};
|
|
199958
200004
|
|
|
199959
200005
|
// src/config/load/watch.ts
|
|
200006
|
+
import { basename as basename4, sep as sep4 } from "path";
|
|
200007
|
+
|
|
200008
|
+
// src/dev/watch-tree.ts
|
|
199960
200009
|
import { watch } from "fs";
|
|
199961
|
-
import {
|
|
200010
|
+
import { readdir as readdir5, stat as stat6 } from "fs/promises";
|
|
200011
|
+
import { join as join45, relative as relative11, sep as sep3 } from "path";
|
|
200012
|
+
var watchTree = async (root4, ignored, listener, options2 = {}) => {
|
|
200013
|
+
const native = options2.native ?? (process.platform === "darwin" || process.platform === "win32");
|
|
200014
|
+
if (native) {
|
|
200015
|
+
const watcher = watch(root4, { recursive: true }, (_event, filename) => {
|
|
200016
|
+
if (filename) {
|
|
200017
|
+
listener(filename);
|
|
200018
|
+
}
|
|
200019
|
+
});
|
|
200020
|
+
return { close: () => watcher.close() };
|
|
200021
|
+
}
|
|
200022
|
+
const watchers = new Map;
|
|
200023
|
+
let closed = false;
|
|
200024
|
+
const add = async (dir) => {
|
|
200025
|
+
if (closed || watchers.has(dir)) {
|
|
200026
|
+
return;
|
|
200027
|
+
}
|
|
200028
|
+
let watcher;
|
|
200029
|
+
try {
|
|
200030
|
+
watcher = watch(dir, (event, filename) => {
|
|
200031
|
+
if (!filename) {
|
|
200032
|
+
return;
|
|
200033
|
+
}
|
|
200034
|
+
const path6 = join45(dir, filename);
|
|
200035
|
+
const name = relative11(root4, path6);
|
|
200036
|
+
if (name.split(sep3).some((segment) => ignored.has(segment))) {
|
|
200037
|
+
return;
|
|
200038
|
+
}
|
|
200039
|
+
listener(name);
|
|
200040
|
+
if (event === "rename" && !ignored.has(filename)) {
|
|
200041
|
+
stat6(path6).then((info3) => info3.isDirectory() ? walk2(path6) : undefined).catch(() => {});
|
|
200042
|
+
}
|
|
200043
|
+
});
|
|
200044
|
+
} catch (error53) {
|
|
200045
|
+
debug(`Can't watch ${dir}`, error53);
|
|
200046
|
+
return;
|
|
200047
|
+
}
|
|
200048
|
+
watcher.on("error", (error53) => debug(`Watcher error in ${dir}`, error53));
|
|
200049
|
+
watchers.set(dir, watcher);
|
|
200050
|
+
};
|
|
200051
|
+
const walk2 = async (dir) => {
|
|
200052
|
+
await add(dir);
|
|
200053
|
+
let entries2;
|
|
200054
|
+
try {
|
|
200055
|
+
entries2 = await readdir5(dir, { withFileTypes: true });
|
|
200056
|
+
} catch {
|
|
200057
|
+
return;
|
|
200058
|
+
}
|
|
200059
|
+
for (const entry of entries2) {
|
|
200060
|
+
if (entry.isDirectory() && !entry.isSymbolicLink() && !ignored.has(entry.name)) {
|
|
200061
|
+
await walk2(join45(dir, entry.name));
|
|
200062
|
+
}
|
|
200063
|
+
}
|
|
200064
|
+
};
|
|
200065
|
+
await walk2(root4);
|
|
200066
|
+
return {
|
|
200067
|
+
close: () => {
|
|
200068
|
+
closed = true;
|
|
200069
|
+
for (const watcher of watchers.values()) {
|
|
200070
|
+
watcher.close();
|
|
200071
|
+
}
|
|
200072
|
+
watchers.clear();
|
|
200073
|
+
}
|
|
200074
|
+
};
|
|
200075
|
+
};
|
|
200076
|
+
|
|
200077
|
+
// src/config/load/watch.ts
|
|
199962
200078
|
var ignoredDirectories = new Set(["node_modules", ".awsless", "dist", ".git"]);
|
|
199963
200079
|
var isConfigFile = (path6) => {
|
|
199964
200080
|
const base = basename4(path6);
|
|
@@ -199968,11 +200084,8 @@ var watchConfig = async (options2, resolve5, reject) => {
|
|
|
199968
200084
|
await loadAppConfig(options2);
|
|
199969
200085
|
debug("Start watching...");
|
|
199970
200086
|
let reloadTimer;
|
|
199971
|
-
const watcher =
|
|
199972
|
-
if (
|
|
199973
|
-
return;
|
|
199974
|
-
}
|
|
199975
|
-
if (filename.split(sep3).some((segment) => ignoredDirectories.has(segment))) {
|
|
200087
|
+
const watcher = await watchTree(directories.root, ignoredDirectories, (filename) => {
|
|
200088
|
+
if (filename.split(sep4).some((segment) => ignoredDirectories.has(segment))) {
|
|
199976
200089
|
return;
|
|
199977
200090
|
}
|
|
199978
200091
|
if (!isConfigFile(filename)) {
|
|
@@ -199996,18 +200109,18 @@ var watchConfig = async (options2, resolve5, reject) => {
|
|
|
199996
200109
|
// src/dev/index.ts
|
|
199997
200110
|
import { watch as watch2 } from "fs";
|
|
199998
200111
|
import { mkdir as mkdir12, rm as rm13, writeFile as writeFile16 } from "fs/promises";
|
|
199999
|
-
import { basename as basename5, dirname as dirname26, join as
|
|
200112
|
+
import { basename as basename5, dirname as dirname26, join as join52, sep as sep7 } from "path";
|
|
200000
200113
|
import { loadWorkspace as loadWorkspace3 } from "@awsless/ts-file-cache";
|
|
200001
200114
|
|
|
200002
200115
|
// src/dev/context.ts
|
|
200003
|
-
import { join as
|
|
200116
|
+
import { join as join47 } from "path";
|
|
200004
200117
|
import { DynamoDBServer } from "@awsless/dynamodb-server";
|
|
200005
200118
|
|
|
200006
200119
|
// src/dev/servers/s3.ts
|
|
200007
200120
|
import { createHash as createHash21 } from "crypto";
|
|
200008
|
-
import { mkdir as mkdir10, readdir as
|
|
200121
|
+
import { mkdir as mkdir10, readdir as readdir6, readFile as readFile19, rm as rm11, stat as stat7, writeFile as writeFile13 } from "fs/promises";
|
|
200009
200122
|
import { createServer as createServer9 } from "http";
|
|
200010
|
-
import { dirname as dirname24, isAbsolute as isAbsolute6, join as
|
|
200123
|
+
import { dirname as dirname24, isAbsolute as isAbsolute6, join as join46, relative as relative12, sep as sep5 } from "path";
|
|
200011
200124
|
var escapeXml = (value) => {
|
|
200012
200125
|
return value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
200013
200126
|
};
|
|
@@ -200072,10 +200185,10 @@ var createS3Server = (props) => {
|
|
|
200072
200185
|
res.end(xmlError("InvalidRequest", "Missing bucket name"));
|
|
200073
200186
|
return;
|
|
200074
200187
|
}
|
|
200075
|
-
const bucketDir =
|
|
200076
|
-
const file3 =
|
|
200188
|
+
const bucketDir = join46(props.root, bucket);
|
|
200189
|
+
const file3 = join46(bucketDir, ...keyParts);
|
|
200077
200190
|
const escapes = (base, path6) => {
|
|
200078
|
-
const rel =
|
|
200191
|
+
const rel = relative12(base, path6);
|
|
200079
200192
|
return rel.startsWith("..") || isAbsolute6(rel);
|
|
200080
200193
|
};
|
|
200081
200194
|
if (escapes(props.root, bucketDir) || escapes(bucketDir, file3)) {
|
|
@@ -200089,20 +200202,20 @@ var createS3Server = (props) => {
|
|
|
200089
200202
|
const walk2 = async (dir) => {
|
|
200090
200203
|
let entries2;
|
|
200091
200204
|
try {
|
|
200092
|
-
entries2 = await
|
|
200205
|
+
entries2 = await readdir6(dir, { withFileTypes: true });
|
|
200093
200206
|
} catch {
|
|
200094
200207
|
return;
|
|
200095
200208
|
}
|
|
200096
200209
|
for (const entry of entries2) {
|
|
200097
|
-
const path6 =
|
|
200210
|
+
const path6 = join46(dir, entry.name);
|
|
200098
200211
|
if (entry.isDirectory()) {
|
|
200099
200212
|
await walk2(path6);
|
|
200100
200213
|
} else {
|
|
200101
|
-
const objectKey =
|
|
200214
|
+
const objectKey = relative12(bucketDir, path6).split(sep5).join("/");
|
|
200102
200215
|
if (!objectKey.startsWith(prefix)) {
|
|
200103
200216
|
continue;
|
|
200104
200217
|
}
|
|
200105
|
-
const info3 = await
|
|
200218
|
+
const info3 = await stat7(path6);
|
|
200106
200219
|
contents.push(`<Contents><Key>${escapeXml(objectKey)}</Key><Size>${info3.size}</Size><LastModified>${info3.mtime.toISOString()}</LastModified><ETag>"local"</ETag></Contents>`);
|
|
200107
200220
|
}
|
|
200108
200221
|
}
|
|
@@ -200568,7 +200681,7 @@ var createDevContext = (props) => {
|
|
|
200568
200681
|
const value = await props.pool.keep("store", null, async () => {
|
|
200569
200682
|
const rules = [];
|
|
200570
200683
|
const server = createS3Server({
|
|
200571
|
-
root:
|
|
200684
|
+
root: join47(directories.output, "local", "store"),
|
|
200572
200685
|
region: props.appConfig.region,
|
|
200573
200686
|
rules
|
|
200574
200687
|
});
|
|
@@ -200696,16 +200809,16 @@ var createDevContext = (props) => {
|
|
|
200696
200809
|
// src/dev/dashboard/index.ts
|
|
200697
200810
|
var import_ioredis4 = __toESM(require_built3(), 1);
|
|
200698
200811
|
import { randomUUID as randomUUID8 } from "crypto";
|
|
200699
|
-
import { readdir as
|
|
200812
|
+
import { readdir as readdir7, readFile as readFile20, stat as stat8, writeFile as writeFile15 } from "fs/promises";
|
|
200700
200813
|
import { createServer as createServer11 } from "http";
|
|
200701
|
-
import { join as
|
|
200814
|
+
import { join as join49, relative as relative13, sep as sep6 } from "path";
|
|
200702
200815
|
import { DynamoDBClient as DynamoDBClient6 } from "@aws-sdk/client-dynamodb";
|
|
200703
200816
|
import { DynamoDBDocumentClient, ScanCommand as ScanCommand2 } from "@aws-sdk/lib-dynamodb";
|
|
200704
200817
|
|
|
200705
200818
|
// src/dev/worker.ts
|
|
200706
200819
|
import { writeFile as writeFile14 } from "fs/promises";
|
|
200707
200820
|
import { availableParallelism as availableParallelism2 } from "os";
|
|
200708
|
-
import { join as
|
|
200821
|
+
import { join as join48 } from "path";
|
|
200709
200822
|
class WorkerError extends Error {
|
|
200710
200823
|
name;
|
|
200711
200824
|
constructor(name, message3, stack) {
|
|
@@ -200925,7 +201038,7 @@ var createBundleWorker = (props) => {
|
|
|
200925
201038
|
throw new Error("The bundle worker never became ready.");
|
|
200926
201039
|
};
|
|
200927
201040
|
const startWorker = async () => {
|
|
200928
|
-
const entry =
|
|
201041
|
+
const entry = join48(props.buildDir, "worker.mjs");
|
|
200929
201042
|
const port = await findFreePort();
|
|
200930
201043
|
const child = spawnDevChild("node", ["--enable-source-maps", entry], {
|
|
200931
201044
|
cwd: props.buildDir,
|
|
@@ -200986,7 +201099,7 @@ var createBundleWorker = (props) => {
|
|
|
200986
201099
|
return worker;
|
|
200987
201100
|
};
|
|
200988
201101
|
const doStart = async () => {
|
|
200989
|
-
await writeFile14(
|
|
201102
|
+
await writeFile14(join48(props.buildDir, "worker.mjs"), WORKER_ENTRY);
|
|
200990
201103
|
const results = await Promise.allSettled(Array.from({ length: concurrency }, () => startWorker()));
|
|
200991
201104
|
const started = results.filter((result) => result.status === "fulfilled").map((result) => result.value);
|
|
200992
201105
|
const failed = results.find((result) => result.status === "rejected");
|
|
@@ -203434,18 +203547,18 @@ var createDashboardServer = (props) => {
|
|
|
203434
203547
|
const walk2 = async (dir) => {
|
|
203435
203548
|
let entries2;
|
|
203436
203549
|
try {
|
|
203437
|
-
entries2 = await
|
|
203550
|
+
entries2 = await readdir7(dir, { withFileTypes: true });
|
|
203438
203551
|
} catch {
|
|
203439
203552
|
return;
|
|
203440
203553
|
}
|
|
203441
203554
|
for (const entry of entries2) {
|
|
203442
|
-
const path6 =
|
|
203555
|
+
const path6 = join49(dir, entry.name);
|
|
203443
203556
|
if (entry.isDirectory()) {
|
|
203444
203557
|
await walk2(path6);
|
|
203445
203558
|
} else {
|
|
203446
|
-
const key =
|
|
203559
|
+
const key = relative13(props.storeRoot, path6).split(sep6).slice(1).join("/");
|
|
203447
203560
|
if (key.startsWith(prefix)) {
|
|
203448
|
-
const info3 = await
|
|
203561
|
+
const info3 = await stat8(path6);
|
|
203449
203562
|
files.push({ key, size: info3.size, modified: info3.mtime.toISOString() });
|
|
203450
203563
|
}
|
|
203451
203564
|
}
|
|
@@ -203654,17 +203767,17 @@ var createFailureReporter = (props) => {
|
|
|
203654
203767
|
};
|
|
203655
203768
|
|
|
203656
203769
|
// src/dev/sdk.ts
|
|
203657
|
-
import { readdir as
|
|
203770
|
+
import { readdir as readdir8, readFile as readFile21, mkdir as mkdir11, rm as rm12, stat as stat9, symlink } from "fs/promises";
|
|
203658
203771
|
import { createRequire } from "module";
|
|
203659
|
-
import { dirname as dirname25, join as
|
|
203772
|
+
import { dirname as dirname25, join as join50 } from "path";
|
|
203660
203773
|
var linkSdkPackages = async (workspace, buildDir, onWarn) => {
|
|
203661
|
-
const filesDir =
|
|
203774
|
+
const filesDir = join50(buildDir, "files");
|
|
203662
203775
|
const packages = new Set;
|
|
203663
|
-
for (const file3 of await
|
|
203776
|
+
for (const file3 of await readdir8(filesDir)) {
|
|
203664
203777
|
if (!file3.endsWith(".mjs")) {
|
|
203665
203778
|
continue;
|
|
203666
203779
|
}
|
|
203667
|
-
const code = await readFile21(
|
|
203780
|
+
const code = await readFile21(join50(filesDir, file3), "utf8");
|
|
203668
203781
|
for (const match3 of code.matchAll(/(?:from\s*|import\()\s*["'](@aws-sdk\/[a-z0-9-]+|sharp)["']/g)) {
|
|
203669
203782
|
packages.add(match3[1]);
|
|
203670
203783
|
}
|
|
@@ -203672,7 +203785,7 @@ var linkSdkPackages = async (workspace, buildDir, onWarn) => {
|
|
|
203672
203785
|
const ownRequire = createRequire(import.meta.url);
|
|
203673
203786
|
const isProjectDep = async (name) => {
|
|
203674
203787
|
try {
|
|
203675
|
-
await
|
|
203788
|
+
await stat9(join50(directories.root, "node_modules", name, "package.json"));
|
|
203676
203789
|
return true;
|
|
203677
203790
|
} catch {
|
|
203678
203791
|
return false;
|
|
@@ -203681,19 +203794,19 @@ var linkSdkPackages = async (workspace, buildDir, onWarn) => {
|
|
|
203681
203794
|
const resolveFromDependents = async (name) => {
|
|
203682
203795
|
const roots = Object.values(workspace.packages).flatMap((pkg) => [
|
|
203683
203796
|
pkg.path,
|
|
203684
|
-
...Object.entries(pkg.dependencies).map(([dependency, info3]) => info3.type === "workspace" ? workspace.packages[info3.link]?.path :
|
|
203797
|
+
...Object.entries(pkg.dependencies).map(([dependency, info3]) => info3.type === "workspace" ? workspace.packages[info3.link]?.path : join50(pkg.path, "node_modules", dependency))
|
|
203685
203798
|
]);
|
|
203686
203799
|
for (const root4 of roots.filter((root5) => typeof root5 === "string").toSorted()) {
|
|
203687
|
-
const path6 =
|
|
203800
|
+
const path6 = join50(root4, "node_modules", name);
|
|
203688
203801
|
try {
|
|
203689
|
-
await
|
|
203802
|
+
await stat9(join50(path6, "package.json"));
|
|
203690
203803
|
return path6;
|
|
203691
203804
|
} catch {}
|
|
203692
203805
|
}
|
|
203693
203806
|
return;
|
|
203694
203807
|
};
|
|
203695
203808
|
for (const name of packages) {
|
|
203696
|
-
const target2 =
|
|
203809
|
+
const target2 = join50(buildDir, "node_modules", name);
|
|
203697
203810
|
try {
|
|
203698
203811
|
if (await isProjectDep(name)) {
|
|
203699
203812
|
await rm12(target2, { recursive: true, force: true });
|
|
@@ -203712,7 +203825,7 @@ var linkSdkPackages = async (workspace, buildDir, onWarn) => {
|
|
|
203712
203825
|
await mkdir11(dirname25(target2), { recursive: true });
|
|
203713
203826
|
await rm12(target2, { recursive: true, force: true });
|
|
203714
203827
|
await symlink(source, target2, "dir");
|
|
203715
|
-
await
|
|
203828
|
+
await stat9(join50(target2, "package.json"));
|
|
203716
203829
|
debug(`Sdk link ${name}: ${source}`);
|
|
203717
203830
|
} catch (error53) {
|
|
203718
203831
|
onWarn?.(`Linking the "${name}" sdk package failed: ${error53 instanceof Error ? error53.message : String(error53)}`);
|
|
@@ -203722,9 +203835,9 @@ var linkSdkPackages = async (workspace, buildDir, onWarn) => {
|
|
|
203722
203835
|
|
|
203723
203836
|
// src/dev/seed.ts
|
|
203724
203837
|
import { spawn as spawn5 } from "child_process";
|
|
203725
|
-
import { isAbsolute as isAbsolute7, join as
|
|
203838
|
+
import { isAbsolute as isAbsolute7, join as join51 } from "path";
|
|
203726
203839
|
var createSeedRunner = (props) => {
|
|
203727
|
-
const file3 = props.seed && (isAbsolute7(props.seed) ? props.seed :
|
|
203840
|
+
const file3 = props.seed && (isAbsolute7(props.seed) ? props.seed : join51(directories.root, props.seed));
|
|
203728
203841
|
let running;
|
|
203729
203842
|
const run = () => {
|
|
203730
203843
|
running ??= (async () => {
|
|
@@ -203900,7 +204013,7 @@ var startDev = async (props) => {
|
|
|
203900
204013
|
dev: true
|
|
203901
204014
|
});
|
|
203902
204015
|
ready2();
|
|
203903
|
-
await mkdir12(
|
|
204016
|
+
await mkdir12(join52(directories.output, "local"), { recursive: true });
|
|
203904
204017
|
await writeFile16(watchdogPath(), WATCHDOG_SOURCE);
|
|
203905
204018
|
const routerPorts = {};
|
|
203906
204019
|
Object.keys(appConfig.router ?? {}).forEach((id, index) => {
|
|
@@ -203978,7 +204091,7 @@ var startDev = async (props) => {
|
|
|
203978
204091
|
for (const [id, port] of Object.entries(routerPorts)) {
|
|
203979
204092
|
env4[`ROUTER_${constantCase(id)}_ENDPOINT`] = `localhost:${port}`;
|
|
203980
204093
|
}
|
|
203981
|
-
await writeFile16(
|
|
204094
|
+
await writeFile16(join52(directories.output, "local", "env.json"), JSON.stringify(env4, null, "\t") + `
|
|
203982
204095
|
`);
|
|
203983
204096
|
return { env: env4, lambda: lambda2 };
|
|
203984
204097
|
});
|
|
@@ -204232,8 +204345,8 @@ var startDev = async (props) => {
|
|
|
204232
204345
|
resources: dev.resources,
|
|
204233
204346
|
routes: dev.routes,
|
|
204234
204347
|
env: env3,
|
|
204235
|
-
storeRoot:
|
|
204236
|
-
configFile:
|
|
204348
|
+
storeRoot: join52(directories.output, "local", "store"),
|
|
204349
|
+
configFile: join52(directories.output, "local", "config.json"),
|
|
204237
204350
|
getEmails: () => props.pool.peek("shim:ses-email")?.server.list() ?? [],
|
|
204238
204351
|
getAlerts: () => props.pool.peek("shim:sns")?.alerts ?? [],
|
|
204239
204352
|
getSession: () => ({ startedAt, workers: worker.size() }),
|
|
@@ -204249,11 +204362,8 @@ var startDev = async (props) => {
|
|
|
204249
204362
|
await dashboard.listen(dashboardPort);
|
|
204250
204363
|
const ignoredDirectories2 = new Set(["node_modules", ".awsless", "dist", ".git"]);
|
|
204251
204364
|
let rebuildTimer;
|
|
204252
|
-
const watcher =
|
|
204253
|
-
if (
|
|
204254
|
-
return;
|
|
204255
|
-
}
|
|
204256
|
-
if (filename.split(sep6).some((segment) => ignoredDirectories2.has(segment))) {
|
|
204365
|
+
const watcher = await watchTree(directories.root, ignoredDirectories2, (filename) => {
|
|
204366
|
+
if (filename.split(sep7).some((segment) => ignoredDirectories2.has(segment))) {
|
|
204257
204367
|
return;
|
|
204258
204368
|
}
|
|
204259
204369
|
const base = basename5(filename);
|
|
@@ -204296,7 +204406,7 @@ var startDev = async (props) => {
|
|
|
204296
204406
|
routerPorts,
|
|
204297
204407
|
async stop() {
|
|
204298
204408
|
stopping = true;
|
|
204299
|
-
await rm13(
|
|
204409
|
+
await rm13(join52(directories.output, "local", "env.json"), { force: true });
|
|
204300
204410
|
clearTimeout(rebuildTimer);
|
|
204301
204411
|
watcher.close();
|
|
204302
204412
|
for (const restartWatcher of restartWatchers) {
|
|
@@ -204364,7 +204474,7 @@ var createServerPool = () => {
|
|
|
204364
204474
|
|
|
204365
204475
|
// src/type-gen/generate.ts
|
|
204366
204476
|
import { mkdir as mkdir13, writeFile as writeFile17 } from "fs/promises";
|
|
204367
|
-
import { dirname as dirname27, join as
|
|
204477
|
+
import { dirname as dirname27, join as join53, relative as relative14 } from "path";
|
|
204368
204478
|
var generateTypes = async (props) => {
|
|
204369
204479
|
const files = [];
|
|
204370
204480
|
await Promise.all(features.map(async (feature) => {
|
|
@@ -204372,10 +204482,10 @@ var generateTypes = async (props) => {
|
|
|
204372
204482
|
...props,
|
|
204373
204483
|
async write(file3, data, include = false) {
|
|
204374
204484
|
const code = data?.toString("utf8");
|
|
204375
|
-
const path6 =
|
|
204485
|
+
const path6 = join53(directories.types, file3);
|
|
204376
204486
|
if (code) {
|
|
204377
204487
|
if (include) {
|
|
204378
|
-
files.push(
|
|
204488
|
+
files.push(relative14(directories.root, path6));
|
|
204379
204489
|
}
|
|
204380
204490
|
await mkdir13(dirname27(path6), { recursive: true });
|
|
204381
204491
|
await writeFile17(path6, code);
|
|
@@ -204386,7 +204496,7 @@ var generateTypes = async (props) => {
|
|
|
204386
204496
|
if (files.length) {
|
|
204387
204497
|
const code = files.map((file3) => `/// <reference path='${file3}' />`).join(`
|
|
204388
204498
|
`);
|
|
204389
|
-
await writeFile17(
|
|
204499
|
+
await writeFile17(join53(directories.root, `awsless.d.ts`), code);
|
|
204390
204500
|
}
|
|
204391
204501
|
};
|
|
204392
204502
|
|
|
@@ -205220,7 +205330,10 @@ var buildRemoteAgentPolicy = ({ appName, region, accountId, auth: auth2 }) => {
|
|
|
205220
205330
|
Sid: "ReadConfig",
|
|
205221
205331
|
Effect: "Allow",
|
|
205222
205332
|
Action: ["ssm:GetParametersByPath", "ssm:GetParameter", "ssm:GetParameters"],
|
|
205223
|
-
Resource:
|
|
205333
|
+
Resource: [
|
|
205334
|
+
`arn:aws:ssm:${region}:${accountId}:parameter${configParameterPrefix(appName)}`,
|
|
205335
|
+
`arn:aws:ssm:${region}:${accountId}:parameter${configParameterPrefix(appName)}/*`
|
|
205336
|
+
]
|
|
205224
205337
|
},
|
|
205225
205338
|
{
|
|
205226
205339
|
Sid: "DecryptConfig",
|
|
@@ -205385,7 +205498,8 @@ var create2 = (program3) => {
|
|
|
205385
205498
|
if (keys.length > 0) {
|
|
205386
205499
|
const key2 = keys[0];
|
|
205387
205500
|
const created = key2.createdAt ? ` created ${key2.createdAt.toISOString()}` : "";
|
|
205388
|
-
|
|
205501
|
+
logs_exports.warning(`The ${iam.userName} user already has an access key (${key2.id}${created}). ` + `Its secret can't be shown again - run ${color2.info("awsless remote-agent credentials rotate")} to replace it.`);
|
|
205502
|
+
return;
|
|
205389
205503
|
}
|
|
205390
205504
|
const key = await iam.createKey();
|
|
205391
205505
|
printCredentials(appConfig, key);
|
|
@@ -206782,7 +206896,7 @@ var sinon;
|
|
|
206782
206896
|
const arraySlice = arrayProto.slice;
|
|
206783
206897
|
const concat = arrayProto.concat;
|
|
206784
206898
|
const forEach = arrayProto.forEach;
|
|
206785
|
-
const
|
|
206899
|
+
const join54 = arrayProto.join;
|
|
206786
206900
|
const splice = arrayProto.splice;
|
|
206787
206901
|
function applyDefaults(obj, defaults2) {
|
|
206788
206902
|
for (const key of Object.keys(defaults2)) {
|
|
@@ -206818,7 +206932,7 @@ var sinon;
|
|
|
206818
206932
|
let actual = "";
|
|
206819
206933
|
if (!calledInOrder(arguments)) {
|
|
206820
206934
|
try {
|
|
206821
|
-
expected =
|
|
206935
|
+
expected = join54(arguments, ", ");
|
|
206822
206936
|
const calls = arraySlice(arguments);
|
|
206823
206937
|
let i5 = calls.length;
|
|
206824
206938
|
while (i5) {
|
|
@@ -206826,7 +206940,7 @@ var sinon;
|
|
|
206826
206940
|
splice(calls, i5, 1);
|
|
206827
206941
|
}
|
|
206828
206942
|
}
|
|
206829
|
-
actual =
|
|
206943
|
+
actual = join54(orderByFirstCall(calls), ", ");
|
|
206830
206944
|
} catch (e5) {}
|
|
206831
206945
|
failAssertion(this, `expected ${expected} to be called in order but were called as ${actual}`);
|
|
206832
206946
|
} else {
|
|
@@ -206871,7 +206985,7 @@ var sinon;
|
|
|
206871
206985
|
` expected = ${inspect2(expectation)}`,
|
|
206872
206986
|
` actual = ${inspect2(actual)}`
|
|
206873
206987
|
];
|
|
206874
|
-
failAssertion(this,
|
|
206988
|
+
failAssertion(this, join54(formatted, `
|
|
206875
206989
|
`));
|
|
206876
206990
|
}
|
|
206877
206991
|
}
|
|
@@ -206976,7 +207090,7 @@ var sinon;
|
|
|
206976
207090
|
const valueToString = require2("@sinonjs/commons").valueToString;
|
|
206977
207091
|
const exportAsyncBehaviors = require2("./util/core/export-async-behaviors");
|
|
206978
207092
|
const concat = arrayProto.concat;
|
|
206979
|
-
const
|
|
207093
|
+
const join54 = arrayProto.join;
|
|
206980
207094
|
const reverse = arrayProto.reverse;
|
|
206981
207095
|
const slice = arrayProto.slice;
|
|
206982
207096
|
const useLeftMostCallback = -1;
|
|
@@ -207013,7 +207127,7 @@ var sinon;
|
|
|
207013
207127
|
msg = `${functionName(behavior.stub)} expected to yield, but no callback was passed.`;
|
|
207014
207128
|
}
|
|
207015
207129
|
if (args.length > 0) {
|
|
207016
|
-
msg += ` Received [${
|
|
207130
|
+
msg += ` Received [${join54(args, ", ")}]`;
|
|
207017
207131
|
}
|
|
207018
207132
|
return msg;
|
|
207019
207133
|
}
|
|
@@ -207823,7 +207937,7 @@ var sinon;
|
|
|
207823
207937
|
const filter2 = arrayProto.filter;
|
|
207824
207938
|
const forEach = arrayProto.forEach;
|
|
207825
207939
|
const every = arrayProto.every;
|
|
207826
|
-
const
|
|
207940
|
+
const join54 = arrayProto.join;
|
|
207827
207941
|
const push2 = arrayProto.push;
|
|
207828
207942
|
const slice = arrayProto.slice;
|
|
207829
207943
|
const unshift = arrayProto.unshift;
|
|
@@ -207900,10 +208014,10 @@ var sinon;
|
|
|
207900
208014
|
});
|
|
207901
208015
|
this.restore();
|
|
207902
208016
|
if (messages.length > 0) {
|
|
207903
|
-
mockExpectation.fail(
|
|
208017
|
+
mockExpectation.fail(join54(concat(messages, met), `
|
|
207904
208018
|
`));
|
|
207905
208019
|
} else if (met.length > 0) {
|
|
207906
|
-
mockExpectation.pass(
|
|
208020
|
+
mockExpectation.pass(join54(concat(messages, met), `
|
|
207907
208021
|
`));
|
|
207908
208022
|
}
|
|
207909
208023
|
return true;
|
|
@@ -207956,7 +208070,7 @@ var sinon;
|
|
|
207956
208070
|
args,
|
|
207957
208071
|
stack: err.stack
|
|
207958
208072
|
})}`);
|
|
207959
|
-
mockExpectation.fail(
|
|
208073
|
+
mockExpectation.fail(join54(messages, `
|
|
207960
208074
|
`));
|
|
207961
208075
|
}
|
|
207962
208076
|
});
|
|
@@ -208063,14 +208177,14 @@ var sinon;
|
|
|
208063
208177
|
const valueToString = require2("@sinonjs/commons").valueToString;
|
|
208064
208178
|
const concat = arrayProto.concat;
|
|
208065
208179
|
const filter2 = arrayProto.filter;
|
|
208066
|
-
const
|
|
208180
|
+
const join54 = arrayProto.join;
|
|
208067
208181
|
const map3 = arrayProto.map;
|
|
208068
208182
|
const reduce2 = arrayProto.reduce;
|
|
208069
208183
|
const slice = arrayProto.slice;
|
|
208070
208184
|
function throwYieldError(proxy, text2, args) {
|
|
208071
208185
|
let msg = functionName(proxy) + text2;
|
|
208072
208186
|
if (args.length) {
|
|
208073
|
-
msg += ` Received [${
|
|
208187
|
+
msg += ` Received [${join54(slice(args), ", ")}]`;
|
|
208074
208188
|
}
|
|
208075
208189
|
throw new Error(msg);
|
|
208076
208190
|
}
|
|
@@ -208192,7 +208306,7 @@ var sinon;
|
|
|
208192
208306
|
const formattedArgs = map3(this.args, function(arg) {
|
|
208193
208307
|
return inspect2(arg);
|
|
208194
208308
|
});
|
|
208195
|
-
callStr = `${callStr +
|
|
208309
|
+
callStr = `${callStr + join54(formattedArgs, ", ")})`;
|
|
208196
208310
|
if (typeof this.returnValue !== "undefined") {
|
|
208197
208311
|
callStr += ` => ${inspect2(this.returnValue)}`;
|
|
208198
208312
|
}
|
|
@@ -208923,7 +209037,7 @@ var sinon;
|
|
|
208923
209037
|
const timesInWords = require2("./util/core/times-in-words");
|
|
208924
209038
|
const inspect2 = require2("util").inspect;
|
|
208925
209039
|
const jsDiff = require2("diff");
|
|
208926
|
-
const
|
|
209040
|
+
const join54 = arrayProto.join;
|
|
208927
209041
|
const map3 = arrayProto.map;
|
|
208928
209042
|
const push2 = arrayProto.push;
|
|
208929
209043
|
const slice = arrayProto.slice;
|
|
@@ -208951,7 +209065,7 @@ var sinon;
|
|
|
208951
209065
|
}
|
|
208952
209066
|
return text2;
|
|
208953
209067
|
});
|
|
208954
|
-
return
|
|
209068
|
+
return join54(objects, "");
|
|
208955
209069
|
}
|
|
208956
209070
|
function quoteStringValue(value) {
|
|
208957
209071
|
if (typeof value === "string") {
|
|
@@ -209009,7 +209123,7 @@ ${stringifiedCall}`;
|
|
|
209009
209123
|
push2(calls, stringifiedCall);
|
|
209010
209124
|
}
|
|
209011
209125
|
return calls.length > 0 ? `
|
|
209012
|
-
${
|
|
209126
|
+
${join54(calls, `
|
|
209013
209127
|
`)}` : "";
|
|
209014
209128
|
},
|
|
209015
209129
|
t: function(spyInstance) {
|
|
@@ -209017,10 +209131,10 @@ ${join53(calls, `
|
|
|
209017
209131
|
for (let i5 = 0, l4 = spyInstance.callCount;i5 < l4; ++i5) {
|
|
209018
209132
|
push2(objects, inspect2(spyInstance.thisValues[i5]));
|
|
209019
209133
|
}
|
|
209020
|
-
return
|
|
209134
|
+
return join54(objects, ", ");
|
|
209021
209135
|
},
|
|
209022
209136
|
"*": function(spyInstance, args) {
|
|
209023
|
-
return
|
|
209137
|
+
return join54(map3(args, function(arg) {
|
|
209024
209138
|
return inspect2(arg);
|
|
209025
209139
|
}), ", ");
|
|
209026
209140
|
}
|
|
@@ -209352,7 +209466,7 @@ ${join53(calls, `
|
|
|
209352
209466
|
}, { "@sinonjs/commons": 48 }], 26: [function(require2, module, exports) {
|
|
209353
209467
|
const arrayProto = require2("@sinonjs/commons").prototypes.array;
|
|
209354
209468
|
const hasOwnProperty2 = require2("@sinonjs/commons").prototypes.object.hasOwnProperty;
|
|
209355
|
-
const
|
|
209469
|
+
const join54 = arrayProto.join;
|
|
209356
209470
|
const push2 = arrayProto.push;
|
|
209357
209471
|
const hasDontEnumBug = function() {
|
|
209358
209472
|
const obj = {
|
|
@@ -209393,7 +209507,7 @@ ${join53(calls, `
|
|
|
209393
209507
|
push2(result, obj[prop]());
|
|
209394
209508
|
}
|
|
209395
209509
|
}
|
|
209396
|
-
return
|
|
209510
|
+
return join54(result, "") !== "0123456789";
|
|
209397
209511
|
}();
|
|
209398
209512
|
function extendCommon(target2, sources, doCopy) {
|
|
209399
209513
|
let source, i5, prop;
|
|
@@ -211458,7 +211572,7 @@ ${job.error.stack.split(`
|
|
|
211458
211572
|
module.exports = matcherPrototype;
|
|
211459
211573
|
}, { "../create-matcher": 63 }], 71: [function(require2, module, exports) {
|
|
211460
211574
|
var functionName = require2("@sinonjs/commons").functionName;
|
|
211461
|
-
var
|
|
211575
|
+
var join54 = require2("@sinonjs/commons").prototypes.array.join;
|
|
211462
211576
|
var map3 = require2("@sinonjs/commons").prototypes.array.map;
|
|
211463
211577
|
var stringIndexOf = require2("@sinonjs/commons").prototypes.string.indexOf;
|
|
211464
211578
|
var valueToString = require2("@sinonjs/commons").valueToString;
|
|
@@ -211489,7 +211603,7 @@ ${job.error.stack.split(`
|
|
|
211489
211603
|
m4.test = function(actual) {
|
|
211490
211604
|
return matchObject(actual, expectation, match3);
|
|
211491
211605
|
};
|
|
211492
|
-
m4.message = `match(${
|
|
211606
|
+
m4.message = `match(${join54(array3, ", ")})`;
|
|
211493
211607
|
return m4;
|
|
211494
211608
|
},
|
|
211495
211609
|
regexp: function(m4, expectation) {
|
|
@@ -214813,7 +214927,7 @@ ${job.error.stack.split(`
|
|
|
214813
214927
|
tokenize: function tokenize(value) {
|
|
214814
214928
|
return value.split("");
|
|
214815
214929
|
},
|
|
214816
|
-
join: function
|
|
214930
|
+
join: function join54(chars) {
|
|
214817
214931
|
return chars.join("");
|
|
214818
214932
|
}
|
|
214819
214933
|
};
|
|
@@ -221315,9 +221429,7 @@ program2.exitOverride((error53) => {
|
|
|
221315
221429
|
program2.on("option:skip-prompt", () => {
|
|
221316
221430
|
process.env.SKIP_PROMPT = program2.opts().skipPrompt ? "1" : undefined;
|
|
221317
221431
|
});
|
|
221318
|
-
|
|
221319
|
-
process.env.SKIP_PROMPT = "1";
|
|
221320
|
-
}
|
|
221432
|
+
applyRemoteAgentEnv();
|
|
221321
221433
|
program2.on("option:no-cache", () => {
|
|
221322
221434
|
process.env.NO_CACHE = program2.opts().cache === false ? "1" : undefined;
|
|
221323
221435
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awsless/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.40",
|
|
4
4
|
"bugs": {
|
|
5
5
|
"url": "https://github.com/awsless/awsless/issues"
|
|
6
6
|
},
|
|
@@ -82,25 +82,25 @@
|
|
|
82
82
|
"wildstring": "1.0.9",
|
|
83
83
|
"wrap-ansi": "10.0.1",
|
|
84
84
|
"zod": "4.4.3",
|
|
85
|
-
"@awsless/cloudwatch": "^0.0.2",
|
|
86
85
|
"@awsless/big-float": "^0.1.8",
|
|
87
|
-
"@awsless/duration": "^0.0.4",
|
|
88
86
|
"@awsless/clui": "^0.0.10",
|
|
87
|
+
"@awsless/cloudwatch": "^0.0.2",
|
|
89
88
|
"@awsless/dynamodb": "^0.3.28",
|
|
89
|
+
"@awsless/duration": "^0.0.4",
|
|
90
90
|
"@awsless/dynamodb-server": "^0.1.11",
|
|
91
|
-
"@awsless/iot": "^0.0.6",
|
|
92
91
|
"@awsless/json": "^0.0.12",
|
|
92
|
+
"@awsless/iot": "^0.0.6",
|
|
93
93
|
"@awsless/lambda": "^0.0.50",
|
|
94
94
|
"@awsless/open-search": "^0.0.32",
|
|
95
95
|
"@awsless/open-search-server": "^0.0.1",
|
|
96
|
-
"@awsless/redis": "^0.1.
|
|
97
|
-
"@awsless/
|
|
98
|
-
"@awsless/redis-server": "^0.1.0",
|
|
96
|
+
"@awsless/redis": "^0.1.16",
|
|
97
|
+
"@awsless/redis-server": "^0.1.1",
|
|
99
98
|
"@awsless/size": "^0.0.3",
|
|
100
|
-
"@awsless/
|
|
101
|
-
"@awsless/ts-file-cache": "^0.0.22",
|
|
99
|
+
"@awsless/s3": "^0.0.23",
|
|
102
100
|
"@awsless/sqs": "^0.0.25",
|
|
101
|
+
"@awsless/sns": "^0.0.12",
|
|
103
102
|
"@awsless/validate": "^0.2.1",
|
|
103
|
+
"@awsless/ts-file-cache": "^0.0.22",
|
|
104
104
|
"@awsless/weak-cache": "^0.0.2",
|
|
105
105
|
"awsless": "^0.1.11"
|
|
106
106
|
},
|
|
@@ -122,15 +122,15 @@
|
|
|
122
122
|
"@opensearch-project/opensearch": "3.6.0",
|
|
123
123
|
"@awsless/big-float": "^0.1.8",
|
|
124
124
|
"@awsless/duration": "^0.0.4",
|
|
125
|
-
"@awsless/dynamodb": "^0.3.28",
|
|
126
|
-
"@awsless/json": "^0.0.12",
|
|
127
|
-
"@awsless/lambda": "^0.0.50",
|
|
128
125
|
"@awsless/dynamodb-server": "^0.1.11",
|
|
126
|
+
"@awsless/lambda": "^0.0.50",
|
|
129
127
|
"@awsless/ts-file-cache": "^0.0.22",
|
|
130
|
-
"@awsless/
|
|
131
|
-
"awsless": "^0.1.11",
|
|
128
|
+
"@awsless/json": "^0.0.12",
|
|
132
129
|
"@awsless/s3": "^0.0.23",
|
|
133
|
-
"@awsless/
|
|
130
|
+
"@awsless/dynamodb": "^0.3.28",
|
|
131
|
+
"@awsless/validate": "^0.2.1",
|
|
132
|
+
"@awsless/weak-cache": "^0.0.2",
|
|
133
|
+
"awsless": "^0.1.11"
|
|
134
134
|
},
|
|
135
135
|
"scripts": {
|
|
136
136
|
"test": "bun cli/build-handlers.ts && pnpm vitest run",
|