@awsless/awsless 0.0.533 → 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
@@ -87,15 +87,19 @@ var createCloudFrontKvsProvider = ({ profile, region }) => {
87
87
  const validateInput = (state2) => {
88
88
  return z.object({
89
89
  kvsArn: z.string(),
90
- keys: z.array(z.object({ key: z.string(), value: z.string() })),
91
- eTag: z.string().optional()
90
+ keys: z.array(
91
+ z.object({
92
+ key: z.string(),
93
+ value: z.string()
94
+ })
95
+ )
92
96
  }).parse(state2);
93
97
  };
94
98
  const formatOutput = (output) => {
95
99
  return {
96
- eTag: output.ETag,
97
- itemCount: output.ItemCount,
98
- totalSizeInBytes: output.TotalSizeInBytes
100
+ eTag: output?.ETag,
101
+ itemCount: output?.ItemCount ?? 0,
102
+ totalSizeInBytes: output?.TotalSizeInBytes ?? 0
99
103
  };
100
104
  };
101
105
  const bulkUpdate = async (props) => {
@@ -1674,6 +1678,7 @@ var IconsSchema = z34.record(
1674
1678
  domain: ResourceIdSchema.describe("The domain id to link your site with.").optional(),
1675
1679
  subDomain: z34.string().optional(),
1676
1680
  log: LogSchema.optional(),
1681
+ cacheDuration: DurationSchema.optional().describe("The cache duration of the cached icons."),
1677
1682
  preserveId: z34.boolean().optional().default(false).describe("Preserve the IDs of the icons."),
1678
1683
  symbols: z34.boolean().optional().default(false).describe("Use SVG symbols for icons."),
1679
1684
  origin: z34.union([
@@ -1725,6 +1730,7 @@ var ImagesSchema = z35.record(
1725
1730
  domain: ResourceIdSchema.describe("The domain id to link your site with.").optional(),
1726
1731
  subDomain: z35.string().optional(),
1727
1732
  log: LogSchema.optional(),
1733
+ cacheDuration: DurationSchema.optional().describe("Cache duration of the cached images."),
1728
1734
  presets: z35.record(z35.string(), transformationOptionsSchema).describe("Named presets for image transformations"),
1729
1735
  extensions: z35.object({
1730
1736
  jpeg: z35.object({
@@ -4501,6 +4507,7 @@ var rpcFeature = defineFeature({
4501
4507
  // Name: name,
4502
4508
  // // Feature: ''
4503
4509
  // },
4510
+ waitForDeployment: false,
4504
4511
  comment: name,
4505
4512
  enabled: true,
4506
4513
  aliases: domainName ? [domainName] : void 0,
@@ -5993,7 +6000,7 @@ var layerFeature = defineFeature({
5993
6000
  import { $ as $22, Group as Group23 } from "@awsless/formation";
5994
6001
  import { join as join12, dirname as dirname8 } from "path";
5995
6002
  import { mebibytes as mebibytes4 } from "@awsless/size";
5996
- 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";
5997
6004
  import { constantCase as constantCase11 } from "change-case";
5998
6005
  import { fileURLToPath as fileURLToPath2 } from "url";
5999
6006
  import { glob as glob3 } from "glob";
@@ -6072,7 +6079,18 @@ var imageFeature = defineFeature({
6072
6079
  tags: {
6073
6080
  cache: "true"
6074
6081
  },
6075
- 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
+ } : {}
6076
6094
  });
6077
6095
  const sharpLayerId = formatGlobalResourceName({
6078
6096
  appName: ctx.appConfig.name,
@@ -6179,6 +6197,7 @@ var imageFeature = defineFeature({
6179
6197
  aliases: domainName ? [domainName] : void 0,
6180
6198
  priceClass: "PriceClass_All",
6181
6199
  httpVersion: "http2and3",
6200
+ waitForDeployment: false,
6182
6201
  restrictions: {
6183
6202
  geoRestriction: {
6184
6203
  restrictionType: "none",
@@ -6288,7 +6307,7 @@ var imageFeature = defineFeature({
6288
6307
  import { $ as $23, Group as Group24 } from "@awsless/formation";
6289
6308
  import { join as join13, dirname as dirname9 } from "path";
6290
6309
  import { mebibytes as mebibytes5 } from "@awsless/size";
6291
- 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";
6292
6311
  import { constantCase as constantCase12 } from "change-case";
6293
6312
  import { fileURLToPath as fileURLToPath3 } from "url";
6294
6313
  import { glob as glob4 } from "glob";
@@ -6327,7 +6346,21 @@ var iconFeature = defineFeature({
6327
6346
  resourceType: "icon",
6328
6347
  resourceName: shortId(`cache-${id}-${ctx.appId}`)
6329
6348
  }),
6330
- 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
+ } : {}
6331
6364
  });
6332
6365
  const serverLambda = createPrebuildLambdaFunction(group, ctx, "icon", id, {
6333
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