@koralabs/kora-labs-common 2.0.2 → 2.0.4

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.
@@ -253,6 +253,7 @@ export interface ProtectedWord {
253
253
  }
254
254
  export declare enum AvailabilityResponseCode {
255
255
  AVAILABLE = 200,
256
+ ALREADY_CLAIMED = 403,
256
257
  NOT_AVAILABLE_FOR_LEGAL_REASONS = 451,
257
258
  NOT_ACCEPTABLE = 406,
258
259
  LOCKED = 423
@@ -47,6 +47,7 @@ var OAuthSocial;
47
47
  var AvailabilityResponseCode;
48
48
  (function (AvailabilityResponseCode) {
49
49
  AvailabilityResponseCode[AvailabilityResponseCode["AVAILABLE"] = 200] = "AVAILABLE";
50
+ AvailabilityResponseCode[AvailabilityResponseCode["ALREADY_CLAIMED"] = 403] = "ALREADY_CLAIMED";
50
51
  AvailabilityResponseCode[AvailabilityResponseCode["NOT_AVAILABLE_FOR_LEGAL_REASONS"] = 451] = "NOT_AVAILABLE_FOR_LEGAL_REASONS";
51
52
  AvailabilityResponseCode[AvailabilityResponseCode["NOT_ACCEPTABLE"] = 406] = "NOT_ACCEPTABLE";
52
53
  AvailabilityResponseCode[AvailabilityResponseCode["LOCKED"] = 423] = "LOCKED";
@@ -1,9 +1,4 @@
1
1
  export declare const checkHandlePattern: (handle: string, root?: string) => {
2
- available: boolean;
2
+ valid: boolean;
3
3
  message: string;
4
- type: string;
5
- } | {
6
- available: boolean;
7
- message: string;
8
- type?: undefined;
9
4
  };
@@ -6,20 +6,18 @@ const checkHandlePattern = (handle, root) => {
6
6
  handle = handle.toLowerCase();
7
7
  if (handle.length <= 1) {
8
8
  return {
9
- available: false,
10
- message: constants_1.RESPONSE_UNAVAILABLE_LEGENDARY,
11
- type: 'invalid',
9
+ valid: false,
10
+ message: constants_1.RESPONSE_UNAVAILABLE_LEGENDARY
12
11
  };
13
12
  }
14
13
  if (!!handle.match(constants_1.REGEX_SUB_HANDLE) && root ? handle.endsWith(`@${root}`) : true) {
15
14
  return {
16
- available: false,
17
- message: constants_1.RESPONSE_INVALID_HANDLE_FORMAT,
18
- type: 'invalid',
15
+ valid: false,
16
+ message: constants_1.RESPONSE_INVALID_HANDLE_FORMAT
19
17
  };
20
18
  }
21
19
  return {
22
- available: true,
20
+ valid: true,
23
21
  message: constants_1.RESPONSE_AVAILABLE
24
22
  };
25
23
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koralabs/kora-labs-common",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "Kora Labs Common Utilities",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",