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