Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Muneeb/add new functions #8

Merged
merged 14 commits into from
Sep 20, 2024
Merged

Muneeb/add new functions #8

merged 14 commits into from
Sep 20, 2024

Conversation

muneebkq
Copy link
Collaborator

update delphi wrapper with new functions

@adnan-kamili
Copy link
Contributor

/review

*)

function GetLicenseAllowedDeactivations: LongWord;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@muneebkq LongWord in Delphi does not support -ve values as it represents unsigned int. Please make the changes to the GetLicenseAllowedActivations() as well. This is because we now support to -1 as a sentinal value.

*)

procedure SetDebugMode(Enable: Boolean);

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@muneebkq SetDebugMode() takes a numeric argument. Different values could correspond to different log levels.

(*
FUNCTION: GetLicenseExpiryDate()

PURPOSE: Gets the license expiry date timestamp.

RESULT: License expiry date timestamp

EXCEPTIONS: ELAFailException, ELAProductIdException,
EXCEPTIONS: ELAFailException, ELAProductIdException, ELALicenseKeyException
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@muneebkq A value of 0 indicates it has no expiry i.e a lifetime license. Add this to the result of GetLicenseExpiryDate(). Also to the maintenance getter.

*)

LA_E_TWO_FACTOR_AUTHENTICATION_CODE_INVALID = TLAStatusCode(89);

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@muneebkq Please confirm if all error codes have been added. I can see LA_E_TWO_FACTOR_AUTHENTICATION_CODE_MISSING 88 is missing. Please check others too.

Copy link
Collaborator

@ahmad-kemsan ahmad-kemsan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the comments. Make sure to incorporate the changes for -1 as a sentinal value.

@muneebkq muneebkq requested a review from ahmad-kemsan August 22, 2024 10:35
*)

procedure SetReleasePublishedDate(ReleasePublishedDate: LongWord);

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@muneebkq We have used TDateTime wherever the timestamp is returned. Please make sure it remains consistent.

@@ -458,7 +562,7 @@ function GetLicenseMetadata(const Key: UnicodeString): UnicodeString;
*)

procedure GetLicenseMeterAttribute
(const Name: UnicodeString; out AllowedUses, TotalUses, GrossUses: LongWord);
(const Name: UnicodeString; out AllowedUses: Int64; TotalUses, GrossUses: LongWord);

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@muneebkq Please use UInt64 for totalUses, grossUses.

*)

ELATwoFactorAuthenticationCodeMissing = class(ELAException)
public
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@muneebkq Please add Exception to the error codes as followed in other error codes

@@ -3317,6 +3918,22 @@ function ActivateLicenseOffline(const FilePath: UnicodeString): TLAKeyStatus;
Result := ELAError.CheckKeyStatus(Thin_ActivateLicenseOffline(PWideChar(FilePath)));
end;

function Thin_AuthenticateUser(const email , password : unicodestring): TLAStatusCode; cdecl;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@muneebkq unicodestring -> PWideChar

Result := ELAError.CheckKeyStatus(Thin_AuthenticateUser(PWideChar(Email),PWideChar(Password)));
end;

function Thin_AuthenticateUserWithIdToken(const token : unicodestring): TLAStatusCode; cdecl;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@muneebkq unicodestring -> PWideChar

@muneebkq muneebkq requested a review from ahmad-kemsan August 23, 2024 06:26
RESULT: Organization name.

EXCEPTIONS: ELAFailException, ELAProductIdException, ELATimeException,
ELATimeModifiedException, ELAProductVersionNotLinkedException,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@muneebkq Why this ELAProductVersionNotLinkedException in Org name function?

if not ELAError.CheckOKFail(ErrorCode) then
raise ELAFailException.Create('Failed to get activation mode');

Result := 'Initial Mode: ' + InitialMode + ', Current Mode: ' + CurrentMode;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@muneebkq Why inititalMode and currentMode are concatenated?

EXCEPTIONS: ELAProductIdException, ELAReleaseVersionFormatException, ELAReleasePlatformLengthException
*)

procedure SetReleasePlatform(const ReleasePlatform: UnicodeString);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@muneebkq Please remove the platform and channel setter for now. We will add them once we include CheckReleaseUpdate().

@muneebkq muneebkq requested a review from ahmad-kemsan August 26, 2024 05:01
@adnan-kamili adnan-kamili merged commit 0496344 into master Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants