├── .eslintrc.js ├── .github └── workflows │ ├── npm-publish.yml │ └── update-version.yml ├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── binding.gyp ├── examples ├── package-lock.json ├── package.json └── sample.js ├── lib └── bindings │ ├── linux │ ├── gcc │ │ ├── arm │ │ │ └── .gitkeep │ │ ├── arm64 │ │ │ └── .gitkeep │ │ └── x64 │ │ │ └── .gitkeep │ └── musl │ │ ├── arm64 │ │ └── .gitkeep │ │ └── x64 │ │ └── .gitkeep │ ├── macos │ ├── arm64 │ │ └── .gitkeep │ └── x64 │ │ └── .gitkeep │ └── windows │ ├── arm64 │ └── .gitkeep │ ├── x32 │ └── .gitkeep │ └── x64 │ └── .gitkeep ├── package-lock.json ├── package.json ├── scripts ├── build-linux-arm.sh ├── build-linux-musl-arm.sh ├── build-linux-musl.sh ├── build-linux.sh ├── build-macos.sh ├── build-windows-arm64.ps1 └── build-windows.ps1 ├── src ├── index.ts ├── lexactivator-exception.ts ├── lexactivator-native.ts ├── lexactivator.ts ├── lexstatus-codes.ts ├── native │ ├── CallbackWrapper.h │ ├── LexActivator.h │ ├── LexStatusCodes.h │ └── main.cpp └── release.ts └── tsconfig.json /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | 'env': { 3 | 'commonjs': true, 4 | 'es2021': true 5 | }, 6 | 'extends': [ 7 | 'eslint:recommended', 8 | 'plugin:@typescript-eslint/recommended' 9 | ], 10 | 'overrides': [ 11 | ], 12 | 'parser': '@typescript-eslint/parser', 13 | 'parserOptions': { 14 | 'ecmaVersion': 'latest' 15 | }, 16 | 'plugins': [ 17 | '@typescript-eslint' 18 | ], 19 | 'rules': { 20 | 'semi': [ 21 | 'error', 22 | 'always' 23 | ], 24 | '@typescript-eslint/explicit-function-return-type': 'warn' 25 | }, 26 | 'ignorePatterns': ['lib/**/*', 'examples/**/*', 'node_modules/**/*'] 27 | }; 28 | -------------------------------------------------------------------------------- /.github/workflows/npm-publish.yml: -------------------------------------------------------------------------------- 1 | name: Build @cryptlex/lexactivator package 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | # Link LexActivator static libs to Node 8 | build-addons: 9 | runs-on: ${{ matrix.os }} 10 | strategy: 11 | matrix: 12 | os: [ubuntu-latest, macos-13, windows-2019, windows-2022] 13 | steps: 14 | - uses: actions/checkout@v2 15 | 16 | - run: git pull origin master --ff-only 17 | 18 | - name: Setup Node.js v1 19 | if: matrix.os != 'windows-2022' 20 | uses: actions/setup-node@v1 21 | with: 22 | node-version: 10 23 | 24 | # - name: Install Windows 2015 build tools 25 | # if: matrix.os == 'windows-2019' 26 | # run: npm i --global windows-build-tools --vs2015 27 | 28 | - name: Build for Windows 2019 29 | if: matrix.os == 'windows-2019' 30 | shell: powershell 31 | run: | 32 | npm i -g node-gyp@8 33 | .\scripts\build-windows.ps1 34 | 35 | - name: Setup Node.js v4 36 | if: matrix.os == 'windows-2022' 37 | uses: actions/setup-node@v4 38 | with: 39 | node-version: 20 40 | 41 | - name: Build for Windows 2022 42 | if: matrix.os == 'windows-2022' 43 | shell: powershell 44 | run: | 45 | npm i -g node-gyp@10 46 | .\scripts\build-windows-arm64.ps1 47 | 48 | - name: Build for macOS 49 | if: matrix.os == 'macos-13' 50 | run: | 51 | npm i -g node-gyp@8 52 | ./scripts/build-macos.sh 53 | 54 | - name: Build for Linux 55 | if: matrix.os == 'ubuntu-latest' 56 | run: | 57 | docker run -t -v $PWD:$PWD -w $PWD cryptlex/gcc-4.9:1 ./scripts/build-linux.sh 58 | docker run -t -v $PWD:$PWD -w $PWD cryptlex/gcc-4.9-arm:1 ./scripts/build-linux-arm.sh 59 | docker run -t -v $PWD:$PWD -w $PWD cryptlex/alpine-builder:2 ./scripts/build-linux-musl.sh 60 | docker run -t -v $PWD:$PWD -w $PWD cryptlex/alpine-builder-arm:1 ./scripts/build-linux-musl-arm.sh 61 | 62 | - name: 'Upload artifacts' 63 | uses: actions/upload-artifact@v4 64 | with: 65 | name: artifacts-${{matrix.os}} 66 | path: | 67 | ./lib/bindings/linux/**/**/*.node 68 | ./lib/bindings/macos/**/*.node 69 | ./lib/bindings/windows/**/*.node 70 | ./lib/bindings/windows/**/*.dll 71 | retention-days: 1 72 | 73 | # Publish to NPM 74 | publish-npm: 75 | needs: build-addons 76 | runs-on: ubuntu-latest 77 | steps: 78 | - uses: actions/checkout@v2 79 | - uses: actions/setup-node@v3 80 | with: 81 | node-version: 16 82 | registry-url: https://registry.npmjs.org/ 83 | - run: git pull origin master --ff-only 84 | 85 | - name: 'Download artifacts' 86 | uses: actions/download-artifact@v4 87 | with: 88 | path: ./lib/bindings 89 | merge-multiple: true 90 | 91 | - name: 'Build library' 92 | run: | 93 | npm ci 94 | npm run build 95 | 96 | - run: npm publish --access public 97 | env: 98 | NODE_AUTH_TOKEN: ${{secrets.npm_token}} 99 | -------------------------------------------------------------------------------- /.github/workflows/update-version.yml: -------------------------------------------------------------------------------- 1 | name: Update verison 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | libraryVersion: 7 | description: 'Library Version' 8 | required: true 9 | default: '' 10 | packageVersion: 11 | description: 'Package Version' 12 | required: true 13 | default: '' 14 | 15 | jobs: 16 | # Set version in package.json, git tag 17 | update-version: 18 | runs-on: ubuntu-latest 19 | steps: 20 | - name: Checkout code 21 | uses: actions/checkout@v2 22 | 23 | - name: Update Library Version 24 | run: | 25 | sed -i '/VERSION=/!b;cVERSION=\"v${{ github.event.inputs.libraryVersion }}";' scripts/*.sh 26 | sed -i '/lexactivator_version =/!b;c$lexactivator_version ="v${{ github.event.inputs.libraryVersion }}"' scripts/*.ps1 27 | 28 | - name: Update Package Version 29 | run: | 30 | sed -i '/"version":/!b;c \ \ "version": "${{ github.event.inputs.packageVersion }}",' package.json 31 | 32 | - name: Commit, Tag and Push 33 | run: | 34 | git add package.json 35 | git add scripts/*.* 36 | git config user.name github-actions 37 | git config user.email github-actions@github.com 38 | git commit -m "chore(package version): updated version" | exit 0 39 | git tag ${{ github.event.inputs.packageVersion }} 40 | git push & git push --tags 41 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Bower dependency directory (https://bower.io/) 24 | bower_components 25 | 26 | # node-waf configuration 27 | .lock-wscript 28 | 29 | # Compiled binary addons (https://nodejs.org/api/addons.html) 30 | build 31 | *.node 32 | *.a 33 | 34 | # Dependency directories 35 | node_modules/ 36 | jspm_packages/ 37 | 38 | # TypeScript v1 declaration files 39 | typings/ 40 | 41 | # Optional npm cache directory 42 | .npm 43 | 44 | # Optional eslint cache 45 | .eslintcache 46 | 47 | # VSCode Config 48 | .vscode 49 | 50 | # Generated files 51 | lib/*.js 52 | lib/*.ts 53 | lib/*.map -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # Examples directory 2 | examples/ 3 | .vscode/ 4 | .git/ 5 | .github/ 6 | build/ 7 | node_modules/ 8 | scripts/ 9 | 10 | # libs 11 | .gitkeep 12 | LexActivator.lib 13 | libLexActivator.dylib 14 | libLexActivator.so 15 | libLexActivator.a 16 | binding.gyp 17 | 18 | # Source files 19 | src -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Cryptlex 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Build @cryptlex/lexactivator package](https://github.com/cryptlex/lexactivator-js/workflows/Build%20@cryptlex/lexactivator%20package/badge.svg) 2 | 3 | # @cryptlex/lexactivator 4 | 5 | Cryptlex lets you license your software apps effortlessly. You can easily generate license keys using the REST API or Dashboard and validate the license keys in your software apps using LexActivator (Cryptlex client library). 6 | 7 | Additionally, you can offer trials, subscriptions, floating licenses and much more. 8 | 9 | **LexActivator.js** is a Node.js wrapper for LexActivator licensing library. 10 | 11 | ## Installation 12 | 13 | npm install @cryptlex/lexactivator 14 | 15 | Then you can include it in your code: 16 | 17 | const { LexActivator, LexStatusCodes, LexActivatorException, PermissionFlags } = require('@cryptlex/lexactivator'); 18 | 19 | 20 | ## Usage 21 | Refer to following for documentation: 22 | 23 | https://docs.cryptlex.com/node-locked-licenses/using-lexactivator/using-lexactivator-with-node.js 24 | -------------------------------------------------------------------------------- /binding.gyp: -------------------------------------------------------------------------------- 1 | { 2 | "targets": [ 3 | { 4 | "target_name": "lexactivator", 5 | "sources": [ 6 | "src/native/main.cpp" 7 | ], 8 | "cflags!": [ 9 | "-fno-exceptions" 10 | ], 11 | "cflags_cc!": [ 12 | "-fno-exceptions" 13 | ], 14 | "include_dirs": [ 15 | " 6 | 7 | #ifdef _WIN32 8 | typedef std::wstring STRING; 9 | #else 10 | typedef std::string STRING; 11 | #endif 12 | 13 | class CallbackWrapper : public Napi::AsyncWorker 14 | { 15 | public: 16 | CallbackWrapper(Napi::Function &callback) : Napi::AsyncWorker(callback) 17 | { 18 | } 19 | uint32_t status; 20 | 21 | private: 22 | void Execute() 23 | { 24 | } 25 | 26 | void OnOK() 27 | { 28 | Napi::HandleScope scope(Env()); 29 | Callback().Call({Napi::Number::New(Env(), status)}); 30 | } 31 | }; 32 | 33 | class ReleaseUpdateCallbackWrapper : public Napi::AsyncWorker 34 | { 35 | public: 36 | ReleaseUpdateCallbackWrapper(Napi::Function &callback) : Napi::AsyncWorker(callback) 37 | { 38 | } 39 | uint32_t status; 40 | STRING releaseJson; 41 | void* userData; 42 | 43 | private: 44 | void Execute() 45 | { 46 | } 47 | 48 | void OnOK() 49 | { 50 | Napi::HandleScope scope(Env()); 51 | #ifdef _WIN32 52 | // convert STRING to utf16 encoded string 53 | const wchar_t *releaseJsonPtr = releaseJson.c_str(); 54 | const char16_t *utf16StringPtr = reinterpret_cast(releaseJsonPtr); 55 | Callback().Call({Napi::Number::New(Env(), status), Napi::String::New(Env(), utf16StringPtr), Napi::External::New(Env(), userData)}); 56 | #else 57 | Callback().Call({Napi::Number::New(Env(), status), Napi::String::New(Env(), releaseJson), Napi::External::New(Env(), userData)}); 58 | #endif 59 | } 60 | }; -------------------------------------------------------------------------------- /src/native/LexActivator.h: -------------------------------------------------------------------------------- 1 | /* LexActivator.h */ 2 | #pragma once 3 | 4 | #include 5 | #include 6 | #include "LexStatusCodes.h" 7 | #ifdef _WIN32 8 | /* 9 | Make sure you're using the MSVC or Intel compilers on Windows. 10 | */ 11 | #include 12 | 13 | #ifdef LEXACTIVATOR_EXPORTS 14 | #ifdef LEXACTIVATOR_STATIC 15 | #define LEXACTIVATOR_API extern "C" 16 | #else 17 | #define LEXACTIVATOR_API extern "C" __declspec(dllexport) 18 | #endif 19 | #else 20 | #ifdef __cplusplus 21 | #ifdef LEXACTIVATOR_STATIC 22 | #define LEXACTIVATOR_API extern "C" 23 | #else 24 | #define LEXACTIVATOR_API extern "C" __declspec(dllimport) 25 | #endif 26 | #else 27 | #ifdef LEXACTIVATOR_STATIC 28 | #define LEXACTIVATOR_API 29 | #else 30 | #define LEXACTIVATOR_API __declspec(dllimport) 31 | #endif 32 | #endif 33 | #endif 34 | 35 | #if defined(USE_STDCALL_DLL) && !defined(LEXACTIVATOR_STATIC) 36 | #define LA_CC __stdcall 37 | #else 38 | #define LA_CC __cdecl 39 | #endif 40 | typedef const wchar_t* CSTRTYPE; 41 | typedef wchar_t* STRTYPE; 42 | #else 43 | #define LA_CC 44 | #if __GNUC__ >= 4 45 | #ifdef __cplusplus 46 | #define LEXACTIVATOR_API extern "C" __attribute__((visibility("default"))) 47 | #else 48 | #define LEXACTIVATOR_API __attribute__((visibility("default"))) 49 | #endif 50 | #else 51 | #ifdef __cplusplus 52 | #define LEXACTIVATOR_API extern "C" 53 | #else 54 | #define LEXACTIVATOR_API 55 | #endif 56 | #endif 57 | typedef const char* CSTRTYPE; 58 | typedef char* STRTYPE; 59 | #endif 60 | 61 | typedef void (LA_CC *CallbackType)(uint32_t); 62 | typedef void (LA_CC *ReleaseCallbackType)(uint32_t, CSTRTYPE, void*); 63 | 64 | #define LA_USER ((uint32_t)1) 65 | #define LA_SYSTEM ((uint32_t)2) 66 | #define LA_ALL_USERS ((uint32_t)3) 67 | #define LA_IN_MEMORY ((uint32_t)4) 68 | 69 | #define LA_RELEASES_ALL ((uint32_t)1) 70 | #define LA_RELEASES_ALLOWED ((uint32_t)2) 71 | 72 | /* 73 | FUNCTION: SetProductFile() 74 | 75 | PURPOSE: Sets the absolute path of the Product.dat file. 76 | 77 | This function must be called on every start of your program 78 | before any other functions are called. 79 | 80 | PARAMETERS: 81 | * filePath - absolute path of the product file (Product.dat) 82 | 83 | RETURN CODES: LA_OK, LA_E_FILE_PATH, LA_E_PRODUCT_FILE 84 | 85 | NOTE: If this function fails to set the path of product file, none of the 86 | other functions will work. 87 | */ 88 | LEXACTIVATOR_API int LA_CC SetProductFile(CSTRTYPE filePath); 89 | 90 | /* 91 | FUNCTION: SetProductData() 92 | 93 | PURPOSE: Embeds the Product.dat file in the application. 94 | 95 | It can be used instead of SetProductFile() in case you want 96 | to embed the Product.dat file in your application. 97 | 98 | This function must be called on every start of your program 99 | before any other functions are called. 100 | 101 | PARAMETERS: 102 | * productData - content of the Product.dat file 103 | 104 | RETURN CODES: LA_OK, LA_E_PRODUCT_DATA 105 | 106 | NOTE: If this function fails to set the product data, none of the 107 | other functions will work. 108 | */ 109 | LEXACTIVATOR_API int LA_CC SetProductData(CSTRTYPE productData); 110 | 111 | /* 112 | FUNCTION: SetProductId() 113 | 114 | PURPOSE: Sets the product id of your application. 115 | 116 | This function must be called on every start of your program before 117 | any other functions are called, with the exception of SetProductFile() 118 | or SetProductData() function. 119 | 120 | PARAMETERS: 121 | * productId - the unique product id of your application as mentioned 122 | on the product page in the dashboard. 123 | 124 | * flags - depending on your application's requirements, choose one of 125 | the following values: LA_USER, LA_SYSTEM, LA_IN_MEMORY, LA_ALL_USERS. 126 | 127 | - LA_USER: This flag indicates that the application does not require 128 | admin or root permissions to run. 129 | 130 | - LA_SYSTEM: This flag indicates that the application must be run with admin or 131 | root permissions. 132 | 133 | - LA_IN_MEMORY: This flag will store activation data in memory. Thus, requires 134 | re-activation on every start of the application and should only be used in floating 135 | licenses. 136 | 137 | - LA_ALL_USERS: This flag is specifically designed for Windows and should be used 138 | for system-wide activations. 139 | 140 | RETURN CODES: LA_OK, LA_E_WMIC, LA_E_PRODUCT_FILE, LA_E_PRODUCT_DATA, LA_E_PRODUCT_ID, 141 | LA_E_SYSTEM_PERMISSION 142 | 143 | NOTE: If this function fails to set the product id, none of the other 144 | functions will work. 145 | */ 146 | LEXACTIVATOR_API int LA_CC SetProductId(CSTRTYPE productId, uint32_t flags); 147 | 148 | /* 149 | FUNCTION: SetDataDirectory() 150 | 151 | PURPOSE: In case you want to change the default directory used by LexActivator to 152 | store the activation data on Linux and macOS, this function can be used to 153 | set a different directory. 154 | 155 | If you decide to use this function, then it must be called on every start of 156 | your program before calling SetProductFile() or SetProductData() function. 157 | 158 | Please ensure that the directory exists and your app has read and write 159 | permissions in the directory. 160 | 161 | PARAMETERS: 162 | * directoryPath - absolute path of the directory. 163 | 164 | RETURN CODES: LA_OK, LA_E_FILE_PERMISSION 165 | 166 | */ 167 | LEXACTIVATOR_API int LA_CC SetDataDirectory(CSTRTYPE directoryPath); 168 | 169 | /* 170 | FUNCTION: SetDebugMode() 171 | 172 | PURPOSE: Enables network logs. 173 | 174 | This function should be used for network testing only in case of network errors. 175 | By default logging is disabled. 176 | 177 | This function generates the lexactivator-logs.log file in the same directory 178 | where the application is running. 179 | 180 | PARAMETERS : 181 | *enable - 0 or 1 to disable or enable logging. 182 | 183 | RETURN CODES : LA_OK 184 | */ 185 | LEXACTIVATOR_API int LA_CC SetDebugMode(uint32_t enable); 186 | 187 | /* 188 | FUNCTION: SetCacheMode() 189 | 190 | PURPOSE: Enables or disables in-memory caching for LexActivator. This function is designed to control caching 191 | behavior to suit specific application requirements. Caching is enabled by default to enhance performance. 192 | 193 | Disabling caching is recommended in environments where multiple processes access the same license on a 194 | single machine and require real-time updates to the license state. 195 | 196 | * enable - 0 or 1 to disable or enable in-memory caching. 197 | 198 | RETURN CODES: LA_OK, LA_E_PRODUCT_ID 199 | */ 200 | 201 | LEXACTIVATOR_API int LA_CC SetCacheMode(uint32_t enable); 202 | 203 | /* 204 | FUNCTION: SetCustomDeviceFingerprint() 205 | 206 | PURPOSE: In case you don't want to use the LexActivator's advanced 207 | device fingerprinting algorithm, this function can be used to set a custom 208 | device fingerprint. 209 | 210 | If you decide to use your own custom device fingerprint then this function must be 211 | called on every start of your program immediately after calling SetProductFile() 212 | or SetProductData() function. 213 | 214 | The license fingerprint matching strategy is ignored if this function is used. 215 | 216 | PARAMETERS: 217 | * fingerprint - string of minimum length 64 characters and maximum length 256 characters. 218 | 219 | RETURN CODES: LA_OK, LA_E_PRODUCT_ID, LA_E_CUSTOM_FINGERPRINT_LENGTH 220 | */ 221 | LEXACTIVATOR_API int LA_CC SetCustomDeviceFingerprint(CSTRTYPE fingerprint); 222 | 223 | /* 224 | FUNCTION: SetLicenseKey() 225 | 226 | PURPOSE: Sets the license key required to activate the license. 227 | 228 | PARAMETERS: 229 | * licenseKey - a valid license key. 230 | 231 | RETURN CODES: LA_OK, LA_E_PRODUCT_ID, LA_E_LICENSE_KEY 232 | */ 233 | LEXACTIVATOR_API int LA_CC SetLicenseKey(CSTRTYPE licenseKey); 234 | 235 | /* 236 | FUNCTION: SetLicenseUserCredential() 237 | 238 | PURPOSE: Sets the license user email and password for authentication. 239 | 240 | This function must be called before ActivateLicense() or IsLicenseGenuine() 241 | function if 'requireAuthentication' property of the license is set to true. 242 | 243 | PARAMETERS: 244 | * email - user email address. 245 | * password - user password. 246 | 247 | RETURN CODES: LA_OK, LA_E_PRODUCT_ID, LA_E_LICENSE_KEY 248 | */ 249 | LEXACTIVATOR_API int LA_CC SetLicenseUserCredential(CSTRTYPE email, CSTRTYPE password); 250 | 251 | /* 252 | FUNCTION: SetLicenseCallback() 253 | 254 | PURPOSE: Sets server sync callback function. 255 | 256 | In case this function is used it should be called just before the IsLicenseGenuine(). 257 | 258 | Whenever the server sync occurs in a separate thread, and server returns the response, 259 | license callback function gets invoked with the following status codes: 260 | LA_OK, LA_EXPIRED, LA_SUSPENDED, 261 | LA_E_REVOKED, LA_E_ACTIVATION_NOT_FOUND, LA_E_MACHINE_FINGERPRINT 262 | LA_E_AUTHENTICATION_FAILED, LA_E_COUNTRY, LA_E_INET, LA_E_SERVER, 263 | LA_E_RATE_LIMIT, LA_E_IP 264 | 265 | PARAMETERS: 266 | * callback - name of the callback function 267 | 268 | RETURN CODES: LA_OK, LA_E_PRODUCT_ID, LA_E_LICENSE_KEY 269 | */ 270 | LEXACTIVATOR_API int LA_CC SetLicenseCallback(CallbackType callback); 271 | 272 | /* 273 | FUNCTION: SetActivationLeaseDuration() 274 | 275 | PURPOSE: Sets the lease duration for the activation. 276 | 277 | The activation lease duration is honoured when the allow client 278 | lease duration property is enabled. 279 | 280 | PARAMETERS: 281 | * leaseDuration - value of the lease duration. A value of -1 indicates unlimited 282 | lease duration. 283 | 284 | RETURN CODES: LA_OK, LA_E_PRODUCT_ID, LA_E_LICENSE_KEY 285 | */ 286 | LEXACTIVATOR_API int LA_CC SetActivationLeaseDuration(int64_t leaseDuration); 287 | 288 | /* 289 | FUNCTION: SetActivationMetadata() 290 | 291 | PURPOSE: Sets the activation metadata. 292 | 293 | The metadata appears along with the activation details of the license 294 | in dashboard. 295 | 296 | PARAMETERS: 297 | * key - string of maximum length 256 characters. 298 | * value - string of maximum length 4096 characters. 299 | 300 | RETURN CODES: LA_OK, LA_E_PRODUCT_ID, LA_E_LICENSE_KEY, LA_E_METADATA_KEY_LENGTH, 301 | LA_E_METADATA_VALUE_LENGTH, LA_E_ACTIVATION_METADATA_LIMIT 302 | */ 303 | LEXACTIVATOR_API int LA_CC SetActivationMetadata(CSTRTYPE key, CSTRTYPE value); 304 | 305 | /* 306 | FUNCTION: SetTrialActivationMetadata() 307 | 308 | PURPOSE: Sets the trial activation metadata. 309 | 310 | The metadata appears along with the trial activation details of the product 311 | in dashboard. 312 | 313 | PARAMETERS: 314 | * key - string of maximum length 256 characters. 315 | * value - string of maximum length 4096 characters. 316 | 317 | RETURN CODES: LA_OK, LA_E_PRODUCT_ID, LA_E_METADATA_KEY_LENGTH, 318 | LA_E_METADATA_VALUE_LENGTH, LA_E_TRIAL_ACTIVATION_METADATA_LIMIT 319 | */ 320 | LEXACTIVATOR_API int LA_CC SetTrialActivationMetadata(CSTRTYPE key, CSTRTYPE value); 321 | 322 | /* 323 | FUNCTION: SetAppVersion() 324 | 325 | PURPOSE: Sets the current app version of your application. 326 | 327 | The app version appears along with the activation details in dashboard. It 328 | is also used to generate app analytics. 329 | 330 | PARAMETERS: 331 | * appVersion - string of maximum length 256 characters. 332 | 333 | RETURN CODES: LA_OK, LA_E_PRODUCT_ID, LA_E_APP_VERSION_LENGTH 334 | */ 335 | LEXACTIVATOR_API int LA_CC SetAppVersion(CSTRTYPE appVersion); 336 | 337 | /* 338 | FUNCTION: SetReleaseVersion() 339 | 340 | PURPOSE: Sets the current release version of your application. 341 | 342 | The release version appears along with the activation details in dashboard. 343 | 344 | PARAMETERS: 345 | * releaseVersion - string in following allowed formats: x.x, x.x.x, x.x.x.x 346 | 347 | RETURN CODES: LA_OK, LA_E_PRODUCT_ID, LA_E_RELEASE_VERSION_FORMAT 348 | */ 349 | LEXACTIVATOR_API int LA_CC SetReleaseVersion(CSTRTYPE releaseVersion); 350 | 351 | /* 352 | FUNCTION: SetReleasePublishedDate() 353 | 354 | PURPOSE: Sets the release published date of your application. 355 | 356 | PARAMETERS: 357 | * releasePublishedDate - unix timestamp of release published date. 358 | 359 | RETURN CODES: LA_OK, LA_E_PRODUCT_ID 360 | */ 361 | LEXACTIVATOR_API int LA_CC SetReleasePublishedDate(uint32_t releasePublishedDate); 362 | 363 | /* 364 | FUNCTION: SetReleasePlatform() 365 | 366 | PURPOSE: Sets the release platform e.g. windows, macos, linux 367 | 368 | The release platform appears along with the activation details in dashboard. 369 | 370 | PARAMETERS: 371 | * releasePlatform - release platform e.g. windows, macos, linux 372 | 373 | RETURN CODES: LA_OK, LA_E_PRODUCT_ID, LA_E_RELEASE_PLATFORM_LENGTH 374 | */ 375 | LEXACTIVATOR_API int LA_CC SetReleasePlatform(CSTRTYPE releasePlatform); 376 | 377 | /* 378 | FUNCTION: SetReleaseChannel() 379 | 380 | PURPOSE: Sets the release channel e.g. stable, beta 381 | 382 | The release channel appears along with the activation details in dashboard. 383 | 384 | PARAMETERS: 385 | * channel - release channel e.g. stable 386 | 387 | RETURN CODES: LA_OK, LA_E_PRODUCT_ID, LA_E_RELEASE_CHANNEL_LENGTH 388 | */ 389 | LEXACTIVATOR_API int LA_CC SetReleaseChannel(CSTRTYPE releaseChannel); 390 | 391 | /* 392 | FUNCTION: SetOfflineActivationRequestMeterAttributeUses() 393 | 394 | PURPOSE: Sets the meter attribute uses for the offline activation request. 395 | 396 | This function should only be called before GenerateOfflineActivationRequest() 397 | function to set the meter attributes in case of offline activation. 398 | 399 | PARAMETERS: 400 | * name - name of the meter attribute 401 | * uses - the uses value 402 | 403 | RETURN CODES: LA_OK, LA_E_PRODUCT_ID, LA_E_LICENSE_KEY 404 | 405 | */ 406 | LEXACTIVATOR_API int LA_CC SetOfflineActivationRequestMeterAttributeUses(CSTRTYPE name, uint32_t uses); 407 | 408 | /* 409 | FUNCTION: SetNetworkProxy() 410 | 411 | PURPOSE: Sets the network proxy to be used when contacting Cryptlex servers. 412 | 413 | The proxy format should be: [protocol://][username:password@]machine[:port] 414 | 415 | Following are some examples of the valid proxy strings: 416 | - http://127.0.0.1:8000/ 417 | - http://user:pass@127.0.0.1:8000/ 418 | - socks5://127.0.0.1:8000/ 419 | 420 | PARAMETERS: 421 | * proxy - proxy string having correct proxy format 422 | 423 | RETURN CODES: LA_OK, LA_E_PRODUCT_ID, LA_E_NET_PROXY 424 | 425 | NOTE: Proxy settings of the computer are automatically detected. So, in most of the 426 | cases you don't need to care whether your user is behind a proxy server or not. 427 | */ 428 | LEXACTIVATOR_API int LA_CC SetNetworkProxy(CSTRTYPE proxy); 429 | 430 | /* 431 | FUNCTION: SetCryptlexHost() 432 | 433 | PURPOSE: In case you are running Cryptlex on-premise, you can set the 434 | host for your on-premise server. 435 | 436 | PARAMETERS: 437 | * host - the address of the Cryptlex on-premise server 438 | 439 | RETURN CODES: LA_OK, LA_E_PRODUCT_ID, LA_E_HOST_URL 440 | */ 441 | LEXACTIVATOR_API int LA_CC SetCryptlexHost(CSTRTYPE host); 442 | 443 | /* 444 | FUNCTION: SetTwoFactorAuthenticationCode() 445 | 446 | PURPOSE: Sets the two-factor authentication code for the user authentication. 447 | 448 | PARAMETERS: 449 | * twoFactorAuthenticationCode - the 2FA code 450 | 451 | RETURN CODES: LA_OK, LA_E_PRODUCT_ID, LA_E_TWO_FACTOR_AUTHENTICATION_CODE_INVALID 452 | */ 453 | LEXACTIVATOR_API int LA_CC SetTwoFactorAuthenticationCode(CSTRTYPE twoFactorAuthenticationCode); 454 | 455 | /* 456 | FUNCTION: GetProductMetadata() 457 | 458 | PURPOSE: Gets the product metadata as set in the dashboard. 459 | 460 | This is available for trial as well as license activations. 461 | 462 | PARAMETERS: 463 | * key - key to retrieve the value 464 | * value - pointer to a buffer that receives the value of the string 465 | * length - size of the buffer pointed to by the value parameter 466 | 467 | RETURN CODES: LA_OK, LA_E_PRODUCT_ID, LA_E_METADATA_KEY_NOT_FOUND, LA_E_BUFFER_SIZE 468 | */ 469 | LEXACTIVATOR_API int LA_CC GetProductMetadata(CSTRTYPE key, STRTYPE value, uint32_t length); 470 | 471 | /* 472 | FUNCTION: GetProductVersionName() 473 | 474 | PURPOSE: Gets the product version name. 475 | 476 | PARAMETERS: 477 | * name - pointer to a buffer that receives the value of the string 478 | * length - size of the buffer pointed to by the name parameter 479 | 480 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME, LA_E_TIME_MODIFIED, LA_E_PRODUCT_VERSION_NOT_LINKED, 481 | LA_E_BUFFER_SIZE 482 | */ 483 | LEXACTIVATOR_API int LA_CC GetProductVersionName(STRTYPE name, uint32_t length); 484 | 485 | /* 486 | FUNCTION: GetProductVersionDisplayName() 487 | 488 | PURPOSE: Gets the product version display name. 489 | 490 | PARAMETERS: 491 | * displayName - pointer to a buffer that receives the value of the string 492 | * length - size of the buffer pointed to by the displayName parameter 493 | 494 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME, LA_E_TIME_MODIFIED, LA_E_PRODUCT_VERSION_NOT_LINKED, 495 | LA_E_BUFFER_SIZE 496 | */ 497 | LEXACTIVATOR_API int LA_CC GetProductVersionDisplayName(STRTYPE displayName, uint32_t length); 498 | 499 | /* 500 | FUNCTION: GetProductVersionFeatureFlag() 501 | 502 | PURPOSE: Gets the product version feature flag. 503 | 504 | PARAMETERS: 505 | * name - name of the feature flag 506 | * enabled - pointer to the integer that receives the value - 0 or 1 507 | * data - pointer to a buffer that receives the value of the string 508 | * length - size of the buffer pointed to by the data parameter 509 | 510 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME, LA_E_TIME_MODIFIED, LA_E_PRODUCT_VERSION_NOT_LINKED, 511 | LA_E_FEATURE_FLAG_NOT_FOUND, LA_E_BUFFER_SIZE 512 | */ 513 | LEXACTIVATOR_API int LA_CC GetProductVersionFeatureFlag(CSTRTYPE name, uint32_t *enabled, STRTYPE data, uint32_t length); 514 | 515 | /* 516 | FUNCTION: GetLicenseEntitlementSetName() 517 | 518 | PURPOSE: Gets the license entitlement set name. 519 | 520 | PARAMETERS: 521 | * name - pointer to a buffer that receives the value of the string 522 | * length - size of the buffer pointed to by the name parameter 523 | 524 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME, LA_E_TIME_MODIFIED, LA_E_BUFFER_SIZE, LA_E_ENTITLEMENT_SET_NOT_LINKED 525 | */ 526 | LEXACTIVATOR_API int LA_CC GetLicenseEntitlementSetName(STRTYPE name, uint32_t length); 527 | 528 | /* 529 | FUNCTION: GetLicenseEntitlementSetDisplayName() 530 | 531 | PURPOSE: Gets the license entitlement set display name. 532 | 533 | PARAMETERS: 534 | * displayName - pointer to a buffer that receives the value of the string 535 | * length - size of the buffer pointed to by the displayName parameter 536 | 537 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME, LA_E_TIME_MODIFIED, LA_E_BUFFER_SIZE, 538 | LA_E_ENTITLEMENT_SET_NOT_LINKED 539 | */ 540 | LEXACTIVATOR_API int LA_CC GetLicenseEntitlementSetDisplayName(STRTYPE displayName, uint32_t length); 541 | 542 | /* 543 | FUNCTION: GetFeatureEntitlementsInternal() 544 | 545 | PURPOSE: Gets the feature entitlements associated with the license. 546 | 547 | Feature entitlements can be linked directly to a license (license feature entitlements) 548 | or via entitlement sets. If a feature entitlement is defined in both, the value from 549 | the license feature entitlement takes precedence, overriding the entitlement set value. 550 | 551 | PARAMETERS: 552 | * featureEntitlementsJson - pointer to a buffer that receives the value of the string 553 | * length - size of the buffer pointed to by the featureEntitlementsJson parameter 554 | 555 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME, LA_E_TIME_MODIFIED, 556 | LA_E_BUFFER_SIZE, LA_E_FEATURE_ENTITLEMENTS_INVALID 557 | */ 558 | LEXACTIVATOR_API int LA_CC GetFeatureEntitlementsInternal(STRTYPE featureEntitlementsJson, uint32_t length); 559 | 560 | /* 561 | FUNCTION: GetFeatureEntitlementInternal() 562 | 563 | PURPOSE: Gets the feature entitlement associated with the license. 564 | 565 | Feature entitlements can be linked directly to a license (license feature entitlements) 566 | or via entitlement sets. If a feature entitlement is defined in both, the value from 567 | the license feature entitlement takes precedence, overriding the entitlement set value. 568 | 569 | PARAMETERS: 570 | * featureName - name of the feature 571 | * featureEntitlementJson - pointer to a buffer that receives the value of the string 572 | * length - size of the buffer pointed to by the featureEntitlementJson parameter 573 | 574 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME, LA_E_TIME_MODIFIED, 575 | LA_E_BUFFER_SIZE, LA_E_FEATURE_ENTITLEMENT_NOT_FOUND, LA_E_FEATURE_ENTITLEMENTS_INVALID 576 | */ 577 | LEXACTIVATOR_API int LA_CC GetFeatureEntitlementInternal(CSTRTYPE featureName, STRTYPE featureEntitlementJson, uint32_t length); 578 | 579 | /* 580 | FUNCTION: GetLicenseMetadata() 581 | 582 | PURPOSE: Gets the license metadata as set in the dashboard. 583 | 584 | PARAMETERS: 585 | * key - key to retrieve the value 586 | * value - pointer to a buffer that receives the value of the string 587 | * length - size of the buffer pointed to by the value parameter 588 | 589 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_METADATA_KEY_NOT_FOUND, LA_E_BUFFER_SIZE 590 | */ 591 | LEXACTIVATOR_API int LA_CC GetLicenseMetadata(CSTRTYPE key, STRTYPE value, uint32_t length); 592 | 593 | /* 594 | FUNCTION: GetLicenseMeterAttribute() 595 | 596 | PURPOSE: Gets the license meter attribute allowed, total and gross uses. 597 | 598 | PARAMETERS: 599 | * name - name of the meter attribute 600 | * allowedUses - pointer to the integer that receives the value. A value of -1 indicates unlimited allowed uses. 601 | * totalUses - pointer to the integer that receives the value 602 | * grossUses - pointer to the integer that receives the value 603 | 604 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_METER_ATTRIBUTE_NOT_FOUND 605 | */ 606 | LEXACTIVATOR_API int LA_CC GetLicenseMeterAttribute(CSTRTYPE name, int64_t *allowedUses, uint64_t *totalUses, uint64_t *grossUses); 607 | 608 | /* 609 | FUNCTION: GetLicenseKey() 610 | 611 | PURPOSE: Gets the license key used for activation. 612 | 613 | PARAMETERS: 614 | * licenseKey - pointer to a buffer that receives the value of the string 615 | * length - size of the buffer pointed to by the licenseKey parameter 616 | 617 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_BUFFER_SIZE 618 | */ 619 | LEXACTIVATOR_API int LA_CC GetLicenseKey(STRTYPE licenseKey, uint32_t length); 620 | 621 | /* 622 | FUNCTION: GetLicenseAllowedActivations() 623 | 624 | PURPOSE: Gets the allowed activations of the license. 625 | 626 | PARAMETERS: 627 | * allowedActivations - pointer to the integer that receives the value. 628 | A value of -1 indicates unlimited number of activations. 629 | 630 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME, LA_E_TIME_MODIFIED 631 | */ 632 | LEXACTIVATOR_API int LA_CC GetLicenseAllowedActivations(int64_t *allowedActivations); 633 | 634 | /* 635 | FUNCTION: GetLicenseTotalActivations() 636 | 637 | PURPOSE: Gets the total activations of the license. 638 | 639 | PARAMETERS: 640 | * totalActivations - pointer to the integer that receives the value 641 | 642 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME, LA_E_TIME_MODIFIED 643 | */ 644 | LEXACTIVATOR_API int LA_CC GetLicenseTotalActivations(uint32_t *totalActivations); 645 | 646 | /* 647 | FUNCTION: GetLicenseAllowedDeactivations() 648 | 649 | PURPOSE: Gets the allowed deactivations of the license. 650 | 651 | PARAMETERS: 652 | * allowedDeactivations - pointer to the integer that receives the value. 653 | A value of -1 indicates unlimited number of deactivations. 654 | 655 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME, LA_E_TIME_MODIFIED 656 | */ 657 | LEXACTIVATOR_API int LA_CC GetLicenseAllowedDeactivations(int64_t *allowedDeactivations); 658 | 659 | /* 660 | FUNCTION: GetLicenseTotalDeactivations() 661 | 662 | PURPOSE: Gets the total deactivations of the license. 663 | 664 | PARAMETERS: 665 | * totalDeactivations - pointer to the integer that receives the value 666 | 667 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME, LA_E_TIME_MODIFIED 668 | */ 669 | LEXACTIVATOR_API int LA_CC GetLicenseTotalDeactivations(uint32_t *totalDeactivations); 670 | 671 | /* 672 | FUNCTION: GetLicenseCreationDate() 673 | 674 | PURPOSE: Gets the license creation date timestamp. 675 | 676 | PARAMETERS: 677 | * creationDate - pointer to the integer that receives the value 678 | 679 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_LICENSE_KEY, LA_E_TIME, LA_E_TIME_MODIFIED 680 | */ 681 | LEXACTIVATOR_API int LA_CC GetLicenseCreationDate(uint32_t *creationDate); 682 | 683 | /* 684 | FUNCTION: GetLicenseActivationDate() 685 | 686 | PURPOSE: Gets the activation creation date timestamp. 687 | 688 | PARAMETERS: 689 | * activationDate - pointer to the integer that receives the value 690 | 691 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_LICENSE_KEY, LA_E_TIME, LA_E_TIME_MODIFIED 692 | */ 693 | LEXACTIVATOR_API int LA_CC GetLicenseActivationDate(uint32_t *activationDate); 694 | 695 | /* 696 | FUNCTION: GetActivationCreationDate() 697 | 698 | PURPOSE: Gets the activation creation date timestamp for the current activation. 699 | 700 | PARAMETERS: 701 | * activationCreationDate - pointer to the integer that receives the value 702 | 703 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_LICENSE_KEY, LA_E_TIME, LA_E_TIME_MODIFIED 704 | */ 705 | 706 | LEXACTIVATOR_API int LA_CC GetActivationCreationDate(uint32_t *activationCreationDate); 707 | 708 | /* 709 | FUNCTION: GetActivationLastSyncedDate() 710 | 711 | PURPOSE: Gets the activation last synced date timestamp. 712 | 713 | Initially, this timestamp matches the activation creation date, and then updates with each successful server sync. 714 | 715 | PARAMETERS: 716 | * activationLastSyncedDate - pointer to the integer that receives the value 717 | 718 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_LICENSE_KEY, LA_E_TIME, LA_E_TIME_MODIFIED 719 | */ 720 | LEXACTIVATOR_API int LA_CC GetActivationLastSyncedDate(uint32_t *activationLastSyncedDate); 721 | 722 | /* 723 | FUNCTION: GetLicenseExpiryDate() 724 | 725 | PURPOSE: Gets the license expiry date timestamp. 726 | 727 | PARAMETERS: 728 | * expiryDate - pointer to the integer that receives the value. 729 | A value of 0 indicates it has no expiry i.e a lifetime license. 730 | 731 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME, LA_E_TIME_MODIFIED 732 | */ 733 | LEXACTIVATOR_API int LA_CC GetLicenseExpiryDate(uint32_t *expiryDate); 734 | 735 | /* 736 | FUNCTION: GetLicenseMaintenanceExpiryDate() 737 | 738 | PURPOSE: Gets the license maintenance expiry date timestamp. 739 | 740 | PARAMETERS: 741 | * maintenanceExpiryDate - pointer to the integer that receives the value. 742 | A value of 0 indicates an unlimited maintenance period. 743 | 744 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_LICENSE_KEY, LA_E_TIME, LA_E_TIME_MODIFIED 745 | */ 746 | LEXACTIVATOR_API int LA_CC GetLicenseMaintenanceExpiryDate(uint32_t* maintenanceExpiryDate); 747 | 748 | /* 749 | FUNCTION: GetLicenseMaxAllowedReleaseVersion() 750 | 751 | PURPOSE: Gets the maximum allowed release version of the license. 752 | 753 | PARAMETERS: 754 | * maxAllowedReleaseVersion - pointer to a buffer that receives the value of the string. 755 | * length - size of the buffer pointed to by the maxAllowedReleaseVersion parameter. 756 | 757 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_LICENSE_KEY, LA_E_TIME, LA_E_TIME_MODIFIED, LA_E_BUFFER_SIZE 758 | */ 759 | LEXACTIVATOR_API int LA_CC GetLicenseMaxAllowedReleaseVersion(STRTYPE maxAllowedReleaseVersion, uint32_t length); 760 | 761 | /* 762 | FUNCTION: GetLicenseUserEmail() 763 | 764 | PURPOSE: Gets the email associated with license user. 765 | 766 | PARAMETERS: 767 | * email - pointer to a buffer that receives the value of the string 768 | * length - size of the buffer pointed to by the email parameter 769 | 770 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME, LA_E_TIME_MODIFIED, 771 | LA_E_BUFFER_SIZE 772 | */ 773 | LEXACTIVATOR_API int LA_CC GetLicenseUserEmail(STRTYPE email, uint32_t length); 774 | 775 | /* 776 | FUNCTION: GetLicenseUserName() 777 | 778 | PURPOSE: Gets the name associated with the license user. 779 | 780 | PARAMETERS: 781 | * name - pointer to a buffer that receives the value of the string 782 | * length - size of the buffer pointed to by the name parameter 783 | 784 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME, LA_E_TIME_MODIFIED, 785 | LA_E_BUFFER_SIZE 786 | */ 787 | LEXACTIVATOR_API int LA_CC GetLicenseUserName(STRTYPE name, uint32_t length); 788 | 789 | /* 790 | FUNCTION: GetLicenseUserCompany() 791 | 792 | PURPOSE: Gets the company associated with the license user. 793 | 794 | PARAMETERS: 795 | * company - pointer to a buffer that receives the value of the string 796 | * length - size of the buffer pointed to by the company parameter 797 | 798 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME, LA_E_TIME_MODIFIED, 799 | LA_E_BUFFER_SIZE 800 | */ 801 | LEXACTIVATOR_API int LA_CC GetLicenseUserCompany(STRTYPE company, uint32_t length); 802 | 803 | /* 804 | FUNCTION: GetLicenseUserMetadata() 805 | 806 | PURPOSE: Gets the metadata associated with the license user. 807 | 808 | PARAMETERS: 809 | * key - key to retrieve the value 810 | * value - pointer to a buffer that receives the value of the string 811 | * length - size of the buffer pointed to by the value parameter 812 | 813 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_METADATA_KEY_NOT_FOUND, LA_E_BUFFER_SIZE 814 | */ 815 | LEXACTIVATOR_API int LA_CC GetLicenseUserMetadata(CSTRTYPE key, STRTYPE value, uint32_t length); 816 | 817 | /* 818 | FUNCTION: GetLicenseOrganizationName() 819 | 820 | PURPOSE: Gets the organization name associated with the license. 821 | 822 | PARAMETERS: 823 | * organizationName - pointer to a buffer that receives the value of the string. 824 | * length - size of the buffer pointed to by the organizationName parameter 825 | 826 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME, LA_E_TIME_MODIFIED, 827 | LA_E_BUFFER_SIZE 828 | */ 829 | LEXACTIVATOR_API int LA_CC GetLicenseOrganizationName(STRTYPE organizationName, uint32_t length); 830 | 831 | /* 832 | FUNCTION: GetLicenseOrganizationAddressInternal() 833 | 834 | PURPOSE: Gets the organization address json associated with the license. 835 | 836 | PARAMETERS: 837 | * organizationAddress - pointer to a buffer that receives the value of the string. 838 | * length - size of the buffer pointed to by the organizationAddress parameter 839 | 840 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME, LA_E_TIME_MODIFIED, 841 | LA_E_BUFFER_SIZE 842 | */ 843 | LEXACTIVATOR_API int LA_CC GetLicenseOrganizationAddressInternal(STRTYPE organizationAddress, uint32_t length); 844 | 845 | /* 846 | FUNCTION: GetUserLicenses() 847 | 848 | PURPOSE: Gets the user licenses for the product. 849 | 850 | This function sends a network request to Cryptlex servers to get the licenses. 851 | 852 | Make sure AuthenticateUser() function is called before calling this function. 853 | 854 | PARAMETERS: 855 | * userLicenses - pointer to a buffer that receives the value of the string. 856 | * length - size of the buffer pointed to by the userLicenses parameter 857 | 858 | RETURN CODES: LA_OK, LA_E_PRODUCT_ID, LA_E_INET, LA_E_SERVER, LA_E_RATE_LIMIT 859 | LA_E_USER_NOT_AUTHENTICATED, LA_E_BUFFER_SIZE 860 | */ 861 | LEXACTIVATOR_API int LA_CC GetUserLicensesInternal(STRTYPE userLicenses, uint32_t length); 862 | 863 | /* 864 | FUNCTION: GetLicenseType() 865 | 866 | PURPOSE: Gets the license type (node-locked or hosted-floating). 867 | 868 | PARAMETERS: 869 | * licenseType - pointer to a buffer that receives the value of the string 870 | * length - size of the buffer pointed to by the licenseType parameter 871 | 872 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME, LA_E_TIME_MODIFIED, 873 | LA_E_BUFFER_SIZE 874 | */ 875 | LEXACTIVATOR_API int LA_CC GetLicenseType(STRTYPE licenseType, uint32_t length); 876 | 877 | /* 878 | FUNCTION: GetActivationId() 879 | 880 | PURPOSE: Gets the activation id. 881 | 882 | PARAMETERS: 883 | * id - pointer to a buffer that receives the value of the string 884 | * length - size of the buffer pointed to by the id parameter 885 | 886 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME, LA_E_TIME_MODIFIED, 887 | LA_E_BUFFER_SIZE 888 | */ 889 | LEXACTIVATOR_API int LA_CC GetActivationId(STRTYPE id, uint32_t length); 890 | 891 | /* 892 | FUNCTION: GetActivationMetadata() 893 | 894 | PURPOSE: Gets the activation metadata. 895 | 896 | PARAMETERS: 897 | * key - key to retrieve the value 898 | * value - pointer to a buffer that receives the value of the string 899 | * length - size of the buffer pointed to by the value parameter 900 | 901 | RETURN CODES: LA_OK, LA_E_PRODUCT_ID, LA_E_METADATA_KEY_NOT_FOUND, LA_E_BUFFER_SIZE 902 | */ 903 | LEXACTIVATOR_API int LA_CC GetActivationMetadata(CSTRTYPE key, STRTYPE value, uint32_t length); 904 | 905 | /* 906 | FUNCTION: GetActivationMode() 907 | 908 | PURPOSE: Gets the initial and current mode of activation (online or offline). 909 | 910 | PARAMETERS: 911 | * initialMode - pointer to a buffer that receives the initial mode of activation 912 | * initialModeLength - size of the buffer pointed to by the initialMode parameter 913 | * currentMode - pointer to a buffer that receives the current mode of activation 914 | * currentModeLength - size of the buffer pointed to by the currentMode parameter 915 | 916 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_LICENSE_KEY, LA_E_TIME_MODIFIED, 917 | LA_E_BUFFER_SIZE 918 | */ 919 | LEXACTIVATOR_API int LA_CC GetActivationMode(STRTYPE initialMode, uint32_t initialModeLength, STRTYPE currentMode, uint32_t currentModeLength); 920 | 921 | /* 922 | FUNCTION: GetActivationMeterAttributeUses() 923 | 924 | PURPOSE: Gets the meter attribute uses consumed by the activation. 925 | 926 | PARAMETERS: 927 | * name - name of the meter attribute 928 | * allowedUses - pointer to the integer that receives the value 929 | 930 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_METER_ATTRIBUTE_NOT_FOUND 931 | */ 932 | LEXACTIVATOR_API int LA_CC GetActivationMeterAttributeUses(CSTRTYPE name, uint32_t *uses); 933 | 934 | /* 935 | FUNCTION: GetServerSyncGracePeriodExpiryDate() 936 | 937 | PURPOSE: Gets the server sync grace period expiry date timestamp. 938 | 939 | PARAMETERS: 940 | * expiryDate - pointer to the integer that receives the value. 941 | A value of 0 indicates an unlimited server sync grace period. 942 | 943 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME, LA_E_TIME_MODIFIED 944 | */ 945 | LEXACTIVATOR_API int LA_CC GetServerSyncGracePeriodExpiryDate(uint32_t *expiryDate); 946 | 947 | /* 948 | FUNCTION: GetTrialActivationMetadata() 949 | 950 | PURPOSE: Gets the trial activation metadata. 951 | 952 | PARAMETERS: 953 | * key - key to retrieve the value 954 | * value - pointer to a buffer that receives the value of the string 955 | * length - size of the buffer pointed to by the value parameter 956 | 957 | RETURN CODES: LA_OK, LA_E_PRODUCT_ID, LA_E_METADATA_KEY_NOT_FOUND, LA_E_BUFFER_SIZE 958 | */ 959 | 960 | LEXACTIVATOR_API int LA_CC GetTrialActivationMetadata(CSTRTYPE key, STRTYPE value, uint32_t length); 961 | 962 | /* 963 | FUNCTION: GetTrialExpiryDate() 964 | 965 | PURPOSE: Gets the trial expiry date timestamp. 966 | 967 | PARAMETERS: 968 | * trialExpiryDate - pointer to the integer that receives the value 969 | 970 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME, LA_E_TIME_MODIFIED 971 | */ 972 | LEXACTIVATOR_API int LA_CC GetTrialExpiryDate(uint32_t *trialExpiryDate); 973 | 974 | /* 975 | FUNCTION: GetTrialId() 976 | 977 | PURPOSE: Gets the trial activation id. Used in case of trial extension. 978 | 979 | PARAMETERS: 980 | * trialId - pointer to a buffer that receives the value of the string 981 | * length - size of the buffer pointed to by the trialId parameter 982 | 983 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME, LA_E_TIME_MODIFIED, 984 | LA_E_BUFFER_SIZE 985 | */ 986 | LEXACTIVATOR_API int LA_CC GetTrialId(STRTYPE trialId, uint32_t length); 987 | 988 | /* 989 | FUNCTION: GetLocalTrialExpiryDate() 990 | 991 | PURPOSE: Gets the trial expiry date timestamp. 992 | 993 | PARAMETERS: 994 | * trialExpiryDate - pointer to the integer that receives the value 995 | 996 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME_MODIFIED 997 | */ 998 | LEXACTIVATOR_API int LA_CC GetLocalTrialExpiryDate(uint32_t *trialExpiryDate); 999 | 1000 | /* 1001 | FUNCTION: GetLibraryVersion() 1002 | 1003 | PURPOSE: Gets the version of this library. 1004 | 1005 | PARAMETERS: 1006 | * libraryVersion - pointer to a buffer that receives the value of the string 1007 | * length - size of the buffer pointed to by the libraryVersion parameter 1008 | 1009 | RETURN CODES: LA_OK, LA_E_BUFFER_SIZE 1010 | */ 1011 | LEXACTIVATOR_API int LA_CC GetLibraryVersion(STRTYPE libraryVersion, uint32_t length); 1012 | 1013 | /* 1014 | FUNCTION: CheckReleaseUpdateInternal() 1015 | 1016 | PURPOSE: Checks whether a new release is available for the product. 1017 | 1018 | This function should only be used if you manage your releases through 1019 | Cryptlex release management API. 1020 | 1021 | When this function is called the release update callback function gets invoked 1022 | which passes the following parameters: 1023 | 1024 | * status - determines if any update is available or not. It also determines whether 1025 | an update is allowed or not. Expected values are LA_RELEASE_UPDATE_AVAILABLE, 1026 | LA_RELEASE_UPDATE_NOT_AVAILABLE, LA_RELEASE_UPDATE_AVAILABLE_NOT_ALLOWED. 1027 | 1028 | * releaseJson- returns json string of the latest available release, depending on the 1029 | flag LA_RELEASES_ALLOWED or LA_RELEASES_ALL passed to the CheckReleaseUpdate(). 1030 | 1031 | * userData - data that is passed to the callback function when it is registered 1032 | using the CheckReleaseUpdateInternal function. 1033 | 1034 | PARAMETERS: 1035 | * releaseUpdateCallback - name of the callback function. 1036 | * releaseFlags - If an update only related to the allowed release is required, 1037 | then use LA_RELEASES_ALLOWED. Otherwise, if an update for all the releases is 1038 | required, then use LA_RELEASES_ALL. 1039 | * userData - data that can be passed to the callback function. 1040 | 1041 | RETURN CODES: LA_OK, LA_E_PRODUCT_ID, LA_E_LICENSE_KEY, LA_E_RELEASE_VERSION_FORMAT, LA_E_RELEASE_VERSION, 1042 | LA_E_RELEASE_PLATFORM, LA_E_RELEASE_CHANNEL 1043 | */ 1044 | LEXACTIVATOR_API int LA_CC CheckReleaseUpdateInternal(ReleaseCallbackType releaseUpdateCallback, uint32_t releaseFlags, void* userData); 1045 | 1046 | /* 1047 | FUNCTION: CheckForReleaseUpdate() 1048 | 1049 | PURPOSE: Checks whether a new release is available for the product. 1050 | 1051 | This function should only be used if you manage your releases through 1052 | Cryptlex release management API. 1053 | 1054 | PARAMETERS: 1055 | * platform - release platform e.g. windows, macos, linux 1056 | * version - current release version 1057 | * channel - release channel e.g. stable 1058 | * releaseUpdateCallback - name of the callback function. 1059 | 1060 | RETURN CODES: LA_OK, LA_E_PRODUCT_ID, LA_E_LICENSE_KEY, LA_E_RELEASE_VERSION_FORMAT 1061 | */ 1062 | LEXACTIVATOR_API int LA_CC CheckForReleaseUpdate(CSTRTYPE platform, CSTRTYPE version, CSTRTYPE channel, CallbackType releaseUpdateCallback); 1063 | 1064 | /* 1065 | FUNCTION: AuthenticateUser() 1066 | 1067 | PURPOSE: It sends the request to the Cryptlex servers to authenticate the user. 1068 | 1069 | PARAMETERS: 1070 | * email - user email address. 1071 | * password - user password. 1072 | 1073 | RETURN CODES: LA_OK, LA_E_PRODUCT_ID, LA_E_INET, LA_E_SERVER, LA_E_RATE_LIMIT 1074 | LA_E_TWO_FACTOR_AUTHENTICATION_CODE_MISSING, LA_E_AUTHENTICATION_FAILED, 1075 | LA_E_TWO_FACTOR_AUTHENTICATION_CODE_INVALID, LA_E_LOGIN_TEMPORARILY_LOCKED 1076 | */ 1077 | LEXACTIVATOR_API int LA_CC AuthenticateUser(CSTRTYPE email, CSTRTYPE password); 1078 | 1079 | /* 1080 | FUNCTION: AuthenticateUserWithIdToken() 1081 | 1082 | PURPOSE: Authenticates the user via OIDC Id token. 1083 | 1084 | PARAMETER: 1085 | * idToken - The id token obtained from the OIDC provider. 1086 | 1087 | RETURN CODES: LA_OK, LA_E_PRODUCT_ID, LA_E_INET, LA_E_SERVER, LA_E_RATE_LIMIT, 1088 | LA_E_AUTHENTICATION_ID_TOKEN_INVALID, LA_E_OIDC_SSO_NOT_ENABLED, LA_E_USERS_LIMIT_REACHED 1089 | */ 1090 | LEXACTIVATOR_API int LA_CC AuthenticateUserWithIdToken(CSTRTYPE idToken); 1091 | 1092 | /* 1093 | FUNCTION: ActivateLicense() 1094 | 1095 | PURPOSE: Activates the license by contacting the Cryptlex servers. It 1096 | validates the key and returns with encrypted and digitally signed token 1097 | which it stores and uses to activate your application. 1098 | 1099 | This function should be executed at the time of registration, ideally on 1100 | a button click. 1101 | 1102 | RETURN CODES: LA_OK, LA_EXPIRED, LA_SUSPENDED, LA_E_REVOKED, LA_FAIL, LA_E_PRODUCT_ID, 1103 | LA_E_INET, LA_E_VM, LA_E_TIME, LA_E_ACTIVATION_LIMIT, LA_E_FREE_PLAN_ACTIVATION_LIMIT_REACHED, LA_E_SERVER, LA_E_CLIENT, 1104 | LA_E_AUTHENTICATION_FAILED, LA_E_LICENSE_TYPE, LA_E_COUNTRY, LA_E_IP, LA_E_RATE_LIMIT, LA_E_LICENSE_KEY, 1105 | LA_E_RELEASE_VERSION_NOT_ALLOWED, LA_E_RELEASE_VERSION_FORMAT, LA_E_LICENSE_NOT_EFFECTIVE 1106 | */ 1107 | LEXACTIVATOR_API int LA_CC ActivateLicense(); 1108 | 1109 | /* 1110 | FUNCTION: ActivateLicenseOffline() 1111 | 1112 | PURPOSE: Activates your licenses using the offline activation response file. 1113 | 1114 | PARAMETERS: 1115 | * filePath - path of the offline activation response file. 1116 | 1117 | RETURN CODES: LA_OK, LA_EXPIRED, LA_FAIL, LA_E_PRODUCT_ID, LA_E_LICENSE_KEY, LA_E_OFFLINE_RESPONSE_FILE 1118 | LA_E_VM, LA_E_TIME, LA_E_FILE_PATH, LA_E_OFFLINE_RESPONSE_FILE_EXPIRED 1119 | */ 1120 | LEXACTIVATOR_API int LA_CC ActivateLicenseOffline(CSTRTYPE filePath); 1121 | 1122 | /* 1123 | FUNCTION: GenerateOfflineActivationRequest() 1124 | 1125 | PURPOSE: Generates the offline activation request needed for generating 1126 | offline activation response in the dashboard. 1127 | 1128 | PARAMETERS: 1129 | * filePath - path of the file for the offline request. 1130 | 1131 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_LICENSE_KEY, LA_E_FILE_PERMISSION 1132 | */ 1133 | LEXACTIVATOR_API int LA_CC GenerateOfflineActivationRequest(CSTRTYPE filePath); 1134 | 1135 | /* 1136 | FUNCTION: DeactivateLicense() 1137 | 1138 | PURPOSE: Deactivates the license activation and frees up the corresponding activation 1139 | slot by contacting the Cryptlex servers. 1140 | 1141 | This function should be executed at the time of de-registration, ideally on 1142 | a button click. 1143 | 1144 | RETURN CODES: LA_OK, LA_E_DEACTIVATION_LIMIT, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME 1145 | LA_E_LICENSE_KEY, LA_E_INET, LA_E_SERVER, LA_E_RATE_LIMIT, LA_E_TIME_MODIFIED 1146 | */ 1147 | LEXACTIVATOR_API int LA_CC DeactivateLicense(); 1148 | 1149 | /* 1150 | FUNCTION: GenerateOfflineDeactivationRequest() 1151 | 1152 | PURPOSE: Generates the offline deactivation request needed for deactivation of 1153 | the license in the dashboard and deactivates the license locally. 1154 | 1155 | A valid offline deactivation file confirms that the license has been successfully 1156 | deactivated on the user's machine. 1157 | 1158 | PARAMETERS: 1159 | * filePath - path of the file for the offline request. 1160 | 1161 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_LICENSE_KEY, LA_E_FILE_PERMISSION, 1162 | LA_E_TIME, LA_E_TIME_MODIFIED 1163 | */ 1164 | LEXACTIVATOR_API int LA_CC GenerateOfflineDeactivationRequest(CSTRTYPE filePath); 1165 | 1166 | /* 1167 | FUNCTION: IsLicenseGenuine() 1168 | 1169 | PURPOSE: It verifies whether your app is genuinely activated or not. The verification is 1170 | done locally by verifying the cryptographic digital signature fetched at the time of 1171 | activation. 1172 | 1173 | After verifying locally, it schedules a server check in a separate thread. After the 1174 | first server sync it periodically does further syncs at a frequency set for the license. 1175 | 1176 | In case server sync fails due to network error, and it continues to fail for fixed 1177 | number of days (grace period), the function returns LA_GRACE_PERIOD_OVER instead of LA_OK. 1178 | 1179 | This function must be called on every start of your program to verify the activation 1180 | of your app. 1181 | 1182 | RETURN CODES: LA_OK, LA_EXPIRED, LA_SUSPENDED, LA_GRACE_PERIOD_OVER, LA_FAIL, 1183 | LA_E_PRODUCT_ID, LA_E_LICENSE_KEY, LA_E_TIME, LA_E_TIME_MODIFIED, LA_E_MACHINE_FINGERPRINT, 1184 | LA_E_RELEASE_VERSION_NOT_ALLOWED, LA_E_OS_USER, LA_E_FEATURE_ENTITLEMENTS_INVALID 1185 | 1186 | NOTE: If application was activated offline using ActivateLicenseOffline() function, you 1187 | may want to set grace period to 0 to ignore grace period. 1188 | */ 1189 | LEXACTIVATOR_API int LA_CC IsLicenseGenuine(); 1190 | 1191 | /* 1192 | FUNCTION: IsLicenseValid() 1193 | 1194 | PURPOSE: It verifies whether your app is genuinely activated or not. The verification is 1195 | done locally by verifying the cryptographic digital signature fetched at the time of 1196 | activation. 1197 | 1198 | This is just an auxiliary function which you may use in some specific cases, when you 1199 | want to skip the server sync. 1200 | 1201 | RETURN CODES: LA_OK, LA_EXPIRED, LA_SUSPENDED, LA_GRACE_PERIOD_OVER, LA_FAIL, 1202 | LA_E_PRODUCT_ID, LA_E_LICENSE_KEY, LA_E_TIME, LA_E_TIME_MODIFIED, LA_E_MACHINE_FINGERPRINT, 1203 | LA_E_RELEASE_VERSION_NOT_ALLOWED, LA_E_OS_USER, LA_E_FEATURE_ENTITLEMENTS_INVALID 1204 | 1205 | NOTE: You may want to set grace period to 0 to ignore grace period. 1206 | */ 1207 | LEXACTIVATOR_API int LA_CC IsLicenseValid(); 1208 | 1209 | /* 1210 | FUNCTION: ActivateTrial() 1211 | 1212 | PURPOSE: Starts the verified trial in your application by contacting the 1213 | Cryptlex servers. 1214 | 1215 | This function should be executed when your application starts first time on 1216 | the user's computer, ideally on a button click. 1217 | 1218 | RETURN CODES: LA_OK, LA_TRIAL_EXPIRED, LA_FAIL, LA_E_PRODUCT_ID, LA_E_INET, 1219 | LA_E_VM, LA_E_TIME, LA_E_SERVER, LA_E_CLIENT, LA_E_COUNTRY, LA_E_IP, LA_E_RATE_LIMIT 1220 | */ 1221 | LEXACTIVATOR_API int LA_CC ActivateTrial(); 1222 | 1223 | /* 1224 | FUNCTION: ActivateTrialOffline() 1225 | 1226 | PURPOSE: Activates your trial using the offline activation response file. 1227 | 1228 | PARAMETERS: 1229 | * filePath - path of the offline activation response file. 1230 | 1231 | RETURN CODES: LA_OK, LA_TRIAL_EXPIRED, LA_FAIL, LA_E_PRODUCT_ID, LA_E_OFFLINE_RESPONSE_FILE 1232 | LA_E_VM, LA_E_TIME, LA_E_FILE_PATH, LA_E_OFFLINE_RESPONSE_FILE_EXPIRED 1233 | */ 1234 | LEXACTIVATOR_API int LA_CC ActivateTrialOffline(CSTRTYPE filePath); 1235 | 1236 | /* 1237 | FUNCTION: GenerateOfflineTrialActivationRequest() 1238 | 1239 | PURPOSE: Generates the offline trial activation request needed for generating 1240 | offline trial activation response in the dashboard. 1241 | 1242 | PARAMETERS: 1243 | * filePath - path of the file for the offline request. 1244 | 1245 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_FILE_PERMISSION 1246 | */ 1247 | LEXACTIVATOR_API int LA_CC GenerateOfflineTrialActivationRequest(CSTRTYPE filePath); 1248 | 1249 | /* 1250 | FUNCTION: IsTrialGenuine() 1251 | 1252 | PURPOSE: It verifies whether trial has started and is genuine or not. The 1253 | verification is done locally by verifying the cryptographic digital signature 1254 | fetched at the time of trial activation. 1255 | 1256 | This function must be called on every start of your program during the trial period. 1257 | 1258 | RETURN CODES: LA_OK, LA_TRIAL_EXPIRED, LA_FAIL, LA_E_TIME, LA_E_PRODUCT_ID, LA_E_TIME_MODIFIED 1259 | 1260 | */ 1261 | LEXACTIVATOR_API int LA_CC IsTrialGenuine(); 1262 | 1263 | /* 1264 | FUNCTION: ActivateLocalTrial() 1265 | 1266 | PURPOSE: Starts the local(unverified) trial. 1267 | 1268 | This function should be executed when your application starts first time on 1269 | the user's computer. 1270 | 1271 | PARAMETERS: 1272 | * trialLength - trial length in days 1273 | 1274 | RETURN CODES: LA_OK, LA_LOCAL_TRIAL_EXPIRED, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME_MODIFIED 1275 | 1276 | NOTE: The function is only meant for local(unverified) trials. 1277 | */ 1278 | LEXACTIVATOR_API int LA_CC ActivateLocalTrial(uint32_t trialLength); 1279 | 1280 | /* 1281 | FUNCTION: IsLocalTrialGenuine() 1282 | 1283 | PURPOSE: It verifies whether trial has started and is genuine or not. The 1284 | verification is done locally. 1285 | 1286 | This function must be called on every start of your program during the trial period. 1287 | 1288 | RETURN CODES: LA_OK, LA_LOCAL_TRIAL_EXPIRED, LA_FAIL, LA_E_PRODUCT_ID, 1289 | LA_E_TIME_MODIFIED 1290 | 1291 | NOTE: The function is only meant for local(unverified) trials. 1292 | */ 1293 | LEXACTIVATOR_API int LA_CC IsLocalTrialGenuine(); 1294 | 1295 | /* 1296 | FUNCTION: ExtendLocalTrial() 1297 | 1298 | PURPOSE: Extends the local trial. 1299 | 1300 | PARAMETERS: 1301 | * trialExtensionLength - number of days to extend the trial 1302 | 1303 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME_MODIFIED 1304 | 1305 | NOTE: The function is only meant for local(unverified) trials. 1306 | */ 1307 | LEXACTIVATOR_API int LA_CC ExtendLocalTrial(uint32_t trialExtensionLength); 1308 | 1309 | /* 1310 | FUNCTION: IncrementActivationMeterAttributeUses() 1311 | 1312 | PURPOSE: Increments the meter attribute uses of the activation. 1313 | 1314 | PARAMETERS: 1315 | * name - name of the meter attribute 1316 | * increment - the increment value 1317 | 1318 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_METER_ATTRIBUTE_NOT_FOUND, 1319 | LA_E_INET, LA_E_TIME, LA_E_SERVER, LA_E_CLIENT, LA_E_METER_ATTRIBUTE_USES_LIMIT_REACHED, 1320 | LA_E_AUTHENTICATION_FAILED, LA_E_COUNTRY, LA_E_IP, LA_E_RATE_LIMIT, LA_E_LICENSE_KEY 1321 | 1322 | */ 1323 | LEXACTIVATOR_API int LA_CC IncrementActivationMeterAttributeUses(CSTRTYPE name, uint32_t increment); 1324 | 1325 | /* 1326 | FUNCTION: DecrementActivationMeterAttributeUses() 1327 | 1328 | PURPOSE: Decrements the meter attribute uses of the activation. 1329 | 1330 | PARAMETERS: 1331 | * name - name of the meter attribute 1332 | * decrement - the decrement value 1333 | 1334 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_METER_ATTRIBUTE_NOT_FOUND, 1335 | LA_E_INET, LA_E_TIME, LA_E_SERVER, LA_E_CLIENT, LA_E_RATE_LIMIT, LA_E_LICENSE_KEY, 1336 | LA_E_AUTHENTICATION_FAILED, LA_E_COUNTRY, LA_E_IP, LA_E_ACTIVATION_NOT_FOUND 1337 | 1338 | NOTE: If the decrement is more than the current uses, it resets the uses to 0. 1339 | */ 1340 | LEXACTIVATOR_API int LA_CC DecrementActivationMeterAttributeUses(CSTRTYPE name, uint32_t decrement); 1341 | 1342 | /* 1343 | FUNCTION: ResetActivationMeterAttributeUses() 1344 | 1345 | PURPOSE: Resets the meter attribute uses consumed by the activation. 1346 | 1347 | PARAMETERS: 1348 | * name - name of the meter attribute 1349 | * decrement - the decrement value 1350 | 1351 | RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_METER_ATTRIBUTE_NOT_FOUND, 1352 | LA_E_INET, LA_E_TIME, LA_E_SERVER, LA_E_CLIENT, LA_E_RATE_LIMIT, LA_E_LICENSE_KEY, 1353 | LA_E_AUTHENTICATION_FAILED, LA_E_COUNTRY, LA_E_IP, LA_E_ACTIVATION_NOT_FOUND 1354 | */ 1355 | LEXACTIVATOR_API int LA_CC ResetActivationMeterAttributeUses(CSTRTYPE name); 1356 | 1357 | /* 1358 | FUNCTION: Reset() 1359 | 1360 | PURPOSE: Resets the activation and trial data stored in the machine. 1361 | 1362 | This function is meant for developer testing only. 1363 | 1364 | RETURN CODES: LA_OK, LA_E_PRODUCT_ID 1365 | 1366 | NOTE: The function does not reset local(unverified) trial data. 1367 | */ 1368 | LEXACTIVATOR_API int LA_CC Reset(); 1369 | -------------------------------------------------------------------------------- /src/native/LexStatusCodes.h: -------------------------------------------------------------------------------- 1 | #ifndef LEX_STATUS_CODES_H 2 | #define LEX_STATUS_CODES_H 3 | 4 | enum LexStatusCodes 5 | { 6 | /* 7 | CODE: LA_OK 8 | 9 | MESSAGE: Success code. 10 | */ 11 | LA_OK = 0, 12 | 13 | /* 14 | CODE: LA_FAIL 15 | 16 | MESSAGE: Failure code. 17 | */ 18 | LA_FAIL = 1, 19 | 20 | /* 21 | CODE: LA_EXPIRED 22 | 23 | MESSAGE: The license has expired or system time has been tampered 24 | with. Ensure your date and time settings are correct. 25 | */ 26 | LA_EXPIRED = 20, 27 | 28 | /* 29 | CODE: LA_SUSPENDED 30 | 31 | MESSAGE: The license has been suspended. 32 | */ 33 | LA_SUSPENDED = 21, 34 | 35 | /* 36 | CODE: LA_GRACE_PERIOD_OVER 37 | 38 | MESSAGE: The grace period for server sync is over. 39 | */ 40 | LA_GRACE_PERIOD_OVER = 22, 41 | 42 | /* 43 | CODE: LA_TRIAL_EXPIRED 44 | 45 | MESSAGE: The trial has expired or system time has been tampered 46 | with. Ensure your date and time settings are correct. 47 | */ 48 | LA_TRIAL_EXPIRED = 25, 49 | 50 | /* 51 | CODE: LA_LOCAL_TRIAL_EXPIRED 52 | 53 | MESSAGE: The local trial has expired or system time has been tampered 54 | with. Ensure your date and time settings are correct. 55 | */ 56 | LA_LOCAL_TRIAL_EXPIRED = 26, 57 | 58 | /* 59 | CODE: LA_RELEASE_UPDATE_AVAILABLE 60 | 61 | MESSAGE: A new update is available for the product. This means a new release has 62 | been published for the product. 63 | */ 64 | LA_RELEASE_UPDATE_AVAILABLE = 30, 65 | 66 | /* 67 | CODE: LA_RELEASE_NO_UPDATE_AVAILABLE 68 | 69 | MESSAGE: No new update is available for the product. The current version is latest. 70 | */ 71 | LA_RELEASE_NO_UPDATE_AVAILABLE = 31, //deprecated 72 | 73 | /* 74 | CODE: LA_RELEASE_UPDATE_NOT_AVAILABLE 75 | 76 | MESSAGE: No new update is available for the product. The current version is latest. 77 | */ 78 | LA_RELEASE_UPDATE_NOT_AVAILABLE = 31, 79 | 80 | /* 81 | CODE: LA_RELEASE_UPDATE_AVAILABLE_NOT_ALLOWED 82 | 83 | MESSAGE: The update available is not allowed for this license. 84 | */ 85 | LA_RELEASE_UPDATE_AVAILABLE_NOT_ALLOWED = 32, 86 | 87 | /* 88 | CODE: LA_E_FILE_PATH 89 | 90 | MESSAGE: Invalid file path. 91 | */ 92 | LA_E_FILE_PATH = 40, 93 | 94 | /* 95 | CODE: LA_E_PRODUCT_FILE 96 | 97 | MESSAGE: Invalid or corrupted product file. 98 | */ 99 | LA_E_PRODUCT_FILE = 41, 100 | 101 | /* 102 | CODE: LA_E_PRODUCT_DATA 103 | 104 | MESSAGE: Invalid product data. 105 | */ 106 | LA_E_PRODUCT_DATA = 42, 107 | 108 | /* 109 | CODE: LA_E_PRODUCT_ID 110 | 111 | MESSAGE: The product id is incorrect. 112 | */ 113 | LA_E_PRODUCT_ID = 43, 114 | 115 | /* 116 | CODE: LA_E_SYSTEM_PERMISSION 117 | 118 | MESSAGE: Insufficient system permissions. Occurs when LA_SYSTEM flag is used 119 | but application is not run with admin privileges. 120 | */ 121 | LA_E_SYSTEM_PERMISSION = 44, 122 | 123 | /* 124 | CODE: LA_E_FILE_PERMISSION 125 | 126 | MESSAGE: No permission to write to file. 127 | */ 128 | LA_E_FILE_PERMISSION = 45, 129 | 130 | /* 131 | CODE: LA_E_WMIC 132 | 133 | MESSAGE: Fingerprint couldn't be generated because Windows Management 134 | Instrumentation (WMI) service has been disabled. This error is specific 135 | to Windows only. 136 | */ 137 | LA_E_WMIC = 46, 138 | 139 | /* 140 | CODE: LA_E_TIME 141 | 142 | MESSAGE: The difference between the network time and the system time is 143 | more than allowed clock offset. 144 | */ 145 | LA_E_TIME = 47, 146 | 147 | /* 148 | CODE: LA_E_INET 149 | 150 | MESSAGE: Failed to connect to the server due to network error. 151 | */ 152 | LA_E_INET = 48, 153 | 154 | /* 155 | CODE: LA_E_NET_PROXY 156 | 157 | MESSAGE: Invalid network proxy. 158 | */ 159 | LA_E_NET_PROXY = 49, 160 | 161 | /* 162 | CODE: LA_E_HOST_URL 163 | 164 | MESSAGE: Invalid Cryptlex host url. 165 | */ 166 | LA_E_HOST_URL = 50, 167 | 168 | /* 169 | CODE: LA_E_BUFFER_SIZE 170 | 171 | MESSAGE: The buffer size was smaller than required. 172 | */ 173 | LA_E_BUFFER_SIZE = 51, 174 | 175 | /* 176 | CODE: LA_E_APP_VERSION_LENGTH 177 | 178 | MESSAGE: App version length is more than 256 characters. 179 | */ 180 | LA_E_APP_VERSION_LENGTH = 52, 181 | 182 | /* 183 | CODE: LA_E_REVOKED 184 | 185 | MESSAGE: The license has been revoked. 186 | */ 187 | LA_E_REVOKED = 53, 188 | 189 | /* 190 | CODE: LA_E_LICENSE_KEY 191 | 192 | MESSAGE: Invalid license key. 193 | */ 194 | LA_E_LICENSE_KEY = 54, 195 | 196 | /* 197 | CODE: LA_E_LICENSE_TYPE 198 | 199 | MESSAGE: Invalid license type. Make sure floating license 200 | is not being used. 201 | */ 202 | LA_E_LICENSE_TYPE = 55, 203 | 204 | /* 205 | CODE: LA_E_OFFLINE_RESPONSE_FILE 206 | 207 | MESSAGE: Invalid offline activation response file. 208 | */ 209 | LA_E_OFFLINE_RESPONSE_FILE = 56, 210 | 211 | /* 212 | CODE: LA_E_OFFLINE_RESPONSE_FILE_EXPIRED 213 | 214 | MESSAGE: The offline activation response has expired. 215 | */ 216 | LA_E_OFFLINE_RESPONSE_FILE_EXPIRED = 57, 217 | 218 | /* 219 | CODE: LA_E_ACTIVATION_LIMIT 220 | 221 | MESSAGE: The license has reached it's allowed activations limit. 222 | */ 223 | LA_E_ACTIVATION_LIMIT = 58, 224 | 225 | /* 226 | CODE: LA_E_ACTIVATION_NOT_FOUND 227 | 228 | MESSAGE: The license activation was deleted on the server. 229 | */ 230 | LA_E_ACTIVATION_NOT_FOUND = 59, 231 | 232 | /* 233 | CODE: LA_E_DEACTIVATION_LIMIT 234 | 235 | MESSAGE: The license has reached it's allowed deactivations limit. 236 | */ 237 | LA_E_DEACTIVATION_LIMIT = 60, 238 | 239 | /* 240 | CODE: LA_E_TRIAL_NOT_ALLOWED 241 | 242 | MESSAGE: Trial not allowed for the product. 243 | */ 244 | LA_E_TRIAL_NOT_ALLOWED = 61, 245 | 246 | /* 247 | CODE: LA_E_TRIAL_ACTIVATION_LIMIT 248 | 249 | MESSAGE: Your account has reached it's trial activations limit. 250 | */ 251 | LA_E_TRIAL_ACTIVATION_LIMIT = 62, 252 | 253 | /* 254 | CODE: LA_E_MACHINE_FINGERPRINT 255 | 256 | MESSAGE: Machine fingerprint has changed since activation. 257 | */ 258 | LA_E_MACHINE_FINGERPRINT = 63, 259 | 260 | /* 261 | CODE: LA_E_METADATA_KEY_LENGTH 262 | 263 | MESSAGE: Metadata key length is more than 256 characters. 264 | */ 265 | LA_E_METADATA_KEY_LENGTH = 64, 266 | 267 | /* 268 | CODE: LA_E_METADATA_VALUE_LENGTH 269 | 270 | MESSAGE: Metadata value length is more than 4096 characters. 271 | */ 272 | LA_E_METADATA_VALUE_LENGTH = 65, 273 | 274 | /* 275 | CODE: LA_E_ACTIVATION_METADATA_LIMIT 276 | 277 | MESSAGE: The license has reached it's metadata fields limit. 278 | */ 279 | LA_E_ACTIVATION_METADATA_LIMIT = 66, 280 | 281 | /* 282 | CODE: LA_E_TRIAL_ACTIVATION_METADATA_LIMIT 283 | 284 | MESSAGE: The trial has reached it's metadata fields limit. 285 | */ 286 | LA_E_TRIAL_ACTIVATION_METADATA_LIMIT = 67, 287 | 288 | /* 289 | CODE: LA_E_METADATA_KEY_NOT_FOUND 290 | 291 | MESSAGE: The metadata key does not exist. 292 | */ 293 | LA_E_METADATA_KEY_NOT_FOUND = 68, 294 | 295 | /* 296 | CODE: LA_E_TIME_MODIFIED 297 | 298 | MESSAGE: The system time has been tampered (backdated). 299 | */ 300 | LA_E_TIME_MODIFIED = 69, 301 | 302 | /* 303 | CODE: LA_E_RELEASE_VERSION_FORMAT 304 | 305 | MESSAGE: Invalid version format. 306 | */ 307 | LA_E_RELEASE_VERSION_FORMAT = 70, 308 | 309 | /* 310 | CODE: LA_E_AUTHENTICATION_FAILED 311 | 312 | MESSAGE: Incorrect email or password. 313 | */ 314 | LA_E_AUTHENTICATION_FAILED = 71, 315 | 316 | /* 317 | CODE: LA_E_METER_ATTRIBUTE_NOT_FOUND 318 | 319 | MESSAGE: The meter attribute does not exist. 320 | */ 321 | LA_E_METER_ATTRIBUTE_NOT_FOUND = 72, 322 | 323 | /* 324 | CODE: LA_E_METER_ATTRIBUTE_USES_LIMIT_REACHED 325 | 326 | MESSAGE: The meter attribute has reached it's usage limit. 327 | */ 328 | LA_E_METER_ATTRIBUTE_USES_LIMIT_REACHED = 73, 329 | 330 | /* 331 | CODE: LA_E_CUSTOM_FINGERPRINT_LENGTH 332 | 333 | MESSAGE: Custom device fingerprint length is less than 64 characters 334 | or more than 256 characters. 335 | */ 336 | LA_E_CUSTOM_FINGERPRINT_LENGTH = 74, 337 | 338 | /* 339 | CODE: LA_E_PRODUCT_VERSION_NOT_LINKED 340 | 341 | MESSAGE: No product version is linked with the license. 342 | */ 343 | LA_E_PRODUCT_VERSION_NOT_LINKED = 75, 344 | 345 | /* 346 | CODE: LA_E_FEATURE_FLAG_NOT_FOUND 347 | 348 | MESSAGE: The product version feature flag does not exist. 349 | */ 350 | LA_E_FEATURE_FLAG_NOT_FOUND = 76, 351 | 352 | /* 353 | CODE: LA_E_RELEASE_VERSION_NOT_ALLOWED 354 | 355 | MESSAGE: The release version is not allowed. 356 | */ 357 | LA_E_RELEASE_VERSION_NOT_ALLOWED = 77, 358 | 359 | /* 360 | CODE: LA_E_RELEASE_PLATFORM_LENGTH 361 | 362 | MESSAGE: Release platform length is more than 256 characters. 363 | */ 364 | LA_E_RELEASE_PLATFORM_LENGTH = 78, 365 | 366 | /* 367 | CODE: LA_E_RELEASE_CHANNEL_LENGTH 368 | 369 | MESSAGE: Release channel length is more than 256 characters. 370 | */ 371 | LA_E_RELEASE_CHANNEL_LENGTH = 79, 372 | 373 | /* 374 | CODE: LA_E_VM 375 | 376 | MESSAGE: Application is being run inside a virtual machine / hypervisor, 377 | and activation has been disallowed in the VM. 378 | */ 379 | LA_E_VM = 80, 380 | 381 | /* 382 | CODE: LA_E_COUNTRY 383 | 384 | MESSAGE: Country is not allowed. 385 | */ 386 | LA_E_COUNTRY = 81, 387 | 388 | /* 389 | CODE: LA_E_IP 390 | 391 | MESSAGE: IP address is not allowed. 392 | */ 393 | LA_E_IP = 82, 394 | 395 | /* 396 | CODE: LA_E_CONTAINER 397 | 398 | MESSAGE: Application is being run inside a container and 399 | activation has been disallowed in the container. 400 | */ 401 | LA_E_CONTAINER = 83, 402 | 403 | /* 404 | CODE: LA_E_RELEASE_VERSION 405 | 406 | MESSAGE: Invalid release version. Make sure the release version 407 | uses the following formats: x.x, x.x.x, x.x.x.x (where x is a number). 408 | */ 409 | LA_E_RELEASE_VERSION = 84, 410 | 411 | /* 412 | CODE: LA_E_RELEASE_PLATFORM 413 | 414 | MESSAGE: Release platform not set. 415 | */ 416 | LA_E_RELEASE_PLATFORM = 85, 417 | 418 | /* 419 | CODE: LA_E_RELEASE_CHANNEL 420 | 421 | MESSAGE: Release channel not set. 422 | */ 423 | LA_E_RELEASE_CHANNEL = 86, 424 | 425 | /* 426 | CODE: LA_E_USER_NOT_AUTHENTICATED 427 | 428 | MESSAGE: The user is not authenticated. 429 | */ 430 | LA_E_USER_NOT_AUTHENTICATED = 87, 431 | 432 | /* 433 | CODE: LA_E_TWO_FACTOR_AUTHENTICATION_CODE_MISSING 434 | 435 | MESSAGE: The two-factor authentication code for the user authentication is missing. 436 | */ 437 | LA_E_TWO_FACTOR_AUTHENTICATION_CODE_MISSING = 88, 438 | 439 | /* 440 | CODE: LA_E_TWO_FACTOR_AUTHENTICATION_CODE_INVALID 441 | 442 | MESSAGE: The two-factor authentication code provided by the user is invalid. 443 | */ 444 | LA_E_TWO_FACTOR_AUTHENTICATION_CODE_INVALID = 89, 445 | 446 | /* 447 | CODE: LA_E_RATE_LIMIT 448 | 449 | MESSAGE: Rate limit for API has reached, try again later. 450 | */ 451 | LA_E_RATE_LIMIT = 90, 452 | 453 | /* 454 | CODE: LA_E_SERVER 455 | 456 | MESSAGE: Server error. 457 | */ 458 | LA_E_SERVER = 91, 459 | 460 | /* 461 | CODE: LA_E_CLIENT 462 | 463 | MESSAGE: Client error. 464 | */ 465 | LA_E_CLIENT = 92, 466 | 467 | /* 468 | CODE: LA_E_ACCOUNT_ID 469 | 470 | MESSAGE: Invalid account ID. 471 | */ 472 | LA_E_ACCOUNT_ID = 93, 473 | 474 | /* 475 | CODE: LA_E_LOGIN_TEMPORARILY_LOCKED 476 | 477 | MESSAGE: The user account has been temporarily locked for 5 mins due to 5 failed attempts. 478 | */ 479 | LA_E_LOGIN_TEMPORARILY_LOCKED = 100, 480 | 481 | /* 482 | CODE: LA_E_AUTHENTICATION_ID_TOKEN_INVALID 483 | 484 | MESSAGE: Invalid authentication ID token. 485 | */ 486 | LA_E_AUTHENTICATION_ID_TOKEN_INVALID = 101, 487 | 488 | /* 489 | CODE: LA_E_OIDC_SSO_NOT_ENABLED 490 | 491 | MESSAGE: OIDC SSO is not enabled. 492 | */ 493 | LA_E_OIDC_SSO_NOT_ENABLED = 102, 494 | 495 | /* 496 | CODE: LA_E_USERS_LIMIT_REACHED 497 | 498 | MESSAGE: The allowed users for this account has reached its limit. 499 | */ 500 | LA_E_USERS_LIMIT_REACHED = 103, 501 | 502 | /* 503 | CODE: LA_E_OS_USER 504 | 505 | MESSAGE: OS user has changed since activation and the license is user-locked. 506 | */ 507 | LA_E_OS_USER = 104, 508 | 509 | /* 510 | CODE: LA_E_INVALID_PERMISSION_FLAG 511 | 512 | MESSAGE: Invalid permission flag. 513 | */ 514 | LA_E_INVALID_PERMISSION_FLAG = 105, 515 | 516 | /* 517 | CODE: LA_E_FREE_PLAN_ACTIVATION_LIMIT_REACHED 518 | 519 | MESSAGE: The free plan has reached its activation limit. 520 | */ 521 | LA_E_FREE_PLAN_ACTIVATION_LIMIT_REACHED = 106, 522 | 523 | /* 524 | CODE: LA_E_FEATURE_ENTITLEMENTS_INVALID 525 | 526 | MESSAGE: Invalid feature entitlements. 527 | */ 528 | LA_E_FEATURE_ENTITLEMENTS_INVALID = 107, 529 | 530 | /* 531 | CODE: LA_E_FEATURE_ENTITLEMENT_NOT_FOUND 532 | 533 | MESSAGE: The feature entitlement does not exist. 534 | */ 535 | LA_E_FEATURE_ENTITLEMENT_NOT_FOUND = 108, 536 | 537 | /* 538 | CODE: LA_E_ENTITLEMENT_SET_NOT_LINKED 539 | 540 | MESSAGE: No entitlement set is linked to the license. 541 | */ 542 | LA_E_ENTITLEMENT_SET_NOT_LINKED = 109, 543 | 544 | /* 545 | CODE: LA_E_LICENSE_NOT_EFFECTIVE 546 | 547 | MESSAGE: The license cannot be activated before its effective date. 548 | */ 549 | LA_E_LICENSE_NOT_EFFECTIVE = 110 550 | }; 551 | 552 | #endif // LEX_STATUS_CODES_H 553 | -------------------------------------------------------------------------------- /src/release.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @class Release 3 | * @property {number} totalFiles - The total number of files in the release. 4 | * @property {boolean} isPrivate - Indicates whether the release is private or not. 5 | * @property {boolean} published - Indicates whether the release has been published or not. 6 | * @property {string} id - The unique identifier for the release. 7 | * @property {string} createdAt - The timestamp when the release was created. 8 | * @property {string} updatedAt - The timestamp when the release was last updated. 9 | * @property {string} name - The name of the release. 10 | * @property {string} channel - The channel for the release. 11 | * @property {string} version - The version of the release. 12 | * @property {string} notes - The release notes. 13 | * @property {string} publishedAt - The timestamp when the release was published. 14 | * @property {string} productId - The unique identifier for the product that this release is associated with. 15 | * @property {string[]} platforms - An array of platforms for the release. 16 | * @property {Object[]} files - An array of files associated with the release. 17 | * @property {number} files.size - The size of the file in bytes. 18 | * @property {number} files.downloads - The number of times the file has been downloaded. 19 | * @property {boolean} files.secured - Indicates whether the file is secured or not. 20 | * @property {string} files.id - The unique identifier for the file. 21 | * @property {string} files.name - The name of the file. 22 | * @property {string} files.url - The URL of the file. 23 | * @property {string} files.extension - The file extension. 24 | * @property {string} files.checksum - The file checksum. 25 | * @property {string} files.releaseId - The unique identifier for the release that this file is associated with. 26 | * @property {string} files.createdAt - The timestamp when the file was created. 27 | * @property {string} files.updatedAt - The timestamp when the file was last updated. 28 | */ 29 | 30 | export class Release { 31 | totalFiles: number; 32 | isPrivate: boolean; 33 | published: boolean; 34 | id: string; 35 | createdAt: string; 36 | updatedAt: string; 37 | name: string; 38 | channel: string; 39 | version: string; 40 | notes: string; 41 | publishedAt: string; 42 | productId: string; 43 | platforms: string[]; 44 | files: { 45 | size: number; 46 | downloads: number; 47 | secured: boolean; 48 | id: string; 49 | name: string; 50 | url: string; 51 | extension: string; 52 | checksum: string; 53 | releaseId: string; 54 | createdAt: string; 55 | updatedAt: string; 56 | }[]; 57 | }; -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig to read more about this file */ 4 | /* Projects */ 5 | // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ 6 | // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ 7 | // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ 8 | // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ 9 | // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ 10 | // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ 11 | /* Language and Environment */ 12 | "target": "ES2015", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ 13 | "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ 14 | // "jsx": "preserve", /* Specify what JSX code is generated. */ 15 | // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ 16 | // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ 17 | // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ 18 | // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ 19 | // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ 20 | // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ 21 | // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ 22 | // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ 23 | // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ 24 | /* Modules */ 25 | "module": "commonjs", /* Specify what module code is generated. */ 26 | // "rootDir": "./", /* Specify the root folder within your source files. */ 27 | "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ 28 | // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ 29 | // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ 30 | // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ 31 | // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ 32 | // "types": [], /* Specify type package names to be included without being referenced in a source file. */ 33 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 34 | // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ 35 | // "resolveJsonModule": true, /* Enable importing .json files. */ 36 | // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ 37 | /* JavaScript Support */ 38 | // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ 39 | // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ 40 | // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ 41 | /* Emit */ 42 | "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ 43 | "declarationMap": true, /* Create sourcemaps for d.ts files. */ 44 | // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ 45 | "sourceMap": true, /* Create source map files for emitted JavaScript files. */ 46 | // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ 47 | "outDir": "./lib", /* Specify an output folder for all emitted files. */ 48 | // "removeComments": true, /* Disable emitting comments. */ 49 | // "noEmit": true, /* Disable emitting files from a compilation. */ 50 | // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ 51 | // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ 52 | // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ 53 | // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ 54 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 55 | // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ 56 | // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ 57 | // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ 58 | // "newLine": "crlf", /* Set the newline character for emitting files. */ 59 | // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ 60 | // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ 61 | "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ 62 | // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ 63 | // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ 64 | // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ 65 | /* Interop Constraints */ 66 | // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ 67 | // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ 68 | "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ 69 | // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ 70 | "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ 71 | /* Type Checking */ 72 | "strict": true, /* Enable all strict type-checking options. */ 73 | // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ 74 | "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ 75 | "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ 76 | // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ 77 | "strictPropertyInitialization": false, /* Check for class properties that are declared but not set in the constructor. */ 78 | "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ 79 | // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ 80 | // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ 81 | "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ 82 | "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ 83 | // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ 84 | "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ 85 | // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ 86 | "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ 87 | "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ 88 | // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ 89 | // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ 90 | "allowUnreachableCode": false, /* Error reporting for unreachable code. */ 91 | /* Completeness */ 92 | // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ 93 | "skipLibCheck": true /* Skip type checking all .d.ts files. */ 94 | }, 95 | "include": ["./lib/**/*", "src/index.ts"] 96 | } --------------------------------------------------------------------------------