@awsless/awsless 0.0.509 → 0.0.511

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.
@@ -615,7 +615,7 @@ var AppSchema = z21.object({
615
615
  });
616
616
 
617
617
  // src/config/stack.ts
618
- import { z as z36 } from "zod";
618
+ import { z as z37 } from "zod";
619
619
 
620
620
  // src/feature/cache/schema.ts
621
621
  import { gibibytes as gibibytes2 } from "@awsless/size";
@@ -1059,44 +1059,22 @@ var StoresSchema = z30.union([
1059
1059
  )
1060
1060
  ]).optional().describe("Define the stores in your stack.");
1061
1061
 
1062
- // src/feature/images/schema.ts
1062
+ // src/feature/icon/schema.ts
1063
1063
  import { z as z31 } from "zod";
1064
- var transformationOptionsSchema = z31.object({
1065
- width: z31.number().int().positive().optional(),
1066
- height: z31.number().int().positive().optional(),
1067
- fit: z31.enum(["cover", "contain", "fill", "inside", "outside"]).optional(),
1068
- position: z31.enum(["top", "right top", "right", "right bottom", "bottom", "left bottom", "left", "left top", "center"]).optional(),
1069
- quality: z31.number().int().min(1).max(100).optional()
1070
- });
1071
1064
  var staticOriginSchema = LocalDirectorySchema.describe(
1072
- "Specifies the path to a image directory that will be uploaded in S3."
1065
+ "Specifies the path to a local image directory that will be uploaded in S3."
1073
1066
  );
1074
1067
  var functionOriginSchema = FunctionSchema.describe(
1075
- "Specifies the file that will be called when an image isn't found in the S3 bucket."
1068
+ "Specifies the file that will be called when an image isn't found in the (cache) bucket."
1076
1069
  );
