@awsless/awsless 0.0.595 → 0.0.597
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 +116 -134
- 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,74 @@ var zipBundle = async ({ directory }) => {
|
|
|
3365
3275
|
});
|
|
3366
3276
|
};
|
|
3367
3277
|
|
|
3278
|
+
// src/feature/function/build/typescript/rolldown.ts
|
|
3279
|
+
import { createHash as createHash3 } from "crypto";
|
|
3280
|
+
import { rolldown } from "rolldown";
|
|
3281
|
+
import { importAsString } from "rollup-plugin-string-import";
|
|
3282
|
+
var bundleTypeScriptWithRolldown = async ({
|
|
3283
|
+
format: format2 = "esm",
|
|
3284
|
+
minify = true,
|
|
3285
|
+
file,
|
|
3286
|
+
nativeDir,
|
|
3287
|
+
external,
|
|
3288
|
+
importAsString: importAsStringList
|
|
3289
|
+
}) => {
|
|
3290
|
+
const bundle = await rolldown({
|
|
3291
|
+
input: file,
|
|
3292
|
+
platform: "node",
|
|
3293
|
+
external: (importee) => {
|
|
3294
|
+
return importee.startsWith("@aws-sdk") || importee.startsWith("aws-sdk") || external?.includes(importee);
|
|
3295
|
+
},
|
|
3296
|
+
onwarn: (error) => {
|
|
3297
|
+
debugError(error.message);
|
|
3298
|
+
},
|
|
3299
|
+
treeshake: {
|
|
3300
|
+
moduleSideEffects: (id) => file === id
|
|
3301
|
+
},
|
|
3302
|
+
plugins: [
|
|
3303
|
+
// nodeResolve({ preferBuiltins: true }),
|
|
3304
|
+
// nativeDir
|
|
3305
|
+
// ? natives({
|
|
3306
|
+
// copyTo: nativeDir,
|
|
3307
|
+
// targetEsm: format === 'esm',
|
|
3308
|
+
// sourcemap: true,
|
|
3309
|
+
// })
|
|
3310
|
+
// : undefined,
|
|
3311
|
+
importAsStringList ? importAsString({
|
|
3312
|
+
include: importAsStringList
|
|
3313
|
+
}) : void 0
|
|
3314
|
+
]
|
|
3315
|
+
});
|
|
3316
|
+
const ext = format2 === "esm" ? "mjs" : "js";
|
|
3317
|
+
const result = await bundle.generate({
|
|
3318
|
+
format: format2,
|
|
3319
|
+
sourcemap: "hidden",
|
|
3320
|
+
exports: "auto",
|
|
3321
|
+
entryFileNames: `index.${ext}`,
|
|
3322
|
+
chunkFileNames: `[name].${ext}`,
|
|
3323
|
+
minify
|
|
3324
|
+
});
|
|
3325
|
+
const hash = createHash3("sha1");
|
|
3326
|
+
const files = [];
|
|
3327
|
+
for (const item of result.output) {
|
|
3328
|
+
if (item.type !== "chunk") {
|
|
3329
|
+
continue;
|
|
3330
|
+
}
|
|
3331
|
+
const code = Buffer.from(item.code, "utf8");
|
|
3332
|
+
const map = item.map ? Buffer.from(item.map.toString(), "utf8") : void 0;
|
|
3333
|
+
hash.update(code);
|
|
3334
|
+
files.push({
|
|
3335
|
+
name: item.fileName,
|
|
3336
|
+
code,
|
|
3337
|
+
map
|
|
3338
|
+
});
|
|
3339
|
+
}
|
|
3340
|
+
return {
|
|
3341
|
+
hash: hash.digest("hex"),
|
|
3342
|
+
files
|
|
3343
|
+
};
|
|
3344
|
+
};
|
|
3345
|
+
|
|
3368
3346
|
// src/feature/function/util.ts
|
|
3369
3347
|
var createLambdaFunction = (parentGroup, ctx, ns, id, local) => {
|
|
3370
3348
|
let name;
|
|
@@ -3400,7 +3378,7 @@ var createLambdaFunction = (parentGroup, ctx, ns, id, local) => {
|
|
|
3400
3378
|
const fingerprint = await generateFileHash(workspace, fileCode.file);
|
|
3401
3379
|
return build3(fingerprint, async (write) => {
|
|
3402
3380
|
const temp = await createTempFolder(`function--${name}`);
|
|
3403
|
-
const bundle = await
|
|
3381
|
+
const bundle = await bundleTypeScriptWithRolldown({
|
|
3404
3382
|
file: fileCode.file,
|
|
3405
3383
|
external: [
|
|
3406
3384
|
...fileCode.external ?? [],
|
|
@@ -4569,7 +4547,7 @@ import { camelCase as camelCase5, kebabCase as kebabCase6 } from "change-case";
|
|
|
4569
4547
|
import { Group as Group13 } from "@terraforge/core";
|
|
4570
4548
|
import { aws as aws14 } from "@terraforge/aws";
|
|
4571
4549
|
import { mebibytes as mebibytes3 } from "@awsless/size";
|
|
4572
|
-
import { dirname as
|
|
4550
|
+
import { dirname as dirname5, join as join10, relative as relative5 } from "path";
|
|
4573
4551
|
import { fileURLToPath } from "node:url";
|
|
4574
4552
|
|
|
4575
4553
|
// src/feature/function/prebuild.ts
|
|
@@ -4761,7 +4739,7 @@ var createPrebuildLambdaFunction = (group, ctx, ns, id, props) => {
|
|
|
4761
4739
|
|
|
4762
4740
|
// src/feature/rpc/index.ts
|
|
4763
4741
|
import { toSeconds as toSeconds6 } from "@awsless/duration";
|
|
4764
|
-
var __dirname =
|
|
4742
|
+
var __dirname = dirname5(fileURLToPath(import.meta.url));
|
|
4765
4743
|
var rpcFeature = defineFeature({
|
|
4766
4744
|
name: "rpc",
|
|
4767
4745
|
async onTypeGen(ctx) {
|
|
@@ -5081,7 +5059,7 @@ var searchFeature = defineFeature({
|
|
|
5081
5059
|
import { Group as Group15 } from "@terraforge/core";
|
|
5082
5060
|
import { aws as aws16 } from "@terraforge/aws";
|
|
5083
5061
|
import { glob as glob2 } from "glob";
|
|
5084
|
-
import { dirname as
|
|
5062
|
+
import { dirname as dirname6, join as join11 } from "path";
|
|
5085
5063
|
|
|
5086
5064
|
// src/feature/site/util.ts
|
|
5087
5065
|
import { contentType, lookup } from "mime-types";
|
|
@@ -5141,7 +5119,7 @@ var siteFeature = defineFeature({
|
|
|
5141
5119
|
return build3(fingerprint, async (write) => {
|
|
5142
5120
|
const credentialProvider = await getCredentials(ctx.appConfig.profile);
|
|
5143
5121
|
const credentials = await credentialProvider();
|
|
5144
|
-
const cwd = join11(directories.root,
|
|
5122
|
+
const cwd = join11(directories.root, dirname6(ctx.stackConfig.file));
|
|
5145
5123
|
const env = {
|
|
5146
5124
|
// Pass the app config name
|
|
5147
5125
|
APP: ctx.appConfig.name,
|
|
@@ -6103,6 +6081,9 @@ var layerFeature = defineFeature({
|
|
|
6103
6081
|
resourceName: "assets",
|
|
6104
6082
|
postfix: ctx.appId
|
|
6105
6083
|
}),
|
|
6084
|
+
versioning: {
|
|
6085
|
+
enabled: true
|
|
6086
|
+
},
|
|
6106
6087
|
forceDestroy: true
|
|
6107
6088
|
});
|
|
6108
6089
|
ctx.shared.set("layer", "bucket-name", bucket.bucket);
|
|
@@ -6153,10 +6134,12 @@ var layerFeature = defineFeature({
|
|
|
6153
6134
|
}
|
|
6154
6135
|
return name;
|
|
6155
6136
|
}),
|
|
6156
|
-
sourceCodeHash: $hash(props.file)
|
|
6137
|
+
sourceCodeHash: $hash(props.file),
|
|
6138
|
+
skipDestroy: true
|
|
6157
6139
|
},
|
|
6158
6140
|
{
|
|
6159
|
-
dependsOn: [zip]
|
|
6141
|
+
dependsOn: [zip],
|
|
6142
|
+
replaceOnChanges: ["sourceCodeHash"]
|
|
6160
6143
|
}
|
|
6161
6144
|
);
|
|
6162
6145
|
ctx.shared.add("layer", "arn", id, layer.arn);
|
|
@@ -6168,12 +6151,12 @@ var layerFeature = defineFeature({
|
|
|
6168
6151
|
// src/feature/image/index.ts
|
|
6169
6152
|
import { Group as Group23 } from "@terraforge/core";
|
|
6170
6153
|
import { aws as aws24 } from "@terraforge/aws";
|
|
6171
|
-
import { join as join13, dirname as
|
|
6154
|
+
import { join as join13, dirname as dirname7 } from "path";
|
|
6172
6155
|
import { mebibytes as mebibytes4 } from "@awsless/size";
|
|
6173
6156
|
import { seconds as seconds7, toDays as toDays6 } from "@awsless/duration";
|
|
6174
6157
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
6175
6158
|
import { glob as glob4 } from "glob";
|
|
6176
|
-
var __dirname2 =
|
|
6159
|
+
var __dirname2 = dirname7(fileURLToPath2(import.meta.url));
|
|
6177
6160
|
var imageFeature = defineFeature({
|
|
6178
6161
|
name: "image",
|
|
6179
6162
|
onApp(ctx) {
|
|
@@ -6356,12 +6339,12 @@ var imageFeature = defineFeature({
|
|
|
6356
6339
|
// src/feature/icon/index.ts
|
|
6357
6340
|
import { Group as Group24 } from "@terraforge/core";
|
|
6358
6341
|
import { aws as aws25 } from "@terraforge/aws";
|
|
6359
|
-
import { join as join14, dirname as
|
|
6342
|
+
import { join as join14, dirname as dirname8 } from "path";
|
|
6360
6343
|
import { mebibytes as mebibytes5 } from "@awsless/size";
|
|
6361
6344
|
import { seconds as seconds8, toDays as toDays7 } from "@awsless/duration";
|
|
6362
6345
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
6363
6346
|
import { glob as glob5 } from "glob";
|
|
6364
|
-
var __dirname3 =
|
|
6347
|
+
var __dirname3 = dirname8(fileURLToPath3(import.meta.url));
|
|
6365
6348
|
var iconFeature = defineFeature({
|
|
6366
6349
|
name: "icon",
|
|
6367
6350
|
onStack(ctx) {
|
|
@@ -6530,8 +6513,7 @@ var buildExecutable = async (input, outputPath, architecture) => {
|
|
|
6530
6513
|
target,
|
|
6531
6514
|
outfile: filePath
|
|
6532
6515
|
},
|
|
6533
|
-
target: "bun"
|
|
6534
|
-
bytecode: true
|
|
6516
|
+
target: "bun"
|
|
6535
6517
|
});
|
|
6536
6518
|
} catch (error) {
|
|
6537
6519
|
throw new ExpectedError(
|
|
@@ -8654,7 +8636,7 @@ import wildstring3 from "wildstring";
|
|
|
8654
8636
|
// src/build/__fingerprint.ts
|
|
8655
8637
|
import { createHash as createHash6 } from "crypto";
|
|
8656
8638
|
import { readdir as readdir4, readFile as readFile5, stat as stat4 } from "fs/promises";
|
|
8657
|
-
import { basename as basename4, dirname as
|
|
8639
|
+
import { basename as basename4, dirname as dirname9, extname as extname4, join as join17 } from "path";
|
|
8658
8640
|
import parseStaticImports from "parse-static-imports";
|
|
8659
8641
|
var extensions = ["js", "mjs", "jsx", "ts", "mts", "tsx"];
|
|
8660
8642
|
var generateFileHashes = async (file, hashes) => {
|
|
@@ -8710,25 +8692,25 @@ var readFiles = async (files) => {
|
|
|
8710
8692
|
};
|
|
8711
8693
|
var findDependencies = async (file, code) => {
|
|
8712
8694
|
const imports = await parseStaticImports(code);
|
|
8713
|
-
return imports.map((entry) => entry.moduleName).filter(Boolean).map((value) => value?.startsWith(".") ? join17(
|
|
8695
|
+
return imports.map((entry) => entry.moduleName).filter(Boolean).map((value) => value?.startsWith(".") ? join17(dirname9(file), value) : value);
|
|
8714
8696
|
};
|
|
8715
8697
|
|
|
8716
8698
|
// src/cli/ui/complex/run-tests.ts
|
|
8717
8699
|
import { parse as parse4, stringify } from "@awsless/json";
|
|
8718
8700
|
|
|
8719
8701
|
// src/test/start.ts
|
|
8720
|
-
import
|
|
8721
|
-
import
|
|
8722
|
-
import
|
|
8723
|
-
import { dirname as
|
|
8724
|
-
import { swc
|
|
8702
|
+
import commonjs from "@rollup/plugin-commonjs";
|
|
8703
|
+
import json from "@rollup/plugin-json";
|
|
8704
|
+
import nodeResolve from "@rollup/plugin-node-resolve";
|
|
8705
|
+
import { dirname as dirname10, join as join18 } from "path";
|
|
8706
|
+
import { swc } from "rollup-plugin-swc3";
|
|
8725
8707
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
8726
8708
|
import { configDefaults } from "vitest/config";
|
|
8727
8709
|
import { startVitest } from "vitest/node";
|
|
8728
8710
|
var NullReporter = class {
|
|
8729
8711
|
};
|
|
8730
8712
|
var startTest = async (props) => {
|
|
8731
|
-
const __dirname4 =
|
|
8713
|
+
const __dirname4 = dirname10(fileURLToPath4(import.meta.url));
|
|
8732
8714
|
const startTime = process.hrtime.bigint();
|
|
8733
8715
|
process.noDeprecation = true;
|
|
8734
8716
|
const vitest = await startVitest(
|
|
@@ -8775,10 +8757,10 @@ var startTest = async (props) => {
|
|
|
8775
8757
|
{
|
|
8776
8758
|
plugins: [
|
|
8777
8759
|
// @ts-ignore
|
|
8778
|
-
|
|
8760
|
+
commonjs({ sourceMap: true }),
|
|
8779
8761
|
// @ts-ignore
|
|
8780
|
-
|
|
8781
|
-
|
|
8762
|
+
nodeResolve({ preferBuiltins: true }),
|
|
8763
|
+
swc({
|
|
8782
8764
|
jsc: {
|
|
8783
8765
|
// baseUrl: dirname(input),
|
|
8784
8766
|
minify: { sourceMap: true }
|
|
@@ -8786,7 +8768,7 @@ var startTest = async (props) => {
|
|
|
8786
8768
|
sourceMaps: true
|
|
8787
8769
|
}),
|
|
8788
8770
|
// @ts-ignore
|
|
8789
|
-
|
|
8771
|
+
json()
|
|
8790
8772
|
]
|
|
8791
8773
|
}
|
|
8792
8774
|
);
|
|
@@ -9305,7 +9287,7 @@ import { log as log20 } from "@awsless/clui";
|
|
|
9305
9287
|
|
|
9306
9288
|
// src/type-gen/generate.ts
|
|
9307
9289
|
import { mkdir as mkdir5, writeFile as writeFile4 } from "fs/promises";
|
|
9308
|
-
import { dirname as
|
|
9290
|
+
import { dirname as dirname11, join as join20, relative as relative7 } from "path";
|
|
9309
9291
|
var generateTypes = async (props) => {
|
|
9310
9292
|
const files = [];
|
|
9311
9293
|
await Promise.all(
|
|
@@ -9319,7 +9301,7 @@ var generateTypes = async (props) => {
|
|
|
9319
9301
|
if (include) {
|
|
9320
9302
|
files.push(relative7(directories.root, path));
|
|
9321
9303
|
}
|
|
9322
|
-
await mkdir5(
|
|
9304
|
+
await mkdir5(dirname11(path), { recursive: true });
|
|
9323
9305
|
await writeFile4(path, code);
|
|
9324
9306
|
}
|
|
9325
9307
|
}
|
|
@@ -9792,28 +9774,28 @@ var formatLog = (level, date, group, message) => {
|
|
|
9792
9774
|
);
|
|
9793
9775
|
};
|
|
9794
9776
|
var parseJsonLog = (message) => {
|
|
9795
|
-
let
|
|
9777
|
+
let json2;
|
|
9796
9778
|
try {
|
|
9797
|
-
|
|
9779
|
+
json2 = JSON.parse(message);
|
|
9798
9780
|
} catch (error) {
|
|
9799
9781
|
}
|
|
9800
|
-
if ("level" in
|
|
9782
|
+
if ("level" in json2 && typeof json2.level === "string" && "timestamp" in json2 && typeof json2.timestamp === "string" && "message" in json2) {
|
|
9801
9783
|
return {
|
|
9802
|
-
level:
|
|
9803
|
-
message: typeof
|
|
9804
|
-
date: new Date(
|
|
9784
|
+
level: json2.level,
|
|
9785
|
+
message: typeof json2.message === "string" ? json2.message : JSON.stringify(json2.message, void 0, 2),
|
|
9786
|
+
date: new Date(json2.timestamp)
|
|
9805
9787
|
};
|
|
9806
9788
|
}
|
|
9807
|
-
if ("type" in
|
|
9789
|
+
if ("type" in json2 && typeof json2.type === "string" && json2.type.startsWith("platform") && "time" in json2 && typeof json2.time === "string" && "record" in json2) {
|
|
9808
9790
|
return {
|
|
9809
9791
|
level: "SYSTEM",
|
|
9810
|
-
message: JSON.stringify(
|
|
9811
|
-
date: new Date(
|
|
9792
|
+
message: JSON.stringify(json2.record, void 0, 2),
|
|
9793
|
+
date: new Date(json2.time)
|
|
9812
9794
|
};
|
|
9813
9795
|
}
|
|
9814
9796
|
return {
|
|
9815
9797
|
level: "INFO",
|
|
9816
|
-
message: JSON.stringify(
|
|
9798
|
+
message: JSON.stringify(json2, void 0, 2)
|
|
9817
9799
|
};
|
|
9818
9800
|
};
|
|
9819
9801
|
|
|
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.597",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -35,21 +35,21 @@
|
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@awsless/big-float": "^0.1.5",
|
|
37
37
|
"@awsless/cloudwatch": "^0.0.1",
|
|
38
|
-
"@awsless/clui": "^0.0.8",
|
|
39
38
|
"@awsless/duration": "^0.0.4",
|
|
40
|
-
"@awsless/iot": "^0.0.3",
|
|
41
|
-
"@awsless/dynamodb": "^0.3.8",
|
|
42
39
|
"@awsless/json": "^0.0.10",
|
|
40
|
+
"@awsless/clui": "^0.0.8",
|
|
41
|
+
"@awsless/dynamodb": "^0.3.8",
|
|
42
|
+
"@awsless/iot": "^0.0.3",
|
|
43
43
|
"@awsless/lambda": "^0.0.35",
|
|
44
|
-
"@awsless/mqtt": "^0.0.2",
|
|
45
|
-
"@awsless/s3": "^0.0.21",
|
|
46
44
|
"@awsless/redis": "^0.0.14",
|
|
45
|
+
"@awsless/s3": "^0.0.21",
|
|
46
|
+
"@awsless/ssm": "^0.0.7",
|
|
47
47
|
"@awsless/sqs": "^0.0.16",
|
|
48
|
-
"@awsless/sns": "^0.0.10",
|
|
49
48
|
"@awsless/open-search": "^0.0.21",
|
|
49
|
+
"@awsless/sns": "^0.0.10",
|
|
50
50
|
"@awsless/validate": "^0.1.3",
|
|
51
|
-
"@awsless/
|
|
52
|
-
"@awsless/
|
|
51
|
+
"@awsless/weak-cache": "^0.0.1",
|
|
52
|
+
"@awsless/mqtt": "^0.0.2"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@arcanyx/cidr-slicer": "^0.3.0",
|
|
@@ -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",
|
|
@@ -142,16 +142,18 @@
|
|
|
142
142
|
"@awsless/big-float": "^0.1.5",
|
|
143
143
|
"@awsless/cloudwatch": "^0.0.1",
|
|
144
144
|
"@awsless/duration": "^0.0.4",
|
|
145
|
-
"@awsless/graphql": "^0.0.9",
|
|
146
145
|
"@awsless/json": "^0.0.10",
|
|
146
|
+
"@awsless/graphql": "^0.0.9",
|
|
147
147
|
"@awsless/size": "^0.0.2",
|
|
148
|
-
"@awsless/ts-file-cache": "^0.0.12",
|
|
149
148
|
"@awsless/scheduler": "^0.0.4",
|
|
150
149
|
"@awsless/validate": "^0.1.3",
|
|
150
|
+
"@awsless/ts-file-cache": "^0.0.12",
|
|
151
151
|
"@awsless/clui": "^0.0.8"
|
|
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": {
|