@composurecdk/budgets 0.8.3 → 0.8.5

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.
@@ -9,19 +9,14 @@ declare const emailBrand: unique symbol;
9
9
  export type Email = string & {
10
10
  readonly [emailBrand]: true;
11
11
  };
12
+ /** Validates a Budgets subscriber email against {@link EMAIL}. @throws on invalid input. */
13
+ export declare function validateEmail(value: string): void;
12
14
  /**
13
- * Validates and brands a string as an {@link Email}.
15
+ * Validates and brands a string as an {@link Email}. Surrounding whitespace is
16
+ * trimmed before validation, so the branded value is exactly what AWS receives.
14
17
  *
15
- * The pattern intentionally errs on the side of acceptance — anything
16
- * obviously not an email (whitespace, missing `@`, missing TLD) is
17
- * rejected, but any address AWS Budgets will plausibly accept passes.
18
- * The 50-char cap matches the Budgets API's documented per-subscriber
19
- * limit.
20
- *
21
- * @throws If the input is empty, exceeds 50 characters, or doesn't
22
- * contain `local@domain.tld`.
23
- *
24
- * @see https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_Subscriber.html
18
+ * @throws If the input exceeds 50 characters or is not of the form
19
+ * `local@domain.tld`.
25
20
  */
26
21
  export declare function email(input: string): Email;
27
22
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../src/email.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,UAAU,EAAE,OAAO,MAAM,CAAC;AAExC;;;;;;GAMG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,CAAC,UAAU,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAK7D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAc1C"}
1
+ {"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../src/email.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,UAAU,EAAE,OAAO,MAAM,CAAC;AAExC;;;;;;GAMG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,CAAC,UAAU,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAyB7D,4FAA4F;AAC5F,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAEjD;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAI1C"}
@@ -1,33 +1,43 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateEmail = validateEmail;
3
4
  exports.email = email;
4
- const MAX_LEN = 50;
5
- const EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
5
+ const cloudformation_1 = require("@composurecdk/cloudformation");
6
6
  /**
7
- * Validates and brands a string as an {@link Email}.
7
+ * The Budgets subscriber-email constraint. Email is a *format* rule rather than
8
+ * a character-class one, so it carries an explicit `pattern` instead of being
9
+ * built from `stringConstraint()`'s `charClass`. The pattern errs on the side
10
+ * of acceptance — anything obviously not an email (whitespace, missing `@`,
11
+ * missing TLD) is rejected, but any address AWS Budgets will plausibly accept
12
+ * passes. The 50-char cap matches the Budgets API's documented per-subscriber
13
+ * limit. See ADR-0010.
8
14
  *
9
- * The pattern intentionally errs on the side of acceptance — anything
10
- * obviously not an email (whitespace, missing `@`, missing TLD) is
11
- * rejected, but any address AWS Budgets will plausibly accept passes.
12
- * The 50-char cap matches the Budgets API's documented per-subscriber
13
- * limit.
14
- *
15
- * @throws If the input is empty, exceeds 50 characters, or doesn't
16
- * contain `local@domain.tld`.
15
+ * The domain is matched as dot-separated labels (`[^\s@.]+(\.[^\s@.]+)+`) rather
16
+ * than `[^\s@]+\.[^\s@]+`: excluding `.` from each label removes the overlapping
17
+ * quantifiers that make the latter a super-linear (ReDoS-prone) pattern, while
18
+ * accepting exactly the same addresses.
19
+ */
20
+ const EMAIL = {
21
+ name: "Budgets subscriber email",
22
+ pattern: /^[^\s@]+@[^\s@.]+(?:\.[^\s@.]+)+$/,
23
+ maxLength: 50,
24
+ allowed: "an email address of the form local@domain.tld",
25
+ source: "https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_Subscriber.html",
26
+ };
27
+ /** Validates a Budgets subscriber email against {@link EMAIL}. @throws on invalid input. */
28
+ function validateEmail(value) {
29
+ (0, cloudformation_1.validateString)(value, EMAIL);
30
+ }
31
+ /**
32
+ * Validates and brands a string as an {@link Email}. Surrounding whitespace is
33
+ * trimmed before validation, so the branded value is exactly what AWS receives.
17
34
  *
18
- * @see https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_Subscriber.html
35
+ * @throws If the input exceeds 50 characters or is not of the form
36
+ * `local@domain.tld`.
19
37
  */
