@kaitranntt/ccs 7.52.2-dev.2 → 7.52.2-dev.3
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../src/utils/error-codes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;CAgCd,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../src/utils/error-codes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;CAgCd,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAIvE;;GAEG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAE3D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAiB7D"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* CCS Error Codes
|
|
4
|
-
* Documentation:
|
|
4
|
+
* Documentation: https://docs.ccs.kaitran.ca/reference/error-codes
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.getErrorCategory = exports.getErrorDocUrl = exports.ERROR_CODES = void 0;
|
|
@@ -10,7 +10,7 @@ exports.ERROR_CODES = {
|
|
|
10
10
|
CONFIG_MISSING: 'E101',
|
|
11
11
|
CONFIG_INVALID_JSON: 'E102',
|
|
12
12
|
CONFIG_INVALID_PROFILE: 'E103',
|
|
13
|
-
// Profile Management Errors (
|
|
13
|
+
// Profile Management Errors (E104-E107)
|
|
14
14
|
PROFILE_NOT_FOUND: 'E104',
|
|
15
15
|
PROFILE_ALREADY_EXISTS: 'E105',
|
|
16
16
|
PROFILE_CANNOT_DELETE_DEFAULT: 'E106',
|
|
@@ -33,22 +33,27 @@ exports.ERROR_CODES = {
|
|
|
33
33
|
INTERNAL_ERROR: 'E900',
|
|
34
34
|
INVALID_STATE: 'E901',
|
|
35
35
|
};
|
|
36
|
+
const ERROR_CODE_DOCS_BASE_URL = 'https://docs.ccs.kaitran.ca/reference/error-codes';
|
|
36
37
|
/**
|
|
37
38
|
* Error code documentation URL generator
|
|
38
39
|
*/
|
|
39
40
|
function getErrorDocUrl(errorCode) {
|
|
40
|
-
return
|
|
41
|
+
return `${ERROR_CODE_DOCS_BASE_URL}#${errorCode.toLowerCase()}`;
|
|
41
42
|
}
|
|
42
43
|
exports.getErrorDocUrl = getErrorDocUrl;
|
|
43
44
|
/**
|
|
44
45
|
* Get error category from code
|
|
45
46
|
*/
|
|
46
47
|
function getErrorCategory(errorCode) {
|
|
47
|
-
|
|
48
|
+
if (errorCode === exports.ERROR_CODES.PROFILE_NOT_FOUND ||
|
|
49
|
+
errorCode === exports.ERROR_CODES.PROFILE_ALREADY_EXISTS ||
|
|
50
|
+
errorCode === exports.ERROR_CODES.PROFILE_CANNOT_DELETE_DEFAULT ||
|
|
51
|
+
errorCode === exports.ERROR_CODES.PROFILE_INVALID_NAME) {
|
|
52
|
+
return 'Profile Management';
|
|
53
|
+
}
|
|
54
|
+
const code = parseInt(errorCode.substring(1), 10);
|
|
48
55
|
if (code >= 100 && code < 200)
|
|
49
56
|
return 'Configuration';
|
|
50
|
-
if (code >= 200 && code < 300)
|
|
51
|
-
return 'Profile Management';
|
|
52
57
|
if (code >= 300 && code < 400)
|
|
53
58
|
return 'Claude CLI Detection';
|
|
54
59
|
if (code >= 400 && code < 500)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-codes.js","sourceRoot":"","sources":["../../src/utils/error-codes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEU,QAAA,WAAW,GAAG;IACzB,mCAAmC;IACnC,cAAc,EAAE,MAAM;IACtB,mBAAmB,EAAE,MAAM;IAC3B,sBAAsB,EAAE,MAAM;IAE9B,wCAAwC;IACxC,iBAAiB,EAAE,MAAM;IACzB,sBAAsB,EAAE,MAAM;IAC9B,6BAA6B,EAAE,MAAM;IACrC,oBAAoB,EAAE,MAAM;IAE5B,0CAA0C;IAC1C,gBAAgB,EAAE,MAAM;IACxB,2BAA2B,EAAE,MAAM;IACnC,uBAAuB,EAAE,MAAM;IAE/B,iCAAiC;IACjC,kBAAkB,EAAE,MAAM;IAC1B,eAAe,EAAE,MAAM;IACvB,eAAe,EAAE,MAAM;IACvB,cAAc,EAAE,MAAM;IAEtB,iCAAiC;IACjC,oBAAoB,EAAE,MAAM;IAC5B,oBAAoB,EAAE,MAAM;IAC5B,mBAAmB,EAAE,MAAM;IAC3B,qBAAqB,EAAE,MAAM;IAE7B,8BAA8B;IAC9B,cAAc,EAAE,MAAM;IACtB,aAAa,EAAE,MAAM;CACb,CAAC;AAIX;;GAEG;AACH,SAAgB,cAAc,CAAC,SAAoB;IACjD,OAAO,
|
|
1
|
+
{"version":3,"file":"error-codes.js","sourceRoot":"","sources":["../../src/utils/error-codes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEU,QAAA,WAAW,GAAG;IACzB,mCAAmC;IACnC,cAAc,EAAE,MAAM;IACtB,mBAAmB,EAAE,MAAM;IAC3B,sBAAsB,EAAE,MAAM;IAE9B,wCAAwC;IACxC,iBAAiB,EAAE,MAAM;IACzB,sBAAsB,EAAE,MAAM;IAC9B,6BAA6B,EAAE,MAAM;IACrC,oBAAoB,EAAE,MAAM;IAE5B,0CAA0C;IAC1C,gBAAgB,EAAE,MAAM;IACxB,2BAA2B,EAAE,MAAM;IACnC,uBAAuB,EAAE,MAAM;IAE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,UAAU,CAAC;IAClD,OAAO,SAAS,CAAC;AACnB,CAAC;AAjBD,4CAiBC"}
|
package/lib/error-codes.ps1
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
# CCS Error Codes
|
|
2
|
-
# Documentation:
|
|
2
|
+
# Documentation: https://docs.ccs.kaitran.ca/reference/error-codes
|
|
3
|
+
|
|
4
|
+
$script:ERROR_CODE_DOCS_BASE_URL = "https://docs.ccs.kaitran.ca/reference/error-codes"
|
|
3
5
|
|
|
4
6
|
# Configuration Errors (E100-E199)
|
|
5
7
|
$script:E_CONFIG_MISSING = "E101"
|
|
6
8
|
$script:E_CONFIG_INVALID_JSON = "E102"
|
|
7
9
|
$script:E_CONFIG_INVALID_PROFILE = "E103"
|
|
8
10
|
|
|
9
|
-
# Profile Management Errors (
|
|
11
|
+
# Profile Management Errors (E104-E107)
|
|
10
12
|
$script:E_PROFILE_NOT_FOUND = "E104"
|
|
11
13
|
$script:E_PROFILE_ALREADY_EXISTS = "E105"
|
|
12
14
|
$script:E_PROFILE_CANNOT_DELETE_DEFAULT = "E106"
|
|
@@ -37,17 +39,25 @@ $script:E_INVALID_STATE = "E901"
|
|
|
37
39
|
function Get-ErrorDocUrl {
|
|
38
40
|
param([string]$ErrorCode)
|
|
39
41
|
$LowerCode = $ErrorCode.ToLower()
|
|
40
|
-
return "
|
|
42
|
+
return "$script:ERROR_CODE_DOCS_BASE_URL#$LowerCode"
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
# Get error category from code
|
|
44
46
|
function Get-ErrorCategory {
|
|
45
47
|
param([string]$ErrorCode)
|
|
46
48
|
|
|
49
|
+
if (
|
|
50
|
+
$ErrorCode -eq $script:E_PROFILE_NOT_FOUND -or
|
|
51
|
+
$ErrorCode -eq $script:E_PROFILE_ALREADY_EXISTS -or
|
|
52
|
+
$ErrorCode -eq $script:E_PROFILE_CANNOT_DELETE_DEFAULT -or
|
|
53
|
+
$ErrorCode -eq $script:E_PROFILE_INVALID_NAME
|
|
54
|
+
) {
|
|
55
|
+
return "Profile Management"
|
|
56
|
+
}
|
|
57
|
+
|
|
47
58
|
$code = [int]$ErrorCode.Substring(1)
|
|
48
59
|
|
|
49
60
|
if ($code -ge 100 -and $code -lt 200) { return "Configuration" }
|
|
50
|
-
elseif ($code -ge 200 -and $code -lt 300) { return "Profile Management" }
|
|
51
61
|
elseif ($code -ge 300 -and $code -lt 400) { return "Claude CLI Detection" }
|
|
52
62
|
elseif ($code -ge 400 -and $code -lt 500) { return "Network/API" }
|
|
53
63
|
elseif ($code -ge 500 -and $code -lt 600) { return "File System" }
|
package/lib/error-codes.sh
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# CCS Error Codes
|
|
3
|
-
# Documentation:
|
|
3
|
+
# Documentation: https://docs.ccs.kaitran.ca/reference/error-codes
|
|
4
|
+
|
|
5
|
+
readonly ERROR_CODE_DOCS_BASE_URL="https://docs.ccs.kaitran.ca/reference/error-codes"
|
|
4
6
|
|
|
5
7
|
# Configuration Errors (E100-E199)
|
|
6
8
|
readonly E_CONFIG_MISSING="E101"
|
|
7
9
|
readonly E_CONFIG_INVALID_JSON="E102"
|
|
8
10
|
readonly E_CONFIG_INVALID_PROFILE="E103"
|
|
9
11
|
|
|
10
|
-
# Profile Management Errors (
|
|
12
|
+
# Profile Management Errors (E104-E107)
|
|
11
13
|
readonly E_PROFILE_NOT_FOUND="E104"
|
|
12
14
|
readonly E_PROFILE_ALREADY_EXISTS="E105"
|
|
13
15
|
readonly E_PROFILE_CANNOT_DELETE_DEFAULT="E106"
|
|
@@ -37,7 +39,9 @@ readonly E_INVALID_STATE="E901"
|
|
|
37
39
|
# Get error documentation URL
|
|
38
40
|
get_error_doc_url() {
|
|
39
41
|
local error_code="$1"
|
|
40
|
-
|
|
42
|
+
local lowercase_code
|
|
43
|
+
lowercase_code="$(printf '%s' "$error_code" | tr '[:upper:]' '[:lower:]')"
|
|
44
|
+
echo "${ERROR_CODE_DOCS_BASE_URL}#${lowercase_code}"
|
|
41
45
|
}
|
|
42
46
|
|
|
43
47
|
# Get error category from code
|
|
@@ -45,10 +49,10 @@ get_error_category() {
|
|
|
45
49
|
local error_code="$1"
|
|
46
50
|
local code="${error_code#E}"
|
|
47
51
|
|
|
48
|
-
if [[ $
|
|
49
|
-
echo "Configuration"
|
|
50
|
-
elif [[ $code -ge 200 && $code -lt 300 ]]; then
|
|
52
|
+
if [[ "$error_code" == "$E_PROFILE_NOT_FOUND" || "$error_code" == "$E_PROFILE_ALREADY_EXISTS" || "$error_code" == "$E_PROFILE_CANNOT_DELETE_DEFAULT" || "$error_code" == "$E_PROFILE_INVALID_NAME" ]]; then
|
|
51
53
|
echo "Profile Management"
|
|
54
|
+
elif [[ $code -ge 100 && $code -lt 200 ]]; then
|
|
55
|
+
echo "Configuration"
|
|
52
56
|
elif [[ $code -ge 300 && $code -lt 400 ]]; then
|
|
53
57
|
echo "Claude CLI Detection"
|
|
54
58
|
elif [[ $code -ge 400 && $code -lt 500 ]]; then
|