@awsless/awsless 0.0.595 → 0.0.596
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 +113 -132
- package/dist/prebuild/icon/bundle.zip +0 -0
- package/dist/prebuild/image/bundle.zip +0 -0
- package/dist/prebuild/rpc/bundle.zip +0 -0
- package/package.json +14 -12
package/dist/bin.js
CHANGED
|
@@ -2353,8 +2353,8 @@ import { readFile as readFile2 } from "fs/promises";
|
|
|
2353
2353
|
import { basename, dirname as dirname2, extname, join as join4 } from "path";
|
|
2354
2354
|
var readConfig = async (file) => {
|
|
2355
2355
|
try {
|
|
2356
|
-
const
|
|
2357
|
-
const data = Bun.JSON5.parse(
|
|
2356
|
+
const json2 = await readFile2(file, "utf8");
|
|
2357
|
+
const data = Bun.JSON5.parse(json2);
|
|
2358
2358
|
return data;
|
|
2359
2359
|
} catch (error) {
|
|
2360
2360
|
if (error instanceof Error) {
|
|
@@ -3147,96 +3147,6 @@ var getGlobalOnFailure = (ctx) => {
|
|
|
3147
3147
|
return ctx.shared.get("on-failure", "queue-arn");
|
|
3148
3148
|
};
|
|
3149
3149
|
|
|
3150
|
-
// src/feature/function/build/typescript/bundle.ts
|
|
3151
|
-
import commonjs from "@rollup/plugin-commonjs";
|
|
3152
|
-
import json from "@rollup/plugin-json";
|
|
3153
|
-
import nodeResolve from "@rollup/plugin-node-resolve";
|
|
3154
|
-
import { createHash } from "crypto";
|
|
3155
|
-
import { dirname as dirname5 } from "path";
|
|
3156
|
-
import { rollup } from "rollup";
|
|
3157
|
-
import natives from "rollup-plugin-natives";
|
|
3158
|
-
import { importAsString } from "rollup-plugin-string-import";
|
|
3159
|
-
import { swc, minify as swcMinify } from "rollup-plugin-swc3";
|
|
3160
|
-
var bundleTypeScript = async ({
|
|
3161
|
-
format: format2 = "esm",
|
|
3162
|
-
minify = true,
|
|
3163
|
-
file,
|
|
3164
|
-
nativeDir,
|
|
3165
|
-
external,
|
|
3166
|
-
importAsString: importAsStringList
|
|
3167
|
-
}) => {
|
|
3168
|
-
const bundle = await rollup({
|
|
3169
|
-
input: file,
|
|
3170
|
-
external: (importee) => {
|
|
3171
|
-
return importee.startsWith("@aws-sdk") || importee.startsWith("aws-sdk") || external?.includes(importee);
|
|
3172
|
-
},
|
|
3173
|
-
onwarn: (error) => {
|
|
3174
|
-
debugError(error.message);
|
|
3175
|
-
},
|
|
3176
|
-
treeshake: {
|
|
3177
|
-
preset: "smallest",
|
|
3178
|
-
moduleSideEffects: (id) => file === id
|
|
3179
|
-
},
|
|
3180
|
-
plugins: [
|
|
3181
|
-
commonjs({ sourceMap: true }),
|
|
3182
|
-
nodeResolve({ preferBuiltins: true }),
|
|
3183
|
-
// @ts-ignore
|
|
3184
|
-
nativeDir ? natives({
|
|
3185
|
-
copyTo: nativeDir,
|
|
3186
|
-
targetEsm: format2 === "esm",
|
|
3187
|
-
sourcemap: true
|
|
3188
|
-
}) : void 0,
|
|
3189
|
-
swc({
|
|
3190
|
-
// minify,
|
|
3191
|
-
// module: true,
|
|
3192
|
-
jsc: {
|
|
3193
|
-
baseUrl: dirname5(file),
|
|
3194
|
-
minify: { sourceMap: true }
|
|
3195
|
-
},
|
|
3196
|
-
sourceMaps: true
|
|
3197
|
-
}),
|
|
3198
|
-
minify ? swcMinify({
|
|
3199
|
-
module: format2 === "esm",
|
|
3200
|
-
sourceMap: true,
|
|
3201
|
-
compress: true
|
|
3202
|
-
}) : void 0,
|
|
3203
|
-
json(),
|
|
3204
|
-
importAsStringList ? importAsString({
|
|
3205
|
-
include: importAsStringList
|
|
3206
|
-
}) : void 0
|
|
3207
|
-
]
|
|
3208
|
-
});
|
|
3209
|
-
const ext = format2 === "esm" ? "mjs" : "js";
|
|
3210
|
-
const result = await bundle.generate({
|
|
3211
|
-
format: format2,
|
|
3212
|
-
sourcemap: "hidden",
|
|
3213
|
-
exports: "auto",
|
|
3214
|
-
manualChunks: {},
|
|
3215
|
-
entryFileNames: `index.${ext}`,
|
|
3216
|
-
chunkFileNames: `[name].${ext}`
|
|
3217
|
-
});
|
|
3218
|
-
const hash = createHash("sha1");
|
|
3219
|
-
const files = [];
|
|
3220
|
-
for (const item of result.output) {
|
|
3221
|
-
if (item.type !== "chunk") {
|
|
3222
|
-
continue;
|
|
3223
|
-
}
|
|
3224
|
-
const code = Buffer.from(item.code, "utf8");
|
|
3225
|
-
const map = item.map ? Buffer.from(item.map.toString(), "utf8") : void 0;
|
|
3226
|
-
item.map?.version;
|
|
3227
|
-
hash.update(code);
|
|
3228
|
-
files.push({
|
|
3229
|
-
name: item.fileName,
|
|
3230
|
-
code,
|
|
3231
|
-
map
|
|
3232
|
-
});
|
|
3233
|
-
}
|
|
3234
|
-
return {
|
|
3235
|
-
hash: hash.digest("hex"),
|
|
3236
|
-
files
|
|
3237
|
-
};
|
|
3238
|
-
};
|
|
3239
|
-
|
|
3240
3150
|
// src/feature/function/build/zip.ts
|
|
3241
3151
|
import { createReadStream } from "fs";
|
|
3242
3152
|
import JSZip from "jszip";
|
|
@@ -3264,7 +3174,7 @@ import { toMebibytes as toMebibytes2 } from "@awsless/size";
|
|
|
3264
3174
|
import { pascalCase } from "change-case";
|
|
3265
3175
|
|
|
3266
3176
|
// src/util/cache.ts
|
|
3267
|
-
import { createHash
|
|
3177
|
+
import { createHash } from "node:crypto";
|
|
3268
3178
|
import { createReadStream as createReadStream2 } from "node:fs";
|
|
3269
3179
|
import { lstat as lstat2, readdir } from "node:fs/promises";
|
|
3270
3180
|
import { join as join7 } from "node:path";
|
|
@@ -3274,11 +3184,11 @@ var generateCacheKey = async (directories2) => {
|
|
|
3274
3184
|
for (const file of files) {
|
|
3275
3185
|
hashes[file] = await createHashFromFile(file);
|
|
3276
3186
|
}
|
|
3277
|
-
return
|
|
3187
|
+
return createHash("md5").update(JSON.stringify(hashes)).digest("hex");
|
|
3278
3188
|
};
|
|
3279
3189
|
var createHashFromFile = (file) => {
|
|
3280
3190
|
return new Promise((resolve) => {
|
|
3281
|
-
const hash =
|
|
3191
|
+
const hash = createHash("md5");
|
|
3282
3192
|
const stream = createReadStream2(file);
|
|
3283
3193
|
stream.on("data", (data) => hash.update(data));
|
|
3284
3194
|
stream.on("end", () => resolve(hash.digest("hex")));
|
|
@@ -3302,9 +3212,9 @@ var listAllFiles = async (list3) => {
|
|
|
3302
3212
|
};
|
|
3303
3213
|
|
|
3304
3214
|
// src/util/id.ts
|
|
3305
|
-
import { createHash as
|
|
3215
|
+
import { createHash as createHash2 } from "crypto";
|
|
3306
3216
|
var shortId = (ns) => {
|
|
3307
|
-
return
|
|
3217
|
+
return createHash2("md5").update(ns).digest("hex").substring(0, 10);
|
|
3308
3218
|
};
|
|
3309
3219
|
|
|
3310
3220
|
// src/util/temp.ts
|
|
@@ -3365,6 +3275,73 @@ var zipBundle = async ({ directory }) => {
|
|
|
3365
3275
|
});
|
|
3366
3276
|
};
|
|
3367
3277
|
|
|
3278
|
+
// src/feature/function/build/typescript/rolldown.ts
|
|
3279
|
+
import nodeResolve from "@rollup/plugin-node-resolve";
|
|
3280
|
+
import { createHash as createHash3 } from "crypto";
|
|
3281
|
+
import { rolldown } from "rolldown";
|
|
3282
|
+
import natives from "rollup-plugin-natives";
|
|
3283
|
+
import { importAsString } from "rollup-plugin-string-import";
|
|
3284
|
+
var bundleTypeScriptWithRolldown = async ({
|
|
3285
|
+
format: format2 = "esm",
|
|
3286
|
+
minify = true,
|
|
3287
|
+
file,
|
|
3288
|
+
nativeDir,
|
|
3289
|
+
external,
|
|
3290
|
+
importAsString: importAsStringList
|
|
3291
|
+
}) => {
|
|
3292
|
+
const bundle = await rolldown({
|
|
3293
|
+
input: file,
|
|
3294
|
+
external: (importee) => {
|
|
3295
|
+
return importee.startsWith("@aws-sdk") || importee.startsWith("aws-sdk") || external?.includes(importee);
|
|
3296
|
+
},
|
|
3297
|
+
onwarn: (error) => {
|
|
3298
|
+
debugError(error.message);
|
|
3299
|
+
},
|
|
3300
|
+
treeshake: {
|
|
3301
|
+
moduleSideEffects: (id) => file === id
|
|
3302
|
+
},
|
|
3303
|
+
plugins: [
|
|
3304
|
+
nodeResolve({ preferBuiltins: true }),
|
|
3305
|
+
nativeDir ? natives({
|
|
3306
|
+
copyTo: nativeDir,
|
|
3307
|
+
targetEsm: format2 === "esm",
|
|
3308
|
+
sourcemap: true
|
|
3309
|
+
}) : void 0,
|
|
3310
|
+
importAsStringList ? importAsString({
|
|
3311
|
+
include: importAsStringList
|
|
3312
|
+
}) : void 0
|
|
3313
|
+
]
|
|
3314
|
+
});
|
|
3315
|
+
const ext = format2 === "esm" ? "mjs" : "js";
|
|
3316
|
+
const result = await bundle.generate({
|
|
3317
|
+
format: format2,
|
|
3318
|
+
sourcemap: "hidden",
|
|
3319
|
+
exports: "auto",
|
|
3320
|
+
entryFileNames: `index.${ext}`,
|
|
3321
|
+
chunkFileNames: `[name].${ext}`,
|
|
3322
|
+
minify
|
|
3323
|
+
});
|
|
3324
|
+
const hash = createHash3("sha1");
|
|
3325
|
+
const files = [];
|
|
3326
|
+
for (const item of result.output) {
|
|
3327
|
+
if (item.type !== "chunk") {
|
|
3328
|
+
continue;
|
|
3329
|
+
}
|
|
3330
|
+
const code = Buffer.from(item.code, "utf8");
|
|
3331
|
+
const map = item.map ? Buffer.from(item.map.toString(), "utf8") : void 0;
|
|
3332
|
+
hash.update(code);
|
|
3333
|
+
files.push({
|
|
3334
|
+
name: item.fileName,
|
|
3335
|
+
code,
|
|
3336
|
+
map
|
|
3337
|
+
});
|
|
3338
|
+
}
|
|
3339
|
+
return {
|
|
3340
|
+
hash: hash.digest("hex"),
|
|
3341
|
+
files
|
|
3342
|
+
};
|
|
3343
|
+
};
|
|
3344
|
+
|
|
3368
3345
|
// src/feature/function/util.ts
|
|
3369
3346
|
var createLambdaFunction = (parentGroup, ctx, ns, id, local) => {
|
|
3370
3347
|
let name;
|
|
@@ -3400,7 +3377,7 @@ var createLambdaFunction = (parentGroup, ctx, ns, id, local) => {
|
|
|
3400
3377
|
const fingerprint = await generateFileHash(workspace, fileCode.file);
|
|
3401
3378
|
return build3(fingerprint, async (write) => {
|
|
3402
3379
|
const temp = await createTempFolder(`function--${name}`);
|
|
3403
|
-
const bundle = await
|
|
3380
|
+
const bundle = await bundleTypeScriptWithRolldown({
|
|
3404
3381
|
file: fileCode.file,
|
|
3405
3382
|
external: [
|
|
3406
3383
|
...fileCode.external ?? [],
|
|
@@ -4569,7 +4546,7 @@ import { camelCase as camelCase5, kebabCase as kebabCase6 } from "change-case";
|
|
|
4569
4546
|
import { Group as Group13 } from "@terraforge/core";
|
|
4570
4547
|
import { aws as aws14 } from "@terraforge/aws";
|
|
4571
4548
|
import { mebibytes as mebibytes3 } from "@awsless/size";
|
|
4572
|
-
import { dirname as
|
|
4549
|
+
import { dirname as dirname5, join as join10, relative as relative5 } from "path";
|
|
4573
4550
|
import { fileURLToPath } from "node:url";
|
|
4574
4551
|
|
|
4575
4552
|
// src/feature/function/prebuild.ts
|
|
@@ -4761,7 +4738,7 @@ var createPrebuildLambdaFunction = (group, ctx, ns, id, props) => {
|
|
|
4761
4738
|
|
|
4762
4739
|
// src/feature/rpc/index.ts
|
|
4763
4740
|
import { toSeconds as toSeconds6 } from "@awsless/duration";
|
|
4764
|
-
var __dirname =
|
|
4741
|
+
var __dirname = dirname5(fileURLToPath(import.meta.url));
|
|
4765
4742
|
var rpcFeature = defineFeature({
|
|
4766
4743
|
name: "rpc",
|
|
4767
4744
|
async onTypeGen(ctx) {
|
|
@@ -5081,7 +5058,7 @@ var searchFeature = defineFeature({
|
|
|
5081
5058
|
import { Group as Group15 } from "@terraforge/core";
|
|
5082
5059
|
import { aws as aws16 } from "@terraforge/aws";
|
|
5083
5060
|
import { glob as glob2 } from "glob";
|
|
5084
|
-
import { dirname as
|
|
5061
|
+
import { dirname as dirname6, join as join11 } from "path";
|
|
5085
5062
|
|
|
5086
5063
|
// src/feature/site/util.ts
|
|
5087
5064
|
import { contentType, lookup } from "mime-types";
|
|
@@ -5141,7 +5118,7 @@ var siteFeature = defineFeature({
|
|
|
5141
5118
|
return build3(fingerprint, async (write) => {
|
|
5142
5119
|
const credentialProvider = await getCredentials(ctx.appConfig.profile);
|
|
5143
5120
|
const credentials = await credentialProvider();
|
|
5144
|
-
const cwd = join11(directories.root,
|
|
5121
|
+
const cwd = join11(directories.root, dirname6(ctx.stackConfig.file));
|
|
5145
5122
|
const env = {
|
|
5146
5123
|
// Pass the app config name
|
|
5147
5124
|
APP: ctx.appConfig.name,
|
|
@@ -6103,6 +6080,9 @@ var layerFeature = defineFeature({
|
|
|
6103
6080
|
resourceName: "assets",
|
|
6104
6081
|
postfix: ctx.appId
|
|
6105
6082
|
}),
|
|
6083
|
+
versioning: {
|
|
6084
|
+
enabled: true
|
|
6085
|
+
},
|
|
6106
6086
|
forceDestroy: true
|
|
6107
6087
|
});
|
|
6108
6088
|
ctx.shared.set("layer", "bucket-name", bucket.bucket);
|
|
@@ -6153,10 +6133,12 @@ var layerFeature = defineFeature({
|
|
|
6153
6133
|
}
|
|
6154
6134
|
return name;
|
|
6155
6135
|
}),
|
|
6156
|
-
sourceCodeHash: $hash(props.file)
|
|
6136
|
+
sourceCodeHash: $hash(props.file),
|
|
6137
|
+
skipDestroy: true
|
|
6157
6138
|
},
|
|
6158
6139
|
{
|
|
6159
|
-
dependsOn: [zip]
|
|
6140
|
+
dependsOn: [zip],
|
|
6141
|
+
replaceOnChanges: ["sourceCodeHash"]
|
|
6160
6142
|
}
|
|
6161
6143
|
);
|
|
6162
6144
|
ctx.shared.add("layer", "arn", id, layer.arn);
|
|
@@ -6168,12 +6150,12 @@ var layerFeature = defineFeature({
|
|
|
6168
6150
|
// src/feature/image/index.ts
|
|
6169
6151
|
import { Group as Group23 } from "@terraforge/core";
|
|
6170
6152
|
import { aws as aws24 } from "@terraforge/aws";
|
|
6171
|
-
import { join as join13, dirname as
|
|
6153
|
+
import { join as join13, dirname as dirname7 } from "path";
|
|
6172
6154
|
import { mebibytes as mebibytes4 } from "@awsless/size";
|
|
6173
6155
|
import { seconds as seconds7, toDays as toDays6 } from "@awsless/duration";
|
|
6174
6156
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
6175
6157
|
import { glob as glob4 } from "glob";
|
|
6176
|
-
var __dirname2 =
|
|
6158
|
+
var __dirname2 = dirname7(fileURLToPath2(import.meta.url));
|
|
6177
6159
|
var imageFeature = defineFeature({
|
|
6178
6160
|
name: "image",
|
|
6179
6161
|
onApp(ctx) {
|
|
@@ -6356,12 +6338,12 @@ var imageFeature = defineFeature({
|
|
|
6356
6338
|
// src/feature/icon/index.ts
|
|
6357
6339
|
import { Group as Group24 } from "@terraforge/core";
|
|
6358
6340
|
import { aws as aws25 } from "@terraforge/aws";
|
|
6359
|
-
import { join as join14, dirname as
|
|
6341
|
+
import { join as join14, dirname as dirname8 } from "path";
|
|
6360
6342
|
import { mebibytes as mebibytes5 } from "@awsless/size";
|
|
6361
6343
|
import { seconds as seconds8, toDays as toDays7 } from "@awsless/duration";
|
|
6362
6344
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
6363
6345
|
import { glob as glob5 } from "glob";
|
|
6364
|
-
var __dirname3 =
|
|
6346
|
+
var __dirname3 = dirname8(fileURLToPath3(import.meta.url));
|
|
6365
6347
|
var iconFeature = defineFeature({
|
|
6366
6348
|
name: "icon",
|
|
6367
6349
|
onStack(ctx) {
|
|
@@ -6530,8 +6512,7 @@ var buildExecutable = async (input, outputPath, architecture) => {
|
|
|
6530
6512
|
target,
|
|
6531
6513
|
outfile: filePath
|
|
6532
6514
|
},
|
|
6533
|
-
target: "bun"
|
|
6534
|
-
bytecode: true
|
|
6515
|
+
target: "bun"
|
|
6535
6516
|
});
|
|
6536
6517
|
} catch (error) {
|
|
6537
6518
|
throw new ExpectedError(
|
|
@@ -8654,7 +8635,7 @@ import wildstring3 from "wildstring";
|
|
|
8654
8635
|
// src/build/__fingerprint.ts
|
|
8655
8636
|
import { createHash as createHash6 } from "crypto";
|
|
8656
8637
|
import { readdir as readdir4, readFile as readFile5, stat as stat4 } from "fs/promises";
|
|
8657
|
-
import { basename as basename4, dirname as
|
|
8638
|
+
import { basename as basename4, dirname as dirname9, extname as extname4, join as join17 } from "path";
|
|
8658
8639
|
import parseStaticImports from "parse-static-imports";
|
|
8659
8640
|
var extensions = ["js", "mjs", "jsx", "ts", "mts", "tsx"];
|
|
8660
8641
|
var generateFileHashes = async (file, hashes) => {
|
|
@@ -8710,25 +8691,25 @@ var readFiles = async (files) => {
|
|
|
8710
8691
|
};
|
|
8711
8692
|
var findDependencies = async (file, code) => {
|
|
8712
8693
|
const imports = await parseStaticImports(code);
|
|
8713
|
-
return imports.map((entry) => entry.moduleName).filter(Boolean).map((value) => value?.startsWith(".") ? join17(
|
|
8694
|
+
return imports.map((entry) => entry.moduleName).filter(Boolean).map((value) => value?.startsWith(".") ? join17(dirname9(file), value) : value);
|
|
8714
8695
|
};
|
|
8715
8696
|
|
|
8716
8697
|
// src/cli/ui/complex/run-tests.ts
|
|
8717
8698
|
import { parse as parse4, stringify } from "@awsless/json";
|
|
8718
8699
|
|
|
8719
8700
|
// src/test/start.ts
|
|
8720
|
-
import
|
|
8721
|
-
import
|
|
8701
|
+
import commonjs from "@rollup/plugin-commonjs";
|
|
8702
|
+
import json from "@rollup/plugin-json";
|
|
8722
8703
|
import nodeResolve2 from "@rollup/plugin-node-resolve";
|
|
8723
|
-
import { dirname as
|
|
8724
|
-
import { swc
|
|
8704
|
+
import { dirname as dirname10, join as join18 } from "path";
|
|
8705
|
+
import { swc } from "rollup-plugin-swc3";
|
|
8725
8706
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
8726
8707
|
import { configDefaults } from "vitest/config";
|
|
8727
8708
|
import { startVitest } from "vitest/node";
|
|
8728
8709
|
var NullReporter = class {
|
|
8729
8710
|
};
|
|
8730
8711
|
var startTest = async (props) => {
|
|
8731
|
-
const __dirname4 =
|
|
8712
|
+
const __dirname4 = dirname10(fileURLToPath4(import.meta.url));
|
|
8732
8713
|
const startTime = process.hrtime.bigint();
|
|
8733
8714
|
process.noDeprecation = true;
|
|
8734
8715
|
const vitest = await startVitest(
|
|
@@ -8775,10 +8756,10 @@ var startTest = async (props) => {
|
|
|
8775
8756
|
{
|
|
8776
8757
|
plugins: [
|
|
8777
8758
|
// @ts-ignore
|
|
8778
|
-
|
|
8759
|
+
commonjs({ sourceMap: true }),
|
|
8779
8760
|
// @ts-ignore
|
|
8780
8761
|
nodeResolve2({ preferBuiltins: true }),
|
|
8781
|
-
|
|
8762
|
+
swc({
|
|
8782
8763
|
jsc: {
|
|
8783
8764
|
// baseUrl: dirname(input),
|
|
8784
8765
|
minify: { sourceMap: true }
|
|
@@ -8786,7 +8767,7 @@ var startTest = async (props) => {
|
|
|
8786
8767
|
sourceMaps: true
|
|
8787
8768
|
}),
|
|
8788
8769
|
// @ts-ignore
|
|
8789
|
-
|
|
8770
|
+
json()
|
|
8790
8771
|
]
|
|
8791
8772
|
}
|
|
8792
8773
|
);
|
|
@@ -9305,7 +9286,7 @@ import { log as log20 } from "@awsless/clui";
|
|
|
9305
9286
|
|
|
9306
9287
|
// src/type-gen/generate.ts
|
|
9307
9288
|
import { mkdir as mkdir5, writeFile as writeFile4 } from "fs/promises";
|
|
9308
|
-
import { dirname as
|
|
9289
|
+
import { dirname as dirname11, join as join20, relative as relative7 } from "path";
|
|
9309
9290
|
var generateTypes = async (props) => {
|
|
9310
9291
|
const files = [];
|
|
9311
9292
|
await Promise.all(
|
|
@@ -9319,7 +9300,7 @@ var generateTypes = async (props) => {
|
|
|
9319
9300
|
if (include) {
|
|
9320
9301
|
files.push(relative7(directories.root, path));
|
|
9321
9302
|
}
|
|
9322
|
-
await mkdir5(
|
|
9303
|
+
await mkdir5(dirname11(path), { recursive: true });
|
|
9323
9304
|
await writeFile4(path, code);
|
|
9324
9305
|
}
|
|
9325
9306
|
}
|
|
@@ -9792,28 +9773,28 @@ var formatLog = (level, date, group, message) => {
|
|
|
9792
9773
|
);
|
|
9793
9774
|
};
|
|
9794
9775
|
var parseJsonLog = (message) => {
|
|
9795
|
-
let
|
|
9776
|
+
let json2;
|
|
9796
9777
|
try {
|
|
9797
|
-
|
|
9778
|
+
json2 = JSON.parse(message);
|
|
9798
9779
|
} catch (error) {
|
|
9799
9780
|
}
|
|
9800
|
-
if ("level" in
|
|
9781
|
+
if ("level" in json2 && typeof json2.level === "string" && "timestamp" in json2 && typeof json2.timestamp === "string" && "message" in json2) {
|
|
9801
9782
|
return {
|
|
9802
|
-
level:
|
|
9803
|
-
message: typeof
|
|
9804
|
-
date: new Date(
|
|
9783
|
+
level: json2.level,
|
|
9784
|
+
message: typeof json2.message === "string" ? json2.message : JSON.stringify(json2.message, void 0, 2),
|
|
9785
|
+
date: new Date(json2.timestamp)
|
|
9805
9786
|
};
|
|
9806
9787
|
}
|
|
9807
|
-
if ("type" in
|
|
9788
|
+
if ("type" in json2 && typeof json2.type === "string" && json2.type.startsWith("platform") && "time" in json2 && typeof json2.time === "string" && "record" in json2) {
|
|
9808
9789
|
return {
|
|
9809
9790
|
level: "SYSTEM",
|
|
9810
|
-
message: JSON.stringify(
|
|
9811
|
-
date: new Date(
|
|
9791
|
+
message: JSON.stringify(json2.record, void 0, 2),
|
|
9792
|
+
date: new Date(json2.time)
|
|
9812
9793
|
};
|
|
9813
9794
|
}
|
|
9814
9795
|
return {
|
|
9815
9796
|
level: "INFO",
|
|
9816
|
-
message: JSON.stringify(
|
|
9797
|
+
message: JSON.stringify(json2, void 0, 2)
|
|
9817
9798
|
};
|
|
9818
9799
|
};
|
|
9819
9800
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awsless/awsless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.596",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -37,18 +37,18 @@
|
|
|
37
37
|
"@awsless/cloudwatch": "^0.0.1",
|
|
38
38
|
"@awsless/clui": "^0.0.8",
|
|
39
39
|
"@awsless/duration": "^0.0.4",
|
|
40
|
-
"@awsless/iot": "^0.0.3",
|
|
41
40
|
"@awsless/dynamodb": "^0.3.8",
|
|
42
|
-
"@awsless/
|
|
41
|
+
"@awsless/iot": "^0.0.3",
|
|
43
42
|
"@awsless/lambda": "^0.0.35",
|
|
44
|
-
"@awsless/
|
|
43
|
+
"@awsless/open-search": "^0.0.21",
|
|
45
44
|
"@awsless/s3": "^0.0.21",
|
|
46
|
-
"@awsless/redis": "^0.0.14",
|
|
47
45
|
"@awsless/sqs": "^0.0.16",
|
|
46
|
+
"@awsless/ssm": "^0.0.7",
|
|
48
47
|
"@awsless/sns": "^0.0.10",
|
|
49
|
-
"@awsless/
|
|
48
|
+
"@awsless/json": "^0.0.10",
|
|
50
49
|
"@awsless/validate": "^0.1.3",
|
|
51
|
-
"@awsless/
|
|
50
|
+
"@awsless/mqtt": "^0.0.2",
|
|
51
|
+
"@awsless/redis": "^0.0.14",
|
|
52
52
|
"@awsless/weak-cache": "^0.0.1"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"pretty-hrtime": "^1.0.3",
|
|
122
122
|
"promise-dag": "^1.0.0",
|
|
123
123
|
"promisify-child-process": "^4.1.2",
|
|
124
|
-
"rolldown": "1.0.0-
|
|
124
|
+
"rolldown": "1.0.0-rc.3",
|
|
125
125
|
"rollup": "^4.18.0",
|
|
126
126
|
"rollup-plugin-natives": "^0.7.8",
|
|
127
127
|
"rollup-plugin-replace": "^2.2.0",
|
|
@@ -141,17 +141,19 @@
|
|
|
141
141
|
"zod-to-json-schema": "^3.24.3",
|
|
142
142
|
"@awsless/big-float": "^0.1.5",
|
|
143
143
|
"@awsless/cloudwatch": "^0.0.1",
|
|
144
|
-
"@awsless/duration": "^0.0.4",
|
|
145
144
|
"@awsless/graphql": "^0.0.9",
|
|
145
|
+
"@awsless/duration": "^0.0.4",
|
|
146
146
|
"@awsless/json": "^0.0.10",
|
|
147
|
-
"@awsless/size": "^0.0.2",
|
|
148
|
-
"@awsless/ts-file-cache": "^0.0.12",
|
|
149
147
|
"@awsless/scheduler": "^0.0.4",
|
|
148
|
+
"@awsless/size": "^0.0.2",
|
|
150
149
|
"@awsless/validate": "^0.1.3",
|
|
151
|
-
"@awsless/clui": "^0.0.8"
|
|
150
|
+
"@awsless/clui": "^0.0.8",
|
|
151
|
+
"@awsless/ts-file-cache": "^0.0.12"
|
|
152
152
|
},
|
|
153
153
|
"devDependencies": {
|
|
154
|
+
"@hono/node-server": "1.19.9",
|
|
154
155
|
"@node-rs/bcrypt": "^1.10.5",
|
|
156
|
+
"hono": "4.11.7",
|
|
155
157
|
"sharp": "^0.34.2"
|
|
156
158
|
},
|
|
157
159
|
"scripts": {
|