@awsless/awsless 0.0.550 → 0.0.552

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.
@@ -390,30 +390,32 @@ var DomainSchema = ResourceIdSchema.describe("The domain id to link your Pubsub
390
390
  var PubSubDefaultSchema = z15.record(
391
391
  ResourceIdSchema,
392
392
  z15.object({
393
- auth: FunctionSchema.describe("The authentication function for the pubsub API."),
393
+ auth: FunctionSchema,
394
394
  domain: DomainSchema.optional(),
395
- subDomain: z15.string().optional(),
396
- namespaces: z15.array(z15.string()).optional().describe('The namespaces for the PubSub API. If not set, a single "default" namespace is created.'),
397
- logLevel: z15.enum(["none", "info", "error", "debug", "all"]).optional().describe("The logging level for AppSync API. When set, logging is enabled.")
395
+ subDomain: z15.string().optional()
396
+ // auth: z.union([
397
+ // ResourceIdSchema,
398
+ // z.object({
399
+ // authorizer: FunctionSchema,
400
+ // // ttl: AuthorizerTtl.default('1 hour'),
401
+ // }),
402
+ // ]),
403
+ // policy: z
404
+ // .object({
405
+ // publish: z.array(z.string()).optional(),
406
+ // subscribe: z.array(z.string()).optional(),
407
+ // })
408
+ // .optional(),
398
409
  })
399
- ).optional().describe("Define the pubsub API configuration in your stack.");
410
+ ).optional().describe("Define the pubsub subscriber in your stack.");
400
411
  var PubSubSchema = z15.record(
401
412
  ResourceIdSchema,
402
413
  z15.object({
403
- channels: z15.array(z15.string()).describe("The event channels this subscriber listens to."),
404
- filter: z15.object({
405
- eventType: z15.string().optional().describe("Filter events by event type.")
406
- // Add more filter options as needed
407
- // userId: z.string().optional(),
408
- // custom: z.record(z.string(), z.any()).optional(),
409
- }).optional().describe("Event filtering options."),
410
- consumer: FunctionSchema.describe("The consuming lambda function properties."),
411
- batchSize: z15.number().int().min(1).max(100).default(1).describe("Number of events to batch before invoking the consumer function."),
412
- retryPolicy: z15.object({
413
- maxRetries: z15.number().int().min(0).max(3).default(2).describe("Maximum number of retry attempts.")
414
- }).optional().describe("Retry policy for failed event processing.")
414
+ sql: z15.string().describe("The SQL statement used to query the IOT topic."),
415
+ sqlVersion: z15.enum(["2015-10-08", "2016-03-23", "beta"]).default("2016-03-23").describe("The version of the SQL rules engine to use when evaluating the rule."),
416
+ consumer: FunctionSchema.describe("The consuming lambda function properties.")
415
417
  })
416
- ).optional().describe("Define the pubsub event subscribers in your stack.");
418
+ ).optional().describe("Define the pubsub subscriber in your stack.");
417
419
 
418
420
  // src/feature/queue/schema.ts
419
421
  import { days as days2, hours, minutes as minutes2, seconds as seconds2 } from "@awsless/duration";
Binary file
Binary file
Binary file
package/dist/server.js CHANGED
@@ -16,6 +16,7 @@ import { publish } from "@awsless/sns";
16
16
  import { kebabCase } from "change-case";
17
17
  var APP = process.env.APP ?? "app";
18
18
  var STACK = process.env.STACK ?? "stack";
19
+ var IS_TEST = process.env.NODE_ENV === "test";
19
20
  var build = (opt) => {
20
21
  return [
21
22
  //
@@ -396,7 +397,6 @@ import { kebabCase as kebabCase2 } from "change-case";
396
397
  var getConfigName = (name) => {
397
398
  return `/.awsless/${APP}/${name}`;
398
399
  };
399
- var IS_TEST = process.env.NODE_ENV === "test";
400
400
  var loadConfigData = /* @__NO_SIDE_EFFECTS__ */ async () => {
401
401
  if (!IS_TEST) {
402
402
  const keys = [];
@@ -473,18 +473,22 @@ var Metric = /* @__PURE__ */ createProxy((stack) => {
473
473
  const name = getMetricName(metricName);
474
474
  const namespace = getMetricNamespace(stack);
475
475
  const unit = process.env[`METRIC_${constantCase4(metricName)}`];
476
- if (!unit) {
476
+ let metric;
477
+ if (!unit && !IS_TEST) {
477
478
  throw new TypeError(`Metric "${name}" isn't defined in your stack.`);
479
+ } else if (!unit) {
480
+ metric = createMetric({ name, namespace });
481
+ } else {
482
+ const factories = {
483
+ number: createMetric,
484
+ size: createSizeMetric,
485
+ duration: createDurationMetric
486
+ };
487
+ metric = factories[unit]({
488
+ name,
489
+ namespace
490
+ });
478
491
  }
479
- const factories = {
480
- number: createMetric,
481
- size: createSizeMetric,
482
- duration: createDurationMetric
483
- };
484
- const metric = factories[unit]({
485
- name,
486
- namespace
487
- });
488
492
  return {
489
493
  name,
490
494
  namespace,