@awsless/awsless 0.0.644 → 0.0.646
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 +32 -30
- 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 +13 -13
package/dist/bin.js
CHANGED
|
@@ -4533,6 +4533,7 @@ var formatFullDomainName = (config2, id, subDomain) => {
|
|
|
4533
4533
|
};
|
|
4534
4534
|
|
|
4535
4535
|
// src/feature/pubsub/index.ts
|
|
4536
|
+
import { minutes as minutes7, toSeconds as toSeconds4 } from "@awsless/duration";
|
|
4536
4537
|
var pubsubFeature = defineFeature({
|
|
4537
4538
|
name: "pubsub",
|
|
4538
4539
|
onApp(ctx) {
|
|
@@ -4583,6 +4584,7 @@ var pubsubFeature = defineFeature({
|
|
|
4583
4584
|
zoneId: ctx.shared.entry("domain", `zone-id`, props.domain),
|
|
4584
4585
|
name: domainName,
|
|
4585
4586
|
type: "CNAME",
|
|
4587
|
+
ttl: toSeconds4(minutes7(5)),
|
|
4586
4588
|
records: [endpoint.endpointAddress]
|
|
4587
4589
|
});
|
|
4588
4590
|
ctx.bind(`PUBSUB_${constantCase5(id)}_ENDPOINT`, domainName);
|
|
@@ -4624,7 +4626,7 @@ import { aws as aws11 } from "@terraforge/aws";
|
|
|
4624
4626
|
import { camelCase as camelCase5, constantCase as constantCase6 } from "change-case";
|
|
4625
4627
|
import deepmerge3 from "deepmerge";
|
|
4626
4628
|
import { relative as relative5 } from "path";
|
|
4627
|
-
import { seconds as seconds5, toSeconds as
|
|
4629
|
+
import { seconds as seconds5, toSeconds as toSeconds5 } from "@awsless/duration";
|
|
4628
4630
|
import { toBytes } from "@awsless/size";
|
|
4629
4631
|
var typeGenCode4 = `
|
|
4630
4632
|
import { SendMessageOptions, SendMessageBatchOptions, BatchItem } from '@awsless/sqs'
|
|
@@ -4697,10 +4699,10 @@ var queueFeature = defineFeature({
|
|
|
4697
4699
|
const onFailure = getGlobalOnFailure(ctx);
|
|
4698
4700
|
const queue2 = new aws11.sqs.Queue(group, "queue", {
|
|
4699
4701
|
name,
|
|
4700
|
-
delaySeconds:
|
|
4701
|
-
visibilityTimeoutSeconds:
|
|
4702
|
-
receiveWaitTimeSeconds:
|
|
4703
|
-
messageRetentionSeconds:
|
|
4702
|
+
delaySeconds: toSeconds5(props.deliveryDelay),
|
|
4703
|
+
visibilityTimeoutSeconds: toSeconds5(props.visibilityTimeout),
|
|
4704
|
+
receiveWaitTimeSeconds: toSeconds5(props.receiveMessageWaitTime ?? seconds5(0)),
|
|
4705
|
+
messageRetentionSeconds: toSeconds5(props.retentionPeriod),
|
|
4704
4706
|
maxMessageSize: toBytes(props.maxMessageSize),
|
|
4705
4707
|
redrivePolicy: onFailure.pipe(
|
|
4706
4708
|
(arn) => JSON.stringify({
|
|
@@ -4719,7 +4721,7 @@ var queueFeature = defineFeature({
|
|
|
4719
4721
|
functionName: lambdaConsumer.lambda.functionName,
|
|
4720
4722
|
eventSourceArn: queue2.arn,
|
|
4721
4723
|
batchSize: props.batchSize,
|
|
4722
|
-
maximumBatchingWindowInSeconds: props.maxBatchingWindow &&
|
|
4724
|
+
maximumBatchingWindowInSeconds: props.maxBatchingWindow && toSeconds5(props.maxBatchingWindow),
|
|
4723
4725
|
scalingConfig: {
|
|
4724
4726
|
maximumConcurrency: props.maxConcurrency
|
|
4725
4727
|
}
|
|
@@ -4873,7 +4875,7 @@ import { dirname as dirname5, join as join10, relative as relative6 } from "path
|
|
|
4873
4875
|
import { fileURLToPath } from "node:url";
|
|
4874
4876
|
|
|
4875
4877
|
// src/feature/function/prebuild.ts
|
|
4876
|
-
import { days as days6, seconds as seconds6, toDays as toDays5, toSeconds as
|
|
4878
|
+
import { days as days6, seconds as seconds6, toDays as toDays5, toSeconds as toSeconds6 } from "@awsless/duration";
|
|
4877
4879
|
import { mebibytes as mebibytes2, toMebibytes as toMebibytes3 } from "@awsless/size";
|
|
4878
4880
|
import { aws as aws13 } from "@terraforge/aws";
|
|
4879
4881
|
import { Output as Output4, findInputDeps as findInputDeps2, resolveInputs as resolveInputs2 } from "@terraforge/core";
|
|
@@ -4970,7 +4972,7 @@ var createPrebuildLambdaFunction = (group, ctx, ns, id, props) => {
|
|
|
4970
4972
|
// runtime: props.runtime === 'container' ? undefined : props.runtime,
|
|
4971
4973
|
runtime: props.runtime,
|
|
4972
4974
|
handler: props.handler,
|
|
4973
|
-
timeout:
|
|
4975
|
+
timeout: toSeconds6(props.timeout ?? seconds6(10)),
|
|
4974
4976
|
memorySize: toMebibytes3(props.memorySize ?? mebibytes2(128)),
|
|
4975
4977
|
architectures: [props.architecture ?? "arm64"],
|
|
4976
4978
|
layers: props.layers?.map((id2) => ctx.shared.entry("layer", "arn", id2)),
|
|
@@ -5060,7 +5062,7 @@ var createPrebuildLambdaFunction = (group, ctx, ns, id, props) => {
|
|
|
5060
5062
|
};
|
|
5061
5063
|
|
|
5062
5064
|
// src/feature/rpc/index.ts
|
|
5063
|
-
import { toSeconds as
|
|
5065
|
+
import { toSeconds as toSeconds7 } from "@awsless/duration";
|
|
5064
5066
|
var __dirname = dirname5(fileURLToPath(import.meta.url));
|
|
5065
5067
|
var rpcFeature = defineFeature({
|
|
5066
5068
|
name: "rpc",
|
|
@@ -5105,8 +5107,8 @@ var rpcFeature = defineFeature({
|
|
|
5105
5107
|
} else {
|
|
5106
5108
|
list3.add(name);
|
|
5107
5109
|
}
|
|
5108
|
-
const timeout =
|
|
5109
|
-
const maxTimeout =
|
|
5110
|
+
const timeout = toSeconds7(props.function.timeout ?? ctx.appConfig.defaults.function.timeout);
|
|
5111
|
+
const maxTimeout = toSeconds7(ctx.appConfig.defaults.rpc[id].timeout) * 0.8;
|
|
5110
5112
|
if (timeout > maxTimeout) {
|
|
5111
5113
|
throw new FileError(
|
|
5112
5114
|
stack.file,
|
|
@@ -5130,7 +5132,7 @@ var rpcFeature = defineFeature({
|
|
|
5130
5132
|
warm: 3,
|
|
5131
5133
|
log: props.log
|
|
5132
5134
|
});
|
|
5133
|
-
result.setEnvironment("TIMEOUT",
|
|
5135
|
+
result.setEnvironment("TIMEOUT", toSeconds7(props.timeout).toString());
|
|
5134
5136
|
const schemaTable = new aws14.dynamodb.Table(group, "schema", {
|
|
5135
5137
|
name: formatGlobalResourceName({
|
|
5136
5138
|
appName: ctx.app.name,
|
|
@@ -5806,7 +5808,7 @@ var storeFeature = defineFeature({
|
|
|
5806
5808
|
import { Group as Group17 } from "@terraforge/core";
|
|
5807
5809
|
import { aws as aws18 } from "@terraforge/aws";
|
|
5808
5810
|
import { constantCase as constantCase11 } from "change-case";
|
|
5809
|
-
import { toSeconds as
|
|
5811
|
+
import { toSeconds as toSeconds8 } from "@awsless/duration";
|
|
5810
5812
|
var tableFeature = defineFeature({
|
|
5811
5813
|
name: "table",
|
|
5812
5814
|
async onTypeGen(ctx) {
|
|
@@ -5938,7 +5940,7 @@ var tableFeature = defineFeature({
|
|
|
5938
5940
|
// maximumRecordAgeInSeconds: props.stream.
|
|
5939
5941
|
// bisectBatchOnFunctionError: true,
|
|
5940
5942
|
batchSize: props.stream.batchSize,
|
|
5941
|
-
maximumBatchingWindowInSeconds: props.stream.batchWindow ?
|
|
5943
|
+
maximumBatchingWindowInSeconds: props.stream.batchWindow ? toSeconds8(props.stream.batchWindow) : void 0,
|
|
5942
5944
|
maximumRetryAttempts: props.stream.retryAttempts,
|
|
5943
5945
|
parallelizationFactor: props.stream.concurrencyPerShard,
|
|
5944
5946
|
functionResponseTypes: ["ReportBatchItemFailures"],
|
|
@@ -6840,7 +6842,7 @@ import { Group as Group26 } from "@terraforge/core";
|
|
|
6840
6842
|
import { aws as aws27 } from "@terraforge/aws";
|
|
6841
6843
|
|
|
6842
6844
|
// src/feature/instance/util.ts
|
|
6843
|
-
import { toDays as toDays8, toSeconds as
|
|
6845
|
+
import { toDays as toDays8, toSeconds as toSeconds9 } from "@awsless/duration";
|
|
6844
6846
|
import { toMebibytes as toMebibytes4 } from "@awsless/size";
|
|
6845
6847
|
import { generateFileHash as generateFileHash2 } from "@awsless/ts-file-cache";
|
|
6846
6848
|
import { aws as aws26 } from "@terraforge/aws";
|
|
@@ -7100,10 +7102,10 @@ var createFargateTask = (parentGroup, ctx, ns, id, local) => {
|
|
|
7100
7102
|
"CMD-SHELL",
|
|
7101
7103
|
`curl -f http://${join16("localhost", props.healthCheck.path)} || exit 1`
|
|
7102
7104
|
],
|
|
7103
|
-
interval:
|
|
7105
|
+
interval: toSeconds9(props.healthCheck.interval),
|
|
7104
7106
|
retries: props.healthCheck.retries,
|
|
7105
|
-
startPeriod:
|
|
7106
|
-
timeout:
|
|
7107
|
+
startPeriod: toSeconds9(props.healthCheck.startPeriod),
|
|
7108
|
+
timeout: toSeconds9(props.healthCheck.timeout)
|
|
7107
7109
|
} : void 0
|
|
7108
7110
|
}
|
|
7109
7111
|
])
|
|
@@ -7247,7 +7249,7 @@ var instanceFeature = defineFeature({
|
|
|
7247
7249
|
import { Group as Group27 } from "@terraforge/core";
|
|
7248
7250
|
import { aws as aws28 } from "@terraforge/aws";
|
|
7249
7251
|
import { kebabCase as kebabCase8, constantCase as constantCase13 } from "change-case";
|
|
7250
|
-
import { toSeconds as
|
|
7252
|
+
import { toSeconds as toSeconds10 } from "@awsless/duration";
|
|
7251
7253
|
var typeGenCode10 = `
|
|
7252
7254
|
import { type PutDataProps, putData, batchPutData } from '@awsless/cloudwatch'
|
|
7253
7255
|
import { type Duration } from '@awsless/duration'
|
|
@@ -7355,7 +7357,7 @@ var metricFeature = defineFeature({
|
|
|
7355
7357
|
alarmDescription: alarmProps.description,
|
|
7356
7358
|
statistic: alarmProps.where.stat,
|
|
7357
7359
|
threshold: alarmProps.where.value,
|
|
7358
|
-
period:
|
|
7360
|
+
period: toSeconds10(alarmProps.period),
|
|
7359
7361
|
evaluationPeriods: alarmProps.minDataPoints,
|
|
7360
7362
|
comparisonOperator: alarmProps.where.op,
|
|
7361
7363
|
alarmActions: [alarmAction]
|
|
@@ -7374,7 +7376,7 @@ var metricFeature = defineFeature({
|
|
|
7374
7376
|
});
|
|
7375
7377
|
|
|
7376
7378
|
// src/feature/router/index.ts
|
|
7377
|
-
import { days as days7, seconds as seconds9, toSeconds as
|
|
7379
|
+
import { days as days7, seconds as seconds9, toSeconds as toSeconds11, years } from "@awsless/duration";
|
|
7378
7380
|
import { Future, Group as Group28 } from "@terraforge/core";
|
|
7379
7381
|
import { aws as aws29 } from "@terraforge/aws";
|
|
7380
7382
|
import { camelCase as camelCase8, constantCase as constantCase14 } from "change-case";
|
|
@@ -7624,9 +7626,9 @@ var routerFeature = defineFeature({
|
|
|
7624
7626
|
});
|
|
7625
7627
|
const cache = new aws29.cloudfront.CachePolicy(group, "cache", {
|
|
7626
7628
|
name,
|
|
7627
|
-
minTtl:
|
|
7628
|
-
maxTtl:
|
|
7629
|
-
defaultTtl:
|
|
7629
|
+
minTtl: toSeconds11(seconds9(0)),
|
|
7630
|
+
maxTtl: toSeconds11(days7(365)),
|
|
7631
|
+
defaultTtl: toSeconds11(days7(0)),
|
|
7630
7632
|
parametersInCacheKeyAndForwardedToOrigin: {
|
|
7631
7633
|
enableAcceptEncodingBrotli: true,
|
|
7632
7634
|
enableAcceptEncodingGzip: true,
|
|
@@ -7676,7 +7678,7 @@ var routerFeature = defineFeature({
|
|
|
7676
7678
|
name,
|
|
7677
7679
|
corsConfig: {
|
|
7678
7680
|
originOverride: props.cors?.override ?? true,
|
|
7679
|
-
accessControlMaxAgeSec:
|
|
7681
|
+
accessControlMaxAgeSec: toSeconds11(props.cors?.maxAge ?? years(1)),
|
|
7680
7682
|
accessControlAllowHeaders: { items: props.cors?.headers ?? ["*"] },
|
|
7681
7683
|
accessControlAllowMethods: { items: props.cors?.methods ?? ["ALL"] },
|
|
7682
7684
|
accessControlAllowOrigins: { items: props.cors?.origins ?? ["*"] },
|
|
@@ -7701,7 +7703,7 @@ var routerFeature = defineFeature({
|
|
|
7701
7703
|
strictTransportSecurity: {
|
|
7702
7704
|
override: true,
|
|
7703
7705
|
preload: true,
|
|
7704
|
-
accessControlMaxAgeSec:
|
|
7706
|
+
accessControlMaxAgeSec: toSeconds11(years(1)),
|
|
7705
7707
|
includeSubdomains: true
|
|
7706
7708
|
},
|
|
7707
7709
|
xssProtection: {
|
|
@@ -7732,7 +7734,7 @@ var routerFeature = defineFeature({
|
|
|
7732
7734
|
rateBasedStatement: {
|
|
7733
7735
|
limit: wafSettingsConfig.rateLimiter.limit,
|
|
7734
7736
|
aggregateKeyType: "IP",
|
|
7735
|
-
evaluationWindowSec:
|
|
7737
|
+
evaluationWindowSec: toSeconds11(wafSettingsConfig.rateLimiter.window)
|
|
7736
7738
|
}
|
|
7737
7739
|
},
|
|
7738
7740
|
action: {
|
|
@@ -7822,12 +7824,12 @@ var routerFeature = defineFeature({
|
|
|
7822
7824
|
rule: wafRules,
|
|
7823
7825
|
captchaConfig: {
|
|
7824
7826
|
immunityTimeProperty: {
|
|
7825
|
-
immunityTime:
|
|
7827
|
+
immunityTime: toSeconds11(wafSettingsConfig.captchaImmunityTime)
|
|
7826
7828
|
}
|
|
7827
7829
|
},
|
|
7828
7830
|
challengeConfig: {
|
|
7829
7831
|
immunityTimeProperty: {
|
|
7830
|
-
immunityTime:
|
|
7832
|
+
immunityTime: toSeconds11(wafSettingsConfig.challengeImmunityTime)
|
|
7831
7833
|
}
|
|
7832
7834
|
},
|
|
7833
7835
|
visibilityConfig: {
|
|
@@ -7883,7 +7885,7 @@ var routerFeature = defineFeature({
|
|
|
7883
7885
|
}
|
|
7884
7886
|
return {
|
|
7885
7887
|
errorCode: Number(errorCode),
|
|
7886
|
-
errorCachingMinTtl: item.minTTL ?
|
|
7888
|
+
errorCachingMinTtl: item.minTTL ? toSeconds11(item.minTTL) : void 0,
|
|
7887
7889
|
responseCode: item.statusCode?.toString() ?? errorCode,
|
|
7888
7890
|
responsePagePath: item.path
|
|
7889
7891
|
};
|
|
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.646",
|
|
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/duration": "^0.0.4",
|
|
39
|
-
"@awsless/clui": "^0.0.8",
|
|
40
|
-
"@awsless/json": "^0.0.11",
|
|
41
|
-
"@awsless/iot": "^0.0.3",
|
|
42
38
|
"@awsless/dynamodb": "^0.3.18",
|
|
39
|
+
"@awsless/json": "^0.0.11",
|
|
40
|
+
"@awsless/duration": "^0.0.4",
|
|
43
41
|
"@awsless/lambda": "^0.0.37",
|
|
42
|
+
"@awsless/clui": "^0.0.8",
|
|
43
|
+
"@awsless/mqtt": "^0.0.2",
|
|
44
44
|
"@awsless/redis": "^0.0.14",
|
|
45
45
|
"@awsless/s3": "^0.0.21",
|
|
46
|
-
"@awsless/
|
|
46
|
+
"@awsless/ssm": "^0.0.7",
|
|
47
|
+
"@awsless/sqs": "^0.0.16",
|
|
47
48
|
"@awsless/open-search": "^0.0.21",
|
|
48
|
-
"@awsless/sns": "^0.0.10",
|
|
49
49
|
"@awsless/validate": "^0.1.5",
|
|
50
|
-
"@awsless/sqs": "^0.0.16",
|
|
51
50
|
"@awsless/weak-cache": "^0.0.1",
|
|
52
|
-
"@awsless/
|
|
51
|
+
"@awsless/sns": "^0.0.10",
|
|
52
|
+
"@awsless/iot": "^0.0.3"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@aws-sdk/client-cloudformation": "^3.369.0",
|
|
@@ -116,12 +116,12 @@
|
|
|
116
116
|
"@awsless/big-float": "^0.1.5",
|
|
117
117
|
"@awsless/cloudwatch": "^0.0.1",
|
|
118
118
|
"@awsless/clui": "^0.0.8",
|
|
119
|
-
"@awsless/
|
|
119
|
+
"@awsless/scheduler": "^0.0.4",
|
|
120
120
|
"@awsless/duration": "^0.0.4",
|
|
121
121
|
"@awsless/size": "^0.0.2",
|
|
122
|
-
"@awsless/
|
|
123
|
-
"@awsless/
|
|
124
|
-
"@awsless/
|
|
122
|
+
"@awsless/validate": "^0.1.5",
|
|
123
|
+
"@awsless/json": "^0.0.11",
|
|
124
|
+
"@awsless/ts-file-cache": "^0.0.12"
|
|
125
125
|
},
|
|
126
126
|
"devDependencies": {
|
|
127
127
|
"@hono/node-server": "1.19.9",
|