1077
- var ImagesSchema = z31.record(
1070
+ var IconsSchema = z31.record(
1078
1071
  ResourceIdSchema,
1079
1072
  z31.object({
1080
1073
  domain: ResourceIdSchema.describe("The domain id to link your site with.").optional(),
1081
1074
  subDomain: z31.string().optional(),
1082
1075
  log: LogSchema.optional(),
1083
- presets: z31.record(z31.string(), transformationOptionsSchema).describe("Named presets for image transformations"),
1084
- extensions: z31.object({
1085
- jpeg: z31.object({
1086
- mozjpeg: z31.boolean().optional(),
1087
- progressive: z31.boolean().optional()
1088
- }).optional(),
1089
- webp: z31.object({
1090
- effort: z31.number().int().min(0).max(6).optional(),
1091
- lossless: z31.boolean().optional(),
1092
- nearLossless: z31.boolean().optional()
1093
- }).optional(),
1094
- png: z31.object({
1095
- compressionLevel: z31.number().int().min(0).max(9).optional()
1096
- }).optional()
1097
- }).refine((data) => {
1098
- return Object.keys(data).length > 0;
1099
- }, "At least one extension must be defined.").describe("Image format-specific options for transformations"),
1076
+ preserveId: z31.boolean().optional().default(false).describe("Preserve the IDs of the icons."),
1077
+ symbols: z31.boolean().optional().default(false).describe("Use SVG symbols for icons."),
1100
1078
  origin: z31.union([
1101
1079
  z31.object({
1102
1080
  static: staticOriginSchema,
@@ -1113,29 +1091,86 @@ var ImagesSchema = z31.record(
1113
1091
  ]).describe(
1114
1092
  "Image transformation will be applied from a base image. Base images orginates from a local directory that will be uploaded to S3 or from a lambda function."
1115
1093
  ),
1116
- version: z31.number().int().min(1).optional().describe("Version of the image configuration.")
1117
- // postprocess: FunctionSchema.optional()
1094
+ version: z31.number().int().min(1).optional().describe("Version of the icon configuration.")
1118
1095
  })
1119
- ).optional().describe("Define image CDN & transformations in your stack.");
1096
+ ).optional().describe("Define an icon proxy in your stack. Store, optimize, and deliver icons at scale.");
1120
1097
 
1121
- // src/feature/table/schema.ts
1122
- import { minutes as minutes4, seconds as seconds4 } from "@awsless/duration";
1098
+ // src/feature/image/schema.ts
1123
1099
  import { z as z32 } from "zod";
1124
- var KeySchema = z32.string().min(1).max(255);
1125
- var TablesSchema = z32.record(
1100
+ var transformationOptionsSchema = z32.object({
1101
+ width: z32.number().int().positive().optional(),
1102
+ height: z32.number().int().positive().optional(),
1103
+ fit: z32.enum(["cover", "contain", "fill", "inside", "outside"]).optional(),
1104
+ position: z32.enum(["top", "right top", "right", "right bottom", "bottom", "left bottom", "left", "left top", "center"]).optional(),
1105
+ quality: z32.number().int().min(1).max(100).optional()
1106
+ });
1107
+ var staticOriginSchema2 = LocalDirectorySchema.describe(
1108
+ "Specifies the path to a local image directory that will be uploaded in S3."
1109
+ );
1110
+ var functionOriginSchema2 = FunctionSchema.describe(
1111
+ "Specifies the file that will be called when an image isn't found in the (cache) bucket."
1112
+ );
1113
+ var ImagesSchema = z32.record(
1126
1114
  ResourceIdSchema,
1127
1115
  z32.object({
1116
+ domain: ResourceIdSchema.describe("The domain id to link your site with.").optional(),
1117
+ subDomain: z32.string().optional(),
1118
+ log: LogSchema.optional(),
1119
+ presets: z32.record(z32.string(), transformationOptionsSchema).describe("Named presets for image transformations"),
1120
+ extensions: z32.object({
1121
+ jpeg: z32.object({
1122
+ mozjpeg: z32.boolean().optional(),
1123
+ progressive: z32.boolean().optional()
1124
+ }).optional(),
1125
+ webp: z32.object({
1126
+ effort: z32.number().int().min(1).max(10).default(7).optional(),
1127
+ lossless: z32.boolean().optional(),
1128
+ nearLossless: z32.boolean().optional()
1129
+ }).optional(),
1130
+ png: z32.object({
1131
+ compressionLevel: z32.number().int().min(0).max(9).default(6).optional()
1132
+ }).optional()
1133
+ }).refine((data) => {
1134
+ return Object.keys(data).length > 0;
1135
+ }, "At least one extension must be defined.").describe("Specify the allowed extensions."),
1136
+ origin: z32.union([
1137
+ z32.object({
1138
+ static: staticOriginSchema2,
1139
+ function: functionOriginSchema2.optional()
1140
+ }),
1141
+ z32.object({
1142
+ static: staticOriginSchema2.optional(),
1143
+ function: functionOriginSchema2
1144
+ }),
1145
+ z32.object({
1146
+ static: staticOriginSchema2,
1147
+ function: functionOriginSchema2
1148
+ })
1149
+ ]).describe(
1150
+ "Specify the origin of your images. Image transformation will be applied from a base image. Base images can be loaded from a S3 bucket (that is synced from a local directory) or dynamicly from a lambda function."
1151
+ ),
1152
+ version: z32.number().int().min(1).optional().describe("Version of the image configuration.")
1153
+ })
1154
+ ).optional().describe("Define an image proxy in your stack. Store, transform, optimize, and deliver images at scale.");
1155
+
1156
+ // src/feature/table/schema.ts
1157
+ import { minutes as minutes4, seconds as seconds4 } from "@awsless/duration";
1158
+ import { z as z33 } from "zod";
1159
+ var KeySchema = z33.string().min(1).max(255);
1160
+ var TablesSchema = z33.record(
1161
+ ResourceIdSchema,
1162
+ z33.object({
1128
1163
  hash: KeySchema.describe(
1129
1164
  "Specifies the name of the partition / hash key that makes up the primary key for the table."
1130
1165
  ),
1131
1166
  sort: KeySchema.optional().describe(
1132
1167
  "Specifies the name of the range / sort key that makes up the primary key for the table."
1133
1168
  ),
1134
- fields: z32.record(z32.string(), z32.enum(["string", "number", "binary"])).optional().describe(
1169
+ fields: z33.record(z33.string(), z33.enum(["string", "number", "binary"])).optional().describe(
1135
1170
  'A list of attributes that describe the key schema for the table and indexes. If no attribute field is defined we default to "string".'
1136
1171
  ),
1137
- class: z32.enum(["standard", "standard-infrequent-access"]).default("standard").describe("The table class of the table."),
1138
- pointInTimeRecovery: z32.boolean().default(false).describe("Indicates whether point in time recovery is enabled on the table."),
1172
+ class: z33.enum(["standard", "standard-infrequent-access"]).default("standard").describe("The table class of the table."),
1173
+ pointInTimeRecovery: z33.boolean().default(false).describe("Indicates whether point in time recovery is enabled on the table."),
1139
1174
  ttl: KeySchema.optional().describe(
1140
1175
  [
1141
1176
  "The name of the TTL attribute used to store the expiration time for items in the table.",
@@ -1143,8 +1178,8 @@ var TablesSchema = z32.record(
1143
1178
  ].join("\n")
1144
1179
  ),
1145
1180
  // deletionProtection: DeletionProtectionSchema.optional(),
1146
- stream: z32.object({
1147
- type: z32.enum(["keys-only", "new-image", "old-image", "new-and-old-images"]).describe(
1181
+ stream: z33.object({
1182
+ type: z33.enum(["keys-only", "new-image", "old-image", "new-and-old-images"]).describe(
1148
1183
  [
1149
1184
  "When an item in the table is modified, you can determines what information is written to the stream for this table.",
1150
1185
  "Valid values are:",
@@ -1154,7 +1189,7 @@ var TablesSchema = z32.record(
1154
1189
  "- new-and-old-images - Both the new and the old item images of the item are written to the stream."
1155
1190
  ].join("\n")
1156
1191
  ),
1157
- batchSize: z32.number().min(1).max(1e4).default(1).describe(
1192
+ batchSize: z33.number().min(1).max(1e4).default(1).describe(
1158
1193
  [
1159
1194
  "The maximum number of records in each batch that Lambda pulls from your stream and sends to your function.",
1160
1195
  "Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation (6 MB).",
@@ -1184,7 +1219,7 @@ var TablesSchema = z32.record(
1184
1219
  // 'You can specify a number from -1 to 10000.',
1185
1220
  // ].join('\n')
1186
1221
  // ),
1187
- retryAttempts: z32.number().min(-1).max(1e4).default(-1).describe(
1222
+ retryAttempts: z33.number().min(-1).max(1e4).default(-1).describe(
1188
1223
  [
1189
1224
  "Discard records after the specified number of retries.",
1190
1225
  "The default value is -1, which sets the maximum number of retries to infinite.",
@@ -1192,7 +1227,7 @@ var TablesSchema = z32.record(
1192
1227
  "You can specify a number from -1 to 10000."
1193
1228
  ].join("\n")
1194
1229
  ),
1195
- concurrencyPerShard: z32.number().min(1).max(10).default(1).describe(
1230
+ concurrencyPerShard: z33.number().min(1).max(10).default(1).describe(
1196
1231
  [
1197
1232
  "The number of batches to process concurrently from each shard.",
1198
1233
  "You can specify a number from 1 to 10."
@@ -1202,16 +1237,16 @@ var TablesSchema = z32.record(
1202
1237
  }).optional().describe(
1203
1238
  "The settings for the DynamoDB table stream, which capture changes to items stored in the table."
1204
1239
  ),
1205
- indexes: z32.record(
1206
- z32.string(),
1207
- z32.object({
1240
+ indexes: z33.record(
1241
+ z33.string(),
1242
+ z33.object({
1208
1243
  hash: KeySchema.describe(
1209
1244
  "Specifies the name of the partition / hash key that makes up the primary key for the global secondary index."
1210
1245
  ),
1211
1246
  sort: KeySchema.optional().describe(
1212
1247
  "Specifies the name of the range / sort key that makes up the primary key for the global secondary index."
1213
1248
  ),
1214
- projection: z32.enum(["all", "keys-only"]).default("all").describe(
1249
+ projection: z33.enum(["all", "keys-only"]).default("all").describe(
1215
1250
  [
1216
1251
  "The set of attributes that are projected into the index:",
1217
1252
  "- all - All of the table attributes are projected into the index.",
@@ -1225,11 +1260,11 @@ var TablesSchema = z32.record(
1225
1260
  ).optional().describe("Define the tables in your stack.");
1226
1261
 
1227
1262
  // src/feature/task/schema.ts
1228
- import { z as z33 } from "zod";
1229
- var RetryAttemptsSchema2 = z33.number().int().min(0).max(2).describe(
1263
+ import { z as z34 } from "zod";
1264
+ var RetryAttemptsSchema2 = z34.number().int().min(0).max(2).describe(
1230
1265
  "The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
1231
1266
  );
1232
- var TaskSchema = z33.union([
1267
+ var TaskSchema = z34.union([
1233
1268
  LocalFileSchema.transform((file) => ({
1234
1269
  consumer: {
1235
1270
  code: {
@@ -1240,33 +1275,33 @@ var TaskSchema = z33.union([
1240
1275
  },
1241
1276
  retryAttempts: void 0
1242
1277
  })),
1243
- z33.object({
1278
+ z34.object({
1244
1279
  consumer: FunctionSchema,
1245
1280
  retryAttempts: RetryAttemptsSchema2.optional()
1246
1281
  })
1247
1282
  ]);
1248
- var TasksSchema = z33.record(ResourceIdSchema, TaskSchema).optional().describe("Define the tasks in your stack.");
1283
+ var TasksSchema = z34.record(ResourceIdSchema, TaskSchema).optional().describe("Define the tasks in your stack.");
1249
1284
 
1250
1285
  // src/feature/test/schema.ts
1251
- import { z as z34 } from "zod";
1252
- var TestsSchema = z34.union([LocalDirectorySchema.transform((v) => [v]), LocalDirectorySchema.array()]).describe("Define the location of your tests for your stack.").optional();
1286
+ import { z as z35 } from "zod";
1287
+ var TestsSchema = z35.union([LocalDirectorySchema.transform((v) => [v]), LocalDirectorySchema.array()]).describe("Define the location of your tests for your stack.").optional();
1253
1288
 
1254
1289
  // src/feature/topic/schema.ts
1255
1290
  import { kebabCase as kebabCase3 } from "change-case";
1256
- import { z as z35 } from "zod";
1257
- var TopicNameSchema = z35.string().min(3).max(256).regex(/^[a-z0-9\-]+$/i, "Invalid topic name").transform((value) => kebabCase3(value)).describe("Define event topic name.");
1258
- var TopicsSchema = z35.array(TopicNameSchema).refine((topics) => {
1291
+ import { z as z36 } from "zod";
1292
+ var TopicNameSchema = z36.string().min(3).max(256).regex(/^[a-z0-9\-]+$/i, "Invalid topic name").transform((value) => kebabCase3(value)).describe("Define event topic name.");
1293
+ var TopicsSchema = z36.array(TopicNameSchema).refine((topics) => {
1259
1294
  return topics.length === new Set(topics).size;
1260
1295
  }, "Must be a list of unique topic names").optional().describe("Define the event topics to publish too in your stack.");
1261
- var SubscribersSchema = z35.record(TopicNameSchema, FunctionSchema).optional().describe("Define the event topics to subscribe too in your stack.");
1296
+ var SubscribersSchema = z36.record(TopicNameSchema, FunctionSchema).optional().describe("Define the event topics to subscribe too in your stack.");
1262
1297
 
1263
1298
  // src/config/stack.ts
1264
1299
  var DependsSchema = ResourceIdSchema.array().optional().describe("Define the stacks that this stack is depended on.");
1265
1300
  var NameSchema = ResourceIdSchema.refine((name) => !["base", "hostedzones"].includes(name), {
1266
1301
  message: `Stack name can't be a reserved name.`
1267
1302
  }).describe("Stack name.");
1268
- var StackSchema = z36.object({
1269
- $schema: z36.string().optional(),
1303
+ var StackSchema = z37.object({
1304
+ $schema: z37.string().optional(),
1270
1305
  name: NameSchema,
1271
1306
  depends: DependsSchema,
1272
1307
  commands: CommandsSchema,
@@ -1292,7 +1327,8 @@ var StackSchema = z36.object({
1292
1327
  searchs: SearchsSchema,
1293
1328
  sites: SitesSchema,
1294
1329
  tests: TestsSchema,
1295
- images: ImagesSchema
1330
+ images: ImagesSchema,
1331
+ icons: IconsSchema
1296
1332
  });
1297
1333
 
1298
1334
  // cli/build-json-schema.ts
@@ -0,0 +1 @@
1
+ e657f7b86864d8615a7f7439663a94419d048c1f
Binary file
@@ -0,0 +1 @@
1
+ ec61da9b3cd0cdab7d90e90891cbd4e68058b97b
Binary file
Binary file
package/dist/prebuild.js CHANGED
@@ -163,7 +163,8 @@ var prebuild = async (file, output, external = []) => {
163
163
  var __dirname = dirname2(fileURLToPath(import.meta.url));
164
164
  var builds = {
165
165
  rpc: "../src/feature/rpc/server/handle.ts",
166
- images: "../src/feature/images/server/handle.ts"
166
+ image: "../src/feature/image/server/handle.ts",
167
+ icon: "../src/feature/icon/server/handle.ts"
167
168
  };
168
169
  for (const [name, file] of Object.entries(builds)) {
169
170
  const output = join2(__dirname, "prebuild", name);