20
38
  function email(input) {
21
39
  const trimmed = input.trim();
22
- if (trimmed.length === 0) {
23
- throw new Error("email cannot be empty");
24
- }
25
- if (trimmed.length > MAX_LEN) {
26
- throw new Error(`email exceeds ${String(MAX_LEN)} chars (AWS Budgets per-subscriber limit): "${trimmed}"`);
27
- }
28
- if (!EMAIL_REGEX.test(trimmed)) {
29
- throw new Error(`invalid email address: "${trimmed}"`);
30
- }
40
+ validateEmail(trimmed);
31
41
  return trimmed;
32
42
  }
33
43
  //# sourceMappingURL=email.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"email.js","sourceRoot":"","sources":["../../src/email.ts"],"names":[],"mappings":";;AA4BA,sBAcC;AA/BD,MAAM,OAAO,GAAG,EAAE,CAAC;AACnB,MAAM,WAAW,GAAG,4BAA4B,CAAC;AAEjD;;;;;;;;;;;;;GAaG;AACH,SAAgB,KAAK,CAAC,KAAa;IACjC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC3C,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,GAAG,OAAO,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CACb,iBAAiB,MAAM,CAAC,OAAO,CAAC,+CAA+C,OAAO,GAAG,CAC1F,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,2BAA2B,OAAO,GAAG,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,OAAgB,CAAC;AAC1B,CAAC"}
