From 899af245d9bb08232cb0a90762342d4b2ed72ddc Mon Sep 17 00:00:00 2001 From: muneebkq Date: Fri, 11 Apr 2025 15:19:34 +0530 Subject: [PATCH 1/9] chore: feature entitlement function added --- src/error_codes.rs | 16 ++++ src/extern_functions.rs | 4 + src/lib.rs | 167 +++++++++++++++++++++++++++++++++++++++- 3 files changed, 183 insertions(+), 4 deletions(-) diff --git a/src/error_codes.rs b/src/error_codes.rs index dd141bd..9fb706b 100644 --- a/src/error_codes.rs +++ b/src/error_codes.rs @@ -141,6 +141,8 @@ pub enum LexActivatorError { LA_E_SERVER = 91, /// Client error. LA_E_CLIENT = 92, + /// Invalid account ID. + LA_E_ACCOUNT_ID = 93, /// The user account has been temporarily locked for 5 mins due to 5 failed attempts. LA_E_LOGIN_TEMPORARILY_LOCKED = 100, /// Invalid authentication ID token. @@ -155,6 +157,12 @@ pub enum LexActivatorError { LA_E_INVALID_PERMISSION_FLAG = 105, /// The free plan has reached its activation limit. LA_E_FREE_PLAN_ACTIVATION_LIMIT_REACHED = 106, + /// The feature entitlements are invalid. + LA_E_FEATURE_ENTITLEMENTS_INVALID = 107, + /// The feature entitlement does not exist. + LA_E_FEATURE_ENTITLEMENT_NOT_FOUND = 108, + /// The entitlement set is not linked. + LA_E_ENTITLEMENT_SET_NOT_LINKED = 109, } impl From for LexActivatorStatus { @@ -232,6 +240,7 @@ impl From for LexActivatorError { 90 => LexActivatorError::LA_E_RATE_LIMIT, 91 => LexActivatorError::LA_E_SERVER, 92 => LexActivatorError::LA_E_CLIENT, + 93 => LexActivatorError::LA_E_ACCOUNT_ID, 100 => LexActivatorError::LA_E_LOGIN_TEMPORARILY_LOCKED, 101 => LexActivatorError::LA_E_AUTHENTICATION_ID_TOKEN_INVALID, 102 => LexActivatorError::LA_E_OIDC_SSO_NOT_ENABLED, @@ -239,6 +248,9 @@ impl From for LexActivatorError { 104 => LexActivatorError::LA_E_OS_USER, 105 => LexActivatorError::LA_E_INVALID_PERMISSION_FLAG, 106 => LexActivatorError::LA_E_FREE_PLAN_ACTIVATION_LIMIT_REACHED, + 107 => LexActivatorError::LA_E_FEATURE_ENTITLEMENTS_INVALID, + 108 => LexActivatorError::LA_E_FEATURE_ENTITLEMENT_NOT_FOUND, + 109 => LexActivatorError::LA_E_ENTITLEMENT_SET_NOT_LINKED, _ => todo!(), // Add more mappings as needed } @@ -326,6 +338,10 @@ impl fmt::Display for LexActivatorError { LexActivatorError::LA_E_OS_USER => write!(f, "{} OS user has changed since activation and the license is user-locked.", LexActivatorError::LA_E_OS_USER as i32), LexActivatorError::LA_E_INVALID_PERMISSION_FLAG => write!(f, "{} Invalid permission flag.", LexActivatorError::LA_E_INVALID_PERMISSION_FLAG as i32), LexActivatorError::LA_E_FREE_PLAN_ACTIVATION_LIMIT_REACHED => write!(f, "{} The free plan has reached its activation limit.", LexActivatorError::LA_E_FREE_PLAN_ACTIVATION_LIMIT_REACHED as i32), + LexActivatorError::LA_E_ACCOUNT_ID => write!(f, "{} Invalid account ID.", LexActivatorError::LA_E_ACCOUNT_ID as i32), + LexActivatorError::LA_E_FEATURE_ENTITLEMENTS_INVALID => write!(f, "{} Invalid feature entitlements.", LexActivatorError::LA_E_FEATURE_ENTITLEMENTS_INVALID as i32), + LexActivatorError::LA_E_FEATURE_ENTITLEMENT_NOT_FOUND => write!(f, "{} The feature entitlement does not exist.", LexActivatorError::LA_E_FEATURE_ENTITLEMENT_NOT_FOUND as i32), + LexActivatorError::LA_E_ENTITLEMENT_SET_NOT_LINKED => write!(f, "{} No entitlement set is linked to the license.", LexActivatorError::LA_E_ENTITLEMENT_SET_NOT_LINKED as i32), } } } diff --git a/src/extern_functions.rs b/src/extern_functions.rs index 0f250dc..ce5d082 100644 --- a/src/extern_functions.rs +++ b/src/extern_functions.rs @@ -79,6 +79,10 @@ extern "C" { pub fn GetLicenseUserMetadata(key: cstrtype!(), value: strtype!(), length: c_uint) -> c_int; pub fn GetLicenseOrganizationName(organizationName: strtype!(), length: c_uint) -> c_int; pub fn GetLicenseOrganizationAddressInternal(organizationAddressJson: strtype!(), length: c_uint) -> c_int; + pub fn GetLicenseEntitlementSetName(name: strtype!(), length: c_uint) -> c_int; + pub fn GetLicenseEntitlementSetDisplayName(displayName: strtype!(), length: c_uint) -> c_int; + pub fn GetFeatureEntitlementsInternal(featureEntitlementsJson: strtype!(), length: c_uint) -> c_int; + pub fn GetFeatureEntitlementInternal(featureName: cstrtype!(), featureEntitlementJson: strtype!()) -> c_int; pub fn GetUserLicensesInternal(userLicenses: strtype!(), length: c_uint) -> c_int; pub fn GetLicenseType(licenseType: strtype!(), length: c_uint) -> c_int; pub fn GetActivationId(id:strtype!(), length: c_uint) -> c_int; diff --git a/src/lib.rs b/src/lib.rs index dad2100..1d96d3e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -104,6 +104,17 @@ pub struct UserLicense { pub metadata: Vec } +/// Represents a feature entitlement with details about its value. +#[derive(Debug, Deserialize)] +pub struct FeatureEntitlement { + /// The name of the feature entitlement. + #[serde(rename = "featureName")] + pub feature_name: String, + /// The value of the feature entitlement. + #[serde(rename = "value")] + pub value: String, +} + /// Represents various permission flags. #[repr(u32)] pub enum PermissionFlags { @@ -340,7 +351,10 @@ pub fn set_license_key(license_key: String) -> Result<(), LexActivatorError> { } /// Sets the license user credentials for activation. -/// +/// +/// # Deprecated +/// This function is deprecated. Use [`authenticate_user`] instead. +/// /// # Arguments /// /// * `email` - The email associated with the user. @@ -749,6 +763,9 @@ pub fn get_product_metadata(key: String) -> Result { /// Retrieves the name of the product version. /// +/// # Deprecated +/// This function is deprecated. Use [`get_license_entitlement_set_name`] instead. +/// /// # Returns /// /// Returns `Ok(String)` with the name of the product version if it is retrieved successfully, If an error occurs, an `Err` containing the `LexActivatorError`is returned. @@ -778,30 +795,36 @@ pub fn get_product_version_name() -> Result { /// Retrieves the display name of the product version. /// -/// # Returns +/// # Deprecated +/// This function is deprecated. Use [`get_license_entitlement_set_display_name`] instead. /// -/// Returns `Ok(String)` with the display name of the product version if it is retrieved successfully, If an error occurs, an `Err` containing the `LexActivatorError`is returned. +/// # Returns +/// Returns `Ok(String)` with the display name of the product version if it is retrieved successfully. +/// If an error occurs, an `Err` containing the `LexActivatorError` is returned. pub fn get_product_version_display_name() -> Result { let status: i32; const LENGTH: usize = 256; // Set the appropriate buffer length let product_version_display_name: String; + #[cfg(windows)] { let mut buffer: [u16; LENGTH] = [0; LENGTH]; status = unsafe { GetProductVersionDisplayName(buffer.as_mut_ptr(), LENGTH as c_uint) }; product_version_display_name = utf16_to_string(&buffer); } + #[cfg(not(windows))] { let mut buffer: [c_char; LENGTH] = [0; LENGTH]; status = unsafe { GetProductVersionDisplayName(buffer.as_mut_ptr(), LENGTH as c_uint) }; product_version_display_name = c_char_to_string(&buffer); } + if status == 0 { Ok(product_version_display_name) } else { - return Err(LexActivatorError::from(status)); + Err(LexActivatorError::from(status)) } } @@ -1331,6 +1354,142 @@ pub fn get_user_licenses() -> Result, LexActivatorError> { } } +/// Retrieves the license entitlement set name. +/// +/// # Returns +/// +/// Returns `Ok(String)` with the entitlement set name of the license if it is retrieved successfully, If an error occurs, an `Err` containing the `LexActivatorError`is returned. + +pub fn get_license_entitlement_set_name() -> Result { + let status: i32; + const LENGTH: usize = 256; + let license_entitlement_set_name: String; + #[cfg(windows)] + { + let mut buffer: [u16; LENGTH] = [0; LENGTH]; + status = unsafe { GetLicenseEntitlementSetName(buffer.as_mut_ptr(), LENGTH as c_uint) }; + license_entitlement_set_name = utf16_to_string(&buffer); + } + #[cfg(not(windows))] + { + let mut buffer: [c_char; LENGTH] = [0; LENGTH]; + status = unsafe { GetLicenseEntitlementSetName(buffer.as_mut_ptr(), LENGTH as c_uint) }; + license_entitlement_set_name = c_char_to_string(&buffer); + } + if status == 0 { + Ok(license_entitlement_set_name) + } else { + return Err(LexActivatorError::from(status)); + } +} + +/// Retrieves the entitlement set display name. +/// +/// # Returns +/// +/// Returns `Ok(String)` with the entitlement set display name of the license if it is retrieved successfully, If an error occurs, an `Err` containing the `LexActivatorError`is returned. + +pub fn get_license_entitlement_set_display_name() -> Result { + let status: i32; + const LENGTH: usize = 256; + let license_entitlement_set_display_name: String; + #[cfg(windows)] + { + let mut buffer: [u16; LENGTH] = [0; LENGTH]; + status = unsafe { GetLicenseEntitlementSetDisplayName(buffer.as_mut_ptr(), LENGTH as c_uint) }; + license_entitlement_set_display_name = utf16_to_string(&buffer); + } + #[cfg(not(windows))] + { + let mut buffer: [c_char; LENGTH] = [0; LENGTH]; + status = unsafe { GetLicenseEntitlementSetDisplayName(buffer.as_mut_ptr(), LENGTH as c_uint) }; + license_entitlement_set_display_name = c_char_to_string(&buffer); + } + if status == 0 { + Ok(license_entitlement_set_display_name) + } else { + return Err(LexActivatorError::from(status)); + } +} + +/// Retrieves the feature entitlements. +/// +/// # Returns +/// +/// Returns `Ok(Vec)` with the feature entitlements of the license if it is retrieved successfully, If an error occurs, an `Err` containing the `LexActivatorError`is returned. +pub fn get_feature_entitlements() -> Result, LexActivatorError> { + let status: i32; + const LENGTH: usize = 4096; + let feature_entitlements_json: String; + + #[cfg(windows)] + { + let mut buffer: [u16; LENGTH] = [0; LENGTH]; + status = unsafe { GetFeatureEntitlementsInternal(buffer.as_mut_ptr(), LENGTH as c_uint) }; + feature_entitlements_json = utf16_to_string(&buffer); + } + + #[cfg(not(windows))] + { + let mut buffer: [c_char; LENGTH] = [0; LENGTH]; + status = unsafe { GetFeatureEntitlementsInternal(buffer.as_mut_ptr(), LENGTH as c_uint) }; + feature_entitlements_json = c_char_to_string(&buffer); + } + + if status == 0 { + if feature_entitlements_json.is_empty() { + Ok(Vec::new()) + } else { + let feature_entitlements: Vec = serde_json::from_str(&feature_entitlements_json).expect("Failed to parse JSON"); + Ok(feature_entitlements) + } + } else { + Err(LexActivatorError::from(status)) + } +} + +/// Retrieves the feature entitlement. +/// +/// # Arguments +/// +/// * `name` - A `string` value representing the name of the feature entitlement. +/// +/// # Returns +/// +/// Returns `Ok(FeatureEntitlement)` with the feature entitlement of the license if it is retrieved successfully, If an error occurs, an `Err` containing the `LexActivatorError`is returned. +pub fn get_feature_entitlement(name: String) -> Result { + let status: i32; + const LENGTH: usize = 4096; + let feature_entitlement_json: String; + + #[cfg(windows)] + { + let mut buffer: [u16; LENGTH] = [0; LENGTH]; + let c_name = to_utf16(name); + status = unsafe { GetFeatureEntitlementInternal(c_name.as_ptr(), buffer.as_mut_ptr()) }; + feature_entitlement_json = utf16_to_string(&buffer); + } + + #[cfg(not(windows))] + { + let c_name = string_to_cstring(name)?; + let mut buffer: [c_char; LENGTH] = [0; LENGTH]; + status = unsafe { GetFeatureEntitlementInternal(c_name.as_ptr(), buffer.as_mut_ptr()) }; + feature_entitlement_json = c_char_to_string(&buffer); + } + + if status == 0 { + if feature_entitlement_json.is_empty() { + Err(LexActivatorError::from(status)) + } else { + let feature_entitlement: FeatureEntitlement = serde_json::from_str(&feature_entitlement_json).expect("Failed to parse JSON"); + Ok(feature_entitlement) + } + } else { + Err(LexActivatorError::from(status)) + } +} + /// Retrieves the type of the license. /// /// # Returns From e6cd36f8b3e76d5f794a7061183f95b31ef7c8ac Mon Sep 17 00:00:00 2001 From: muneebkq Date: Fri, 11 Apr 2025 15:51:27 +0530 Subject: [PATCH 2/9] docs: new error message --- src/error_codes.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/error_codes.rs b/src/error_codes.rs index 9fb706b..fc59dc9 100644 --- a/src/error_codes.rs +++ b/src/error_codes.rs @@ -161,7 +161,7 @@ pub enum LexActivatorError { LA_E_FEATURE_ENTITLEMENTS_INVALID = 107, /// The feature entitlement does not exist. LA_E_FEATURE_ENTITLEMENT_NOT_FOUND = 108, - /// The entitlement set is not linked. + /// No entitlement set is linked to the license. LA_E_ENTITLEMENT_SET_NOT_LINKED = 109, } From adad7be042a097c5fe835944b57fedaa72076814 Mon Sep 17 00:00:00 2001 From: muneebkq Date: Wed, 16 Apr 2025 15:54:34 +0530 Subject: [PATCH 3/9] chore: add length arg --- src/extern_functions.rs | 2 +- src/lib.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/extern_functions.rs b/src/extern_functions.rs index ce5d082..9cd52e8 100644 --- a/src/extern_functions.rs +++ b/src/extern_functions.rs @@ -82,7 +82,7 @@ extern "C" { pub fn GetLicenseEntitlementSetName(name: strtype!(), length: c_uint) -> c_int; pub fn GetLicenseEntitlementSetDisplayName(displayName: strtype!(), length: c_uint) -> c_int; pub fn GetFeatureEntitlementsInternal(featureEntitlementsJson: strtype!(), length: c_uint) -> c_int; - pub fn GetFeatureEntitlementInternal(featureName: cstrtype!(), featureEntitlementJson: strtype!()) -> c_int; + pub fn GetFeatureEntitlementInternal(featureName: cstrtype!(), featureEntitlementJson: strtype!(), length: c_uint) -> c_int; pub fn GetUserLicensesInternal(userLicenses: strtype!(), length: c_uint) -> c_int; pub fn GetLicenseType(licenseType: strtype!(), length: c_uint) -> c_int; pub fn GetActivationId(id:strtype!(), length: c_uint) -> c_int; diff --git a/src/lib.rs b/src/lib.rs index 1d96d3e..7965a37 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1452,12 +1452,12 @@ pub fn get_feature_entitlements() -> Result, LexActivato /// /// # Arguments /// -/// * `name` - A `string` value representing the name of the feature entitlement. +/// * `feature_name` - A `string` value representing the name of the feature entitlement. /// /// # Returns /// /// Returns `Ok(FeatureEntitlement)` with the feature entitlement of the license if it is retrieved successfully, If an error occurs, an `Err` containing the `LexActivatorError`is returned. -pub fn get_feature_entitlement(name: String) -> Result { +pub fn get_feature_entitlement(feature_name: String) -> Result { let status: i32; const LENGTH: usize = 4096; let feature_entitlement_json: String; @@ -1466,15 +1466,15 @@ pub fn get_feature_entitlement(name: String) -> Result Date: Thu, 17 Apr 2025 12:11:03 +0530 Subject: [PATCH 4/9] chore: array length 4096 -> 1024 --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 7965a37..6f42a96 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1459,7 +1459,7 @@ pub fn get_feature_entitlements() -> Result, LexActivato /// Returns `Ok(FeatureEntitlement)` with the feature entitlement of the license if it is retrieved successfully, If an error occurs, an `Err` containing the `LexActivatorError`is returned. pub fn get_feature_entitlement(feature_name: String) -> Result { let status: i32; - const LENGTH: usize = 4096; + const LENGTH: usize = 1024; let feature_entitlement_json: String; #[cfg(windows)] From 4f2a8065b309a077e63261d8107d0e78ee4e0951 Mon Sep 17 00:00:00 2001 From: muneebkq Date: Mon, 21 Apr 2025 17:31:47 +0530 Subject: [PATCH 5/9] docs: change jsdoc --- src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 6f42a96..0d825e5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -107,10 +107,10 @@ pub struct UserLicense { /// Represents a feature entitlement with details about its value. #[derive(Debug, Deserialize)] pub struct FeatureEntitlement { - /// The name of the feature entitlement. + /// The name of the feature. #[serde(rename = "featureName")] pub feature_name: String, - /// The value of the feature entitlement. + /// The value of the feature. #[serde(rename = "value")] pub value: String, } @@ -1354,7 +1354,7 @@ pub fn get_user_licenses() -> Result, LexActivatorError> { } } -/// Retrieves the license entitlement set name. +/// Retrieves the entitlement set name. /// /// # Returns /// @@ -1452,7 +1452,7 @@ pub fn get_feature_entitlements() -> Result, LexActivato /// /// # Arguments /// -/// * `feature_name` - A `string` value representing the name of the feature entitlement. +/// * `feature_name` - A `string` value representing the name of the feature. /// /// # Returns /// From 3c4133b0e029944302f256cc9f20f59874ee5624 Mon Sep 17 00:00:00 2001 From: Ahmad Kemsan Date: Tue, 22 Apr 2025 07:17:45 +0530 Subject: [PATCH 6/9] chore: minor refactoring --- src/lib.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 0d825e5..132b508 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1354,7 +1354,7 @@ pub fn get_user_licenses() -> Result, LexActivatorError> { } } -/// Retrieves the entitlement set name. +/// Retrieves the license entitlement set name. /// /// # Returns /// @@ -1383,7 +1383,7 @@ pub fn get_license_entitlement_set_name() -> Result { } } -/// Retrieves the entitlement set display name. +/// Retrieves the license entitlement set display name. /// /// # Returns /// @@ -1479,12 +1479,8 @@ pub fn get_feature_entitlement(feature_name: String) -> Result Date: Tue, 22 Apr 2025 07:21:41 +0530 Subject: [PATCH 7/9] docs: add deprecation annotation --- src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 132b508..6025d4c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -833,6 +833,9 @@ pub fn get_product_version_display_name() -> Result { /// # Arguments /// /// * `name` - The name of the feature flag. +/// +/// # Deprecated +/// This function is deprecated. Use [`get_feature_entitlement`] instead. /// /// # Returns /// From 0f241ea36d01885b134cc166029794b2ffab56bb Mon Sep 17 00:00:00 2001 From: Ahmad Kemsan Date: Fri, 25 Apr 2025 16:58:57 +0530 Subject: [PATCH 8/9] chore: added featureDisplayName to featureEntitlement --- src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 6025d4c..9ea80de 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -110,6 +110,9 @@ pub struct FeatureEntitlement { /// The name of the feature. #[serde(rename = "featureName")] pub feature_name: String, + /// The display name of the feature. + #[serde(rename = "featureDisplayName")] + pub feature_display_name: String, /// The value of the feature. #[serde(rename = "value")] pub value: String, From 5ea9c615658d971b6c83e7161c9b4c98642ccf30 Mon Sep 17 00:00:00 2001 From: Ahmad Kemsan Date: Fri, 25 Apr 2025 16:59:35 +0530 Subject: [PATCH 9/9] chore: added license not effective error --- src/error_codes.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/error_codes.rs b/src/error_codes.rs index fc59dc9..6e7bd4c 100644 --- a/src/error_codes.rs +++ b/src/error_codes.rs @@ -157,12 +157,14 @@ pub enum LexActivatorError { LA_E_INVALID_PERMISSION_FLAG = 105, /// The free plan has reached its activation limit. LA_E_FREE_PLAN_ACTIVATION_LIMIT_REACHED = 106, - /// The feature entitlements are invalid. + /// Invalid feature entitlements. LA_E_FEATURE_ENTITLEMENTS_INVALID = 107, /// The feature entitlement does not exist. LA_E_FEATURE_ENTITLEMENT_NOT_FOUND = 108, /// No entitlement set is linked to the license. LA_E_ENTITLEMENT_SET_NOT_LINKED = 109, + /// The license cannot be activated before its effective date. + LA_E_LICENSE_NOT_EFFECTIVE = 110, } impl From for LexActivatorStatus { @@ -250,7 +252,8 @@ impl From for LexActivatorError { 106 => LexActivatorError::LA_E_FREE_PLAN_ACTIVATION_LIMIT_REACHED, 107 => LexActivatorError::LA_E_FEATURE_ENTITLEMENTS_INVALID, 108 => LexActivatorError::LA_E_FEATURE_ENTITLEMENT_NOT_FOUND, - 109 => LexActivatorError::LA_E_ENTITLEMENT_SET_NOT_LINKED, + 109 => LexActivatorError::LA_E_ENTITLEMENT_SET_NOT_LINKED, + 110 => LexActivatorError::LA_E_LICENSE_NOT_EFFECTIVE, _ => todo!(), // Add more mappings as needed } @@ -342,6 +345,7 @@ impl fmt::Display for LexActivatorError { LexActivatorError::LA_E_FEATURE_ENTITLEMENTS_INVALID => write!(f, "{} Invalid feature entitlements.", LexActivatorError::LA_E_FEATURE_ENTITLEMENTS_INVALID as i32), LexActivatorError::LA_E_FEATURE_ENTITLEMENT_NOT_FOUND => write!(f, "{} The feature entitlement does not exist.", LexActivatorError::LA_E_FEATURE_ENTITLEMENT_NOT_FOUND as i32), LexActivatorError::LA_E_ENTITLEMENT_SET_NOT_LINKED => write!(f, "{} No entitlement set is linked to the license.", LexActivatorError::LA_E_ENTITLEMENT_SET_NOT_LINKED as i32), + LexActivatorError::LA_E_LICENSE_NOT_EFFECTIVE => write!(f, "{} The license cannot be activated before its effective date.", LexActivatorError::LA_E_LICENSE_NOT_EFFECTIVE as i32), } } } @@ -363,7 +367,7 @@ impl LexActivatorCode { pub fn from_i32(code: i32) -> Self { match code { 0..=32 => LexActivatorCode::Status(LexActivatorStatus::from(code)), - 40..=106 => LexActivatorCode::Error(LexActivatorError::from(code)), + 40..=110 => LexActivatorCode::Error(LexActivatorError::from(code)), _ => LexActivatorCode::Error(LexActivatorError::LA_E_CLIENT), // Fallback to a general error } }