SDKs
node.js SDK
Type Declarations
1min
the package provides typescript declarations for classes, methods and properties the following are typescript definitions for all the types used in the sdk export type licensespringconfig = { apikey string, sharedkey string, apipath string, publickey string, productcode string, appname string, appversion string, filepath string, filename string, graceperiod number, filekey string, airgapkey? string, isguardfileenabled boolean, hardwareidmethod number, sdkversion string, proxy? axiosproxyconfig, }; export type licensespringapiconfig = omit\<licensespringconfig, 'productcode'>; export type licensespringconfigdef = omit\<licensespringconfig, 'apipath'|'publickey'|'filename'|'filepath'|'graceperiod'|'filekey'|'isguardfileenabled'|'hardwareidmethod'|'sdkversion'> & { apipath? string, publickey? string, filename? string, filepath? string, graceperiod? number, filekey? string, isguardfileenabled? boolean, hardwareidmethod? number, }; export type licensespringapiconfigdef = omit\<licensespringapiconfig, 'apipath'|'publickey'|'filename'|'filepath'|'graceperiod'|'filekey'|'isguardfileenabled'|'hardwareidmethod'|'sdkversion'> & { apipath? string, publickey? string, filename? string, filepath? string, graceperiod? number, filekey? string, isguardfileenabled? boolean, hardwareidmethod? number, }; export type licensespringfloatingconfig = { apipath string, appversion string, hardwareidmethod number, sdkversion string, }; export type licensespringfloatingconfigdef = omit\<licensespringfloatingconfig, 'hardwareidmethod'|'sdkversion'> & { hardwareidmethod? number, }; type licenseidentificatorkeybased = { license key string, }; type licenseidentificatoruserbased = { username string, }; type licenseactivationidentificatoruserbased = { username string, password string, }; type licenseidentificatoruserssobased = ({ id token string, } | { code string, }) & { customer account code string, }; export type ssourlparams = { product string, type 'token'|'code', }; type licenseidentificatiorrequired = { hardware id string, product string, bundle code? string, license id? number, }; export type licenseactivationidentificatorwithvariables = licenseactivationidentificator & { variables? dictionary\<string> }; export type licenseactivationidentificatorofflinewithvariables = licenseactivationidentificator & offlineactivationrequest & { variables? dictionary\<string> }; export type licenseidentificatorwithvariables = licenseidentificator & { variables? dictionary\<string> }; export type licenseidentificatorofflinewithvariables = licenseidentificator & offlineactivationrequest & { variables? dictionary\<string> }; export type trialkeypayload = { email string, product string, hardware id string }; export type getuserlicensespayload = { username string, password string, product string }; export type getcustomerlicensespayload = { customer string, product string }; export type licenseidentificatorandfeature = licenseidentificator & { feature string }; export type licenseidentificatoraddconsumptions = licenseidentificator & { consumptions number }; export type licenseidentificatoraddfeatureconsumptions = licenseidentificator & { feature string, consumptions number }; export type productdetailspayload = { product string, / @defaultvalue false / include expired features? boolean, / @defaultvalue false / include latest version? boolean, / @defaultvalue false / include custom fields? boolean, } export type licenseidentificatorwithborroweduntil = licenseidentificator & { borrowed until dateinputstring }; export type passwordchangepayload = { username string, password string, new password string }; export type licenseidentificatorwithinstallation = licenseidentificator & { env string, channel string, version string }; / @type {licenseidentificator} an object that identifies a license using either a license key, user credentials or single sign on credentials optionally can include a `license id` property to force a specific license is being selected / export type licenseidentificator = ( xor\<licenseidentificatorkeybased, licenseidentificatoruserbased> ) & licenseidentificatiorrequired; export type licenseactivationidentificator = ( xor\<licenseidentificatorkeybased, licenseactivationidentificatoruserbased, licenseidentificatoruserssobased> ) & licenseidentificatiorrequired; / @type {licenseuser} an object describing a user associated to a specific license / export type licenseuser = { id number, email string, first name string, last name string, phone number string, is initial password boolean, allow unlimited activations boolean, max activations number, total activations number, }; / @type {productdetails} an object describing the basic properties of a product / export type productdetails = { product id number, product name string, short code string, authorization method 'license key' | 'user', metadata json, }; / @type {customer} an object describing a customer / export type customer = { email string, company name string, reference string, phone string, first name string, last name string, city string, postcode string, state string, country string, address string, customer account string|null, metadata json, }; / @type {customfield} an object describing a custom field these are key value pairs assigned to a product and inherited by that product's licenses they can be overriden on the license level / export type customfield = { name string, data type 'numer' | 'text' | 'date/time', value string, }; / @type {productfeature} an object describing a product feature these are custom attributes assigned to a product and inherited by that product's licenses / export type productfeature = { id number, code string, name string, expiry date string, metadata json, is floating cloud boolean, } & xor<{ feature type 'activation', }, { feature type 'consumption', max consumption number, allow unlimited consumptions boolean, total consumptions number, allow overages number, max overages number, reset consumption boolean, consumption period string | null, }> & xor<{ is floating false }, { is floating true, floating users number, floating timeout? number, }>; / @type {licensetype} declares the type of license which is always one of the following perpetual a perpetual license does not expire the `is expired` field on such a license will always be `false` note that a perpetual trial license (`is trial` flag is set to `true`) does have an `validity period`, which refers to the end of the trial period time limited has a `validity period` set as a calendar date after the date has passed, the `is expired` flag will be set to `true` subscription uses an external source of truth such as a 3rd party service to determine the state of the license consumption permits usage metering these licenses set a value the vendor wishes to meter, and then record the times that resource has been used includes the following properties `max consumptions`, `total consumptions`, `allow unlimited consumptions`, `allow overages`, `max overages`, `reset consumption` and `consumption period` / export type licensetype = 'perpetual' | 'time limited' | 'consumption' | 'subscription'; / @type {licenseresponse} the license object received as a response when checking or activating a license includes a set of common properties and additional ones which may or may not appear depending on `license type`, `is trial`, `is floating`/`is floating cloud` and product `authorization method` (key based vs user based) / export type licenseresponse = { id number; allow grace period boolean, allow overages boolean, allow unlimited activations boolean, borrowed until string | null, can borrow boolean, channel string, device id number, enable maintenance period boolean environment string, eula link string, floating timeout number, grace period number, hash md5 string, installation file string, is air gapped boolean, is borrowed boolean, is expired boolean, is hardware key auth boolean, license active boolean, license enabled boolean, license signature string, license type licensetype, maintenance period string | null, max activations number, max borrow time number, max license users number, max overages number, max transfers number, order store id string, prevent vm boolean, release date string, release notes link string, requires version string, size string, start date string | null, times activated number, transfer count number, validity period dateiso8601utc | null, version string, product features productfeature\[], custom fields customfield\[], customer customer, product details productdetails, metadata json, } & xor<{ license key string, }, { user licenseuser, }> & xor<({ is floating true, is floating cloud boolean, floating in use devices number, } | { is floating boolean, is floating cloud true, floating in use devices number, }) & { floating users number, floating timeout number, }, { is floating cloud false, is floating false, }> & xor<{ is trial false, }, { is trial true, trial days number, }> & xor<{ license type 'consumption', max consumptions number, total consumptions number, allow unlimited consumptions boolean, allow overages boolean, max overages number, reset consumption boolean, consumption period dateiso8601utc | null, }, {} \>; / @type {licenseresponseoffline} the license object received as a response when activating a license using the offline method this type is equal to licenseresponse with the addition of the `license signature v2` property / export type licenseresponseoffline = licenseresponse & { license signature v2 string, }; export type licensefilepayload = licenseresponseoffline & { offline signature string, }; export type offlineactivationrequest = { prefix? string; os ver? string; sdk build version? string; hostname? string; ip? string; external ip? string; app ver? string; mac address? string; }; export type devicevariable = { id number, device id number, created at dateiso8601utc, variable string, value string, }; type licensetrialexisting = { }; type licensetrialnewcommon = { license key string, id number, order id number, product id number, max license users number, max activations number, times activated number, is trial true, active boolean, enabled boolean, max transfers number, trial days number, maintenance duration dateiso8601utc | null, validity period dateiso8601utc | null, enable maintenance period boolean, prevent vm boolean, is hardware key auth boolean, license user string, initial password string, metadata json, created at number, updated at number, licenseproductfeatures licenseproductfeature\[], licensecustomfields { product custom field id number, value string }\[], }; type licensetrialnew = licensetrialnewcommon & (xor< { is floating cloud true, floating users number, floating timeout number, }, {} \>) & (xor< { license type 'consumption', allow overages boolean, max overages number, max consumptions number, valid duration null, consumption period string | null, reset consumption boolean, }, xor< { license type 'subscription', grace period number, allow grace period boolean, }, { license type 'perpetual' | 'time limited', } \> \> ); export type licensetrialresponse = (licensetrialnew | licensetrialexisting) & { license type licensetype, is trial boolean, / username / license user string, }; type customerlicenseuser = { email string, is active boolean, first name string, last name string, phone number string, is initial password boolean, initial password string, max activations number, total activations number, license id number, order id number, order store id string, }; export type customerlicenseusersresponse = { customer { email string | null, first name string | null, last name string | null, company name string | null, phone string | null, reference string | null, address string | null, postcode string | null, city string | null, country string | null, state string | null, customer account null | { id string, name string, code string, }, metadata json, }, users customerlicenseuser\[] }; export type licensefeatureresponse = { id number, code string, name string, floating timeout number | null, floating users number | null, feature type 'activation' | 'consumption' expiry date dateiso8601utc | null, metadata json, is floating boolean, is floating cloud boolean, floating in use devices number, license id number, }; export type licenseproductfeature = { id number, product feature id number, max consumption number, allow overages boolean, max overages number, reset consumption number, consumption period string | null, expiry date dateiso8601utc | null, is floating boolean, is floating cloud boolean, metadata json, } & xor<({ is floating true } | { is floating cloud true }) & { floating timeout number, floating users number, }, {}>; export type licenseconsumptionsresponse = { id number, max consumptions number, total consumptions number, allow unlimited consumptions boolean, allow negative consumptions boolean, allow overages boolean, max overages number, reset consumption boolean, consumption period string | null, }; export type licensefeatureconsumptionresponse = { total consumptions number, is floating boolean, is floating cloud boolean, floating timeout number, floating users number, }; export type productdetailsresponse = productdetails & { floating timeout number, max overages number, trial days number, allow overages boolean, allow trial boolean, prevent vm boolean, custom fields { id number, name string, default value string, }\[], latest version null | (installationfilebase & { id number, product id number, enabled boolean, created at dateiso8601utc, updated at dateiso8601utc, full link string | null, filename string | null, }) }; export type licenseborrowresponse = { license id number, device id number, borrowed until dateinputstring, max borrow time number, }; type installationfilebase = { version string | null, environment string | null, hash md5 string | null, eula link string | null, release notes link string | null, size string | null, requires version string | null, channel string | null, release date dateiso8601utc | null, }; export type installationfileresponse = installationfilebase & { installation file string | null }; export type versionsresponse = { version string, release date dateiso8601utc, }\[]; export type licensedatamethod = 'check license' |'activate license' |'activate license offline' |'activate air gap' |'update license offline' |'product details' |'device variables' |'normal' |'license consumption' |'feature consumption' |'register feature' |'floating server register' ; export enum hardwareidalgorithm { default = 0, windowshardwarefingerprintid = 1, windowscomputersystemproductid = 2, windowscryptographyid = 3, linuxmachineid = 4, cloudplatformsid = 5, }; interface axiosproxyconfig { host string, port number, protocol? string, auth? { username string, password string, } } / date string in iso 8601 format (always in utc timezone) with optional separators and optional time component, e g "2024 09 27t23 30 48 016z" "2024 09 27 23 30 48 016" "2024 09 27 23 30 48" "2024 09 27 23 30" "2024 09 27" / export type dateinputstring = string; / date string in full iso 8601 format, e g "2024 09 27t23 30 48 016z" note this is always in utc timezone / export type dateiso8601utc = string; / date string in rfc 7231 format, e g "fri, 27 sep 2024 23 30 48 gmt" note this is always in gmt timezone / export type daterfc7231 = string; export type managed\<t> = omit\<t, 'product' | 'hardware id'>; type listprops\<t> = { \[k in keyof t] t\[k] } & {}; type without\<t, u> = { \[p in exclude\<keyof t, keyof u>]? never }; type evalifis\<t, u> = unknown extends t ? never u; type xor\<a, b, c = unknown, d = unknown, e = unknown, f = unknown, g = unknown, h = unknown> = listprops< (without\<b & c & d & e & f & g & h, a> & a) \| (without\<a & c & d & e & f & g & h, b> & b) \| evalifis\<c, without\<a & b & d & e & f & g & h, c> & c> \| evalifis\<d, without\<a & b & c & e & f & g & h, d> & d> \| evalifis\<e, without\<a & b & c & d & f & g & h, e> & e> \| evalifis\<f, without\<a & b & c & d & e & g & h, f> & f> \| evalifis\<g, without\<a & b & c & d & e & f & h, g> & g> \| evalifis\<h, without\<a & b & c & d & e & f & g, h> & h> \>;