@awsless/awsless 0.0.534 → 0.0.535

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
@@ -1678,6 +1678,7 @@ var IconsSchema = z34.record(
1678
1678
  domain: ResourceIdSchema.describe("The domain id to link your site with.").optional(),
1679
1679
  subDomain: z34.string().optional(),
1680
1680
  log: LogSchema.optional(),
1681
+ cacheDuration: DurationSchema.optional().describe("The cache duration of the cached icons."),
1681
1682
  preserveId: z34.boolean().optional().default(false).describe("Preserve the IDs of the icons."),
1682
1683
  symbols: z34.boolean().optional().default(false).describe("Use SVG symbols for icons."),
1683
1684
  origin: z34.union([
@@ -1729,6 +1730,7 @@ var ImagesSchema = z35.record(
1729
1730
  domain: ResourceIdSchema.describe("The domain id to link your site with.").optional(),
1730
1731
  subDomain: z35.string().optional(),
1731
1732
  log: LogSchema.optional(),
1733
+ cacheDuration: DurationSchema.optional().describe("Cache duration of the cached images."),
1732
1734
  presets: z35.record(z35.string(), transformationOptionsSchema).describe("Named presets for image transformations"),
1733
1735
  extensions: z35.object({
1734
1736
  jpeg: z35.object({
@@ -5998,7 +6000,7 @@ var layerFeature = defineFeature({
5998
6000
  import { $ as $22, Group as Group23 } from "@awsless/formation";
5999
6001
  import { join as join12, dirname as dirname8 } from "path";
6000
6002
  import { mebibytes as mebibytes4 } from "@awsless/size";
6001
- import { days as days6, seconds as seconds9, toSeconds as toSeconds8 } from "@awsless/duration";
6003
+ import { days as days6, seconds as seconds9, toDays as toDays5, toSeconds as toSeconds8 } from "@awsless/duration";
6002
6004
  import { constantCase as constantCase11 } from "change-case";
6003
6005
  import { fileURLToPath as fileURLToPath2 } from "url";
6004
6006
  import { glob as glob3 } from "glob";
@@ -6077,7 +6079,18 @@ var imageFeature = defineFeature({
6077
6079
  tags: {
6078
6080
  cache: "true"
6079
6081
  },
6080
- forceDestroy: true
6082
+ forceDestroy: true,
6083
+ ...props.cacheDuration ? {
6084
+ lifecycleRule: [
6085
+ {
6086
+ enabled: true,
6087
+ id: "image-cache-duration",
6088
+ expiration: {
6089
+ days: toDays5(props.cacheDuration)
6090
+ }
6091
+ }
6092
+ ]
6093
+ } : {}
6081
6094
  });
6082
6095
  const sharpLayerId = formatGlobalResourceName({
6083
6096
  appName: ctx.appConfig.name,
@@ -6184,6 +6197,7 @@ var imageFeature = defineFeature({
6184
6197
  aliases: domainName ? [domainName] : void 0,
6185
6198
  priceClass: "PriceClass_All",
6186
6199
  httpVersion: "http2and3",
6200
+ waitForDeployment: false,
6187
6201
  restrictions: {
6188
6202
  geoRestriction: {
6189
6203
  restrictionType: "none",
@@ -6293,7 +6307,7 @@ var imageFeature = defineFeature({
6293
6307
  import { $ as $23, Group as Group24 } from "@awsless/formation";
6294
6308
  import { join as join13, dirname as dirname9 } from "path";
6295
6309
  import { mebibytes as mebibytes5 } from "@awsless/size";
6296
- import { days as days7, seconds as seconds10, toSeconds as toSeconds9 } from "@awsless/duration";
6310
+ import { days as days7, seconds as seconds10, toDays as toDays6, toSeconds as toSeconds9 } from "@awsless/duration";
6297
6311
  import { constantCase as constantCase12 } from "change-case";
6298
6312
  import { fileURLToPath as fileURLToPath3 } from "url";
6299
6313
  import { glob as glob4 } from "glob";
@@ -6332,7 +6346,21 @@ var iconFeature = defineFeature({
6332
6346
  resourceType: "icon",
6333
6347
  resourceName: shortId(`cache-${id}-${ctx.appId}`)
6334
6348
  }),
6335
- forceDestroy: true
6349
+ tags: {
6350
+ cache: "true"
6351
+ },
6352
+ forceDestroy: true,
6353
+ ...props.cacheDuration ? {
6354
+ lifecycleRule: [
6355
+ {
6356
+ enabled: true,
6357
+ id: "icon-cache-duration",
6358
+ expiration: {
6359
+ days: toDays6(props.cacheDuration)
6360
+ }
6361
+ }
6362
+ ]
6363
+ } : {}
6336
6364
  });
6337
6365
  const serverLambda = createPrebuildLambdaFunction(group, ctx, "icon", id, {
6338
6366
  bundleFile: join13(__dirname3, "/prebuild/icon/bundle.zip"),
@@ -1073,6 +1073,7 @@ var IconsSchema = z31.record(
1073
1073
  domain: ResourceIdSchema.describe("The domain id to link your site with.").optional(),
1074
1074
  subDomain: z31.string().optional(),
1075
1075
  log: LogSchema.optional(),
1076
+ cacheDuration: DurationSchema.optional().describe("The cache duration of the cached icons."),
1076
1077
  preserveId: z31.boolean().optional().default(false).describe("Preserve the IDs of the icons."),
1077
1078
  symbols: z31.boolean().optional().default(false).describe("Use SVG symbols for icons."),
1078
1079
  origin: z31.union([
@@ -1124,6 +1125,7 @@ var ImagesSchema = z32.record(
1124
1125
  domain: ResourceIdSchema.describe("The domain id to link your site with.").optional(),
1125
1126
  subDomain: z32.string().optional(),
1126
1127
  log: LogSchema.optional(),
1128
+ cacheDuration: DurationSchema.optional().describe("Cache duration of the cached images."),
1127
1129
  presets: z32.record(z32.string(), transformationOptionsSchema).describe("Named presets for image transformations"),
1128
1130
  extensions: z32.object({
1129
1131
  jpeg: z32.object({
Binary file
@@ -1 +1 @@
1
- ec61da9b3cd0cdab7d90e90891cbd4e68058b97b
1
+ 77d5c40c76a204153d51f02737dfbfb9568c0601
Binary file
Binary file