@m1212e/rumble 0.23.20 → 0.23.21

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/out/index.mjs CHANGED
@@ -186,7 +186,7 @@ function mapNullFieldsToUndefined(obj) {
186
186
  }
187
187
  //#endregion
188
188
  //#region package.json
189
- var version = "0.23.20";
189
+ var version = "0.23.21";
190
190
  //#endregion
191
191
  //#region lib/helpers/errorLogging.ts
192
192
  function hasMessage(error) {
@@ -2733,6 +2733,29 @@ function implementDefaultAddressTypes(schemaBuilder) {
2733
2733
  };
2734
2734
  }
2735
2735
  //#endregion
2736
+ //#region lib/scalars/emailAddress.ts
2737
+ /**
2738
+ * Validates an email address using graphql-scalars' own format check, then lowercases it.
2739
+ */
2740
+ const normalize$1 = (value) => {
2741
+ try {
2742
+ return EmailAddressResolver.parseValue(value).toLowerCase();
2743
+ } catch (error) {
2744
+ throw new RumbleErrorSafe(error instanceof Error ? error.message : `Invalid email address: ${value}`);
2745
+ }
2746
+ };
2747
+ const EmailAddressResolver$1 = new GraphQLScalarType({
2748
+ name: "EmailAddress",
2749
+ description: `${EmailAddressResolver.description} Lowercased.`,
2750
+ specifiedByURL: EmailAddressResolver.specifiedByURL,
2751
+ serialize: normalize$1,
2752
+ parseValue: normalize$1,
2753
+ parseLiteral(ast) {
2754
+ if (ast.kind !== Kind.STRING) throw new RumbleErrorSafe(`Can only validate strings as email addresses but got a: ${ast.kind}`);
2755
+ return normalize$1(ast.value);
2756
+ }
2757
+ });
2758
+ //#endregion
2736
2759
  //#region lib/scalars/personName.ts
2737
2760
  const MAX_LENGTH = 200;
2738
2761
  const NAME_REGEX = /^[\p{L}\p{M}]+(?:(?:[ '-]|\.\x20?)[\p{L}\p{M}]+)*\.?$/u;
@@ -2858,7 +2881,7 @@ const createSchemaBuilder = ({ db, pubsub, pothosConfig, otel, logger, validatio
2858
2881
  schemaBuilder.addScalarType("DateTime", DateTimeISOResolver);
2859
2882
  schemaBuilder.addScalarType("BigInt", BigIntResolver);
2860
2883
  schemaBuilder.addScalarType("Bytes", ByteResolver);
2861
- schemaBuilder.addScalarType("EmailAddress", EmailAddressResolver);
2884
+ schemaBuilder.addScalarType("EmailAddress", EmailAddressResolver$1);
2862
2885
  schemaBuilder.addScalarType("PhoneNumber", PhoneNumberResolver);
2863
2886
  schemaBuilder.addScalarType("Locale", LocaleResolver);
2864
2887
  schemaBuilder.addScalarType("PersonName", PersonNameResolver);