cryptlex / lexactivator-js Goto Github PK
View Code? Open in Web Editor NEWLexActivator API wrapper for Node.js (licensing library)
Home Page: https://cryptlex.com
License: MIT License
LexActivator API wrapper for Node.js (licensing library)
Home Page: https://cryptlex.com
License: MIT License
I have checked docs here about offline activation: https://docs.cryptlex.com/node-locked-licenses/offline-activations
BTW I dunno If I have correctly understood the flow needed to activate an offline license.
LexActivator.SetLicenseKey(key)
LexActivator.GenerateOfflineActivationRequest('./activationRequest.txt')
This will create a ./activationRequest.txt
file (?) that I should download on frontend side
User/Admin goes to cryptlex dashobard, go to activations page of the license and click the OFFLINE ACTIVATION
button. You will be asked to paste the content of ./activationRequest.txt
file, set the validity and then press ACTIVATE
to activate it. This will download a file that we could call offlineLicense.txt
On my frontend now I should allow users to upload this file that I will store on backend and then call
LexActivator.ActivateLicenseOffline('path/to/offlineLicense.txt');
Am I correct?
Wondering if for GenerateOfflineActivationRequest
could simply return a Buffer or the string content of the activation request and ActivateLicenseOffline
could get a Buffer or a string as argument instead of a path to a file. IMO this would be easier to handle since I could store this in a var in the first case and on a database when I need to store the activation file
On Windows I see the following issue:
Could not locate the bindings file. Tried:
→ PATH\node_modules\@cryptlex\lexactivator\build\lexactivator.node
→ PATH\node_modules\@cryptlex\lexactivator\build\Debug\lexactivator.node
→ PATH\node_modules\@cryptlex\lexactivator\build\Release\lexactivator.node
→ PATH\node_modules\@cryptlex\lexactivator\out\Debug\lexactivator.node
→ PATH\node_modules\@cryptlex\lexactivator\Debug\lexactivator.node
→ PATH\node_modules\@cryptlex\lexactivator\out\Release\lexactivator.node
→ PATH\node_modules\@cryptlex\lexactivator\Release\lexactivator.node
→ PATH\node_modules\@cryptlex\lexactivator\build\default\lexactivator.node
→ PATH\node_modules\@cryptlex\lexactivator\compiled\12.4.0\win32\x64\lexactivator.node
→ PATH\node_modules\@cryptlex\lexactivator\addon-build\release\install-root\lexactivator.node
→ PATH\node_modules\@cryptlex\lexactivator\addon-build\debug\install-root\lexactivator.node
→ PATH\node_modules\@cryptlex\lexactivator\addon-build\default\install-root\lexactivator.node
→ PATH\node_modules\@cryptlex\lexactivator\lib\binding\node-v72-win32-x64\lexactivator.node
I assume that the issue is that I don't have windows-build-tools
but unfortunately I am missing administrator privileges on my machine and thus I cannot install them. Could you deliver the prebuilt files via npm please? I think node-pre-gyp
would help here.
After the update LexStatusCodes
only contains status codes and there is no way to access error codes contained in lexactivator-exception.js
. T
hey are needed for example in licenseCallback to handle status changes and should be exported in the index.js
like LexStatusCodes
.
My suggestion is to create an universal function getStatusMessage
that returns the message of the error/status from the code, something like the one inside lexactivator-exception.js
function getErrorMessage
but with status support too.
Will there be any support for Typescript types in the nearer future?
Is there a way to dowload a release file? Except by doing an api request to cryptlex server I mean
Where do I find the changelog of new versions?
Hi Adnan
The most recent version enables ElectronJS cross-building (building to Windows from a Mac computer e.g.). This is awesome.
However, when building from Mac to Mac, it now broke the app. The error is: (also see screenshot below)
Library not loaded: @rpath/libLexActivator.dylib
Reason: image not found
I assume the binding.gyp for this repo has been changed, which is breaking the ElectronJS app, since the reference to the dynamic library is wrong.
I think the reference to the dynamic library were fine for Mac as it were in the previous version of this repo.
Thanks
/ Jens
I am using the latest cryptlex version for nodeJs 3.25.2 in my electron based app and am running the latest electron version and latest electron-builder version. The app runs fine when running using npm run but when the app is run after being packaged using electron-builder on macos I get the following error:
node:electron/js2c/node_init in process.func [as dlopen] at line 2:2214
node:internal/modules/cjs/loader in Module._extensions..node at line 1356:18
node:electron/js2c/node_init in Object.func [as .node] at line 2:2441
node:internal/modules/cjs/loader in Module.load at line 1126:32
node:internal/modules/cjs/loader in Module._load at line 967:12
node:electron/js2c/node_init in c._load at line 2:13672
node:internal/modules/cjs/loader in Module.require at line 1150:19
node:internal/modules/cjs/helpers in require at line 119:18
app:///node_modules/@cryptlex/lexactivator/lib/lexactivator-native.js in Object.<anonymous> at line 15:30
node:internal/modules/cjs/loader in Module._compile at line 1271:14
It is failing somewhere when the .node files are being accessed in the lexactivator-native.js file. I do not know why is that happening. I checked that in my app.asar archive i have the node_modules/@cryptlex/.../.node files there so i am not sure what the issue is. @adnan-kamili @azan-n can you guys provide any help with this? thanks!
The docs over at https://docs.cryptlex.com/node-locked-licenses/using-lexactivator/using-lexactivator-with-node.js say:
In order to package your Node.js project into an executable, check out pkg project.
However, this clearly isn't possible as PKG does not allow .node files like those used by lexactivator to be compiled into the binary.
Did this used to be available on an older version or do you have a custom solution?
Could you add some types please?
post yarn add @cryptlex/lexactivator --target_arch=x64 --target_platform=darwin --target_libc=unknown
not able to run application :(
An unhandled error has occurred inside Forge:
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info find Python using Python version 2.7.16 found at "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python"
gyp info spawn /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
gyp info spawn args [
gyp info spawn args '/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@electron-forge/core/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@cryptlex/lexactivator/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@electron-forge/core/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/smt-pro/.electron-gyp/9.2.1/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/smt-pro/.electron-gyp/9.2.1',
gyp info spawn args '-Dnode_gyp_dir=/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@electron-forge/core/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/smt-pro/.electron-gyp/9.2.1/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@cryptlex/lexactivator',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
CC(target) Release/obj.target/nothing/../../node-addon-api/src/nothing.o
LIBTOOL-STATIC Release/nothing.a
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: archive library: Release/nothing.a the table of contents is empty (no object file members in the library define global symbols)
CXX(target) Release/obj.target/lexactivator/src/main.o
SOLINK_MODULE(target) Release/lexactivator.node
ld: library not found for -lLexActivator
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Release/lexactivator.node] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@electron-forge/core/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:311:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/usr/local/bin/node" "/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@electron-forge/core/node_modules/electron-rebuild/node_modules/.bin/node-gyp" "rebuild" "--target=9.2.1" "--arch=x64" "--dist-url=https://www.electronjs.org/headers" "--build-from-source" "--module_name=lexactivator" "--module_path=/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@cryptlex/lexactivator/lib/binding/darwin-x64-napi-v{napi_build_version}-unknown" "--host=https://dl.cryptlex.com" "--remote_path=./downloads/nodejs/lexactivator/v3.12.3/" "--package_name=lexactivator-darwin-x64-napi-v{napi_build_version}-unknown.tar.gz"
gyp ERR! cwd /Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@cryptlex/lexactivator
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok
Failed with exit code: 1
Error: gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info find Python using Python version 2.7.16 found at "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python"
gyp info spawn /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
gyp info spawn args [
gyp info spawn args '/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@electron-forge/core/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@cryptlex/lexactivator/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@electron-forge/core/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/smt-pro/.electron-gyp/9.2.1/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/smt-pro/.electron-gyp/9.2.1',
gyp info spawn args '-Dnode_gyp_dir=/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@electron-forge/core/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/smt-pro/.electron-gyp/9.2.1/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@cryptlex/lexactivator',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
CC(target) Release/obj.target/nothing/../../node-addon-api/src/nothing.o
LIBTOOL-STATIC Release/nothing.a
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: archive library: Release/nothing.a the table of contents is empty (no object file members in the library define global symbols)
CXX(target) Release/obj.target/lexactivator/src/main.o
SOLINK_MODULE(target) Release/lexactivator.node
ld: library not found for -lLexActivator
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Release/lexactivator.node] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@electron-forge/core/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:311:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/usr/local/bin/node" "/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@electron-forge/core/node_modules/electron-rebuild/node_modules/.bin/node-gyp" "rebuild" "--target=9.2.1" "--arch=x64" "--dist-url=https://www.electronjs.org/headers" "--build-from-source" "--module_name=lexactivator" "--module_path=/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@cryptlex/lexactivator/lib/binding/darwin-x64-napi-v{napi_build_version}-unknown" "--host=https://dl.cryptlex.com" "--remote_path=./downloads/nodejs/lexactivator/v3.12.3/" "--package_name=lexactivator-darwin-x64-napi-v{napi_build_version}-unknown.tar.gz"
gyp ERR! cwd /Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@cryptlex/lexactivator
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok
Failed with exit code: 1
at SafeSubscriber._error (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/spawn-rx/src/index.ts:296:18)
at SafeSubscriber.__tryOrUnsub (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/rxjs/src/internal/Subscriber.ts:265:10)
at SafeSubscriber.error (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/rxjs/src/internal/Subscriber.ts:220:16)
at Subscriber._error (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/rxjs/src/internal/Subscriber.ts:143:22)
at Subscriber.error (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/rxjs/src/internal/Subscriber.ts:113:12)
at MapSubscriber.Subscriber._error (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/rxjs/src/internal/Subscriber.ts:143:22)
at MapSubscriber.Subscriber.error (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/rxjs/src/internal/Subscriber.ts:113:12)
at SafeSubscriber._next (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/spawn-rx/src/index.ts:265:42)
at SafeSubscriber.__tryOrUnsub (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/rxjs/src/internal/Subscriber.ts:265:10)
at SafeSubscriber.next (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/rxjs/src/internal/Subscriber.ts:207:14)
at Subscriber._next (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/rxjs/src/internal/Subscriber.ts:139:22)
at Subscriber.next (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/rxjs/src/internal/Subscriber.ts:99:12)
at DefaultIfEmptySubscriber._next (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/rxjs/src/internal/operators/defaultIfEmpty.ts:75:22)
at DefaultIfEmptySubscriber.Subscriber.next (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/rxjs/src/internal/Subscriber.ts:99:12)
at TakeLastSubscriber._complete (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/rxjs/src/internal/operators/takeLast.ts:108:21)
at TakeLastSubscriber.Subscriber.complete (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/rxjs/src/internal/Subscriber.ts:126:12)
error Command failed with exit code 1.
Checking the code it says it requires 4 arguments where the first is the attribute name, no clue what the others are used for, by checking python imlementation it should return an object with allowed_uses
allowed_uses
and gross_uses
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.