@koralabs/kora-labs-common 6.7.7 → 6.7.9

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.
@@ -7,6 +7,7 @@ export declare const RESPONSE_INVALID_HANDLE_FORMAT = "Invalid handle. Only a-z,
7
7
  export declare const RESPONSE_NOT_ALLOWED = "Sorry, that handle is not allowed.";
8
8
  export declare const REGEX_SPLIT_ON_CHARS: RegExp;
9
9
  export declare const REGEX_SPLIT_ON_NUMS: RegExp;
10
+ export declare const REGEX_HANDLE_OR_SUB_HANDLE: RegExp;
10
11
  export declare const REGEX_HANDLE: RegExp;
11
12
  export declare const REGEX_SUB_HANDLE: RegExp;
12
13
  export declare const HANDLES_API_KEY: string;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a, _b, _c;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.TWELVE_HOURS_IN_SLOTS = exports.EMPTY = exports.HANDLES_PER_PAGE_MAX = exports.ERROR_TEXT = exports.KORA_USER_AGENT = exports.HANDLES_API_KEY = exports.REGEX_SUB_HANDLE = exports.REGEX_HANDLE = exports.REGEX_SPLIT_ON_NUMS = exports.REGEX_SPLIT_ON_CHARS = exports.RESPONSE_NOT_ALLOWED = exports.RESPONSE_INVALID_HANDLE_FORMAT = exports.RESPONSE_UNAVAILABLE_LEGENDARY = exports.RESPONSE_UNAVAILABLE_RESERVED = exports.RESPONSE_UNAVAILABLE_ACTIVE_SESSION = exports.RESPONSE_UNAVAILABLE_PAID = exports.RESPONSE_AVAILABLE = void 0;
4
+ exports.TWELVE_HOURS_IN_SLOTS = exports.EMPTY = exports.HANDLES_PER_PAGE_MAX = exports.ERROR_TEXT = exports.KORA_USER_AGENT = exports.HANDLES_API_KEY = exports.REGEX_SUB_HANDLE = exports.REGEX_HANDLE = exports.REGEX_HANDLE_OR_SUB_HANDLE = exports.REGEX_SPLIT_ON_NUMS = exports.REGEX_SPLIT_ON_CHARS = exports.RESPONSE_NOT_ALLOWED = exports.RESPONSE_INVALID_HANDLE_FORMAT = exports.RESPONSE_UNAVAILABLE_LEGENDARY = exports.RESPONSE_UNAVAILABLE_RESERVED = exports.RESPONSE_UNAVAILABLE_ACTIVE_SESSION = exports.RESPONSE_UNAVAILABLE_PAID = exports.RESPONSE_AVAILABLE = void 0;
5
5
  const constants_1 = require("../constants");
6
6
  exports.RESPONSE_AVAILABLE = 'Yay! This handle is available.';
7
7
  exports.RESPONSE_UNAVAILABLE_PAID = 'Sorry! This Handle is pending mint or already minted.';
@@ -12,8 +12,15 @@ exports.RESPONSE_INVALID_HANDLE_FORMAT = 'Invalid handle. Only a-z, 0-9, dash (-
12
12
  exports.RESPONSE_NOT_ALLOWED = 'Sorry, that handle is not allowed.';
13
13
  exports.REGEX_SPLIT_ON_CHARS = /([0-9a-z]+)[@_.-]*/g;
14
14
  exports.REGEX_SPLIT_ON_NUMS = /([a-z]+)[0-9]*/g;
15
- exports.REGEX_HANDLE = new RegExp(/^[a-zA-Z0-9_.-]{1,15}$/);
16
- exports.REGEX_SUB_HANDLE = new RegExp(/(?:^[a-z0-9_.-]{1,15}$)|(?:^(?!.{29})[a-z0-9_.-]+@[a-z0-9_.-]{1,15}$)/g);
15
+ // Single canonical handle/subhandle format. Lowercase a-z, digits, and _ . - only;
16
+ // a root handle is 1-28 chars, or `sub@root` with a TOTAL length of 3-28. This regex is
17
+ // the ONLY charset gate — the on-chain DeMi/legacy validators enforce LENGTH, not charset.
18
+ // No `g` flag: a global regex makes `.test()` stateful (lastIndex), which flips results
19
+ // across calls.
20
+ exports.REGEX_HANDLE_OR_SUB_HANDLE = /^(?:[0-9a-z_.-]{1,28}|(?=.{3,28}$)[0-9a-z_.-]+@[0-9a-z_.-]+)$/;
21
+ // Back-compat aliases — both names now resolve to the one unified pattern (handles + subhandles).
22
+ exports.REGEX_HANDLE = exports.REGEX_HANDLE_OR_SUB_HANDLE;
23
+ exports.REGEX_SUB_HANDLE = exports.REGEX_HANDLE_OR_SUB_HANDLE;
17
24
  exports.HANDLES_API_KEY = constants_1.IS_PRODUCTION ? (_b = (_a = process.env.HANDLES_API_KEY) !== null && _a !== void 0 ? _a : process.env.HANDLE_ME_API_KEY) !== null && _b !== void 0 ? _b : '' : '';
