@awsless/cli 0.0.46-next.20 → 0.0.46-next.21

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 CHANGED
@@ -53724,9 +53724,9 @@ var require_nodefs_handler = __commonJS((exports, module) => {
53724
53724
  if (this.fsw.closed) {
53725
53725
  return;
53726
53726
  }
53727
- const dirname17 = sysPath.dirname(file2);
53727
+ const dirname18 = sysPath.dirname(file2);
53728
53728
  const basename4 = sysPath.basename(file2);
53729
- const parent = this.fsw._getWatchedDir(dirname17);
53729
+ const parent = this.fsw._getWatchedDir(dirname18);
53730
53730
  let prevStats = stats2;
53731
53731
  if (parent.has(basename4))
53732
53732
  return;
@@ -53751,7 +53751,7 @@ var require_nodefs_handler = __commonJS((exports, module) => {
53751
53751
  prevStats = newStats2;
53752
53752
  }
53753
53753
  } catch (error3) {
53754
- this.fsw._remove(dirname17, basename4);
53754
+ this.fsw._remove(dirname18, basename4);
53755
53755
  }
53756
53756
  } else if (parent.has(basename4)) {
53757
53757
  const at = newStats.atimeMs;
@@ -56327,7 +56327,7 @@ var require_client2 = __commonJS((exports) => {
56327
56327
  // ../../node_modules/.pnpm/@smithy+core@3.29.7/node_modules/@smithy/core/dist-cjs/submodules/config/index.js
56328
56328
  var require_config = __commonJS((exports) => {
56329
56329
  var { homedir: homedir2 } = __require("os");
56330
- var { sep: sep2, join: join29 } = __require("path");
56330
+ var { sep: sep2, join: join30 } = __require("path");
56331
56331
  var { createHash: createHash17 } = __require("crypto");
56332
56332
  var { readFile: readFile$1 } = __require("fs/promises");
56333
56333
  var { IniSectionType: IniSectionType2 } = require_dist_cjs();
@@ -56485,7 +56485,7 @@ var require_config = __commonJS((exports) => {
56485
56485
  var getSSOTokenFilepath = (id) => {
56486
56486
  const hasher = createHash17("sha1");
56487
56487
  const cacheName = hasher.update(id).digest("hex");
56488
- return join29(getHomeDir(), ".aws", "sso", "cache", `${cacheName}.json`);
56488
+ return join30(getHomeDir(), ".aws", "sso", "cache", `${cacheName}.json`);
56489
56489
  };
56490
56490
  var tokenIntercept = {};
56491
56491
  var getSSOTokenFromFile = async (id) => {
@@ -56512,9 +56512,9 @@ var require_config = __commonJS((exports) => {
56512
56512
  ...data.default && { default: data.default }
56513
56513
  });
56514
56514
  var ENV_CONFIG_PATH = "AWS_CONFIG_FILE";
56515
- var getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || join29(getHomeDir(), ".aws", "config");
56515
+ var getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || join30(getHomeDir(), ".aws", "config");
56516
56516
  var ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE";
56517
- var getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || join29(getHomeDir(), ".aws", "credentials");
56517
+ var getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || join30(getHomeDir(), ".aws", "credentials");
56518
56518
  var prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@+.%:/]+)\2$/;
56519
56519
  var profileNameBlockList = ["__proto__", "profile __proto__"];
56520
56520
  var parseIni = (iniData) => {
@@ -56580,11 +56580,11 @@ var require_config = __commonJS((exports) => {
56580
56580
  const relativeHomeDirPrefix = "~/";
56581
56581
  let resolvedFilepath = filepath;
56582
56582
  if (filepath.startsWith(relativeHomeDirPrefix)) {
56583
- resolvedFilepath = join29(homeDir, filepath.slice(2));
56583
+ resolvedFilepath = join30(homeDir, filepath.slice(2));
56584
56584
  }
56585
56585
  let resolvedConfigFilepath = configFilepath;
56586
56586
  if (configFilepath.startsWith(relativeHomeDirPrefix)) {
56587
- resolvedConfigFilepath = join29(homeDir, configFilepath.slice(2));
56587
+ resolvedConfigFilepath = join30(homeDir, configFilepath.slice(2));
56588
56588
  }
56589
56589
  const parsedFiles = await Promise.all([
56590
56590
  readFile13(resolvedConfigFilepath, {
@@ -74177,7 +74177,7 @@ var require_signin = __commonJS((exports) => {
74177
74177
  import { createHash as createHash17, createPrivateKey, createPublicKey, sign } from "crypto";
74178
74178
  import { promises as fs3 } from "fs";
74179
74179
  import { homedir as homedir3 } from "os";
74180
- import { dirname as dirname18, join as join32 } from "path";
74180
+ import { dirname as dirname19, join as join33 } from "path";
74181
74181
  var import_config24, import_protocols3, LoginCredentialsFetcher;
74182
74182
  var init_LoginCredentialsFetcher = __esm(() => {
74183
74183
  import_config24 = __toESM(require_config(), 1);
@@ -74329,17 +74329,17 @@ var init_LoginCredentialsFetcher = __esm(() => {
74329
74329
  }
74330
74330
  async saveToken(token) {
74331
74331
  const tokenFilePath = this.getTokenFilePath();
74332
- const directory = dirname18(tokenFilePath);
74332
+ const directory = dirname19(tokenFilePath);
74333
74333
  try {
74334
74334
  await fs3.mkdir(directory, { recursive: true });
74335
74335
  } catch (error3) {}
74336
74336
  await fs3.writeFile(tokenFilePath, JSON.stringify(token, null, 2), "utf8");
74337
74337
  }
74338
74338
  getTokenFilePath() {
74339
- const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ?? join32(homedir3(), ".aws", "login", "cache");
74339
+ const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ?? join33(homedir3(), ".aws", "login", "cache");
74340
74340
  const loginSessionBytes = Buffer.from(this.loginSession, "utf8");
74341
74341
  const loginSessionSha256 = createHash17("sha256").update(loginSessionBytes).digest("hex");
74342
- return join32(directory, `${loginSessionSha256}.json`);
74342
+ return join33(directory, `${loginSessionSha256}.json`);
74343
74343
  }
74344
74344
  derToRawSignature(derSignature) {
74345
74345
  let offset = 2;
@@ -100753,6 +100753,8 @@ var ReservedConcurrentExecutionsSchema = exports_external.number().int().min(0).
100753
100753
  var VPCSchema = exports_external.boolean().describe("Put the function inside your global VPC.");
100754
100754
  var DescriptionSchema = exports_external.string().describe("A description of the function.");
100755
100755
  var LayersSchema = exports_external.string().array().describe(`A list of function layers to add to the function's execution environment. Specify each layer by its name.`);
100756
+ var SandboxRouteKeySchema = exports_external.string().regex(/^[a-z0-9-]+:[a-z0-9-]+:[a-z0-9-]+$/i, 'Invalid route key. Use the "stack:type:name" format.');
100757
+ var SandboxSchema = exports_external.union([exports_external.boolean(), SandboxRouteKeySchema.array()]).describe('Block the function from invoking other lambdas. Pass a list of route keys like "my-stack:function:my-name" to allow only those routes through a private sandbox gateway.');
100756
100758
  var EnvironmentSchema = exports_external.record(exports_external.string(), exports_external.string()).optional().describe("Environment variable key-value pairs.");
100757
100759
  var ArchitectureSchema = exports_external.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the function supports.");
100758
100760
  var RuntimeSchema = exports_external.enum(["nodejs18.x", "nodejs20.x", "nodejs22.x", "nodejs24.x"]).or(exports_external.literal("container")).or(exports_external.string()).describe("The identifier of the function's runtime.");
@@ -100825,7 +100827,8 @@ var StackFnSchema = exports_external.object({
100825
100827
  reserved: ReservedConcurrentExecutionsSchema.optional(),
100826
100828
  layers: LayersSchema.optional(),
100827
100829
  environment: EnvironmentSchema.optional(),
100828
- permissions: PermissionsSchema.optional()
100830
+ permissions: PermissionsSchema.optional(),
100831
+ sandbox: SandboxSchema.optional()
100829
100832
  }).strict();
100830
100833
  var StackFunctionSchema = exports_external.union([
100831
100834
  LocalFileSchema.transform((code) => ({
@@ -100848,7 +100851,7 @@ var FunctionDefaultSchema = exports_external.object({
100848
100851
  timeout: TimeoutSchema.default("15 minutes"),
100849
100852
  memorySize: MemorySizeSchema.default("1024 MB"),
100850
100853
  architecture: ArchitectureSchema.default("arm64"),
100851
- vpc: VPCSchema.default(true),
100854
+ vpc: VPCSchema.default(false),
100852
100855
  ephemeralStorageSize: EphemeralStorageSizeSchema.default("512 MB"),
100853
100856
  reserved: ReservedConcurrentExecutionsSchema.optional(),
100854
100857
  layers: LayersSchema.optional(),
@@ -104531,10 +104534,12 @@ import { formatRouteEnvName } from "awsless";
104531
104534
  import { relative as relative3 } from "path";
104532
104535
 
104533
104536
  // src/feature/function/util.ts
104534
- import { seconds as seconds4, toDays as toDays6, toSeconds as toSeconds4 } from "@awsless/duration";
104537
+ import { days as days8, seconds as seconds4, toDays as toDays6, toSeconds as toSeconds4 } from "@awsless/duration";
104535
104538
  import { generateFileHash as generateFileHash2 } from "@awsless/ts-file-cache";
104536
104539
  var import_deepmerge = __toESM(require_cjs2(), 1);
104537
104540
  import { createHash as createHash10 } from "crypto";
104541
+ import { dirname as dirname7, join as join12 } from "path";
104542
+ import { fileURLToPath as fileURLToPath4 } from "url";
104538
104543
 
104539
104544
  // src/feature/on-error-log/util.ts
104540
104545
  var filterPattern = `{${[
@@ -104550,7 +104555,6 @@ var filterPattern = `{${[
104550
104555
  var standaloneFields = [
104551
104556
  "runtime",
104552
104557
  "description",
104553
- "vpc",
104554
104558
  "log",
104555
104559
  "timeout",
104556
104560
  "memorySize",
@@ -104559,7 +104563,8 @@ var standaloneFields = [
104559
104563
  "reserved",
104560
104564
  "layers",
104561
104565
  "environment",
104562
- "permissions"
104566
+ "permissions",
104567
+ "sandbox"
104563
104568
  ];
104564
104569
  var isStandaloneFunction = (props) => {
104565
104570
  return standaloneFields.some((field) => typeof props[field] !== "undefined");
@@ -104646,10 +104651,13 @@ var createLambdaFunction = (ctx, id, local) => {
104646
104651
  statementDeps.add(dep);
104647
104652
  }
104648
104653
  };
104649
- addPermission(...props.permissions ?? []);
104650
- ctx.onPermission((statement) => {
104651
- addPermission(statement);
104652
- });
104654
+ const sandboxed = typeof local.sandbox !== "undefined" && local.sandbox !== false;
104655
+ addPermission(...(sandboxed ? local.permissions : props.permissions) ?? []);
104656
+ if (!sandboxed) {
104657
+ ctx.onPermission((statement) => {
104658
+ addPermission(statement);
104659
+ });
104660
+ }
104653
104661
  const policy = new aws.iam.RolePolicy(group, "policy", {
104654
104662
  role: role.name,
104655
104663
  name: "lambda-policy",
@@ -104747,7 +104755,11 @@ var createLambdaFunction = (ctx, id, local) => {
104747
104755
  variables.REGION = ctx.appConfig.region;
104748
104756
  variables.STAGE = ctx.appConfig.stage ?? "default";
104749
104757
  variables.STACK = ctx.stackConfig.name;
104750
- variables.STANDALONE = "true";
104758
+ if (sandboxed) {
104759
+ variables.SANDBOX = "true";
104760
+ } else {
104761
+ variables.STANDALONE = "true";
104762
+ }
104751
104763
  if (props.vpc) {
104752
104764
  variables.AWS_USE_DUALSTACK_ENDPOINT = "true";
104753
104765
  }
@@ -104760,6 +104772,33 @@ var createLambdaFunction = (ctx, id, local) => {
104760
104772
  ctx.onBind((name2, value) => {
104761
104773
  variables[name2] = value;
104762
104774
  });
104775
+ if (Array.isArray(local.sandbox) && local.sandbox.length > 0) {
104776
+ const bundle = ctx.shared.get("bundle", "main");
104777
+ const distDir = dirname7(fileURLToPath4(import.meta.url));
104778
+ const proxy = createPrebuildLambdaFunction(group, ctx, "function", `${id}-proxy`, {
104779
+ bundleFile: join12(distDir, "/prebuild/sandbox-proxy/bundle.zip"),
104780
+ bundleHash: join12(distDir, "/prebuild/sandbox-proxy/HASH"),
104781
+ runtime: "nodejs24.x",
104782
+ handler: "index.default",
104783
+ timeout: ctx.appConfig.defaults.function.timeout,
104784
+ log: {
104785
+ format: "json",
104786
+ level: "warn",
104787
+ system: "warn",
104788
+ retention: days8(3)
104789
+ }
104790
+ });
104791
+ proxy.setEnvironment("SANDBOX_ROUTES", JSON.stringify(local.sandbox));
104792
+ proxy.addPermission({
104793
+ actions: ["lambda:InvokeFunction"],
104794
+ resources: [bundle.alias.arn]
104795
+ });
104796
+ variables.SANDBOX_PROXY = proxy.name;
104797
+ addPermission({
104798
+ actions: ["lambda:InvokeFunction"],
104799
+ resources: [proxy.lambda.arn]
104800
+ });
104801
+ }
104763
104802
  if (props.log.retention.value > 0n) {
104764
104803
  const logGroup = new aws.cloudwatch.LogGroup(group, "log", {
104765
104804
  name: `/aws/lambda/${name}`,
@@ -105089,8 +105128,8 @@ var functionFeature = defineFeature({
105089
105128
 
105090
105129
  // src/feature/on-error-log/index.ts
105091
105130
  import { formatRouteEnvName as formatRouteEnvName2 } from "awsless";
105092
- import { dirname as dirname7, join as join12 } from "path";
105093
- import { fileURLToPath as fileURLToPath4 } from "url";
105131
+ import { dirname as dirname8, join as join13 } from "path";
105132
+ import { fileURLToPath as fileURLToPath5 } from "url";
105094
105133
  var onErrorLogFeature = defineFeature({
105095
105134
  name: "on-error-log",
105096
105135
  onApp(ctx) {
@@ -105105,7 +105144,7 @@ var onErrorLogFeature = defineFeature({
105105
105144
  const consumerRoute = formatRouteKey("base", "on-error-log", "consumer");
105106
105145
  bundle.addHandler({
105107
105146
  routeKey: handlerRoute,
105108
- file: join12(dirname7(fileURLToPath4(import.meta.url)), "/handlers/on-error-log.js"),
105147
+ file: join13(dirname8(fileURLToPath5(import.meta.url)), "/handlers/on-error-log.js"),
105109
105148
  exportName: "default"
105110
105149
  });
105111
105150
  bundle.addEnv(formatRouteEnvName2(handlerRoute, "CONSUMER"), consumerRoute);
@@ -105160,9 +105199,9 @@ var onErrorLogFeature = defineFeature({
105160
105199
  });
105161
105200
 
105162
105201
  // src/feature/on-failure/index.ts
105163
- import { days as days8, toSeconds as toSeconds5 } from "@awsless/duration";
105164
- import { dirname as dirname8, join as join13 } from "path";
105165
- import { fileURLToPath as fileURLToPath5 } from "url";
105202
+ import { days as days9, toSeconds as toSeconds5 } from "@awsless/duration";
105203
+ import { dirname as dirname9, join as join14 } from "path";
105204
+ import { fileURLToPath as fileURLToPath6 } from "url";
105166
105205
  var onFailureFeature = defineFeature({
105167
105206
  name: "on-failure",
105168
105207
  onBefore(ctx) {
@@ -105173,7 +105212,7 @@ var onFailureFeature = defineFeature({
105173
105212
  resourceType: "on-failure",
105174
105213
  resourceName: "deadletter"
105175
105214
  }),
105176
- messageRetentionSeconds: toSeconds5(days8(14))
105215
+ messageRetentionSeconds: toSeconds5(days9(14))
105177
105216
  });
105178
105217
  const bundleTimeout = toSeconds5(ctx.appConfig.defaults.function.timeout);
105179
105218
  const queue2 = new aws.sqs.Queue(group, "on-failure", {
@@ -105310,10 +105349,10 @@ var onFailureFeature = defineFeature({
105310
105349
  const bundle = ctx.shared.get("bundle", "main");
105311
105350
  const { group, bucket, queue: queue2 } = ctx.shared.get("on-failure", "resources");
105312
105351
  registerBundleFunction(ctx, formatRouteKey("base", "on-failure", "consumer"), props.consumer);
105313
- const distDir = dirname8(fileURLToPath5(import.meta.url));
105352
+ const distDir = dirname9(fileURLToPath6(import.meta.url));
105314
105353
  const handler = createPrebuildLambdaFunction(group, ctx, "on-failure", "handler", {
105315
- bundleFile: join13(distDir, "/prebuild/on-failure/bundle.zip"),
105316
- bundleHash: join13(distDir, "/prebuild/on-failure/HASH"),
105354
+ bundleFile: join14(distDir, "/prebuild/on-failure/bundle.zip"),
105355
+ bundleHash: join14(distDir, "/prebuild/on-failure/HASH"),
105317
105356
  runtime: "nodejs24.x",
105318
105357
  handler: "index.default",
105319
105358
  memorySize: mebibytes(256),
@@ -105322,7 +105361,7 @@ var onFailureFeature = defineFeature({
105322
105361
  format: "json",
105323
105362
  level: "warn",
105324
105363
  system: "warn",
105325
- retention: days8(3)
105364
+ retention: days9(3)
105326
105365
  }
105327
105366
  });
105328
105367
  handler.addPermission({
@@ -105387,8 +105426,8 @@ var onFailureFeature = defineFeature({
105387
105426
 
105388
105427
  // src/feature/pubsub/index.ts
105389
105428
  import { createHmac as createHmac2 } from "crypto";
105390
- import { fileURLToPath as fileURLToPath7 } from "url";
105391
- import { dirname as dirname10, join as join16 } from "path";
105429
+ import { fileURLToPath as fileURLToPath8 } from "url";
105430
+ import { dirname as dirname11, join as join17 } from "path";
105392
105431
  import { formatRouteEnvName as formatRouteEnvName3 } from "awsless";
105393
105432
 
105394
105433
  // src/feature/pubsub/util.ts
@@ -105396,15 +105435,15 @@ import { toDays as toDays7 } from "@awsless/duration";
105396
105435
  import { stringify } from "@awsless/json";
105397
105436
  import { createHash as createHash12 } from "crypto";
105398
105437
  import { readFile as readFile10 } from "fs/promises";
105399
- import { fileURLToPath as fileURLToPath6 } from "url";
105400
- import { dirname as dirname9, join as join15 } from "path";
105438
+ import { fileURLToPath as fileURLToPath7 } from "url";
105439
+ import { dirname as dirname10, join as join16 } from "path";
105401
105440
 
105402
105441
  // src/feature/instance/build/executable.ts
105403
105442
  import { createHash as createHash11 } from "crypto";
105404
105443
  import { readFile as readFile9 } from "fs/promises";
105405
- import { join as join14 } from "path";
105444
+ import { join as join15 } from "path";
105406
105445
  var buildExecutable = async (input, outputPath, architecture) => {
105407
- const filePath = join14(outputPath, "program");
105446
+ const filePath = join15(outputPath, "program");
105408
105447
  const target2 = architecture === "x86_64" ? "bun-linux-x64" : "bun-linux-arm64";
105409
105448
  let result;
105410
105449
  try {
@@ -105449,7 +105488,7 @@ ${result.logs?.map((log) => log.message).join(`
105449
105488
  };
105450
105489
 
105451
105490
  // src/feature/pubsub/util.ts
105452
- var __dirname2 = dirname9(fileURLToPath6(import.meta.url));
105491
+ var __dirname2 = dirname10(fileURLToPath7(import.meta.url));
105453
105492
  var WS_PORT = 3000;
105454
105493
  var ARCHITECTURE = "arm64";
105455
105494
  var CPU = "0.25 vCPU";
@@ -105465,7 +105504,7 @@ var createPubSubService = (parentGroup, ctx, id, props, inputs) => {
105465
105504
  });
105466
105505
  const shortName = shortId(`${ctx.app.name}:pubsub:${id}:${ctx.appId}`);
105467
105506
  const image = "public.ecr.aws/aws-cli/aws-cli:arm64";
105468
- const bundleFile = join15(__dirname2, "handlers/pubsub-server.js");
105507
+ const bundleFile = join16(__dirname2, "handlers/pubsub-server.js");
105469
105508
  ctx.registerBuild("pubsub", name, async (build2) => {
105470
105509
  const hash2 = createHash12("sha1").update(await readFile10(bundleFile)).digest("hex");
105471
105510
  const fingerprint = `${hash2}-${ARCHITECTURE}`;
@@ -105753,7 +105792,7 @@ var createPubSubService = (parentGroup, ctx, id, props, inputs) => {
105753
105792
  };
105754
105793
 
105755
105794
  // src/feature/pubsub/index.ts
105756
- var __dirname3 = dirname10(fileURLToPath7(import.meta.url));
105795
+ var __dirname3 = dirname11(fileURLToPath8(import.meta.url));
105757
105796
  var typeGenCode4 = `
105758
105797
  import type { Mock } from 'vitest'
105759
105798
 
@@ -105996,7 +106035,7 @@ var pubsubFeature = defineFeature({
105996
106035
  const publisherRouteKey = formatRouteKey("base", "pubsub", `${id}-publisher`);
105997
106036
  bundle.addHandler({
105998
106037
  routeKey: publisherRouteKey,
105999
- file: join16(__dirname3, "/handlers/pubsub-publisher.js"),
106038
+ file: join17(__dirname3, "/handlers/pubsub-publisher.js"),
106000
106039
  exportName: "default"
106001
106040
  });
106002
106041
  bundle.addEnv(formatRouteEnvName3(publisherRouteKey, "REDIS_HOST"), redisHost);
@@ -106257,8 +106296,8 @@ var restFeature = defineFeature({
106257
106296
 
106258
106297
  // src/feature/rpc/index.ts
106259
106298
  import { formatRouteEnvName as formatRouteEnvName4 } from "awsless";
106260
- import { dirname as dirname11, join as join17, relative as relative5 } from "path";
106261
- import { fileURLToPath as fileURLToPath8 } from "url";
106299
+ import { dirname as dirname12, join as join18, relative as relative5 } from "path";
106300
+ import { fileURLToPath as fileURLToPath9 } from "url";
106262
106301
  import { toSeconds as toSeconds7 } from "@awsless/duration";
106263
106302
  var rpcFeature = defineFeature({
106264
106303
  name: "rpc",
@@ -106310,7 +106349,7 @@ var rpcFeature = defineFeature({
106310
106349
  const serverRouteKey = formatRouteKey("base", "rpc", id);
106311
106350
  bundle.addHandler({
106312
106351
  routeKey: serverRouteKey,
106313
- file: join17(dirname11(fileURLToPath8(import.meta.url)), "/handlers/rpc.js"),
106352
+ file: join18(dirname12(fileURLToPath9(import.meta.url)), "/handlers/rpc.js"),
106314
106353
  exportName: "default"
106315
106354
  });
106316
106355
  bundle.addEnv(formatRouteEnvName4(serverRouteKey, "TIMEOUT"), toSeconds7(ctx.appConfig.defaults.function.timeout).toString());
@@ -106460,11 +106499,11 @@ var searchFeature = defineFeature({
106460
106499
 
106461
106500
  // src/feature/site/index.ts
106462
106501
  import { createHash as createHash13 } from "crypto";
106463
- import { dirname as dirname13, join as join20 } from "path";
106502
+ import { dirname as dirname14, join as join21 } from "path";
106464
106503
 
106465
106504
  // src/util/cache.ts
106466
106505
  import { lstat as lstat3, readdir as readdir4 } from "fs/promises";
106467
- import { join as join18 } from "path";
106506
+ import { join as join19 } from "path";
106468
106507
  var generateCacheKey = async (directories2) => {
106469
106508
  const files = await listAllFiles(directories2);
106470
106509
  const sortedFiles = files.toSorted();
@@ -106491,7 +106530,7 @@ var listAllFiles = async (list2) => {
106491
106530
  recursive: true,
106492
106531
  withFileTypes: true
106493
106532
  });
106494
- files.push(...dirents.filter((d3) => d3.isFile()).map((file2) => join18(file2.parentPath, file2.name)));
106533
+ files.push(...dirents.filter((d3) => d3.isFile()).map((file2) => join19(file2.parentPath, file2.name)));
106495
106534
  } else if (stat5.isFile()) {
106496
106535
  files.push(entry);
106497
106536
  }
@@ -106500,7 +106539,7 @@ var listAllFiles = async (list2) => {
106500
106539
  };
106501
106540
 
106502
106541
  // src/feature/site/static-routes.ts
106503
- import { basename as basename3, dirname as dirname12, join as join19 } from "path";
106542
+ import { basename as basename3, dirname as dirname13, join as join20 } from "path";
106504
106543
  var isPageFile = (file2) => {
106505
106544
  return file2.endsWith(".html") || !basename3(file2).includes(".");
106506
106545
  };
@@ -106510,7 +106549,7 @@ var pageUrl = (file2) => {
106510
106549
  }
106511
106550
  const url = file2.slice(0, -".html".length);
106512
106551
  if (basename3(url) === "index") {
106513
- return dirname12(url);
106552
+ return dirname13(url);
106514
106553
  }
106515
106554
  return url;
106516
106555
  };
@@ -106519,10 +106558,10 @@ var planStaticRoutes = (files, sitePath) => {
106519
106558
  const pages = files.filter((file2) => isPageFile(file2));
106520
106559
  const assets = files.filter((file2) => !isPageFile(file2));
106521
106560
  for (const page of pages) {
106522
- plan.files[join19(sitePath, pageUrl(page))] = page;
106561
+ plan.files[join20(sitePath, pageUrl(page))] = page;
106523
106562
  }
106524
106563
  if (sitePath !== "/") {
106525
- plan.catchAll = join19(sitePath, "*.");
106564
+ plan.catchAll = join20(sitePath, "*.");
106526
106565
  return plan;
106527
106566
  }
106528
106567
  const folders = new Set;
@@ -106532,9 +106571,9 @@ var planStaticRoutes = (files, sitePath) => {
106532
106571
  folders.add(folder);
106533
106572
  continue;
106534
106573
  }
106535
- plan.files[join19(sitePath, asset)] = asset;
106574
+ plan.files[join20(sitePath, asset)] = asset;
106536
106575
  }
106537
- plan.dirs = [...folders].map((folder) => join19(sitePath, folder, "*."));
106576
+ plan.dirs = [...folders].map((folder) => join20(sitePath, folder, "*."));
106538
106577
  return plan;
106539
106578
  };
106540
106579
 
@@ -106559,7 +106598,7 @@ var siteFeature = defineFeature({
106559
106598
  return build2(fingerprint, async (write) => {
106560
106599
  const credentialProvider = await getCredentials(ctx.appConfig.profile);
106561
106600
  const credentials2 = await credentialProvider();
106562
- const cwd = join20(directories.root, dirname13(ctx.stackConfig.file));
106601
+ const cwd = join21(directories.root, dirname14(ctx.stackConfig.file));
106563
106602
  const env2 = {
106564
106603
  ...process.env,
106565
106604
  APP: ctx.appConfig.name,
@@ -106623,7 +106662,7 @@ ${(errors3.trim() || output.trim()).slice(-2000)}`);
106623
106662
  cwd: staticDir,
106624
106663
  nodir: true
106625
106664
  }).sort();
106626
- const hashes = files.map((file2) => $hash(join20(staticDir, file2)));
106665
+ const hashes = files.map((file2) => $hash(join21(staticDir, file2)));
106627
106666
  const version = $combine(...hashes).pipe((hashes2) => {
106628
106667
  const hash2 = createHash13("sha1");
106629
106668
  for (const [index, file2] of files.entries()) {
@@ -106671,7 +106710,7 @@ ${(errors3.trim() || output.trim()).slice(-2000)}`);
106671
106710
  });
106672
106711
 
106673
106712
  // src/feature/store/index.ts
106674
- import { join as join21 } from "path";
106713
+ import { join as join22 } from "path";
106675
106714
  import { toDays as toDays8 } from "@awsless/duration";
106676
106715
 
106677
106716
  // src/feature/store/util.ts
@@ -106794,8 +106833,8 @@ var storeFeature = defineFeature({
106794
106833
  key: `${folder}${file2}`,
106795
106834
  cacheControl: getCacheControl(file2),
106796
106835
  contentType: getContentType(file2),
106797
- source: join21(props.static, file2),
106798
- sourceHash: $hash(join21(props.static, file2))
106836
+ source: join22(props.static, file2),
106837
+ sourceHash: $hash(join22(props.static, file2))
106799
106838
  }, {
106800
106839
  replaceOnChanges: ["bucket", "key"]
106801
106840
  });
@@ -107444,8 +107483,8 @@ var layerFeature = defineFeature({
107444
107483
  // src/feature/image/index.ts
107445
107484
  import { toDays as toDays9 } from "@awsless/duration";
107446
107485
  import { formatRouteEnvName as formatRouteEnvName5 } from "awsless";
107447
- import { dirname as dirname14, join as join22 } from "path";
107448
- import { fileURLToPath as fileURLToPath9 } from "url";
107486
+ import { dirname as dirname15, join as join23 } from "path";
107487
+ import { fileURLToPath as fileURLToPath10 } from "url";
107449
107488
  var imageFeature = defineFeature({
107450
107489
  name: "image",
107451
107490
  onApp(ctx) {
@@ -107459,7 +107498,7 @@ var imageFeature = defineFeature({
107459
107498
  throw new FileError("app.json", "The image feature requires an arm64 function bundle.");
107460
107499
  }
107461
107500
  const group = new Group(ctx.base, "image", "layer");
107462
- const path2 = join22(dirname14(fileURLToPath9(import.meta.url)), "/layers/sharp-arm.zip");
107501
+ const path2 = join23(dirname15(fileURLToPath10(import.meta.url)), "/layers/sharp-arm.zip");
107463
107502
  const layerId = formatGlobalResourceName({
107464
107503
  appName: ctx.appConfig.name,
107465
107504
  resourceType: "layer",
@@ -107524,7 +107563,7 @@ var imageFeature = defineFeature({
107524
107563
  const serverRouteKey = formatRouteKey(ctx.stack.name, "image", id);
107525
107564
  bundle.addHandler({
107526
107565
  routeKey: serverRouteKey,
107527
- file: join22(dirname14(fileURLToPath9(import.meta.url)), "/handlers/image.js"),
107566
+ file: join23(dirname15(fileURLToPath10(import.meta.url)), "/handlers/image.js"),
107528
107567
  exportName: "default",
107529
107568
  external: ["sharp"]
107530
107569
  });
@@ -107562,8 +107601,8 @@ var imageFeature = defineFeature({
107562
107601
  new aws.s3.BucketObject(group, `static-${file2}`, {
107563
107602
  bucket: bucket.name,
107564
107603
  key: `${folder}origin/${file2}`,
107565
- source: join22(props.origin.static, file2),
107566
- sourceHash: $hash(join22(props.origin.static, file2))
107604
+ source: join23(props.origin.static, file2),
107605
+ sourceHash: $hash(join23(props.origin.static, file2))
107567
107606
  }, {
107568
107607
  replaceOnChanges: ["bucket", "key"]
107569
107608
  });
@@ -107579,8 +107618,8 @@ var imageFeature = defineFeature({
107579
107618
  // src/feature/icon/index.ts
107580
107619
  import { toDays as toDays10 } from "@awsless/duration";
107581
107620
  import { formatRouteEnvName as formatRouteEnvName6 } from "awsless";
107582
- import { dirname as dirname15, join as join23 } from "path";
107583
- import { fileURLToPath as fileURLToPath10 } from "url";
107621
+ import { dirname as dirname16, join as join24 } from "path";
107622
+ import { fileURLToPath as fileURLToPath11 } from "url";
107584
107623
  var iconFeature = defineFeature({
107585
107624
  name: "icon",
107586
107625
  onStack(ctx) {
@@ -107611,7 +107650,7 @@ var iconFeature = defineFeature({
107611
107650
  const serverRouteKey = formatRouteKey(ctx.stack.name, "icon", id);
107612
107651
  bundle.addHandler({
107613
107652
  routeKey: serverRouteKey,
107614
- file: join23(dirname15(fileURLToPath10(import.meta.url)), "/handlers/icon.js"),
107653
+ file: join24(dirname16(fileURLToPath11(import.meta.url)), "/handlers/icon.js"),
107615
107654
  exportName: "default"
107616
107655
  });
107617
107656
  addRoutes({
@@ -107651,8 +107690,8 @@ var iconFeature = defineFeature({
107651
107690
  new aws.s3.BucketObject(group, `static-${file2}`, {
107652
107691
  bucket: bucket.name,
107653
107692
  key: `${folder}origin/${file2}`,
107654
- source: join23(props.origin.static, file2),
107655
- sourceHash: $hash(join23(props.origin.static, file2))
107693
+ source: join24(props.origin.static, file2),
107694
+ sourceHash: $hash(join24(props.origin.static, file2))
107656
107695
  }, {
107657
107696
  replaceOnChanges: ["bucket", "key"]
107658
107697
  });
@@ -107679,10 +107718,10 @@ var import_deepmerge4 = __toESM(require_cjs2(), 1);
107679
107718
  // src/feature/job/build/executable.ts
107680
107719
  import { createHash as createHash14 } from "crypto";
107681
107720
  import { readFile as readFile11, writeFile as writeFile7 } from "fs/promises";
107682
- import { join as join24, resolve as resolve3 } from "path";
107721
+ import { join as join25, resolve as resolve3 } from "path";
107683
107722
  var buildJobExecutable = async (input, outputPath, architecture) => {
107684
- const filePath = join24(outputPath, "program");
107685
- const wrapperPath = join24(outputPath, "wrapper.ts");
107723
+ const filePath = join25(outputPath, "program");
107724
+ const wrapperPath = join25(outputPath, "wrapper.ts");
107686
107725
  const handlerPath = resolve3(input);
107687
107726
  await writeFile7(wrapperPath, `import { parse } from '@awsless/json'
107688
107727
  import { getObject } from '@awsless/s3'
@@ -108186,7 +108225,7 @@ var jobFeature = defineFeature({
108186
108225
  });
108187
108226
 
108188
108227
  // src/feature/instance/index.ts
108189
- import { days as days9, seconds as seconds6, toSeconds as toSeconds11 } from "@awsless/duration";
108228
+ import { days as days10, seconds as seconds6, toSeconds as toSeconds11 } from "@awsless/duration";
108190
108229
 
108191
108230
  // src/feature/instance/util.ts
108192
108231
  import { toDays as toDays12, toSeconds as toSeconds10 } from "@awsless/duration";
@@ -108194,7 +108233,7 @@ import { stringify as stringify3 } from "@awsless/json";
108194
108233
  import { generateFileHash as generateFileHash4 } from "@awsless/ts-file-cache";
108195
108234
  var import_deepmerge6 = __toESM(require_cjs2(), 1);
108196
108235
  import { createHash as createHash16 } from "crypto";
108197
- import { join as join25 } from "path";
108236
+ import { join as join26 } from "path";
108198
108237
  var createFargateTask = (parentGroup, ctx, ns, id, local) => {
108199
108238
  const group = new Group(parentGroup, "instance", ns);
108200
108239
  const name = formatLocalResourceName({
@@ -108399,7 +108438,7 @@ var createFargateTask = (parentGroup, ctx, ns, id, local) => {
108399
108438
  healthCheck: props.healthCheck ? {
108400
108439
  command: [
108401
108440
  "CMD-SHELL",
108402
- `curl -f http://${join25("localhost", props.healthCheck.path)} || exit 1`
108441
+ `curl -f http://${join26("localhost", props.healthCheck.path)} || exit 1`
108403
108442
  ],
108404
108443
  interval: toSeconds10(props.healthCheck.interval),
108405
108444
  retries: props.healthCheck.retries,
@@ -108570,7 +108609,7 @@ var instanceFeature = defineFeature({
108570
108609
  const queue2 = new aws.sqs.Queue(group, "queue", {
108571
108610
  name: task2.name,
108572
108611
  visibilityTimeoutSeconds: toSeconds11(seconds6(30)),
108573
- messageRetentionSeconds: toSeconds11(days9(4)),
108612
+ messageRetentionSeconds: toSeconds11(days10(4)),
108574
108613
  maxMessageSize: toBytes(kibibytes(256)),
108575
108614
  receiveWaitTimeSeconds: toSeconds11(seconds6(20))
108576
108615
  });
@@ -108728,7 +108767,7 @@ var metricFeature = defineFeature({
108728
108767
  });
108729
108768
 
108730
108769
  // src/feature/router/index.ts
108731
- import { days as days10, seconds as seconds8, toSeconds as toSeconds14, years } from "@awsless/duration";
108770
+ import { days as days11, seconds as seconds8, toSeconds as toSeconds14, years } from "@awsless/duration";
108732
108771
 
108733
108772
  // src/feature/router/router-code.ts
108734
108773
  import { minutes as minutes8, seconds as seconds7, toSeconds as toSeconds13 } from "@awsless/duration";
@@ -109281,8 +109320,8 @@ var routerFeature = defineFeature({
109281
109320
  const cache = new aws.cloudfront.CachePolicy(group, "cache", {
109282
109321
  name,
109283
109322
  minTtl: toSeconds14(seconds8(0)),
109284
- maxTtl: toSeconds14(days10(365)),
109285
- defaultTtl: toSeconds14(days10(0)),
109323
+ maxTtl: toSeconds14(days11(365)),
109324
+ defaultTtl: toSeconds14(days11(0)),
109286
109325
  parametersInCacheKeyAndForwardedToOrigin: {
109287
109326
  enableAcceptEncodingBrotli: true,
109288
109327
  enableAcceptEncodingGzip: true,
@@ -111099,20 +111138,20 @@ import { DynamoDBClient as DynamoDBClient3 } from "@awsless/dynamodb";
111099
111138
  // src/cli/ui/complex/run-tests.ts
111100
111139
  var import_wildstring3 = __toESM(require_wildstring(), 1);
111101
111140
  import { mkdir as mkdir6, readFile as readFile12, writeFile as writeFile8 } from "fs/promises";
111102
- import { join as join27 } from "path";
111141
+ import { join as join28 } from "path";
111103
111142
  import { parse as parse5, stringify as stringify4 } from "@awsless/json";
111104
111143
  import { generateFolderHash, loadWorkspace as loadWorkspace2 } from "@awsless/ts-file-cache";
111105
111144
 
111106
111145
  // src/test/start.ts
111107
- import { dirname as dirname16, join as join26 } from "path";
111108
- import { fileURLToPath as fileURLToPath11 } from "url";
111146
+ import { dirname as dirname17, join as join27 } from "path";
111147
+ import { fileURLToPath as fileURLToPath12 } from "url";
111109
111148
  import { configDefaults } from "vitest/config";
111110
111149
  import { startVitest } from "vitest/node";
111111
111150
 
111112
111151
  class NullReporter {
111113
111152
  }
111114
111153
  var startTest = async (props) => {
111115
- const __dirname4 = dirname16(fileURLToPath11(import.meta.url));
111154
+ const __dirname4 = dirname17(fileURLToPath12(import.meta.url));
111116
111155
  const startTime = process.hrtime.bigint();
111117
111156
  process.noDeprecation = true;
111118
111157
  const vitest = await startVitest("test", props.filters, {
@@ -111124,8 +111163,9 @@ var startTest = async (props) => {
111124
111163
  exclude: ["**/_*", "**/_*/**", ...configDefaults.exclude],
111125
111164
  globals: true,
111126
111165
  reporters: [new NullReporter],
111166
+ env: props.env,
111127
111167
  setupFiles: [
111128
- join26(__dirname4, "test-global-setup.js")
111168
+ join27(__dirname4, "test-global-setup.js")
111129
111169
  ]
111130
111170
  }, {
111131
111171
  logLevel: "silent",
@@ -111279,7 +111319,7 @@ var logTestErrors = (event) => {
111279
111319
  };
111280
111320
  var runTest = async (stack, dir, filters, workspace, opts) => {
111281
111321
  await mkdir6(directories.test, { recursive: true });
111282
- const file2 = join27(directories.test, `${stack}.json`);
111322
+ const file2 = join28(directories.test, `${stack}.json`);
111283
111323
  const fingerprint = await generateFolderHash(workspace, dir);
111284
111324
  if (!process.env.NO_CACHE) {
111285
111325
  const exists2 = await fileExist(file2);
@@ -111306,7 +111346,8 @@ var runTest = async (stack, dir, filters, workspace, opts) => {
111306
111346
  async task(ctx) {
111307
111347
  const result2 = await startTest({
111308
111348
  dir,
111309
- filters
111349
+ filters,
111350
+ env: opts.env
111310
111351
  });
111311
111352
  if (result2.errors.length > 0) {
111312
111353
  throw result2.errors.map((error3) => new ExpectedError(error3.message));
@@ -111339,7 +111380,13 @@ var runTests = async (tests, stackFilters = [], testFilters = [], opts) => {
111339
111380
  }
111340
111381
  }
111341
111382
  for (const path2 of test.paths) {
111342
- const result = await runTest(test.name, path2, testFilters, workspace, opts);
111383
+ const result = await runTest(test.name, path2, testFilters, workspace, {
111384
+ ...opts,
111385
+ env: {
111386
+ ...opts.env,
111387
+ STACK: test.stackName
111388
+ }
111389
+ });
111343
111390
  if (!result) {
111344
111391
  return false;
111345
111392
  }
@@ -111384,7 +111431,7 @@ var deploy = (program3) => {
111384
111431
  appName: appConfig.name
111385
111432
  });
111386
111433
  const deployment = await claimDeployment({ client: dynamo, appId: globalAppId });
111387
- const { app, tests, warnings, builders, ready } = createApp({
111434
+ const { app, tests, warnings, builders, ready, appId } = createApp({
111388
111435
  appConfig,
111389
111436
  stackConfigs,
111390
111437
  accountId,
@@ -111402,7 +111449,13 @@ var deploy = (program3) => {
111402
111449
  }
111403
111450
  if (!options.skipTests) {
111404
111451
  const passed = await runTests(tests, [], [], {
111405
- showLogs: false
111452
+ showLogs: false,
111453
+ env: {
111454
+ APP: appConfig.name,
111455
+ APP_ID: appId,
111456
+ AWS_REGION: appConfig.region,
111457
+ AWS_ACCOUNT_ID: accountId
111458
+ }
111406
111459
  });
111407
111460
  if (!passed) {
111408
111461
  throw new Cancelled2;
@@ -112633,7 +112686,7 @@ var watchConfig = async (options, resolve4, reject) => {
112633
112686
 
112634
112687
  // src/type-gen/generate.ts
112635
112688
  import { mkdir as mkdir7, writeFile as writeFile9 } from "fs/promises";
112636
- import { dirname as dirname17, join as join28, relative as relative8 } from "path";
112689
+ import { dirname as dirname18, join as join29, relative as relative8 } from "path";
112637
112690
  var generateTypes = async (props) => {
112638
112691
  const files = [];
112639
112692
  await Promise.all(features.map((feature) => {
@@ -112641,12 +112694,12 @@ var generateTypes = async (props) => {
112641
112694
  ...props,
112642
112695
  async write(file2, data, include = false) {
112643
112696
  const code = data?.toString("utf8");
112644
- const path2 = join28(directories.types, file2);
112697
+ const path2 = join29(directories.types, file2);
112645
112698
  if (code) {
112646
112699
  if (include) {
112647
112700
  files.push(relative8(directories.root, path2));
112648
112701
  }
112649
- await mkdir7(dirname17(path2), { recursive: true });
112702
+ await mkdir7(dirname18(path2), { recursive: true });
112650
112703
  await writeFile9(path2, code);
112651
112704
  }
112652
112705
  }
@@ -112655,7 +112708,7 @@ var generateTypes = async (props) => {
112655
112708
  if (files.length) {
112656
112709
  const code = files.map((file2) => `/// <reference path='${file2}' />`).join(`
112657
112710
  `);
112658
- await writeFile9(join28(directories.root, `awsless.d.ts`), code);
112711
+ await writeFile9(join29(directories.root, `awsless.d.ts`), code);
112659
112712
  }
112660
112713
  };
112661
112714
 
@@ -114752,7 +114805,7 @@ var DEFAULT_PROFILE = "default";
114752
114805
  var getProfileName = (init) => init.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE;
114753
114806
 
114754
114807
  // ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/loadSharedConfigFiles.js
114755
- import { join as join31 } from "path";
114808
+ import { join as join32 } from "path";
114756
114809
 
114757
114810
  // ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/constants.js
114758
114811
  var CONFIG_PREFIX_SEPARATOR = ".";
@@ -114774,14 +114827,14 @@ var getConfigData = (data) => Object.entries(data).filter(([key]) => {
114774
114827
  });
114775
114828
 
114776
114829
  // ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/getConfigFilepath.js
114777
- import { join as join29 } from "path";
114830
+ import { join as join30 } from "path";
114778
114831
  var ENV_CONFIG_PATH = "AWS_CONFIG_FILE";
114779
- var getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || join29(getHomeDir(), ".aws", "config");
114832
+ var getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || join30(getHomeDir(), ".aws", "config");
114780
114833
 
114781
114834
  // ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/getCredentialsFilepath.js
114782
- import { join as join30 } from "path";
114835
+ import { join as join31 } from "path";
114783
114836
  var ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE";
114784
- var getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || join30(getHomeDir(), ".aws", "credentials");
114837
+ var getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || join31(getHomeDir(), ".aws", "credentials");
114785
114838
 
114786
114839
  // ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/parseIni.js
114787
114840
  var prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/;
@@ -114854,11 +114907,11 @@ var loadSharedConfigFiles = async (init = {}) => {
114854
114907
  const relativeHomeDirPrefix = "~/";
114855
114908
  let resolvedFilepath = filepath;
114856
114909
  if (filepath.startsWith(relativeHomeDirPrefix)) {
114857
- resolvedFilepath = join31(homeDir, filepath.slice(2));
114910
+ resolvedFilepath = join32(homeDir, filepath.slice(2));
114858
114911
  }
114859
114912
  let resolvedConfigFilepath = configFilepath;
114860
114913
  if (configFilepath.startsWith(relativeHomeDirPrefix)) {
114861
- resolvedConfigFilepath = join31(homeDir, configFilepath.slice(2));
114914
+ resolvedConfigFilepath = join32(homeDir, configFilepath.slice(2));
114862
114915
  }
114863
114916
  const parsedFiles = await Promise.all([
114864
114917
  readFile13(resolvedConfigFilepath, {
@@ -115951,16 +116004,16 @@ var getRuntimeUserAgentPair = () => {
115951
116004
 
115952
116005
  // ../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.973.14_aws-crt@1.30.0_supports-color@8.1.1_/node_modules/@aws-sdk/util-user-agent-node/dist-es/getTypeScriptUserAgentPair.js
115953
116006
  import { readFile as readFile15 } from "fs/promises";
115954
- import { join as join33 } from "path";
116007
+ import { join as join34 } from "path";
115955
116008
 
115956
116009
  // ../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.973.14_aws-crt@1.30.0_supports-color@8.1.1_/node_modules/@aws-sdk/util-user-agent-node/dist-es/getNodeModulesParentDirs.js
115957
116010
  import { normalize as normalize3, sep as sep3 } from "path";
115958
- var getNodeModulesParentDirs = (dirname19) => {
116011
+ var getNodeModulesParentDirs = (dirname20) => {
115959
116012
  const cwd = process.cwd();
115960
- if (!dirname19) {
116013
+ if (!dirname20) {
115961
116014
  return [cwd];
115962
116015
  }
115963
- const normalizedPath = normalize3(dirname19);
116016
+ const normalizedPath = normalize3(dirname20);
115964
116017
  const parts = normalizedPath.split(sep3);
115965
116018
  const nodeModulesIndex = parts.indexOf("node_modules");
115966
116019
  const parentDir = nodeModulesIndex !== -1 ? parts.slice(0, nodeModulesIndex).join(sep3) : normalizedPath;
@@ -115999,7 +116052,7 @@ var getSanitizedDevTypeScriptVersion = (version2 = "") => {
115999
116052
  // ../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.973.14_aws-crt@1.30.0_supports-color@8.1.1_/node_modules/@aws-sdk/util-user-agent-node/dist-es/getTypeScriptUserAgentPair.js
116000
116053
  var __dirname = "/Users/work/Code/awsless/node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.973.14_aws-crt@1.30.0_supports-color@8.1.1_/node_modules/@aws-sdk/util-user-agent-node/dist-es";
116001
116054
  var tscVersion;
116002
- var TS_PACKAGE_JSON = join33("node_modules", "typescript", "package.json");
116055
+ var TS_PACKAGE_JSON = join34("node_modules", "typescript", "package.json");
116003
116056
  var getTypeScriptUserAgentPair = async () => {
116004
116057
  if (tscVersion === null) {
116005
116058
  return;
@@ -116014,12 +116067,12 @@ var getTypeScriptUserAgentPair = async () => {
116014
116067
  tscVersion = null;
116015
116068
  return;
116016
116069
  }
116017
- const dirname19 = typeof __dirname !== "undefined" ? __dirname : undefined;
116018
- const nodeModulesParentDirs = getNodeModulesParentDirs(dirname19);
116070
+ const dirname20 = typeof __dirname !== "undefined" ? __dirname : undefined;
116071
+ const nodeModulesParentDirs = getNodeModulesParentDirs(dirname20);
116019
116072
  let versionFromApp;
116020
116073
  for (const nodeModulesParentDir of nodeModulesParentDirs) {
116021
116074
  try {
116022
- const appPackageJsonPath = join33(nodeModulesParentDir, "package.json");
116075
+ const appPackageJsonPath = join34(nodeModulesParentDir, "package.json");
116023
116076
  const packageJson = await readFile15(appPackageJsonPath, "utf-8");
116024
116077
  const { dependencies, devDependencies } = JSON.parse(packageJson);
116025
116078
  const version2 = devDependencies?.typescript ?? dependencies?.typescript;
@@ -116037,7 +116090,7 @@ var getTypeScriptUserAgentPair = async () => {
116037
116090
  let versionFromNodeModules;
116038
116091
  for (const nodeModulesParentDir of nodeModulesParentDirs) {
116039
116092
  try {
116040
- const tsPackageJsonPath = join33(nodeModulesParentDir, TS_PACKAGE_JSON);
116093
+ const tsPackageJsonPath = join34(nodeModulesParentDir, TS_PACKAGE_JSON);
116041
116094
  const packageJson = await readFile15(tsPackageJsonPath, "utf-8");
116042
116095
  const { version: version2 } = JSON.parse(packageJson);
116043
116096
  const sanitizedVersion2 = getSanitizedTypeScriptVersion(version2);
@@ -119098,7 +119151,7 @@ var sinon;
119098
119151
  const arraySlice = arrayProto.slice;
119099
119152
  const concat = arrayProto.concat;
119100
119153
  const forEach = arrayProto.forEach;
119101
- const join34 = arrayProto.join;
119154
+ const join35 = arrayProto.join;
119102
119155
  const splice = arrayProto.splice;
119103
119156
  function applyDefaults(obj, defaults2) {
119104
119157
  for (const key of Object.keys(defaults2)) {
@@ -119134,7 +119187,7 @@ var sinon;
119134
119187
  let actual = "";
119135
119188
  if (!calledInOrder(arguments)) {
119136
119189
  try {
119137
- expected = join34(arguments, ", ");
119190
+ expected = join35(arguments, ", ");
119138
119191
  const calls = arraySlice(arguments);
119139
119192
  let i4 = calls.length;
119140
119193
  while (i4) {
@@ -119142,7 +119195,7 @@ var sinon;
119142
119195
  splice(calls, i4, 1);
119143
119196
  }
119144
119197
  }
119145
- actual = join34(orderByFirstCall(calls), ", ");
119198
+ actual = join35(orderByFirstCall(calls), ", ");
119146
119199
  } catch (e7) {}
119147
119200
  failAssertion(this, `expected ${expected} to be called in order but were called as ${actual}`);
119148
119201
  } else {
@@ -119187,7 +119240,7 @@ var sinon;
119187
119240
  ` expected = ${inspect(expectation)}`,
119188
119241
  ` actual = ${inspect(actual)}`
119189
119242
  ];
119190
- failAssertion(this, join34(formatted, `
119243
+ failAssertion(this, join35(formatted, `
119191
119244
  `));
119192
119245
  }
119193
119246
  }
@@ -119292,7 +119345,7 @@ var sinon;
119292
119345
  const valueToString = require2("@sinonjs/commons").valueToString;
119293
119346
  const exportAsyncBehaviors = require2("./util/core/export-async-behaviors");
119294
119347
  const concat = arrayProto.concat;
119295
- const join34 = arrayProto.join;
119348
+ const join35 = arrayProto.join;
119296
119349
  const reverse = arrayProto.reverse;
119297
119350
  const slice = arrayProto.slice;
119298
119351
  const useLeftMostCallback = -1;
@@ -119329,7 +119382,7 @@ var sinon;
119329
119382
  msg = `${functionName(behavior.stub)} expected to yield, but no callback was passed.`;
119330
119383
  }
119331
119384
  if (args.length > 0) {
119332
- msg += ` Received [${join34(args, ", ")}]`;
119385
+ msg += ` Received [${join35(args, ", ")}]`;
119333
119386
  }
119334
119387
  return msg;
119335
119388
  }
@@ -120139,7 +120192,7 @@ var sinon;
120139
120192
  const filter2 = arrayProto.filter;
120140
120193
  const forEach = arrayProto.forEach;
120141
120194
  const every = arrayProto.every;
120142
- const join34 = arrayProto.join;
120195
+ const join35 = arrayProto.join;
120143
120196
  const push = arrayProto.push;
120144
120197
  const slice = arrayProto.slice;
120145
120198
  const unshift = arrayProto.unshift;
@@ -120216,10 +120269,10 @@ var sinon;
120216
120269
  });
120217
120270
  this.restore();
120218
120271
  if (messages.length > 0) {
120219
- mockExpectation.fail(join34(concat(messages, met), `
120272
+ mockExpectation.fail(join35(concat(messages, met), `
120220
120273
  `));
120221
120274
  } else if (met.length > 0) {
120222
- mockExpectation.pass(join34(concat(messages, met), `
120275
+ mockExpectation.pass(join35(concat(messages, met), `
120223
120276
  `));
120224
120277
  }
120225
120278
  return true;
@@ -120272,7 +120325,7 @@ var sinon;
120272
120325
  args,
120273
120326
  stack: err.stack
120274
120327
  })}`);
120275
- mockExpectation.fail(join34(messages, `
120328
+ mockExpectation.fail(join35(messages, `
120276
120329
  `));
120277
120330
  }
120278
120331
  });
@@ -120379,14 +120432,14 @@ var sinon;
120379
120432
  const valueToString = require2("@sinonjs/commons").valueToString;
120380
120433
  const concat = arrayProto.concat;
120381
120434
  const filter2 = arrayProto.filter;
120382
- const join34 = arrayProto.join;
120435
+ const join35 = arrayProto.join;
120383
120436
  const map = arrayProto.map;
120384
120437
  const reduce = arrayProto.reduce;
120385
120438
  const slice = arrayProto.slice;
120386
120439
  function throwYieldError(proxy, text2, args) {
120387
120440
  let msg = functionName(proxy) + text2;
120388
120441
  if (args.length) {
120389
- msg += ` Received [${join34(slice(args), ", ")}]`;
120442
+ msg += ` Received [${join35(slice(args), ", ")}]`;
120390
120443
  }
120391
120444
  throw new Error(msg);
120392
120445
  }
@@ -120508,7 +120561,7 @@ var sinon;
120508
120561
  const formattedArgs = map(this.args, function(arg) {
120509
120562
  return inspect(arg);
120510
120563
  });
120511
- callStr = `${callStr + join34(formattedArgs, ", ")})`;
120564
+ callStr = `${callStr + join35(formattedArgs, ", ")})`;
120512
120565
  if (typeof this.returnValue !== "undefined") {
120513
120566
  callStr += ` => ${inspect(this.returnValue)}`;
120514
120567
  }
@@ -121239,7 +121292,7 @@ var sinon;
121239
121292
  const timesInWords = require2("./util/core/times-in-words");
121240
121293
  const inspect = require2("util").inspect;
121241
121294
  const jsDiff = require2("diff");
121242
- const join34 = arrayProto.join;
121295
+ const join35 = arrayProto.join;
121243
121296
  const map = arrayProto.map;
121244
121297
  const push = arrayProto.push;
121245
121298
  const slice = arrayProto.slice;
@@ -121267,7 +121320,7 @@ var sinon;
121267
121320
  }
121268
121321
  return text2;
121269
121322
  });
121270
- return join34(objects, "");
121323
+ return join35(objects, "");
121271
121324
  }
121272
121325
  function quoteStringValue(value) {
121273
121326
  if (typeof value === "string") {
@@ -121325,7 +121378,7 @@ ${stringifiedCall}`;
121325
121378
  push(calls, stringifiedCall);
121326
121379
  }
121327
121380
  return calls.length > 0 ? `
121328
- ${join34(calls, `
121381
+ ${join35(calls, `
121329
121382
  `)}` : "";
121330
121383
  },
121331
121384
  t: function(spyInstance) {
@@ -121333,10 +121386,10 @@ ${join34(calls, `
121333
121386
  for (let i4 = 0, l5 = spyInstance.callCount;i4 < l5; ++i4) {
121334
121387
  push(objects, inspect(spyInstance.thisValues[i4]));
121335
121388
  }
121336
- return join34(objects, ", ");
121389
+ return join35(objects, ", ");
121337
121390
  },
121338
121391
  "*": function(spyInstance, args) {
121339
- return join34(map(args, function(arg) {
121392
+ return join35(map(args, function(arg) {
121340
121393
  return inspect(arg);
121341
121394
  }), ", ");
121342
121395
  }
@@ -121668,7 +121721,7 @@ ${join34(calls, `
121668
121721
  }, { "@sinonjs/commons": 48 }], 26: [function(require2, module, exports) {
121669
121722
  const arrayProto = require2("@sinonjs/commons").prototypes.array;
121670
121723
  const hasOwnProperty2 = require2("@sinonjs/commons").prototypes.object.hasOwnProperty;
121671
- const join34 = arrayProto.join;
121724
+ const join35 = arrayProto.join;
121672
121725
  const push = arrayProto.push;
121673
121726
  const hasDontEnumBug = function() {
121674
121727
  const obj = {
@@ -121709,7 +121762,7 @@ ${join34(calls, `
121709
121762
  push(result, obj[prop]());
121710
121763
  }
121711
121764
  }
121712
- return join34(result, "") !== "0123456789";
121765
+ return join35(result, "") !== "0123456789";
121713
121766
  }();
121714
121767
  function extendCommon(target2, sources, doCopy) {
121715
121768
  let source, i4, prop;
@@ -123774,7 +123827,7 @@ ${job.error.stack.split(`
123774
123827
  module.exports = matcherPrototype;
123775
123828
  }, { "../create-matcher": 63 }], 71: [function(require2, module, exports) {
123776
123829
  var functionName = require2("@sinonjs/commons").functionName;
123777
- var join34 = require2("@sinonjs/commons").prototypes.array.join;
123830
+ var join35 = require2("@sinonjs/commons").prototypes.array.join;
123778
123831
  var map = require2("@sinonjs/commons").prototypes.array.map;
123779
123832
  var stringIndexOf = require2("@sinonjs/commons").prototypes.string.indexOf;
123780
123833
  var valueToString = require2("@sinonjs/commons").valueToString;
@@ -123805,7 +123858,7 @@ ${job.error.stack.split(`
123805
123858
  m5.test = function(actual) {
123806
123859
  return matchObject(actual, expectation, match3);
123807
123860
  };
123808
- m5.message = `match(${join34(array, ", ")})`;
123861
+ m5.message = `match(${join35(array, ", ")})`;
123809
123862
  return m5;
123810
123863
  },
123811
123864
  regexp: function(m5, expectation) {
@@ -127129,7 +127182,7 @@ ${job.error.stack.split(`
127129
127182
  tokenize: function tokenize(value) {
127130
127183
  return value.split("");
127131
127184
  },
127132
- join: function join34(chars) {
127185
+ join: function join35(chars) {
127133
127186
  return chars.join("");
127134
127187
  }
127135
127188
  };
@@ -135222,12 +135275,18 @@ var test2 = (program3) => {
135222
135275
  const region = props.appConfig.region;
135223
135276
  const credentials2 = await getCredentials(props.appConfig.profile);
135224
135277
  const accountId = await getAccountId(credentials2, region);
135225
- const { tests } = createApp({ ...props, accountId });
135278
+ const { tests, appId } = createApp({ ...props, accountId });
135226
135279
  if (tests.length === 0) {
135227
135280
  return "No tests found.";
135228
135281
  }
135229
135282
  const passed = await runTests(tests, stacks, options?.filters, {
135230
- showLogs: true
135283
+ showLogs: true,
135284
+ env: {
135285
+ APP: props.appConfig.name,
135286
+ APP_ID: appId,
135287
+ AWS_REGION: region,
135288
+ AWS_ACCOUNT_ID: accountId
135289
+ }
135231
135290
  });
135232
135291
  if (!passed) {
135233
135292
  throw new Cancelled2;