@awsless/cli 0.0.46-next.17 → 0.0.46-next.19

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
@@ -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: join28 } = __require("path");
56330
+ var { sep: sep2, join: join29 } = __require("path");
56331
56331
  var { createHash: createHash16 } = __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 = createHash16("sha1");
56487
56487
  const cacheName = hasher.update(id).digest("hex");
56488
- return join28(getHomeDir(), ".aws", "sso", "cache", `${cacheName}.json`);
56488
+ return join29(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] || join28(getHomeDir(), ".aws", "config");
56515
+ var getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || join29(getHomeDir(), ".aws", "config");
56516
56516
  var ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE";
56517
- var getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || join28(getHomeDir(), ".aws", "credentials");
56517
+ var getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || join29(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 = join28(homeDir, filepath.slice(2));
56583
+ resolvedFilepath = join29(homeDir, filepath.slice(2));
56584
56584
  }
56585
56585
  let resolvedConfigFilepath = configFilepath;
56586
56586
  if (configFilepath.startsWith(relativeHomeDirPrefix)) {
56587
- resolvedConfigFilepath = join28(homeDir, configFilepath.slice(2));
56587
+ resolvedConfigFilepath = join29(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 createHash16, 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 dirname17, join as join31 } from "path";
74180
+ import { dirname as dirname17, join as join32 } from "path";
74181
74181
  var import_config24, import_protocols3, LoginCredentialsFetcher;
74182
74182
  var init_LoginCredentialsFetcher = __esm(() => {
74183
74183
  import_config24 = __toESM(require_config(), 1);
@@ -74336,10 +74336,10 @@ var init_LoginCredentialsFetcher = __esm(() => {
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 ?? join31(homedir3(), ".aws", "login", "cache");
74339
+ const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ?? join32(homedir3(), ".aws", "login", "cache");
74340
74340
  const loginSessionBytes = Buffer.from(this.loginSession, "utf8");
74341
74341
  const loginSessionSha256 = createHash16("sha256").update(loginSessionBytes).digest("hex");
74342
- return join31(directory, `${loginSessionSha256}.json`);
74342
+ return join32(directory, `${loginSessionSha256}.json`);
74343
74343
  }
74344
74344
  derToRawSignature(derSignature) {
74345
74345
  let offset = 2;
@@ -105365,9 +105365,9 @@ var createPubSubService = (parentGroup, ctx, id, props, inputs) => {
105365
105365
  taskDefinition: task2.arn,
105366
105366
  launchType: "FARGATE",
105367
105367
  networkConfiguration: {
105368
- subnets: ctx.shared.get("vpc", "public-subnets"),
105368
+ subnets: ctx.shared.get("vpc", "private-subnets"),
105369
105369
  securityGroups: [inputs.securityGroupId],
105370
- assignPublicIp: true
105370
+ assignPublicIp: false
105371
105371
  },
105372
105372
  loadBalancer: [
105373
105373
  {
@@ -106149,7 +106149,7 @@ var searchFeature = defineFeature({
106149
106149
 
106150
106150
  // src/feature/site/index.ts
106151
106151
  import { createHash as createHash12 } from "crypto";
106152
- import { basename as basename3, dirname as dirname12, join as join19 } from "path";
106152
+ import { dirname as dirname12, join as join20 } from "path";
106153
106153
 
106154
106154
  // src/util/cache.ts
106155
106155
  import { lstat as lstat3, readdir as readdir4 } from "fs/promises";
@@ -106188,6 +106188,40 @@ var listAllFiles = async (list2) => {
106188
106188
  return files;
106189
106189
  };
106190
106190
 
106191
+ // src/feature/site/static-routes.ts
106192
+ import { basename as basename3, join as join19 } from "path";
106193
+ var planStaticRoutes = (files, sitePath) => {
106194
+ const plan = { files: {}, dirs: [] };
106195
+ const assetDirs = new Set;
106196
+ for (const file2 of files) {
106197
+ if (file2.endsWith(".html")) {
106198
+ const strippedHtmlFile = file2.endsWith("index.html") ? file2.slice(0, -11) : file2.slice(0, -5);
106199
+ const urlFriendlyFile = strippedHtmlFile.endsWith("/") ? strippedHtmlFile.slice(0, -1) : strippedHtmlFile;
106200
+ plan.files[join19(sitePath, urlFriendlyFile)] = file2;
106201
+ continue;
106202
+ }
106203
+ if (!basename3(file2).includes(".")) {
106204
+ plan.files[join19(sitePath, file2)] = file2;
106205
+ continue;
106206
+ }
106207
+ if (sitePath !== "/") {
106208
+ continue;
106209
+ }
106210
+ const firstSegment = file2.split("/")[0];
106211
+ if (file2.includes("/") && !firstSegment.includes(".")) {
106212
+ assetDirs.add(firstSegment);
106213
+ continue;
106214
+ }
106215
+ plan.files[join19(sitePath, file2)] = file2;
106216
+ }
106217
+ if (sitePath === "/") {
106218
+ plan.dirs = [...assetDirs].map((dir) => join19(sitePath, dir, "*."));
106219
+ } else {
106220
+ plan.catchAll = join19(sitePath, "*.");
106221
+ }
106222
+ return plan;
106223
+ };
106224
+
106191
106225
  // src/feature/site/index.ts
106192
106226
  var siteFeature = defineFeature({
106193
106227
  name: "site",
@@ -106209,7 +106243,7 @@ var siteFeature = defineFeature({
106209
106243
  return build2(fingerprint, async (write) => {
106210
106244
  const credentialProvider = await getCredentials(ctx.appConfig.profile);
106211
106245
  const credentials2 = await credentialProvider();
106212
- const cwd = join19(directories.root, dirname12(ctx.stackConfig.file));
106246
+ const cwd = join20(directories.root, dirname12(ctx.stackConfig.file));
106213
106247
  const env2 = {
106214
106248
  ...process.env,
106215
106249
  APP: ctx.appConfig.name,
@@ -106273,7 +106307,7 @@ ${(errors3.trim() || output.trim()).slice(-2000)}`);
106273
106307
  cwd: staticDir,
106274
106308
  nodir: true
106275
106309
  }).sort();
106276
- const hashes = files.map((file2) => $hash(join19(staticDir, file2)));
106310
+ const hashes = files.map((file2) => $hash(join20(staticDir, file2)));
106277
106311
  const version = $combine(...hashes).pipe((hashes2) => {
106278
106312
  const hash2 = createHash12("sha1");
106279
106313
  for (const [index, file2] of files.entries()) {
@@ -106289,26 +106323,16 @@ ${(errors3.trim() || output.trim()).slice(-2000)}`);
106289
106323
  version
106290
106324
  });
106291
106325
  const staticRoutes = {};
106292
- for (const file2 of files) {
106293
- if (file2.endsWith(".html")) {
106294
- const strippedHtmlFile = file2.endsWith("index.html") ? file2.slice(0, -11) : file2.slice(0, -5);
106295
- const urlFriendlyFile = strippedHtmlFile.endsWith("/") ? strippedHtmlFile.slice(0, -1) : strippedHtmlFile;
106296
- const routeFileKey = join19(props.path, urlFriendlyFile);
106297
- staticRoutes[routeFileKey] = {
106298
- type: "s3",
106299
- domainName: bucket.regionalDomainName,
106300
- rewrite: { to: $interpolate`/${folder}v-${deployment.version}/${file2}` }
106301
- };
106302
- } else if (!basename3(file2).includes(".")) {
106303
- staticRoutes[join19(props.path, file2)] = {
106304
- type: "s3",
106305
- domainName: bucket.regionalDomainName,
106306
- rewrite: { to: $interpolate`/${folder}v-${deployment.version}/${file2}` }
106307
- };
106308
- }
106326
+ const plan = planStaticRoutes(files, props.path);
106327
+ for (const [routeFileKey, file2] of Object.entries(plan.files)) {
106328
+ staticRoutes[routeFileKey] = {
106329
+ type: "s3",
106330
+ domainName: bucket.regionalDomainName,
106331
+ rewrite: { to: $interpolate`/${folder}v-${deployment.version}/${file2}` }
106332
+ };
106309
106333
  }
106310
106334
  const pathPattern = props.path === "/" ? "" : props.path.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
106311
- staticRoutes[join19(props.path, "*.")] = {
106335
+ const assetRoute = {
106312
106336
  type: "s3",
106313
106337
  domainName: bucket.regionalDomainName,
106314
106338
  rewrite: {
@@ -106316,6 +106340,12 @@ ${(errors3.trim() || output.trim()).slice(-2000)}`);
106316
106340
  to: $interpolate`/${folder}v-${deployment.version}/$1`
106317
106341
  }
106318
106342
  };
106343
+ for (const routeDirKey of plan.dirs) {
106344
+ staticRoutes[routeDirKey] = assetRoute;
106345
+ }
106346
+ if (plan.catchAll) {
106347
+ staticRoutes[plan.catchAll] = assetRoute;
106348
+ }
106319
106349
  addRoutes(staticRoutes, { dependsOn: [deployment, bucket.policy] });
106320
106350
  }
106321
106351
  });
@@ -106325,7 +106355,7 @@ ${(errors3.trim() || output.trim()).slice(-2000)}`);
106325
106355
  });
106326
106356
 
106327
106357
  // src/feature/store/index.ts
106328
- import { join as join20 } from "path";
106358
+ import { join as join21 } from "path";
106329
106359
  import { toDays as toDays8 } from "@awsless/duration";
106330
106360
 
106331
106361
  // src/feature/store/util.ts
@@ -106448,8 +106478,8 @@ var storeFeature = defineFeature({
106448
106478
  key: `${folder}${file2}`,
106449
106479
  cacheControl: getCacheControl(file2),
106450
106480
  contentType: getContentType(file2),
106451
- source: join20(props.static, file2),
106452
- sourceHash: $hash(join20(props.static, file2))
106481
+ source: join21(props.static, file2),
106482
+ sourceHash: $hash(join21(props.static, file2))
106453
106483
  }, {
106454
106484
  replaceOnChanges: ["bucket", "key"]
106455
106485
  });
@@ -106923,9 +106953,13 @@ var vpcFeature = defineFeature({
106923
106953
  public: publicRouteTable
106924
106954
  };
106925
106955
  let ipv6Identifier = 0;
106956
+ const subnetIdsByType = {
106957
+ private: [],
106958
+ public: []
106959
+ };
106926
106960
  for (const [_type, table3] of Object.entries(tables)) {
106927
106961
  const type = _type;
106928
- const subnetIds = [];
106962
+ const subnetIds = subnetIdsByType[type];
106929
106963
  for (const i in zones) {
106930
106964
  const index = Number(i) + 1;
106931
106965
  const id = `${type}-${index}`;
@@ -106952,6 +106986,26 @@ var vpcFeature = defineFeature({
106952
106986
  }
106953
106987
  ctx.shared.set("vpc", `${type}-subnets`, subnetIds);
106954
106988
  }
106989
+ const eip = new aws.Eip(group, "nat", {
106990
+ domain: "vpc",
106991
+ tags: {
106992
+ Name: ctx.app.name
106993
+ }
106994
+ });
106995
+ const natGateway = new aws.nat.Gateway(group, "nat", {
106996
+ allocationId: eip.allocationId,
106997
+ subnetId: subnetIdsByType.public[0],
106998
+ tags: {
106999
+ Name: ctx.app.name
107000
+ }
107001
+ }, {
107002
+ dependsOn: [attachment]
107003
+ });
107004
+ new aws.Route(group, "nat-ipv4", {
107005
+ routeTableId: privateRouteTable.id,
107006
+ destinationCidrBlock: "0.0.0.0/0",
107007
+ natGatewayId: natGateway.id
107008
+ });
106955
107009
  }
106956
107010
  });
106957
107011
 
@@ -107074,7 +107128,7 @@ var layerFeature = defineFeature({
107074
107128
  // src/feature/image/index.ts
107075
107129
  import { toDays as toDays9 } from "@awsless/duration";
107076
107130
  import { formatRouteEnvName as formatRouteEnvName4 } from "awsless";
107077
- import { dirname as dirname13, join as join21 } from "path";
107131
+ import { dirname as dirname13, join as join22 } from "path";
107078
107132
  import { fileURLToPath as fileURLToPath9 } from "url";
107079
107133
  var imageFeature = defineFeature({
107080
107134
  name: "image",
@@ -107089,7 +107143,7 @@ var imageFeature = defineFeature({
107089
107143
  throw new FileError("app.json", "The image feature requires an arm64 function bundle.");
107090
107144
  }
107091
107145
  const group = new Group(ctx.base, "image", "layer");
107092
- const path2 = join21(dirname13(fileURLToPath9(import.meta.url)), "/layers/sharp-arm.zip");
107146
+ const path2 = join22(dirname13(fileURLToPath9(import.meta.url)), "/layers/sharp-arm.zip");
107093
107147
  const layerId = formatGlobalResourceName({
107094
107148
  appName: ctx.appConfig.name,
107095
107149
  resourceType: "layer",
@@ -107154,7 +107208,7 @@ var imageFeature = defineFeature({
107154
107208
  const serverRouteKey = formatRouteKey(ctx.stack.name, "image", id);
107155
107209
  bundle.addHandler({
107156
107210
  routeKey: serverRouteKey,
107157
- file: join21(dirname13(fileURLToPath9(import.meta.url)), "/handlers/image.js"),
107211
+ file: join22(dirname13(fileURLToPath9(import.meta.url)), "/handlers/image.js"),
107158
107212
  exportName: "default",
107159
107213
  external: ["sharp"]
107160
107214
  });
@@ -107192,8 +107246,8 @@ var imageFeature = defineFeature({
107192
107246
  new aws.s3.BucketObject(group, `static-${file2}`, {
107193
107247
  bucket: bucket.name,
107194
107248
  key: `${folder}origin/${file2}`,
107195
- source: join21(props.origin.static, file2),
107196
- sourceHash: $hash(join21(props.origin.static, file2))
107249
+ source: join22(props.origin.static, file2),
107250
+ sourceHash: $hash(join22(props.origin.static, file2))
107197
107251
  }, {
107198
107252
  replaceOnChanges: ["bucket", "key"]
107199
107253
  });
@@ -107209,7 +107263,7 @@ var imageFeature = defineFeature({
107209
107263
  // src/feature/icon/index.ts
107210
107264
  import { toDays as toDays10 } from "@awsless/duration";
107211
107265
  import { formatRouteEnvName as formatRouteEnvName5 } from "awsless";
107212
- import { dirname as dirname14, join as join22 } from "path";
107266
+ import { dirname as dirname14, join as join23 } from "path";
107213
107267
  import { fileURLToPath as fileURLToPath10 } from "url";
107214
107268
  var iconFeature = defineFeature({
107215
107269
  name: "icon",
@@ -107241,7 +107295,7 @@ var iconFeature = defineFeature({
107241
107295
  const serverRouteKey = formatRouteKey(ctx.stack.name, "icon", id);
107242
107296
  bundle.addHandler({
107243
107297
  routeKey: serverRouteKey,
107244
- file: join22(dirname14(fileURLToPath10(import.meta.url)), "/handlers/icon.js"),
107298
+ file: join23(dirname14(fileURLToPath10(import.meta.url)), "/handlers/icon.js"),
107245
107299
  exportName: "default"
107246
107300
  });
107247
107301
  addRoutes({
@@ -107281,8 +107335,8 @@ var iconFeature = defineFeature({
107281
107335
  new aws.s3.BucketObject(group, `static-${file2}`, {
107282
107336
  bucket: bucket.name,
107283
107337
  key: `${folder}origin/${file2}`,
107284
- source: join22(props.origin.static, file2),
107285
- sourceHash: $hash(join22(props.origin.static, file2))
107338
+ source: join23(props.origin.static, file2),
107339
+ sourceHash: $hash(join23(props.origin.static, file2))
107286
107340
  }, {
107287
107341
  replaceOnChanges: ["bucket", "key"]
107288
107342
  });
@@ -107309,10 +107363,10 @@ var import_deepmerge3 = __toESM(require_cjs2(), 1);
107309
107363
  // src/feature/job/build/executable.ts
107310
107364
  import { createHash as createHash13 } from "crypto";
107311
107365
  import { readFile as readFile11, writeFile as writeFile7 } from "fs/promises";
107312
- import { join as join23, resolve as resolve3 } from "path";
107366
+ import { join as join24, resolve as resolve3 } from "path";
107313
107367
  var buildJobExecutable = async (input, outputPath, architecture) => {
107314
- const filePath = join23(outputPath, "program");
107315
- const wrapperPath = join23(outputPath, "wrapper.ts");
107368
+ const filePath = join24(outputPath, "program");
107369
+ const wrapperPath = join24(outputPath, "wrapper.ts");
107316
107370
  const handlerPath = resolve3(input);
107317
107371
  await writeFile7(wrapperPath, `import { parse } from '@awsless/json'
107318
107372
  import { getObject } from '@awsless/s3'
@@ -107770,7 +107824,7 @@ var jobFeature = defineFeature({
107770
107824
  Name: `${ctx.app.name}-job-storage`
107771
107825
  }
107772
107826
  });
107773
- for (const [index, subnetId] of ctx.shared.get("vpc", "public-subnets").entries()) {
107827
+ for (const [index, subnetId] of ctx.shared.get("vpc", "private-subnets").entries()) {
107774
107828
  new aws.efs.MountTarget(storageGroup, `mount-target-${index + 1}`, {
107775
107829
  fileSystemId: fileSystem.id,
107776
107830
  subnetId,
@@ -107784,7 +107838,7 @@ var jobFeature = defineFeature({
107784
107838
  const jobs = Object.entries(ctx.stackConfig.jobs ?? {});
107785
107839
  if (jobs.length === 0)
107786
107840
  return;
107787
- const subnets = ctx.shared.get("vpc", "public-subnets");
107841
+ const subnets = ctx.shared.get("vpc", "private-subnets");
107788
107842
  ctx.addEnv("JOB_SUBNETS", new Output(new Set(findInputDeps(subnets)), async (resolve4) => {
107789
107843
  const resolved = await resolveInputs(subnets);
107790
107844
  resolve4(JSON.stringify(resolved));
@@ -107822,7 +107876,7 @@ import { stringify as stringify3 } from "@awsless/json";
107822
107876
  import { generateFileHash as generateFileHash3 } from "@awsless/ts-file-cache";
107823
107877
  var import_deepmerge5 = __toESM(require_cjs2(), 1);
107824
107878
  import { createHash as createHash15 } from "crypto";
107825
- import { join as join24 } from "path";
107879
+ import { join as join25 } from "path";
107826
107880
  var createFargateTask = (parentGroup, ctx, ns, id, local) => {
107827
107881
  const group = new Group(parentGroup, "instance", ns);
107828
107882
  const name = formatLocalResourceName({
@@ -108027,7 +108081,7 @@ var createFargateTask = (parentGroup, ctx, ns, id, local) => {
108027
108081
  healthCheck: props.healthCheck ? {
108028
108082
  command: [
108029
108083
  "CMD-SHELL",
108030
- `curl -f http://${join24("localhost", props.healthCheck.path)} || exit 1`
108084
+ `curl -f http://${join25("localhost", props.healthCheck.path)} || exit 1`
108031
108085
  ],
108032
108086
  interval: toSeconds10(props.healthCheck.interval),
108033
108087
  retries: props.healthCheck.retries,
@@ -108072,9 +108126,9 @@ var createFargateTask = (parentGroup, ctx, ns, id, local) => {
108072
108126
  desiredCount: 1,
108073
108127
  launchType: "FARGATE",
108074
108128
  networkConfiguration: {
108075
- subnets: ctx.shared.get("vpc", "public-subnets"),
108129
+ subnets: ctx.shared.get("vpc", "private-subnets"),
108076
108130
  securityGroups: [securityGroup.id],
108077
- assignPublicIp: true
108131
+ assignPublicIp: false
108078
108132
  },
108079
108133
  forceNewDeployment: true,
108080
108134
  forceDelete: true,
@@ -110723,12 +110777,12 @@ import { DynamoDBClient as DynamoDBClient3 } from "@awsless/dynamodb";
110723
110777
  // src/cli/ui/complex/run-tests.ts
110724
110778
  var import_wildstring3 = __toESM(require_wildstring(), 1);
110725
110779
  import { mkdir as mkdir6, readFile as readFile12, writeFile as writeFile8 } from "fs/promises";
110726
- import { join as join26 } from "path";
110780
+ import { join as join27 } from "path";
110727
110781
  import { parse as parse5, stringify as stringify4 } from "@awsless/json";
110728
110782
  import { generateFolderHash, loadWorkspace as loadWorkspace2 } from "@awsless/ts-file-cache";
110729
110783
 
110730
110784
  // src/test/start.ts
110731
- import { dirname as dirname15, join as join25 } from "path";
110785
+ import { dirname as dirname15, join as join26 } from "path";
110732
110786
  import { fileURLToPath as fileURLToPath11 } from "url";
110733
110787
  import { configDefaults } from "vitest/config";
110734
110788
  import { startVitest } from "vitest/node";
@@ -110749,7 +110803,7 @@ var startTest = async (props) => {
110749
110803
  globals: true,
110750
110804
  reporters: [new NullReporter],
110751
110805
  setupFiles: [
110752
- join25(__dirname4, "test-global-setup.js")
110806
+ join26(__dirname4, "test-global-setup.js")
110753
110807
  ]
110754
110808
  }, {
110755
110809
  logLevel: "silent",
@@ -110903,7 +110957,7 @@ var logTestErrors = (event) => {
110903
110957
  };
110904
110958
  var runTest = async (stack, dir, filters, workspace, opts) => {
110905
110959
  await mkdir6(directories.test, { recursive: true });
110906
- const file2 = join26(directories.test, `${stack}.json`);
110960
+ const file2 = join27(directories.test, `${stack}.json`);
110907
110961
  const fingerprint = await generateFolderHash(workspace, dir);
110908
110962
  if (!process.env.NO_CACHE) {
110909
110963
  const exists2 = await fileExist(file2);
@@ -112257,7 +112311,7 @@ var watchConfig = async (options, resolve4, reject) => {
112257
112311
 
112258
112312
  // src/type-gen/generate.ts
112259
112313
  import { mkdir as mkdir7, writeFile as writeFile9 } from "fs/promises";
112260
- import { dirname as dirname16, join as join27, relative as relative8 } from "path";
112314
+ import { dirname as dirname16, join as join28, relative as relative8 } from "path";
112261
112315
  var generateTypes = async (props) => {
112262
112316
  const files = [];
112263
112317
  await Promise.all(features.map((feature) => {
@@ -112265,7 +112319,7 @@ var generateTypes = async (props) => {
112265
112319
  ...props,
112266
112320
  async write(file2, data, include = false) {
112267
112321
  const code = data?.toString("utf8");
112268
- const path2 = join27(directories.types, file2);
112322
+ const path2 = join28(directories.types, file2);
112269
112323
  if (code) {
112270
112324
  if (include) {
112271
112325
  files.push(relative8(directories.root, path2));
@@ -112279,7 +112333,7 @@ var generateTypes = async (props) => {
112279
112333
  if (files.length) {
112280
112334
  const code = files.map((file2) => `/// <reference path='${file2}' />`).join(`
112281
112335
  `);
112282
- await writeFile9(join27(directories.root, `awsless.d.ts`), code);
112336
+ await writeFile9(join28(directories.root, `awsless.d.ts`), code);
112283
112337
  }
112284
112338
  };
112285
112339
 
@@ -114376,7 +114430,7 @@ var DEFAULT_PROFILE = "default";
114376
114430
  var getProfileName = (init) => init.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE;
114377
114431
 
114378
114432
  // ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/loadSharedConfigFiles.js
114379
- import { join as join30 } from "path";
114433
+ import { join as join31 } from "path";
114380
114434
 
114381
114435
  // ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/constants.js
114382
114436
  var CONFIG_PREFIX_SEPARATOR = ".";
@@ -114398,14 +114452,14 @@ var getConfigData = (data) => Object.entries(data).filter(([key]) => {
114398
114452
  });
114399
114453
 
114400
114454
  // ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/getConfigFilepath.js
114401
- import { join as join28 } from "path";
114455
+ import { join as join29 } from "path";
114402
114456
  var ENV_CONFIG_PATH = "AWS_CONFIG_FILE";
114403
- var getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || join28(getHomeDir(), ".aws", "config");
114457
+ var getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || join29(getHomeDir(), ".aws", "config");
114404
114458
 
114405
114459
  // ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/getCredentialsFilepath.js
114406
- import { join as join29 } from "path";
114460
+ import { join as join30 } from "path";
114407
114461
  var ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE";
114408
- var getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || join29(getHomeDir(), ".aws", "credentials");
114462
+ var getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || join30(getHomeDir(), ".aws", "credentials");
114409
114463
 
114410
114464
  // ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/parseIni.js
114411
114465
  var prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/;
@@ -114478,11 +114532,11 @@ var loadSharedConfigFiles = async (init = {}) => {
114478
114532
  const relativeHomeDirPrefix = "~/";
114479
114533
  let resolvedFilepath = filepath;
114480
114534
  if (filepath.startsWith(relativeHomeDirPrefix)) {
114481
- resolvedFilepath = join30(homeDir, filepath.slice(2));
114535
+ resolvedFilepath = join31(homeDir, filepath.slice(2));
114482
114536
  }
114483
114537
  let resolvedConfigFilepath = configFilepath;
114484
114538
  if (configFilepath.startsWith(relativeHomeDirPrefix)) {
114485
- resolvedConfigFilepath = join30(homeDir, configFilepath.slice(2));
114539
+ resolvedConfigFilepath = join31(homeDir, configFilepath.slice(2));
114486
114540
  }
114487
114541
  const parsedFiles = await Promise.all([
114488
114542
  readFile13(resolvedConfigFilepath, {
@@ -115575,7 +115629,7 @@ var getRuntimeUserAgentPair = () => {
115575
115629
 
115576
115630
  // ../../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
115577
115631
  import { readFile as readFile15 } from "fs/promises";
115578
- import { join as join32 } from "path";
115632
+ import { join as join33 } from "path";
115579
115633
 
115580
115634
  // ../../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
115581
115635
  import { normalize as normalize3, sep as sep3 } from "path";
@@ -115623,7 +115677,7 @@ var getSanitizedDevTypeScriptVersion = (version2 = "") => {
115623
115677
  // ../../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
115624
115678
  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";
115625
115679
  var tscVersion;
115626
- var TS_PACKAGE_JSON = join32("node_modules", "typescript", "package.json");
115680
+ var TS_PACKAGE_JSON = join33("node_modules", "typescript", "package.json");
115627
115681
  var getTypeScriptUserAgentPair = async () => {
115628
115682
  if (tscVersion === null) {
115629
115683
  return;
@@ -115643,7 +115697,7 @@ var getTypeScriptUserAgentPair = async () => {
115643
115697
  let versionFromApp;
115644
115698
  for (const nodeModulesParentDir of nodeModulesParentDirs) {
115645
115699
  try {
115646
- const appPackageJsonPath = join32(nodeModulesParentDir, "package.json");
115700
+ const appPackageJsonPath = join33(nodeModulesParentDir, "package.json");
115647
115701
  const packageJson = await readFile15(appPackageJsonPath, "utf-8");
115648
115702
  const { dependencies, devDependencies } = JSON.parse(packageJson);
115649
115703
  const version2 = devDependencies?.typescript ?? dependencies?.typescript;
@@ -115661,7 +115715,7 @@ var getTypeScriptUserAgentPair = async () => {
115661
115715
  let versionFromNodeModules;
115662
115716
  for (const nodeModulesParentDir of nodeModulesParentDirs) {
115663
115717
  try {
115664
- const tsPackageJsonPath = join32(nodeModulesParentDir, TS_PACKAGE_JSON);
115718
+ const tsPackageJsonPath = join33(nodeModulesParentDir, TS_PACKAGE_JSON);
115665
115719
  const packageJson = await readFile15(tsPackageJsonPath, "utf-8");
115666
115720
  const { version: version2 } = JSON.parse(packageJson);
115667
115721
  const sanitizedVersion2 = getSanitizedTypeScriptVersion(version2);
@@ -118722,7 +118776,7 @@ var sinon;
118722
118776
  const arraySlice = arrayProto.slice;
118723
118777
  const concat = arrayProto.concat;
118724
118778
  const forEach = arrayProto.forEach;
118725
- const join33 = arrayProto.join;
118779
+ const join34 = arrayProto.join;
118726
118780
  const splice = arrayProto.splice;
118727
118781
  function applyDefaults(obj, defaults2) {
118728
118782
  for (const key of Object.keys(defaults2)) {
@@ -118758,7 +118812,7 @@ var sinon;
118758
118812
  let actual = "";
118759
118813
  if (!calledInOrder(arguments)) {
118760
118814
  try {
118761
- expected = join33(arguments, ", ");
118815
+ expected = join34(arguments, ", ");
118762
118816
  const calls = arraySlice(arguments);
118763
118817
  let i4 = calls.length;
118764
118818
  while (i4) {
@@ -118766,7 +118820,7 @@ var sinon;
118766
118820
  splice(calls, i4, 1);
118767
118821
  }
118768
118822
  }
118769
- actual = join33(orderByFirstCall(calls), ", ");
118823
+ actual = join34(orderByFirstCall(calls), ", ");
118770
118824
  } catch (e7) {}
118771
118825
  failAssertion(this, `expected ${expected} to be called in order but were called as ${actual}`);
118772
118826
  } else {
@@ -118811,7 +118865,7 @@ var sinon;
118811
118865
  ` expected = ${inspect(expectation)}`,
118812
118866
  ` actual = ${inspect(actual)}`
118813
118867
  ];
118814
- failAssertion(this, join33(formatted, `
118868
+ failAssertion(this, join34(formatted, `
118815
118869
  `));
118816
118870
  }
118817
118871
  }
@@ -118916,7 +118970,7 @@ var sinon;
118916
118970
  const valueToString = require2("@sinonjs/commons").valueToString;
118917
118971
  const exportAsyncBehaviors = require2("./util/core/export-async-behaviors");
118918
118972
  const concat = arrayProto.concat;
118919
- const join33 = arrayProto.join;
118973
+ const join34 = arrayProto.join;
118920
118974
  const reverse = arrayProto.reverse;
118921
118975
  const slice = arrayProto.slice;
118922
118976
  const useLeftMostCallback = -1;
@@ -118953,7 +119007,7 @@ var sinon;
118953
119007
  msg = `${functionName(behavior.stub)} expected to yield, but no callback was passed.`;
118954
119008
  }
118955
119009
  if (args.length > 0) {
118956
- msg += ` Received [${join33(args, ", ")}]`;
119010
+ msg += ` Received [${join34(args, ", ")}]`;
118957
119011
  }
118958
119012
  return msg;
118959
119013
  }
@@ -119763,7 +119817,7 @@ var sinon;
119763
119817
  const filter2 = arrayProto.filter;
119764
119818
  const forEach = arrayProto.forEach;
119765
119819
  const every = arrayProto.every;
119766
- const join33 = arrayProto.join;
119820
+ const join34 = arrayProto.join;
119767
119821
  const push = arrayProto.push;
119768
119822
  const slice = arrayProto.slice;
119769
119823
  const unshift = arrayProto.unshift;
@@ -119840,10 +119894,10 @@ var sinon;
119840
119894
  });
119841
119895
  this.restore();
119842
119896
  if (messages.length > 0) {
119843
- mockExpectation.fail(join33(concat(messages, met), `
119897
+ mockExpectation.fail(join34(concat(messages, met), `
119844
119898
  `));
119845
119899
  } else if (met.length > 0) {
119846
- mockExpectation.pass(join33(concat(messages, met), `
119900
+ mockExpectation.pass(join34(concat(messages, met), `
119847
119901
  `));
119848
119902
  }
119849
119903
  return true;
@@ -119896,7 +119950,7 @@ var sinon;
119896
119950
  args,
119897
119951
  stack: err.stack
119898
119952
  })}`);
119899
- mockExpectation.fail(join33(messages, `
119953
+ mockExpectation.fail(join34(messages, `
119900
119954
  `));
119901
119955
  }
119902
119956
  });
@@ -120003,14 +120057,14 @@ var sinon;
120003
120057
  const valueToString = require2("@sinonjs/commons").valueToString;
120004
120058
  const concat = arrayProto.concat;
120005
120059
  const filter2 = arrayProto.filter;
120006
- const join33 = arrayProto.join;
120060
+ const join34 = arrayProto.join;
120007
120061
  const map = arrayProto.map;
120008
120062
  const reduce = arrayProto.reduce;
120009
120063
  const slice = arrayProto.slice;
120010
120064
  function throwYieldError(proxy, text2, args) {
120011
120065
  let msg = functionName(proxy) + text2;
120012
120066
  if (args.length) {
120013
- msg += ` Received [${join33(slice(args), ", ")}]`;
120067
+ msg += ` Received [${join34(slice(args), ", ")}]`;
120014
120068
  }
120015
120069
  throw new Error(msg);
120016
120070
  }
@@ -120132,7 +120186,7 @@ var sinon;
120132
120186
  const formattedArgs = map(this.args, function(arg) {
120133
120187
  return inspect(arg);
120134
120188
  });
120135
- callStr = `${callStr + join33(formattedArgs, ", ")})`;
120189
+ callStr = `${callStr + join34(formattedArgs, ", ")})`;
120136
120190
  if (typeof this.returnValue !== "undefined") {
120137
120191
  callStr += ` => ${inspect(this.returnValue)}`;
120138
120192
  }
@@ -120863,7 +120917,7 @@ var sinon;
120863
120917
  const timesInWords = require2("./util/core/times-in-words");
120864
120918
  const inspect = require2("util").inspect;
120865
120919
  const jsDiff = require2("diff");
120866
- const join33 = arrayProto.join;
120920
+ const join34 = arrayProto.join;
120867
120921
  const map = arrayProto.map;
120868
120922
  const push = arrayProto.push;
120869
120923
  const slice = arrayProto.slice;
@@ -120891,7 +120945,7 @@ var sinon;
120891
120945
  }
120892
120946
  return text2;
120893
120947
  });
120894
- return join33(objects, "");
120948
+ return join34(objects, "");
120895
120949
  }
120896
120950
  function quoteStringValue(value) {
120897
120951
  if (typeof value === "string") {
@@ -120949,7 +121003,7 @@ ${stringifiedCall}`;
120949
121003
  push(calls, stringifiedCall);
120950
121004
  }
120951
121005
  return calls.length > 0 ? `
120952
- ${join33(calls, `
121006
+ ${join34(calls, `
120953
121007
  `)}` : "";
120954
121008
  },
120955
121009
  t: function(spyInstance) {
@@ -120957,10 +121011,10 @@ ${join33(calls, `
120957
121011
  for (let i4 = 0, l5 = spyInstance.callCount;i4 < l5; ++i4) {
120958
121012
  push(objects, inspect(spyInstance.thisValues[i4]));
120959
121013
  }
120960
- return join33(objects, ", ");
121014
+ return join34(objects, ", ");
120961
121015
  },
120962
121016
  "*": function(spyInstance, args) {
120963
- return join33(map(args, function(arg) {
121017
+ return join34(map(args, function(arg) {
120964
121018
  return inspect(arg);
120965
121019
  }), ", ");
120966
121020
  }
@@ -121292,7 +121346,7 @@ ${join33(calls, `
121292
121346
  }, { "@sinonjs/commons": 48 }], 26: [function(require2, module, exports) {
121293
121347
  const arrayProto = require2("@sinonjs/commons").prototypes.array;
121294
121348
  const hasOwnProperty2 = require2("@sinonjs/commons").prototypes.object.hasOwnProperty;
121295
- const join33 = arrayProto.join;
121349
+ const join34 = arrayProto.join;
121296
121350
  const push = arrayProto.push;
121297
121351
  const hasDontEnumBug = function() {
121298
121352
  const obj = {
@@ -121333,7 +121387,7 @@ ${join33(calls, `
121333
121387
  push(result, obj[prop]());
121334
121388
  }
121335
121389
  }
121336
- return join33(result, "") !== "0123456789";
121390
+ return join34(result, "") !== "0123456789";
121337
121391
  }();
121338
121392
  function extendCommon(target2, sources, doCopy) {
121339
121393
  let source, i4, prop;
@@ -123398,7 +123452,7 @@ ${job.error.stack.split(`
123398
123452
  module.exports = matcherPrototype;
123399
123453
  }, { "../create-matcher": 63 }], 71: [function(require2, module, exports) {
123400
123454
  var functionName = require2("@sinonjs/commons").functionName;
123401
- var join33 = require2("@sinonjs/commons").prototypes.array.join;
123455
+ var join34 = require2("@sinonjs/commons").prototypes.array.join;
123402
123456
  var map = require2("@sinonjs/commons").prototypes.array.map;
123403
123457
  var stringIndexOf = require2("@sinonjs/commons").prototypes.string.indexOf;
123404
123458
  var valueToString = require2("@sinonjs/commons").valueToString;
@@ -123429,7 +123483,7 @@ ${job.error.stack.split(`
123429
123483
  m5.test = function(actual) {
123430
123484
  return matchObject(actual, expectation, match3);
123431
123485
  };
123432
- m5.message = `match(${join33(array, ", ")})`;
123486
+ m5.message = `match(${join34(array, ", ")})`;
123433
123487
  return m5;
123434
123488
  },
123435
123489
  regexp: function(m5, expectation) {
@@ -126753,7 +126807,7 @@ ${job.error.stack.split(`
126753
126807
  tokenize: function tokenize(value) {
126754
126808
  return value.split("");
126755
126809
  },
126756
- join: function join33(chars) {
126810
+ join: function join34(chars) {
126757
126811
  return chars.join("");
126758
126812
  }
126759
126813
  };
@@ -1,7 +1,7 @@
1
1
  // src/feature/bundle/server/handle.ts
2
2
  import { patch, unpatch } from "@awsless/json";
3
3
  import { ExpectedError, invoke, isErrorResponse } from "@awsless/lambda";
4
- import { formatRoutePayload, getCurrentRoute, withRoute } from "awsless";
4
+ import { formatRoutePayload, getCurrentRoute, withBundleRouteContext } from "awsless";
5
5
 
6
6
  // src/feature/bundle/server/resource/util.ts
7
7
  var routeType = (route) => {
@@ -198,6 +198,18 @@ var restHandler = (event) => {
198
198
  return;
199
199
  };
200
200
 
201
+ // src/feature/bundle/server/resource/route.ts
202
+ var routeHandler = (event) => {
203
+ if (typeof event?.["$awsless-route"] === "string") {
204
+ return;
205
+ }
206
+ const route = event?.headers?.["x-awsless-route"];
207
+ if (typeof route === "string" && routeType(route) === "route") {
208
+ return webRoute(route, event);
209
+ }
210
+ return;
211
+ };
212
+
201
213
  // src/feature/bundle/server/resource/rpc.ts
202
214
  var rpcHandler = (event) => {
203
215
  const route = event?.["$awsless-route"];
@@ -320,6 +332,7 @@ var createBundle = (handlers) => {
320
332
  topicHandler,
321
333
  taskHandler,
322
334
  restHandler,
335
+ routeHandler,
323
336
  rpcHandler,
324
337
  siteHandler,
325
338
  storeHandler,
@@ -333,8 +346,7 @@ var createBundle = (handlers) => {
333
346
  return match;
334
347
  }
335
348
  }
336
- const route = event?.["$awsless-route"] ?? event?.headers?.["x-awsless-route"];
337
- throw new Error("Unknown bundle route: " + route);
349
+ throw new Error(`Unknown bundle route: ${event?.["$awsless-route"] ?? event?.headers?.["x-awsless-route"]} `);
338
350
  };
339
351
  return async (event, context) => {
340
352
  const handleRoute = (match2) => {
@@ -343,13 +355,13 @@ var createBundle = (handlers) => {
343
355
  throw new Error("Unknown bundle route: " + match2.key);
344
356
  }
345
357
  process.env.AWSLESS_ROUTE = match2.key;
346
- return withRoute(match2.key, invokeRoute, async () => {
358
+ return withBundleRouteContext(match2.key, internalInvoke, async () => {
347
359
  const handle = await load();
348
360
  const routedContext = { ...context, route: match2.key };
349
361
  return handle(match2.payload ?? {}, routedContext);
350
362
  });
351
363
  };
352
- const invokeRoute = async (key, payload) => {
364
+ const internalInvoke = async (key, payload) => {
353
365
  const caller = getCurrentRoute();
354
366
  const throwExpectedErrors = process.env.THROW_EXPECTED_ERRORS;
355
367
  let result;
@@ -14048,7 +14048,7 @@ var require_svgstore = __commonJS((exports, module) => {
14048
14048
 
14049
14049
  // src/feature/icon/server/handle.ts
14050
14050
  import { getObject, putObject } from "@awsless/s3";
14051
- import { getRouteEnv, invokeRoute } from "awsless";
14051
+ import { getRouteEnv, internalInvoke } from "awsless";
14052
14052
 
14053
14053
  // ../../node_modules/.pnpm/svgo@4.0.1/node_modules/svgo/dist/svgo.browser.js
14054
14054
  var visitSkip = Symbol();
@@ -33332,7 +33332,7 @@ var handle_default = async (event) => {
33332
33332
  }
33333
33333
  const originRoute = getRouteEnv("ICON_ORIGIN");
33334
33334
  if (!baseIcon && originRoute) {
33335
- const result = await invokeRoute(originRoute, { path });
33335
+ const result = await internalInvoke(originRoute, { path });
33336
33336
  if (typeof result === "string") {
33337
33337
  baseIcon = Buffer.from(result);
33338
33338
  } else if (result === undefined) {
@@ -1,7 +1,7 @@
1
1
  // src/feature/image/server/handle.ts
2
2
  import { getObject, putObject } from "@awsless/s3";
3
3
  import sharp from "sharp";
4
- import { getRouteEnv, invokeRoute } from "awsless";
4
+ import { getRouteEnv, internalInvoke } from "awsless";
5
5
 
6
6
  // src/feature/image/server/validate.ts
7
7
  import { object, picklist, pipe, safeParse, string, transform } from "@awsless/validate";
@@ -92,7 +92,7 @@ var handle_default = async (event) => {
92
92
  }
93
93
  const originRoute = getRouteEnv("IMAGE_ORIGIN");
94
94
  if (!baseImage && originRoute) {
95
- const result = await invokeRoute(originRoute, { path: originalPath });
95
+ const result = await internalInvoke(originRoute, { path: originalPath });
96
96
  if (typeof result === "string") {
97
97
  baseImage = Buffer.from(result, "base64");
98
98
  } else if (result === undefined) {
@@ -22,7 +22,7 @@ import {
22
22
  putItem,
23
23
  string as dbString
24
24
  } from "@awsless/dynamodb";
25
- import { getRouteEnv, invokeRoute } from "awsless";
25
+ import { getRouteEnv, internalInvoke } from "awsless";
26
26
  import { createHash } from "crypto";
27
27
  import * as zlib from "zlib";
28
28
  var RuntimeErrorSchema = object({
@@ -107,7 +107,7 @@ var handle_default = async (event, context) => {
107
107
  if (!error || await isOwnRequest(error.requestId)) {
108
108
  continue;
109
109
  }
110
- const invoke = invokeRoute(consumerRoute, {
110
+ const invoke = internalInvoke(consumerRoute, {
111
111
  ...error,
112
112
  origin,
113
113
  date: logEvent.timestamp
@@ -1,6 +1,6 @@
1
1
  // src/feature/rpc/server/handle.ts
2
2
  import { ExpectedError, ViewableError } from "@awsless/lambda";
3
- import { invokeRoute as invokeRoute2 } from "awsless";
3
+ import { internalInvoke as internalInvoke2 } from "awsless";
4
4
  import { randomUUID } from "node:crypto";
5
5
 
6
6
  // src/feature/rpc/server/auth.ts
@@ -51,7 +51,7 @@ function isFuture(date) {
51
51
  }
52
52
 
53
53
  // src/feature/rpc/server/auth.ts
54
- import { getRouteEnv, invokeRoute } from "awsless";
54
+ import { getRouteEnv, internalInvoke } from "awsless";
55
55
 
56
56
  // src/feature/rpc/server/validate.ts
57
57
  import {
@@ -135,7 +135,7 @@ var authenticate = async (token) => {
135
135
  }
136
136
  let response;
137
137
  try {
138
- response = await invokeRoute(authRoute, { token });
138
+ response = await internalInvoke(authRoute, { token });
139
139
  } catch (error) {
140
140
  console.error(error);
141
141
  return {
@@ -463,7 +463,7 @@ var handle_default = async (event) => {
463
463
  }
464
464
  let data;
465
465
  try {
466
- data = await invokeRoute2(fn.details.name, {
466
+ data = await internalInvoke2(fn.details.name, {
467
467
  ...fn.payload ?? {},
468
468
  ...auth.context ?? {},
469
469
  viewer: buildViewerPayload(request.output)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/cli",
3
- "version": "0.0.46-next.17",
3
+ "version": "0.0.46-next.19",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -38,15 +38,15 @@
38
38
  "@awsless/ts-file-cache": "^0.0.16"
39
39
  },
40
40
  "peerDependencies": {
41
- "@awsless/big-float": "^0.1.7",
41
+ "@awsless/dynamodb": "^0.3.21",
42
42
  "@awsless/duration": "^0.0.4",
43
43
  "@awsless/json": "^0.0.11",
44
- "@awsless/lambda": "^0.0.47",
45
44
  "@awsless/s3": "^0.0.22",
46
45
  "@awsless/validate": "^0.1.7",
47
46
  "@awsless/weak-cache": "^0.0.1",
48
- "awsless": "^0.0.15-next.3",
49
- "@awsless/dynamodb": "^0.3.21"
47
+ "awsless": "^0.0.15-next.5",
48
+ "@awsless/big-float": "^0.1.7",
49
+ "@awsless/lambda": "^0.0.47"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@clack/prompts": "^0.7.0",
@@ -100,25 +100,25 @@
100
100
  "zip-a-folder": "^3.1.6",
101
101
  "zod": "^3.24.2",
102
102
  "zod-to-json-schema": "^3.24.3",
103
+ "@awsless/big-float": "^0.1.7",
104
+ "@awsless/clui": "^0.0.9",
103
105
  "@awsless/cloudwatch": "^0.0.1",
104
106
  "@awsless/duration": "^0.0.4",
105
107
  "@awsless/dynamodb": "^0.3.21",
106
- "@awsless/big-float": "^0.1.7",
107
- "@awsless/iot": "^0.0.5",
108
- "@awsless/clui": "^0.0.9",
109
- "@awsless/json": "^0.0.11",
110
108
  "@awsless/lambda": "^0.0.47",
111
- "@awsless/s3": "^0.0.22",
109
+ "@awsless/json": "^0.0.11",
110
+ "@awsless/iot": "^0.0.5",
112
111
  "@awsless/open-search": "^0.0.24",
113
- "@awsless/sns": "^0.0.11",
112
+ "@awsless/s3": "^0.0.22",
114
113
  "@awsless/redis": "^0.1.13",
115
- "@awsless/ssm": "^0.0.8",
116
- "@awsless/weak-cache": "^0.0.1",
114
+ "@awsless/size": "^0.0.2",
117
115
  "@awsless/scheduler": "^0.0.5",
118
- "awsless": "^0.0.15-next.3",
119
- "@awsless/validate": "^0.1.7",
116
+ "@awsless/sns": "^0.0.11",
120
117
  "@awsless/sqs": "^0.0.24",
121
- "@awsless/size": "^0.0.2"
118
+ "@awsless/ssm": "^0.0.8",
119
+ "@awsless/validate": "^0.1.7",
120
+ "@awsless/weak-cache": "^0.0.1",
121
+ "awsless": "^0.0.15-next.5"
122
122
  },
123
123
  "scripts": {
124
124
  "test": "bun cli/build-handlers.ts && pnpm vitest",