@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.cjs CHANGED
@@ -216,7 +216,7 @@ function mapNullFieldsToUndefined(obj) {
216
216
  }
217
217
  //#endregion
218
218
  //#region package.json
219
- var version = "0.23.20";
219
+ var version = "0.23.21";
220
220
  //#endregion
221
221
  //#region lib/helpers/errorLogging.ts
222
222
  function hasMessage(error) {
@@ -2763,6 +2763,29 @@ function implementDefaultAddressTypes(schemaBuilder) {
2763
2763
  };
2764
2764
  }
2765
2765
  //#endregion
2766
+ //#region lib/scalars/emailAddress.ts
2767
+ /**
2768
+ * Validates an email address using graphql-scalars' own format check, then lowercases it.
2769
+ */
2770
+ const normalize$1 = (value) => {
2771
+ try {
2772
+ return graphql_scalars.EmailAddressResolver.parseValue(value).toLowerCase();
2773
+ } catch (error) {
2774
+ throw new RumbleErrorSafe(error instanceof Error ? error.message : `Invalid email address: ${value}`);
2775
+ }
2776
+ };
2777
+ const EmailAddressResolver = new graphql.GraphQLScalarType({
2778
+ name: "EmailAddress",
2779
+ description: `${graphql_scalars.EmailAddressResolver.description} Lowercased.`,
2780
+ specifiedByURL: graphql_scalars.EmailAddressResolver.specifiedByURL,
2781
+ serialize: normalize$1,
2782
+ parseValue: normalize$1,
2783
+ parseLiteral(ast) {
2784
+ if (ast.kind !== graphql.Kind.STRING) throw new RumbleErrorSafe(`Can only validate strings as email addresses but got a: ${ast.kind}`);
2785
+ return normalize$1(ast.value);
2786
+ }
2787
+ });
2788
+ //#endregion
2766
2789
  //#region lib/scalars/personName.ts
2767
2790
  const MAX_LENGTH = 200;
2768
2791
  const NAME_REGEX = /^[\p{L}\p{M}]+(?:(?:[ '-]|\.\x20?)[\p{L}\p{M}]+)*\.?$/u;
@@ -2888,7 +2911,7 @@ const createSchemaBuilder = ({ db, pubsub, pothosConfig, otel, logger, validatio
2888
2911
  schemaBuilder.addScalarType("DateTime", graphql_scalars.DateTimeISOResolver);
2889
2912
  schemaBuilder.addScalarType("BigInt", graphql_scalars.BigIntResolver);
2890
2913
  schemaBuilder.addScalarType("Bytes", graphql_scalars.ByteResolver);
2891
- schemaBuilder.addScalarType("EmailAddress", graphql_scalars.EmailAddressResolver);
2914
+ schemaBuilder.addScalarType("EmailAddress", EmailAddressResolver);
2892
2915
  schemaBuilder.addScalarType("PhoneNumber", PhoneNumberResolver);
2893
2916
  schemaBuilder.addScalarType("Locale", graphql_scalars.LocaleResolver);
2894
2917
  schemaBuilder.addScalarType("PersonName", PersonNameResolver);