18
25
  exports.KORA_USER_AGENT = (_c = process.env.KORA_USER_AGENT) !== null && _c !== void 0 ? _c : '';
19
26
  var ERROR_TEXT;
package/package.json CHANGED
@@ -1,56 +1,56 @@
1
1
  {
2
- "name": "@koralabs/kora-labs-common",
3
- "version": "6.7.7",
4
- "description": "Kora Labs Common Utilities",
5
- "main": "index.js",
6
- "types": "index.d.ts",
7
- "homepage": "https://github.com/koralabs/kora-labs-common",
8
- "repository": {
9
- "url": "https://github.com/koralabs/kora-labs-common"
10
- },
11
- "contributors": [
12
- {
13
- "name": "BigIrishLion"
2
+ "name": "@koralabs/kora-labs-common",
3
+ "version": "6.7.9",
4
+ "description": "Kora Labs Common Utilities",
5
+ "main": "index.js",
6
+ "types": "index.d.ts",
7
+ "homepage": "https://github.com/koralabs/kora-labs-common",
8
+ "repository": {
9
+ "url": "https://github.com/koralabs/kora-labs-common"
14
10
  },
15
- {
16
- "name": "papag00se"
11
+ "contributors": [
12
+ {
13
+ "name": "BigIrishLion"
14
+ },
15
+ {
16
+ "name": "papag00se"
17
+ }
18
+ ],
19
+ "scripts": {
20
+ "lint": "ESLINT_USE_FLAT_CONFIG=false eslint --ext=.js,.ts --fix --max-warnings=0 .",
21
+ "test": "NETWORK=mainnet node --experimental-vm-modules node_modules/.bin/jest",
22
+ "build": "tsc",
23
+ "build:local": "npm run build && cp package.json ./lib/package.json && cd lib && npm i --production",
24
+ "npm:publish": "npm run build && cp package.json ./lib/package.json && (cd ./lib && npm publish)"
25
+ },
26
+ "author": "",
27
+ "license": "ISC",
28
+ "devDependencies": {
29
+ "@aws-sdk/client-dynamodb": "^3.549.0",
30
+ "@aws-sdk/lib-dynamodb": "^3.549.0",
31
+ "@types/jest": "^30.0.0",
32
+ "@types/node": "^22.15.17",
33
+ "@types/pluralize": "^0.0.29",
34
+ "@typescript-eslint/eslint-plugin": "^7.6.0",
35
+ "@typescript-eslint/parser": "^7.6.0",
36
+ "eslint": "^8.57.0",
37
+ "jest": "^30.4.2",
38
+ "ts-jest": "^29.4.11",
39
+ "typescript": "^4.7.3"
40
+ },
41
+ "dependencies": {
42
+ "@aws-sdk/client-kms": "^3.1003.0",
43
+ "@emurgo/cardano-message-signing-nodejs": "^1.0.1",
44
+ "bech32": "^2.0.0",
45
+ "blakejs": "^1.2.1",
46
+ "boolean": "^3.2.0",
47
+ "bs58": "^6.0.0",
48
+ "cbor": "^9.0.2",
49
+ "crc": "^4.3.2",
50
+ "libsodium-wrappers-sumo": "^0.8.3",
51
+ "pluralize-esm": "^9.0.5"
52
+ },
53
+ "overrides": {
54
+ "js-yaml": "^4.2.0"
17
55
  }
18
- ],
19
- "scripts": {
20
- "lint": "ESLINT_USE_FLAT_CONFIG=false eslint --ext=.js,.ts --fix --max-warnings=0 .",
21
- "test": "NETWORK=mainnet node --experimental-vm-modules node_modules/.bin/jest",
22
- "build": "tsc",
23
- "build:local": "npm run build && cp package.json ./lib/package.json && cd lib && npm i --production",
24
- "npm:publish": "npm run build && cp package.json ./lib/package.json && (cd ./lib && npm publish)"
25
- },
26
- "author": "",
27
- "license": "ISC",
28
- "devDependencies": {
29
- "@aws-sdk/client-dynamodb": "^3.549.0",
30
- "@aws-sdk/lib-dynamodb": "^3.549.0",
31
- "@types/jest": "^30.0.0",
32
- "@types/node": "^22.15.17",
33
- "@types/pluralize": "^0.0.29",
34
- "@typescript-eslint/eslint-plugin": "^7.6.0",
35
- "@typescript-eslint/parser": "^7.6.0",
36
- "eslint": "^8.57.0",
37
- "jest": "^30.4.2",
38
- "ts-jest": "^29.4.11",
39
- "typescript": "^4.7.3"
40
- },
41
- "dependencies": {
42
- "@aws-sdk/client-kms": "^3.1003.0",
43
- "@emurgo/cardano-message-signing-nodejs": "^1.0.1",
44
- "bech32": "^2.0.0",
45
- "blakejs": "^1.2.1",
46
- "boolean": "^3.2.0",
47
- "bs58": "^6.0.0",
48
- "cbor": "^9.0.2",
49
- "crc": "^4.3.2",
50
- "libsodium-wrappers-sumo": "^0.8.3",
51
- "pluralize-esm": "^9.0.5"
52
- },
53
- "overrides": {
54
- "js-yaml": "^4.2.0"
55
- }
56
56
  }