1
+ {"version":3,"file":"email.js","sourceRoot":"","sources":["../../src/email.ts"],"names":[],"mappings":";;AAqCA,sCAEC;AASD,sBAIC;AApDD,iEAAqF;AAarF;;;;;;;;;;;;;GAaG;AACH,MAAM,KAAK,GAAqB;IAC9B,IAAI,EAAE,0BAA0B;IAChC,OAAO,EAAE,mCAAmC;IAC5C,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,+CAA+C;IACxD,MAAM,EACJ,iGAAiG;CACpG,CAAC;AAEF,4FAA4F;AAC5F,SAAgB,aAAa,CAAC,KAAa;IACzC,IAAA,+BAAc,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,KAAK,CAAC,KAAa;IACjC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,aAAa,CAAC,OAAO,CAAC,CAAC;IACvB,OAAO,OAAgB,CAAC;AAC1B,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { validateEmail } from "./email.js";
1
2
  export { createBudgetBuilder, type IBudgetBuilder, type BudgetBuilderProps, type BudgetBuilderResult, type BudgetLimit, } from "./budget-builder.js";
2
3
  export { createBudgetAlarmBuilder, type IBudgetAlarmBuilder, type BudgetAlarmBuilderProps, type BudgetAlarmBuilderResult, } from "./budget-alarm-builder.js";
3
4
  export { BUDGET_DEFAULTS, DEFAULT_BUDGET_CURRENCIES } from "./defaults.js";
@@ -5,4 +6,16 @@ export { type BudgetAlarmConfig, type EstimatedChargesAlarmConfig } from "./alar
5
6
  export { createBudgetsTopicPolicies } from "./topic-policy.js";
6
7
  export { email, type Email } from "./email.js";
7
8
  export { resolveSubscribers, toCfnNotificationWithSubscribers, type NotificationEntry, type NotificationType, type NotifySubscribers, type ResolvedSubscribers, } from "./notifications.js";
9
+ /**
10
+ * This package's AWS-property constraints, grouped by application strategy.
11
+ * The `constraints.validate.*` / `constraints.sanitize.*` shape is identical in
12
+ * every builder package; the underlying constraint definition stays
13
+ * module-private — this namespace is its only public surface. See ADR-0010.
14
+ */
15
+ export declare const constraints: {
16
+ validate: {
17
+ email: typeof validateEmail;
18
+ };
19
+ sanitize: {};
20
+ };
8
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,WAAW,GACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,wBAAwB,EACxB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,GAC9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EACL,kBAAkB,EAClB,gCAAgC,EAChC,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,GACzB,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EACL,mBAAmB,EACnB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,WAAW,GACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,wBAAwB,EACxB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,GAC9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EACL,kBAAkB,EAClB,gCAAgC,EAChC,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,GACzB,MAAM,oBAAoB,CAAC;AAE5B;;;;;GAKG;AACH,eAAO,MAAM,WAAW;;;;;CAGO,CAAC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toCfnNotificationWithSubscribers = exports.resolveSubscribers = exports.email = exports.createBudgetsTopicPolicies = exports.DEFAULT_BUDGET_CURRENCIES = exports.BUDGET_DEFAULTS = exports.createBudgetAlarmBuilder = exports.createBudgetBuilder = void 0;
3
+ exports.constraints = exports.toCfnNotificationWithSubscribers = exports.resolveSubscribers = exports.email = exports.createBudgetsTopicPolicies = exports.DEFAULT_BUDGET_CURRENCIES = exports.BUDGET_DEFAULTS = exports.createBudgetAlarmBuilder = exports.createBudgetBuilder = void 0;
4
+ const email_js_1 = require("./email.js");
4
5
  var budget_builder_js_1 = require("./budget-builder.js");
5
6
  Object.defineProperty(exports, "createBudgetBuilder", { enumerable: true, get: function () { return budget_builder_js_1.createBudgetBuilder; } });
6
7
  var budget_alarm_builder_js_1 = require("./budget-alarm-builder.js");
@@ -10,9 +11,19 @@ Object.defineProperty(exports, "BUDGET_DEFAULTS", { enumerable: true, get: funct
10
11
  Object.defineProperty(exports, "DEFAULT_BUDGET_CURRENCIES", { enumerable: true, get: function () { return defaults_js_1.DEFAULT_BUDGET_CURRENCIES; } });
11
12
  var topic_policy_js_1 = require("./topic-policy.js");
12
13
  Object.defineProperty(exports, "createBudgetsTopicPolicies", { enumerable: true, get: function () { return topic_policy_js_1.createBudgetsTopicPolicies; } });
13
- var email_js_1 = require("./email.js");
14
- Object.defineProperty(exports, "email", { enumerable: true, get: function () { return email_js_1.email; } });
14
+ var email_js_2 = require("./email.js");
15
+ Object.defineProperty(exports, "email", { enumerable: true, get: function () { return email_js_2.email; } });
15
16
  var notifications_js_1 = require("./notifications.js");
16
17
  Object.defineProperty(exports, "resolveSubscribers", { enumerable: true, get: function () { return notifications_js_1.resolveSubscribers; } });
17
18
  Object.defineProperty(exports, "toCfnNotificationWithSubscribers", { enumerable: true, get: function () { return notifications_js_1.toCfnNotificationWithSubscribers; } });
19
+ /**
20
+ * This package's AWS-property constraints, grouped by application strategy.
21
+ * The `constraints.validate.*` / `constraints.sanitize.*` shape is identical in
22
+ * every builder package; the underlying constraint definition stays
23
+ * module-private — this namespace is its only public surface. See ADR-0010.
24
+ */
25
+ exports.constraints = {
26
+ validate: { email: email_js_1.validateEmail },
27
+ sanitize: {},
28
+ };
18
29
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,yDAM6B;AAL3B,wHAAA,mBAAmB,OAAA;AAMrB,qEAKmC;AAJjC,mIAAA,wBAAwB,OAAA;AAK1B,6CAA2E;AAAlE,8GAAA,eAAe,OAAA;AAAE,wHAAA,yBAAyB,OAAA;AAEnD,qDAA+D;AAAtD,6HAAA,0BAA0B,OAAA;AACnC,uCAA+C;AAAtC,iGAAA,KAAK,OAAA;AACd,uDAO4B;AAN1B,sHAAA,kBAAkB,OAAA;AAClB,oIAAA,gCAAgC,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AACA,yCAA2C;AAE3C,yDAM6B;AAL3B,wHAAA,mBAAmB,OAAA;AAMrB,qEAKmC;AAJjC,mIAAA,wBAAwB,OAAA;AAK1B,6CAA2E;AAAlE,8GAAA,eAAe,OAAA;AAAE,wHAAA,yBAAyB,OAAA;AAEnD,qDAA+D;AAAtD,6HAAA,0BAA0B,OAAA;AACnC,uCAA+C;AAAtC,iGAAA,KAAK,OAAA;AACd,uDAO4B;AAN1B,sHAAA,kBAAkB,OAAA;AAClB,oIAAA,gCAAgC,OAAA;AAOlC;;;;;GAKG;AACU,QAAA,WAAW,GAAG;IACzB,QAAQ,EAAE,EAAE,KAAK,EAAE,wBAAa,EAAE;IAClC,QAAQ,EAAE,EAAE;CACiB,CAAC"}
@@ -9,19 +9,14 @@ declare const emailBrand: unique symbol;
9
9
  export type Email = string & {
10
10
  readonly [emailBrand]: true;
11
11
  };
12
+ /** Validates a Budgets subscriber email against {@link EMAIL}. @throws on invalid input. */
13
+ export declare function validateEmail(value: string): void;
12
14
  /**
13
- * Validates and brands a string as an {@link Email}.
15
+ * Validates and brands a string as an {@link Email}. Surrounding whitespace is
16
+ * trimmed before validation, so the branded value is exactly what AWS receives.
14
17
  *
15
- * The pattern intentionally errs on the side of acceptance — anything
16
- * obviously not an email (whitespace, missing `@`, missing TLD) is
17
- * rejected, but any address AWS Budgets will plausibly accept passes.
18
- * The 50-char cap matches the Budgets API's documented per-subscriber
19
- * limit.
20
- *
21
- * @throws If the input is empty, exceeds 50 characters, or doesn't
22
- * contain `local@domain.tld`.
23
- *
24
- * @see https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_Subscriber.html
18
+ * @throws If the input exceeds 50 characters or is not of the form
19
+ * `local@domain.tld`.
25
20
  */
26
21
  export declare function email(input: string): Email;
27
22
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../src/email.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,UAAU,EAAE,OAAO,MAAM,CAAC;AAExC;;;;;;GAMG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,CAAC,UAAU,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAK7D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAc1C"}
1
+ {"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../src/email.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,UAAU,EAAE,OAAO,MAAM,CAAC;AAExC;;;;;;GAMG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,CAAC,UAAU,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAyB7D,4FAA4F;AAC5F,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAEjD;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAI1C"}
package/dist/esm/email.js CHANGED
@@ -1,30 +1,39 @@
1
- const MAX_LEN = 50;
2
- const EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
1
+ import { validateString } from "@composurecdk/cloudformation";
3
2
  /**
4
- * Validates and brands a string as an {@link Email}.
3
+ * The Budgets subscriber-email constraint. Email is a *format* rule rather than
4
+ * a character-class one, so it carries an explicit `pattern` instead of being
5
+ * built from `stringConstraint()`'s `charClass`. The pattern errs on the side
6
+ * of acceptance — anything obviously not an email (whitespace, missing `@`,
7
+ * missing TLD) is rejected, but any address AWS Budgets will plausibly accept
8
+ * passes. The 50-char cap matches the Budgets API's documented per-subscriber
9
+ * limit. See ADR-0010.
5
10
  *
6
- * The pattern intentionally errs on the side of acceptance — anything
7
- * obviously not an email (whitespace, missing `@`, missing TLD) is
8
- * rejected, but any address AWS Budgets will plausibly accept passes.
9
- * The 50-char cap matches the Budgets API's documented per-subscriber
10
- * limit.
11
- *
12
- * @throws If the input is empty, exceeds 50 characters, or doesn't
13
- * contain `local@domain.tld`.
11
+ * The domain is matched as dot-separated labels (`[^\s@.]+(\.[^\s@.]+)+`) rather
12
+ * than `[^\s@]+\.[^\s@]+`: excluding `.` from each label removes the overlapping
13
+ * quantifiers that make the latter a super-linear (ReDoS-prone) pattern, while
14
+ * accepting exactly the same addresses.
15
+ */
16
+ const EMAIL = {
17
+ name: "Budgets subscriber email",
18
+ pattern: /^[^\s@]+@[^\s@.]+(?:\.[^\s@.]+)+$/,
19
+ maxLength: 50,
20
+ allowed: "an email address of the form local@domain.tld",
21
+ source: "https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_Subscriber.html",
22
+ };
23
+ /** Validates a Budgets subscriber email against {@link EMAIL}. @throws on invalid input. */
24
+ export function validateEmail(value) {
25
+ validateString(value, EMAIL);
26
+ }
27
+ /**
28
+ * Validates and brands a string as an {@link Email}. Surrounding whitespace is
29
+ * trimmed before validation, so the branded value is exactly what AWS receives.
14
30
  *
15
- * @see https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_Subscriber.html
31
+ * @throws If the input exceeds 50 characters or is not of the form
32
+ * `local@domain.tld`.
16
33
  */
17
34
  export function email(input) {
18
35
  const trimmed = input.trim();
19
- if (trimmed.length === 0) {
20
- throw new Error("email cannot be empty");
21
- }
22
- if (trimmed.length > MAX_LEN) {
23
- throw new Error(`email exceeds ${String(MAX_LEN)} chars (AWS Budgets per-subscriber limit): "${trimmed}"`);
24
- }
25
- if (!EMAIL_REGEX.test(trimmed)) {
26
- throw new Error(`invalid email address: "${trimmed}"`);
27
- }
36
+ validateEmail(trimmed);
28
37
  return trimmed;
29
38
  }
30
39
  //# sourceMappingURL=email.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"email.js","sourceRoot":"","sources":["../../src/email.ts"],"names":[],"mappings":"AAWA,MAAM,OAAO,GAAG,EAAE,CAAC;AACnB,MAAM,WAAW,GAAG,4BAA4B,CAAC;AAEjD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,KAAK,CAAC,KAAa;IACjC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC3C,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,GAAG,OAAO,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CACb,iBAAiB,MAAM,CAAC,OAAO,CAAC,+CAA+C,OAAO,GAAG,CAC1F,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,2BAA2B,OAAO,GAAG,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,OAAgB,CAAC;AAC1B,CAAC"}
1
+ {"version":3,"file":"email.js","sourceRoot":"","sources":["../../src/email.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAarF;;;;;;;;;;;;;GAaG;AACH,MAAM,KAAK,GAAqB;IAC9B,IAAI,EAAE,0BAA0B;IAChC,OAAO,EAAE,mCAAmC;IAC5C,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,+CAA+C;IACxD,MAAM,EACJ,iGAAiG;CACpG,CAAC;AAEF,4FAA4F;AAC5F,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,KAAK,CAAC,KAAa;IACjC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,aAAa,CAAC,OAAO,CAAC,CAAC;IACvB,OAAO,OAAgB,CAAC;AAC1B,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { validateEmail } from "./email.js";
1
2
  export { createBudgetBuilder, type IBudgetBuilder, type BudgetBuilderProps, type BudgetBuilderResult, type BudgetLimit, } from "./budget-builder.js";
2
3
  export { createBudgetAlarmBuilder, type IBudgetAlarmBuilder, type BudgetAlarmBuilderProps, type BudgetAlarmBuilderResult, } from "./budget-alarm-builder.js";
3
4
  export { BUDGET_DEFAULTS, DEFAULT_BUDGET_CURRENCIES } from "./defaults.js";
@@ -5,4 +6,16 @@ export { type BudgetAlarmConfig, type EstimatedChargesAlarmConfig } from "./alar
5
6
  export { createBudgetsTopicPolicies } from "./topic-policy.js";
6
7
  export { email, type Email } from "./email.js";
7
8
  export { resolveSubscribers, toCfnNotificationWithSubscribers, type NotificationEntry, type NotificationType, type NotifySubscribers, type ResolvedSubscribers, } from "./notifications.js";
9
+ /**
10
+ * This package's AWS-property constraints, grouped by application strategy.
11
+ * The `constraints.validate.*` / `constraints.sanitize.*` shape is identical in
12
+ * every builder package; the underlying constraint definition stays
13
+ * module-private — this namespace is its only public surface. See ADR-0010.
14
+ */
15
+ export declare const constraints: {
16
+ validate: {
17
+ email: typeof validateEmail;
18
+ };
19
+ sanitize: {};
20
+ };
8
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,WAAW,GACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,wBAAwB,EACxB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,GAC9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EACL,kBAAkB,EAClB,gCAAgC,EAChC,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,GACzB,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EACL,mBAAmB,EACnB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,WAAW,GACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,wBAAwB,EACxB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,GAC9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EACL,kBAAkB,EAClB,gCAAgC,EAChC,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,GACzB,MAAM,oBAAoB,CAAC;AAE5B;;;;;GAKG;AACH,eAAO,MAAM,WAAW;;;;;CAGO,CAAC"}
package/dist/esm/index.js CHANGED
@@ -1,7 +1,18 @@
1
+ import { validateEmail } from "./email.js";
1
2
  export { createBudgetBuilder, } from "./budget-builder.js";
2
3
  export { createBudgetAlarmBuilder, } from "./budget-alarm-builder.js";
3
4
  export { BUDGET_DEFAULTS, DEFAULT_BUDGET_CURRENCIES } from "./defaults.js";
4
5
  export { createBudgetsTopicPolicies } from "./topic-policy.js";
5
6
  export { email } from "./email.js";
6
7
  export { resolveSubscribers, toCfnNotificationWithSubscribers, } from "./notifications.js";
8
+ /**
9
+ * This package's AWS-property constraints, grouped by application strategy.
10
+ * The `constraints.validate.*` / `constraints.sanitize.*` shape is identical in
11
+ * every builder package; the underlying constraint definition stays
12
+ * module-private — this namespace is its only public surface. See ADR-0010.
13
+ */
14
+ export const constraints = {
15
+ validate: { email: validateEmail },
16
+ sanitize: {},
17
+ };
7
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,GAKpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,wBAAwB,GAIzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAc,MAAM,YAAY,CAAC;AAC/C,OAAO,EACL,kBAAkB,EAClB,gCAAgC,GAKjC,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EACL,mBAAmB,GAKpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,wBAAwB,GAIzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAc,MAAM,YAAY,CAAC;AAC/C,OAAO,EACL,kBAAkB,EAClB,gCAAgC,GAKjC,MAAM,oBAAoB,CAAC;AAE5B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,QAAQ,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE;IAClC,QAAQ,EAAE,EAAE;CACiB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@composurecdk/budgets",
3
- "version": "0.8.3",
3
+ "version": "0.8.5",
4
4
  "description": "Composable AWS Budgets builder with well-architected defaults and automatic SNS topic policies",
5
5
  "repository": {
6
6
  "type": "git",
@@ -20,7 +20,17 @@
20
20
  "test": "vitest run --passWithNoTests",
21
21
  "test:watch": "vitest"
22
22
  },
23
- "keywords": [],
23
+ "keywords": [
24
+ "aws",
25
+ "cdk",
26
+ "aws-cdk",
27
+ "infrastructure-as-code",
28
+ "iac",
29
+ "composurecdk",
30
+ "budgets",
31
+ "cost-management",
32
+ "billing"
33
+ ],
24
34
  "author": "Jason Duffett (https://github.com/laazyj)",
25
35
  "license": "MIT",
26
36
  "publishConfig": {
@@ -44,11 +54,11 @@
44
54
  "constructs": "^10.0.0"
45
55
  },
46
56
  "devDependencies": {
47
- "@types/node": "^25.9.1",
48
- "aws-cdk-lib": "^2.257.0",
57
+ "@types/node": "^25.9.3",
58
+ "aws-cdk-lib": "^2.258.1",
49
59
  "constructs": "^10.6.0",
50
60
  "typescript": "^6.0.3",
51
- "vitest": "^4.1.7"
61
+ "vitest": "^4.1.8"
52
62
  },
53
63
  "exports": {
54
64
  "./package.json": "./package.json",