@awsless/awsless 0.0.580 → 0.0.581

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
@@ -1,7 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- shortId
4
- } from "./chunk-W4ED7XCC.js";
5
2
 
6
3
  // src/cli/program.ts
7
4
  import { Command } from "commander";
@@ -874,6 +871,10 @@ var FileCodeSchema = z14.object({
874
871
  });
875
872
  var BundleCodeSchema = z14.object({
876
873
  bundle: LocalDirectorySchema.describe("The directory that needs to be bundled.")
874
+ // dir: z.string(),
875
+ // build: z.string(),
876
+ // run: z.string(),
877
+ // cacheKey:
877
878
  });
878
879
  var CodeSchema = z14.union([
879
880
  LocalFileSchema.transform((file) => ({
@@ -3105,6 +3106,12 @@ var listAllFiles = async (list3) => {
3105
3106
  return files;
3106
3107
  };
3107
3108
 
3109
+ // src/util/id.ts
3110
+ import { createHash as createHash3 } from "crypto";
3111
+ var shortId = (ns) => {
3112
+ return createHash3("md5").update(ns).digest("hex").substring(0, 10);
3113
+ };
3114
+
3108
3115
  // src/util/temp.ts
3109
3116
  import { mkdir as mkdir3, readdir as readdir2, rm as rm2 } from "fs/promises";
3110
3117
  import { join as join8 } from "path";
@@ -3992,8 +3999,7 @@ var pubsubFeature = defineFeature({
3992
3999
  ctx.addGlobalPermission({
3993
4000
  actions: ["iot:Publish"],
3994
4001
  resources: [
3995
- //
3996
- `arn:aws:iot:${ctx.appConfig.region}:${ctx.accountId}:topic/*`,
4002
+ // `arn:aws:iot:${ctx.appConfig.region}:${ctx.accountId}:topic/*`,
3997
4003
  `arn:aws:iot:${ctx.appConfig.region}:${ctx.accountId}:topic/${ctx.app.name}/pubsub/*`
3998
4004
  ]
3999
4005
  });
@@ -5093,7 +5099,7 @@ var execCommand = async ({ cwd, env, command }) => {
5093
5099
  };
5094
5100
 
5095
5101
  // src/feature/site/index.ts
5096
- import { createHash as createHash3 } from "crypto";
5102
+ import { createHash as createHash4 } from "crypto";
5097
5103
  import { Future as Future3 } from "@awsless/formation";
5098
5104
  var siteFeature = defineFeature({
5099
5105
  name: "site",
@@ -5398,7 +5404,7 @@ var siteFeature = defineFeature({
5398
5404
  version: new Future3((resolve) => {
5399
5405
  $combine(...versions).then((versions2) => {
5400
5406
  const combined = versions2.filter((v) => !!v).sort().join(",");
5401
- const version = createHash3("sha1").update(combined).digest("hex");
5407
+ const version = createHash4("sha1").update(combined).digest("hex");
5402
5408
  resolve(version);
5403
5409
  });
5404
5410
  })
@@ -6897,7 +6903,7 @@ import deepmerge4 from "deepmerge";
6897
6903
  import { join as join16 } from "path";
6898
6904
 
6899
6905
  // src/feature/instance/build/executable.ts
6900
- import { createHash as createHash4 } from "crypto";
6906
+ import { createHash as createHash5 } from "crypto";
6901
6907
  import { readFile as readFile4 } from "fs/promises";
6902
6908
  import { join as join15 } from "path";
6903
6909
  import { exec as exec2 } from "promisify-child-process";
@@ -6912,7 +6918,7 @@ var buildExecutable = async (input, outputPath, architecture) => {
6912
6918
  }
6913
6919
  const file = await readFile4(filePath);
6914
6920
  return {
6915
- hash: createHash4("sha1").update(file).update("x86_64").digest("hex"),
6921
+ hash: createHash5("sha1").update(file).update("x86_64").digest("hex"),
6916
6922
  file
6917
6923
  };
6918
6924
  };
@@ -8024,6 +8030,7 @@ var createApp = (props) => {
8024
8030
  };
8025
8031
  return {
8026
8032
  app,
8033
+ appId,
8027
8034
  base,
8028
8035
  zones,
8029
8036
  ready,
@@ -8312,7 +8319,7 @@ import { join as join19 } from "path";
8312
8319
  import wildstring3 from "wildstring";
8313
8320
 
8314
8321
  // src/build/__fingerprint.ts
8315
- import { createHash as createHash5 } from "crypto";
8322
+ import { createHash as createHash6 } from "crypto";
8316
8323
  import { readdir as readdir4, readFile as readFile5, stat as stat4 } from "fs/promises";
8317
8324
  import { basename as basename4, dirname as dirname10, extname as extname4, join as join17 } from "path";
8318
8325
  import parseStaticImports from "parse-static-imports";
@@ -8323,7 +8330,7 @@ var generateFileHashes = async (file, hashes) => {
8323
8330
  }
8324
8331
  const code = await readModuleFile(file);
8325
8332
  const deps = await findDependencies(file, code);
8326
- const hash = createHash5("sha1").update(code).digest();
8333
+ const hash = createHash6("sha1").update(code).digest();
8327
8334
  hashes.set(file, hash);
8328
8335
  for (const dep of deps) {
8329
8336
  if (dep.startsWith("/")) {
@@ -8340,7 +8347,7 @@ var fingerprintFromDirectory = async (dir) => {
8340
8347
  }
8341
8348
  }
8342
8349
  const merge2 = Buffer.concat(Array.from(hashes.values()).sort());
8343
- return createHash5("sha1").update(merge2).digest("hex");
8350
+ return createHash6("sha1").update(merge2).digest("hex");
8344
8351
  };
8345
8352
  var readModuleFile = (file) => {
8346
8353
  if (file.endsWith(".js")) {
@@ -9049,7 +9056,7 @@ var run = (program2) => {
9049
9056
  const region = appConfig.region;
9050
9057
  const credentials = getCredentials(appConfig.profile);
9051
9058
  const accountId = await getAccountId(credentials, region);
9052
- const { commands: commands9 } = createApp({ appConfig, stackConfigs, accountId });
9059
+ const { commands: commands9, appId } = createApp({ appConfig, stackConfigs, accountId });
9053
9060
  let command;
9054
9061
  if (selected) {
9055
9062
  command = commands9.find((cmd) => {
@@ -9070,6 +9077,7 @@ var run = (program2) => {
9070
9077
  throw new ExpectedError(`The provided command doesn't exist.`);
9071
9078
  }
9072
9079
  process.env.APP = appConfig.name;
9080
+ process.env.APP_ID = appId;
9073
9081
  process.env.AWS_REGION = region;
9074
9082
  process.env.AWS_ACCOUNT_ID = accountId;
9075
9083
  const module = await tsImport(command.file, {
@@ -266,6 +266,10 @@ var FileCodeSchema = z11.object({
266
266
  });
267
267
  var BundleCodeSchema = z11.object({
268
268
  bundle: LocalDirectorySchema.describe("The directory that needs to be bundled.")
269
+ // dir: z.string(),
270
+ // build: z.string(),
271
+ // run: z.string(),
272
+ // cacheKey:
269
273
  });
270
274
  var CodeSchema = z11.union([
271
275
  LocalFileSchema.transform((file) => ({
Binary file
Binary file
@@ -1 +1 @@
1
- 67cc66902e9b4f4a3b10b94784c0f0f88f247ce1
1
+ 809ac79b62f213f5ced66b7a051b247cda10444b
Binary file
package/dist/server.d.ts CHANGED
@@ -87,10 +87,6 @@ interface FunctionResources {
87
87
  declare const Function: FunctionResources;
88
88
  declare const Fn: FunctionResources;
89
89
 
90
- interface InstanceResources {
91
- }
92
- declare const Instance: InstanceResources;
93
-
94
90
  declare const getMetricName: (name: string) => string;
95
91
  declare const getMetricNamespace: (stack?: string, app?: string) => string;
96
92
  interface MetricResources {
@@ -171,4 +167,4 @@ declare const Topic: TopicResources;
171
167
  declare const APP: "app";
172
168
  declare const STACK: "stack";
173
169
 
174
- export { APP, Alert, type AlertMock, type AlertMockResponse, type AlertResources, Auth, type AuthResources, Cache, type CacheResources, type CommandContext, type CommandHandler, Config, type ConfigResources, Fn, Function, type FunctionMock, type FunctionMockResponse, type FunctionResources, Instance, type InstanceResources, Metric, type MetricResources, PubSub, type PublishOptions, Queue, type QueueMock, type QueueMockResponse, type QueueResources, type RpcAuthorizerResponse, STACK, Search, type SearchResources, Store, type StoreResources, Table, type TableResources, Task, type TaskMock, type TaskMockResponse, type TaskResources, Topic, type TopicMock, type TopicMockResponse, type TopicResources, getAlertName, getAuthProps, getCacheProps, getConfigName, getConfigValue, getFunctionName, getMetricName, getMetricNamespace, getPubSubTopic, getQueueName, getQueueUrl, getSearchName, getSearchProps, getSiteBucketName, getStoreName, getTableName, getTaskName, getTopicName, mockAlert, mockCache, mockFunction, mockMetric, mockPubSub, mockQueue, mockTask, mockTopic, pubsubAuthorizerHandle, pubsubAuthorizerResponse, setConfigValue };
170
+ export { APP, Alert, type AlertMock, type AlertMockResponse, type AlertResources, Auth, type AuthResources, Cache, type CacheResources, type CommandContext, type CommandHandler, Config, type ConfigResources, Fn, Function, type FunctionMock, type FunctionMockResponse, type FunctionResources, Metric, type MetricResources, PubSub, type PublishOptions, Queue, type QueueMock, type QueueMockResponse, type QueueResources, type RpcAuthorizerResponse, STACK, Search, type SearchResources, Store, type StoreResources, Table, type TableResources, Task, type TaskMock, type TaskMockResponse, type TaskResources, Topic, type TopicMock, type TopicMockResponse, type TopicResources, getAlertName, getAuthProps, getCacheProps, getConfigName, getConfigValue, getFunctionName, getMetricName, getMetricNamespace, getPubSubTopic, getQueueName, getQueueUrl, getSearchName, getSearchProps, getSiteBucketName, getStoreName, getTableName, getTaskName, getTopicName, mockAlert, mockCache, mockFunction, mockMetric, mockPubSub, mockQueue, mockTask, mockTopic, pubsubAuthorizerHandle, pubsubAuthorizerResponse, setConfigValue };
package/dist/server.js CHANGED
@@ -1,6 +1,3 @@
1
- import {
2
- shortId
3
- } from "./chunk-W4ED7XCC.js";
4
1
  import {
5
2
  createProxy
6
3
  } from "./chunk-2LRBH7VV.js";
@@ -456,13 +453,6 @@ var Config = /* @__PURE__ */ new Proxy(
456
453
  }
457
454
  );
458
455
 
459
- // src/lib/server/instance.ts
460
- var Instance = /* @__PURE__ */ createProxy((stack) => {
461
- return createProxy((name) => {
462
- return `http://${shortId(`${stack}:${name}`)}.${APP}`;
463
- });
464
- });
465
-
466
456
  // src/lib/server/metric.ts
467
457
  import {
468
458
  batchPutData,
@@ -678,7 +668,6 @@ export {
678
668
  Config,
679
669
  Fn,
680
670
  Function,
681
- Instance,
682
671
  Metric,
683
672
  PubSub,
684
673
  QoS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/awsless",
3
- "version": "0.0.580",
3
+ "version": "0.0.581",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -33,23 +33,23 @@
33
33
  ]
34
34
  },
35
35
  "peerDependencies": {
36
- "@awsless/big-float": "^0.1.4",
36
+ "@awsless/big-float": "^0.1.5",
37
37
  "@awsless/cloudwatch": "^0.0.1",
38
- "@awsless/dynamodb": "^0.2.10",
39
38
  "@awsless/duration": "^0.0.3",
40
- "@awsless/clui": "^0.0.7",
39
+ "@awsless/dynamodb": "^0.2.12",
41
40
  "@awsless/iot": "^0.0.3",
42
- "@awsless/json": "^0.0.10",
43
41
  "@awsless/lambda": "^0.0.33",
44
- "@awsless/mqtt": "^0.0.2",
42
+ "@awsless/json": "^0.0.10",
43
+ "@awsless/clui": "^0.0.7",
45
44
  "@awsless/open-search": "^0.0.21",
46
45
  "@awsless/redis": "^0.0.14",
47
- "@awsless/s3": "^0.0.21",
48
46
  "@awsless/sns": "^0.0.10",
49
- "@awsless/sqs": "^0.0.15",
47
+ "@awsless/sqs": "^0.0.16",
50
48
  "@awsless/ssm": "^0.0.7",
51
49
  "@awsless/validate": "^0.0.19",
52
- "@awsless/weak-cache": "^0.0.1"
50
+ "@awsless/weak-cache": "^0.0.1",
51
+ "@awsless/mqtt": "^0.0.2",
52
+ "@awsless/s3": "^0.0.21"
53
53
  },
54
54
  "dependencies": {
55
55
  "@arcanyx/cidr-slicer": "^0.3.0",
@@ -134,17 +134,17 @@
134
134
  "zip-a-folder": "^3.1.6",
135
135
  "zod": "^3.24.2",
136
136
  "zod-to-json-schema": "^3.24.3",
137
- "@awsless/big-float": "^0.1.4",
138
- "@awsless/clui": "^0.0.7",
137
+ "@awsless/big-float": "^0.1.5",
139
138
  "@awsless/cloudwatch": "^0.0.1",
139
+ "@awsless/graphql": "^0.0.9",
140
140
  "@awsless/duration": "^0.0.3",
141
141
  "@awsless/formation": "^0.0.80",
142
- "@awsless/graphql": "^0.0.9",
143
- "@awsless/scheduler": "^0.0.4",
144
142
  "@awsless/json": "^0.0.10",
145
- "@awsless/size": "^0.0.2",
143
+ "@awsless/scheduler": "^0.0.4",
146
144
  "@awsless/validate": "^0.0.19",
147
- "@awsless/ts-file-cache": "^0.0.12"
145
+ "@awsless/clui": "^0.0.7",
146
+ "@awsless/ts-file-cache": "^0.0.12",
147
+ "@awsless/size": "^0.0.2"
148
148
  },
149
149
  "devDependencies": {
150
150
  "@node-rs/bcrypt": "^1.10.5",
@@ -1,9 +0,0 @@
1
- // src/util/id.ts
2
- import { createHash } from "crypto";
3
- var shortId = (ns) => {
4
- return createHash("md5").update(ns).digest("hex").substring(0, 10);
5
- };
6
-
7
- export {
8
- shortId
9
- };