@authhero/adapter-interfaces 4.8.0 → 4.8.1

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,3 +9,4 @@ export * from "./hex";
9
9
  export * from "./cursor";
10
10
  export * from "./lucene";
11
11
  export * from "./session-retention";
12
+ export * from "./username-validation";
@@ -0,0 +1,21 @@
1
+ /** Mirrors Auth0's own wording, minus the "@" it allows and we don't. */
2
+ export declare const USERNAME_INVALID_CHARACTERS_MESSAGE = "Username can only contain alphanumeric characters and the following characters: '_', '+', '-', '.', '!', '#', '$', \"'\", '^', '`', '~'";
3
+ export declare const USERNAME_CONTAINS_AT_MESSAGE = "Usernames must not contain \"@\". Use the email field for email addresses.";
4
+ export declare function usernameHasOnlyAllowedCharacters(username: string): boolean;
5
+ /**
6
+ * Auth0 lowercases usernames on write, so `MyUser` and `myuser` are the same
7
+ * account. Applied at the write boundary only — never to values read back out
8
+ * of the database, which may predate this rule.
9
+ */
10
+ export declare function normalizeUsername(username: string): string;
11
+ export interface UsernameLengthBounds {
12
+ min: number;
13
+ max: number;
14
+ }
15
+ /**
16
+ * Returns an Auth0-shaped error message, or `null` when the username is valid.
17
+ * `bounds` comes from the connection's own configuration via
18
+ * `getConnectionIdentifierConfig`; omit it to skip the length check (the
19
+ * caller has no connection in hand).
20
+ */
21
+ export declare function validateUsername(username: string, bounds?: UsernameLengthBounds): string | null;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "type": "git",
12
12
  "url": "https://github.com/markusahlstrand/authhero"
13
13
  },
14
- "version": "4.8.0",
14
+ "version": "4.8.1",
15
15
  "files": [
16
16
  "dist"
17
17
  ],