-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.mjs.map
More file actions
1 lines (1 loc) · 242 KB
/
index.mjs.map
File metadata and controls
1 lines (1 loc) · 242 KB
1
{"version":3,"sources":["../src/constants/LicenseeSecretMode.ts","../src/constants/LicenseType.ts","../src/constants/NotificationEvent.ts","../src/constants/NotificationProtocol.ts","../src/constants/SecurityMode.ts","../src/constants/TimeVolumePeriod.ts","../src/constants/TokenType.ts","../src/constants/TransactionSource.ts","../src/constants/TransactionStatus.ts","../src/constants/index.ts","../src/constants/ApiKeyRole.ts","../src/constants/LicensingModel.ts","../src/constants/NodeSecretMode.ts","../src/constants/PaymentMethodEnum.ts","../src/utils/cast.ts","../src/converters/itemToObject.ts","../src/utils/helpers.ts","../src/utils/serialize.ts","../src/entities/defineEntity.ts","../src/entities/Bundle.ts","../src/converters/itemToBundle.ts","../src/entities/Country.ts","../src/converters/itemToCountry.ts","../src/entities/License.ts","../src/converters/itemToLicense.ts","../src/entities/Licensee.ts","../src/converters/itemToLicensee.ts","../src/entities/LicenseTemplate.ts","../src/converters/itemToLicenseTemplate.ts","../src/entities/Notification.ts","../src/converters/itemToNotification.ts","../src/entities/PaymentMethod.ts","../src/converters/itemToPaymentMethod.ts","../src/entities/Product.ts","../src/errors/NlicError.ts","../src/entities/ProductDiscount.ts","../src/converters/itemToProduct.ts","../src/entities/ProductModule.ts","../src/converters/itemToProductModule.ts","../src/entities/Token.ts","../src/converters/itemToToken.ts","../src/entities/LicenseTransactionJoin.ts","../src/entities/Transaction.ts","../src/converters/itemToTransaction.ts","../src/services/Service/instance.ts","../package.json","../src/services/Service/toQueryString.ts","../src/services/Service/request.ts","../src/services/Service/methods.ts","../src/services/Service/index.ts","../src/utils/filter.ts","../src/utils/validation.ts","../src/vo/Page.ts","../src/services/BundleService.ts","../src/vo/ValidationResults.ts","../src/services/LicenseeService.ts","../src/services/LicenseService.ts","../src/services/LicenseTemplateService.ts","../src/services/NotificationService.ts","../src/services/PaymentMethodService.ts","../src/services/ProductModuleService.ts","../src/services/ProductService.ts","../src/services/TokenService.ts","../src/services/TransactionService.ts","../src/services/UtilityService.ts","../src/vo/Context.ts","../src/vo/ValidationParameters.ts"],"sourcesContent":["/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nconst LicenseeSecretMode = Object.freeze({\r\n // @deprecated\r\n DISABLED: 'DISABLED',\r\n PREDEFINED: 'PREDEFINED',\r\n CLIENT: 'CLIENT',\r\n});\r\n\r\nexport default LicenseeSecretMode;\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nconst LicenseType = Object.freeze({\r\n FEATURE: 'FEATURE',\r\n TIMEVOLUME: 'TIMEVOLUME',\r\n FLOATING: 'FLOATING',\r\n QUANTITY: 'QUANTITY',\r\n});\r\n\r\nexport default LicenseType;\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nconst NotificationEvent = Object.freeze({\r\n LICENSEE_CREATED: 'LICENSEE_CREATED',\r\n LICENSE_CREATED: 'LICENSE_CREATED',\r\n WARNING_LEVEL_CHANGED: 'WARNING_LEVEL_CHANGED',\r\n PAYMENT_TRANSACTION_PROCESSED: 'PAYMENT_TRANSACTION_PROCESSED',\r\n});\r\n\r\nexport default NotificationEvent;\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nconst NotificationProtocol = Object.freeze({\r\n WEBHOOK: 'WEBHOOK',\r\n});\r\n\r\nexport default NotificationProtocol;\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nconst SecurityMode = Object.freeze({\r\n BASIC_AUTHENTICATION: 'BASIC_AUTH',\r\n APIKEY_IDENTIFICATION: 'APIKEY',\r\n ANONYMOUS_IDENTIFICATION: 'ANONYMOUS',\r\n});\r\n\r\nexport default SecurityMode;\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nconst TimeVolumePeriod = Object.freeze({\r\n DAY: 'DAY',\r\n WEEK: 'WEEK',\r\n MONTH: 'MONTH',\r\n YEAR: 'YEAR',\r\n});\r\n\r\nexport default TimeVolumePeriod;\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nconst TokenType = Object.freeze({\r\n DEFAULT: 'DEFAULT',\r\n SHOP: 'SHOP',\r\n APIKEY: 'APIKEY',\r\n ACTION: 'ACTION',\r\n});\r\n\r\nexport default TokenType;\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nconst TransactionSource = Object.freeze({\r\n SHOP: 'SHOP',\r\n\r\n AUTO_LICENSE_CREATE: 'AUTO_LICENSE_CREATE',\r\n AUTO_LICENSE_UPDATE: 'AUTO_LICENSE_UPDATE',\r\n AUTO_LICENSE_DELETE: 'AUTO_LICENSE_DELETE',\r\n\r\n AUTO_LICENSEE_CREATE: 'AUTO_LICENSEE_CREATE',\r\n AUTO_LICENSEE_DELETE: 'AUTO_LICENSEE_DELETE',\r\n AUTO_LICENSEE_VALIDATE: 'AUTO_LICENSEE_VALIDATE',\r\n\r\n AUTO_LICENSETEMPLATE_DELETE: 'AUTO_LICENSETEMPLATE_DELETE',\r\n\r\n AUTO_PRODUCTMODULE_DELETE: 'AUTO_PRODUCTMODULE_DELETE',\r\n\r\n AUTO_PRODUCT_DELETE: 'AUTO_PRODUCT_DELETE',\r\n\r\n AUTO_LICENSES_TRANSFER: 'AUTO_LICENSES_TRANSFER',\r\n\r\n SUBSCRIPTION_UPDATE: 'SUBSCRIPTION_UPDATE',\r\n\r\n RECURRING_PAYMENT: 'RECURRING_PAYMENT',\r\n\r\n CANCEL_RECURRING_PAYMENT: 'CANCEL_RECURRING_PAYMENT',\r\n\r\n OBTAIN_BUNDLE: 'OBTAIN_BUNDLE',\r\n});\r\n\r\nexport default TransactionSource;\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nconst TransactionStatus = Object.freeze({\r\n PENDING: 'PENDING',\r\n CLOSED: 'CLOSED',\r\n CANCELLED: 'CANCELLED',\r\n});\r\n\r\nexport default TransactionStatus;\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nimport LicenseeSecretMode from '@/constants/LicenseeSecretMode';\r\nimport LicenseType from '@/constants/LicenseType';\r\nimport NotificationEvent from '@/constants/NotificationEvent';\r\nimport NotificationProtocol from '@/constants/NotificationProtocol';\r\nimport SecurityMode from '@/constants/SecurityMode';\r\nimport TimeVolumePeriod from '@/constants/TimeVolumePeriod';\r\nimport TokenType from '@/constants/TokenType';\r\nimport TransactionSource from '@/constants/TransactionSource';\r\nimport TransactionStatus from '@/constants/TransactionStatus';\r\n\r\nexport default {\r\n LicenseeSecretMode,\r\n LicenseType,\r\n NotificationEvent,\r\n NotificationProtocol,\r\n SecurityMode,\r\n TimeVolumePeriod,\r\n TokenType,\r\n TransactionSource,\r\n TransactionStatus,\r\n\r\n // @deprecated use SecurityMode.BASIC_AUTHENTICATION instead\r\n BASIC_AUTHENTICATION: 'BASIC_AUTH',\r\n\r\n // @deprecated use SecurityMode.APIKEY_IDENTIFICATION instead\r\n APIKEY_IDENTIFICATION: 'APIKEY',\r\n\r\n // @deprecated use SecurityMode.ANONYMOUS_IDENTIFICATION instead\r\n ANONYMOUS_IDENTIFICATION: 'ANONYMOUS',\r\n\r\n FILTER: 'filter',\r\n\r\n Product: {\r\n TYPE: 'Product',\r\n ENDPOINT_PATH: 'product',\r\n },\r\n\r\n ProductModule: {\r\n TYPE: 'ProductModule',\r\n ENDPOINT_PATH: 'productmodule',\r\n PRODUCT_MODULE_NUMBER: 'productModuleNumber',\r\n },\r\n\r\n Licensee: {\r\n TYPE: 'Licensee',\r\n ENDPOINT_PATH: 'licensee',\r\n ENDPOINT_PATH_VALIDATE: 'validate',\r\n ENDPOINT_PATH_TRANSFER: 'transfer',\r\n LICENSEE_NUMBER: 'licenseeNumber',\r\n },\r\n\r\n LicenseTemplate: {\r\n TYPE: 'LicenseTemplate',\r\n ENDPOINT_PATH: 'licensetemplate',\r\n\r\n // @deprecated use LicenseType directly instead\r\n LicenseType,\r\n },\r\n\r\n License: {\r\n TYPE: 'License',\r\n ENDPOINT_PATH: 'license',\r\n },\r\n\r\n Validation: {\r\n TYPE: 'ProductModuleValidation',\r\n },\r\n\r\n Token: {\r\n TYPE: 'Token',\r\n ENDPOINT_PATH: 'token',\r\n\r\n // @deprecated use TokenType directly instead\r\n Type: TokenType,\r\n },\r\n\r\n PaymentMethod: {\r\n TYPE: 'PaymentMethod',\r\n ENDPOINT_PATH: 'paymentmethod',\r\n },\r\n\r\n Bundle: {\r\n TYPE: 'Bundle',\r\n ENDPOINT_PATH: 'bundle',\r\n ENDPOINT_OBTAIN_PATH: 'obtain',\r\n },\r\n\r\n Notification: {\r\n TYPE: 'Notification',\r\n ENDPOINT_PATH: 'notification',\r\n\r\n // @deprecated use NotificationProtocol directly instead\r\n Protocol: NotificationProtocol,\r\n\r\n // @deprecated use NotificationEvent directly instead\r\n Event: NotificationEvent,\r\n },\r\n\r\n Transaction: {\r\n TYPE: 'Transaction',\r\n ENDPOINT_PATH: 'transaction',\r\n\r\n // @deprecated use TransactionStatus directly instead\r\n Status: TransactionStatus,\r\n },\r\n\r\n Utility: {\r\n ENDPOINT_PATH: 'utility',\r\n ENDPOINT_PATH_LICENSE_TYPES: 'licenseTypes',\r\n ENDPOINT_PATH_LICENSING_MODELS: 'licensingModels',\r\n ENDPOINT_PATH_COUNTRIES: 'countries',\r\n LICENSING_MODEL_TYPE: 'LicensingModelProperties',\r\n LICENSE_TYPE: 'LicenseType',\r\n COUNTRY_TYPE: 'Country',\r\n },\r\n};\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nconst ApiKeyRole = Object.freeze({\r\n ROLE_APIKEY_LICENSEE: 'ROLE_APIKEY_LICENSEE',\r\n ROLE_APIKEY_ANALYTICS: 'ROLE_APIKEY_ANALYTICS',\r\n ROLE_APIKEY_OPERATION: 'ROLE_APIKEY_OPERATION',\r\n ROLE_APIKEY_MAINTENANCE: 'ROLE_APIKEY_MAINTENANCE',\r\n ROLE_APIKEY_ADMIN: 'ROLE_APIKEY_ADMIN',\r\n});\r\n\r\nexport default ApiKeyRole;\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nconst LicensingModel = Object.freeze({\r\n TRY_AND_BUY: 'TryAndBuy',\r\n SUBSCRIPTION: 'Subscription',\r\n RENTAL: 'Rental',\r\n FLOATING: 'Floating',\r\n MULTI_FEATURE: 'MultiFeature',\r\n PAY_PER_USE: 'PayPerUse',\r\n PRICING_TABLE: 'PricingTable',\r\n QUOTA: 'Quota',\r\n NODE_LOCKED: 'NodeLocked',\r\n DISCOUNT: 'Discount',\r\n});\r\n\r\nexport default LicensingModel;\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nconst NodeSecretMode = Object.freeze({\r\n PREDEFINED: 'PREDEFINED',\r\n CLIENT: 'CLIENT',\r\n});\r\n\r\nexport default NodeSecretMode;\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nconst PaymentMethodEnum = Object.freeze({\r\n NULL: 'NULL',\r\n PAYPAL: 'PAYPAL',\r\n PAYPAL_SANDBOX: 'PAYPAL_SANDBOX',\r\n STRIPE: 'STRIPE',\r\n STRIPE_TESTING: 'STRIPE_TESTING',\r\n});\r\n\r\nexport default PaymentMethodEnum;\r\n","const isBooleanString = (value: string): value is 'true' | 'false' => {\r\n return value === 'true' || value === 'false';\r\n};\r\n\r\nconst isNullString = (value: string): value is 'null' => {\r\n return value === 'null';\r\n};\r\n\r\nconst isJsonStructure = (value: string): boolean => {\r\n const trimmed = value.trim();\r\n\r\n return (\r\n (trimmed.startsWith('{') && trimmed.endsWith('}')) ||\r\n (trimmed.startsWith('[') && trimmed.endsWith(']'))\r\n );\r\n};\r\n\r\nconst isNumericString = (value: string): boolean => {\r\n const trimmed = value.trim();\r\n\r\n if (!trimmed) {\r\n return false;\r\n }\r\n\r\n const parsed = Number(trimmed);\r\n\r\n return Number.isFinite(parsed);\r\n};\r\n\r\nconst parseNumber = (value: string): number | string => {\r\n return isNumericString(value) ? Number(value) : value;\r\n};\r\n\r\nconst parseBoolean = (value: string): boolean | string => {\r\n if (value === 'true') {\r\n return true;\r\n }\r\n\r\n if (value === 'false') {\r\n return false;\r\n }\r\n\r\n return value;\r\n};\r\n\r\nconst parseNull = (value: string): null | string => {\r\n return value === 'null' ? null : value;\r\n};\r\n\r\nconst parseJson = (value: string): unknown => {\r\n if (!isJsonStructure(value)) {\r\n return value;\r\n }\r\n\r\n try {\r\n return JSON.parse(value);\r\n } catch {\r\n return value;\r\n }\r\n};\r\n\r\nexport type CastType = 'auto' | 'string' | 'number' | 'boolean' | 'null' | 'json';\r\n\r\nconst parseAuto = (value: string): unknown => {\r\n if (isBooleanString(value)) {\r\n return value === 'true';\r\n }\r\n\r\n if (isNullString(value)) {\r\n return null;\r\n }\r\n\r\n if (isNumericString(value)) {\r\n return Number(value);\r\n }\r\n\r\n if (isJsonStructure(value)) {\r\n try {\r\n return JSON.parse(value);\r\n } catch {\r\n return value;\r\n }\r\n }\r\n\r\n return value;\r\n};\r\n\r\nexport const cast = (value: string, type: CastType = 'auto'): unknown => {\r\n switch (type) {\r\n case 'string':\r\n return value;\r\n\r\n case 'number':\r\n return parseNumber(value);\r\n\r\n case 'boolean':\r\n return parseBoolean(value);\r\n\r\n case 'null':\r\n return parseNull(value);\r\n\r\n case 'json':\r\n return parseJson(value);\r\n\r\n case 'auto':\r\n default:\r\n return parseAuto(value);\r\n }\r\n};\r\n\r\nexport default cast;\r\n","import { Item, List } from '@/types/api/response';\r\nimport { CastType } from '@/types/utils/cast';\r\nimport cast from '@/utils/cast';\r\n\r\nexport type ItemToObjectCastMap = Record<string, CastType>;\r\n\r\nconst extractProperties = (properties?: { name: string; value: string }[], castMap: ItemToObjectCastMap = {}) => {\r\n const result: Record<string, unknown> = {};\r\n properties?.forEach(({ name, value }) => {\r\n result[name] = cast(value, castMap[name]);\r\n });\r\n return result;\r\n};\r\n\r\nconst extractLists = (lists?: List[], castMap: ItemToObjectCastMap = {}) => {\r\n const result: Record<string, unknown[]> = {};\r\n\r\n lists?.forEach((list) => {\r\n const { name } = list;\r\n result[name] = result[name] || [];\r\n result[name].push(itemToObject(list, castMap));\r\n });\r\n return result;\r\n};\r\n\r\nconst itemToObject =\r\n <T extends object = Record<string, unknown>>(item?: Item | List, castMap: ItemToObjectCastMap = {}): T => {\r\n return item\r\n ? ({...extractProperties(item.property, castMap), ...extractLists(item.list, castMap)} as T)\r\n : ({} as T);\r\n };\r\n\r\n\r\nexport default itemToObject;\r\n","export const has = <T extends object, K extends keyof T>(obj: T, key: K): boolean => {\r\n return Object.hasOwn(obj, key);\r\n};\r\n\r\nexport const set = <T extends object, K extends keyof T>(obj: T, key: K, value: T[K]): void => {\r\n obj[key] = value;\r\n};\r\n\r\nexport const get = <T extends object, K extends keyof T, D = undefined>(obj: T, key: K, def?: D): T[K] | D => {\r\n return has(obj, key) ? obj[key] : (def as D);\r\n};\r\n\r\nexport default {\r\n has,\r\n set,\r\n get,\r\n};\r\n","/**\r\n * Converts an object into a map of type Record<string, string>, where the value of each object property is converted\r\n * to a string.\r\n * If the property's value is `undefined`, it will be replaced with an empty string.\r\n * If the value is already a string, it will remain unchanged.\r\n * If the value is Date instance, it wll be replaced with an ISO format date string.\r\n * For complex types (objects, arrays, etc.), the value will be serialized into a JSON string.\r\n * If serialization fails, the value will be converted to a string using `String()`.\r\n *\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n *\r\n * @param obj - The object to be converted into a map.\r\n * @param options\r\n * @returns A map (Record<string, string>) with converted property values from the object.\r\n */\r\nexport default <T extends object>(obj: T, options: { ignore?: string[] } = {}): Record<string, string> => {\r\n const map: Record<string, string> = {};\r\n\r\n const { ignore = [] } = options;\r\n\r\n Object.entries(obj).forEach(([k, v]) => {\r\n // ignore keys\r\n if (ignore.includes(k)) {\r\n return;\r\n }\r\n\r\n if (typeof v === 'function') {\r\n // ignore functions\r\n return;\r\n } else if (v === undefined) {\r\n map[k] = ''; // if the value is `undefined`, replace it with an empty string\r\n } else if (typeof v === 'string') {\r\n map[k] = v; // If the value is already a string, leave it unchanged\r\n } else if (v instanceof Date) {\r\n // if the value is Date, convert it to ISO string\r\n map[k] = v.toISOString();\r\n } else if (typeof v !== 'object' || v === null) {\r\n // If it's not an object (or is null), convert it to string\r\n map[k] = String(v);\r\n } else {\r\n // Try to serialize the object or array into JSON\r\n try {\r\n map[k] = JSON.stringify(v);\r\n } catch {\r\n map[k] = String(v);\r\n }\r\n }\r\n });\r\n\r\n return map;\r\n};\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\n// types\r\nimport type {\r\n Entity,\r\n EntityMethods,\r\n Proto,\r\n PropGetEventListener,\r\n PropSetEventListener,\r\n} from '@/types/entities/defineEntity';\r\n\r\n// utils\r\nimport { set, has, get } from '@/utils/helpers';\r\nimport serialize from '@/utils/serialize';\r\n\r\nconst defineEntity = function <P extends Proto, T extends object, M extends object>(\r\n props: T,\r\n methods: M,\r\n proto: P = {} as P,\r\n options?: { set?: PropSetEventListener<T>; get?: PropGetEventListener<T> },\r\n) {\r\n const listeners: { set: PropSetEventListener<T>[]; get: PropGetEventListener<T>[] } = {\r\n set: [],\r\n get: [],\r\n };\r\n\r\n if (options?.get) {\r\n listeners.get.push(options.get);\r\n }\r\n\r\n if (options?.set) {\r\n listeners.set.push(options.set);\r\n }\r\n\r\n const base: EntityMethods<T> = {\r\n set(this: void, key, value): void {\r\n set(props, key, value);\r\n },\r\n\r\n get(this: void, key, def) {\r\n return get(props, key, def);\r\n },\r\n\r\n has(this: void, key) {\r\n return has(props, key);\r\n },\r\n\r\n // Aliases\r\n setProperty(key, value) {\r\n this.set(key, value);\r\n },\r\n\r\n addProperty(key, value) {\r\n this.set(key, value);\r\n },\r\n\r\n getProperty(key, def) {\r\n return this.get(key, def);\r\n },\r\n\r\n hasProperty(key) {\r\n return this.has(key);\r\n },\r\n\r\n setProperties(properties) {\r\n Object.entries(properties).forEach(([k, v]) => {\r\n this.set(k as keyof T, v as T[keyof T]);\r\n });\r\n },\r\n\r\n serialize(this: void) {\r\n return serialize(props);\r\n },\r\n };\r\n\r\n return new Proxy(props, {\r\n get(obj: T, prop: string | symbol, receiver) {\r\n if (Object.hasOwn(methods, prop)) {\r\n return methods[prop as keyof typeof methods];\r\n }\r\n\r\n if (Object.hasOwn(base, prop)) {\r\n return base[prop as keyof typeof base];\r\n }\r\n\r\n listeners.get.forEach((l) => {\r\n l(obj, prop, receiver);\r\n });\r\n\r\n return Reflect.get(obj, prop, receiver);\r\n },\r\n\r\n set(obj, prop, value, receiver) {\r\n listeners.set.forEach((l) => {\r\n l(obj, prop, value, receiver);\r\n });\r\n\r\n return Reflect.set(obj, prop, value, receiver);\r\n },\r\n\r\n getPrototypeOf() {\r\n return proto.prototype || null;\r\n },\r\n }) as Entity<T, M>;\r\n};\r\n\r\nexport default defineEntity;\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\n\r\n// types\r\nimport type { BundleProps, BundleMethods, BundleEntity } from '@/types/entities/Bundle';\r\n\r\n// utils\r\nimport { set, get } from '@/utils/helpers';\r\nimport serialize from '@/utils/serialize';\r\n\r\n// entity factory\r\nimport defineEntity from './defineEntity';\r\n\r\n/**\r\n * NetLicensing Bundle entity.\r\n *\r\n * Properties visible via NetLicensing API:\r\n *\r\n * Unique number that identifies the bundle. Vendor can assign this number when creating a bundle or\r\n * let NetLicensing generate one.\r\n * @property string number\r\n *\r\n * If set to false, the bundle is disabled.\r\n * @property boolean active\r\n *\r\n * Bundle name.\r\n * @property string name\r\n *\r\n * Price for the bundle. If >0, it must always be accompanied by the currency specification.\r\n * @property number price\r\n *\r\n * Specifies currency for the bundle price. Check data types to discover which currencies are\r\n * supported.\r\n * @property string currency\r\n *\r\n * The bundle includes a set of templates, each identified by a unique template number.\r\n * @property string[] licenseTemplateNumbers\r\n *\r\n * Arbitrary additional user properties of string type may be associated with each bundle. The name of user property\r\n * must not be equal to any of the fixed property names listed above and must be none of id, deleted.\r\n */\r\nconst Bundle = function <T extends object>(properties: BundleProps<T> = {} as BundleProps<T>): BundleEntity<T> {\r\n const props: BundleProps = { ...properties };\r\n\r\n const methods: BundleMethods = {\r\n setActive(this: void, active: boolean) {\r\n set(props, 'active', active);\r\n },\r\n\r\n getActive<D = undefined>(this: void, def?: D): boolean | D {\r\n return get(props, 'active', def) as boolean | D;\r\n },\r\n\r\n setNumber(this: void, number: string) {\r\n set(props, 'number', number);\r\n },\r\n\r\n getNumber<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'number', def) as string | D;\r\n },\r\n\r\n setName(this: void, name: string): void {\r\n set(props, 'name', name);\r\n },\r\n\r\n getName<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'name', def) as string | D;\r\n },\r\n\r\n setPrice(this: void, price: number): void {\r\n set(props, 'price', price);\r\n },\r\n\r\n getPrice<D = undefined>(this: void, def?: D): number | D {\r\n return get(props, 'price', def) as number | D;\r\n },\r\n\r\n setCurrency(this: void, currency: string): void {\r\n set(props, 'currency', currency);\r\n },\r\n\r\n getCurrency<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'currency', def) as string | D;\r\n },\r\n\r\n setProductNumber(number: string) {\r\n set(props, 'productNumber', number);\r\n },\r\n\r\n getProductNumber<D = undefined>(def?: D): string | D {\r\n return get(props, 'productNumber', def) as string | D;\r\n },\r\n\r\n setLicenseTemplateNumbers(this: void, numbers: string[]): void {\r\n set(props, 'licenseTemplateNumbers', numbers);\r\n },\r\n\r\n addLicenseTemplateNumber(this: void, number: string): void {\r\n if (!props.licenseTemplateNumbers) {\r\n props.licenseTemplateNumbers = [];\r\n }\r\n\r\n props.licenseTemplateNumbers.push(number);\r\n },\r\n\r\n getLicenseTemplateNumbers<D = undefined>(this: void, def?: D): string[] | D {\r\n return get(props, 'licenseTemplateNumbers', def) as string[] | D;\r\n },\r\n\r\n removeLicenseTemplateNumber(this: void, number: string): void {\r\n const { licenseTemplateNumbers: numbers = [] } = props;\r\n\r\n numbers.splice(numbers.indexOf(number), 1);\r\n props.licenseTemplateNumbers = numbers;\r\n },\r\n\r\n getStaleLicenseTemplateNumbers<D = undefined>(this: void, def?: D): string[] | D {\r\n return get(props, 'staleLicenseTemplateNumbers', def) as string[] | D;\r\n },\r\n\r\n serialize(this: void): Record<string, string> {\r\n const cast: Record<string, string> = {};\r\n\r\n if (props.licenseTemplateNumbers) {\r\n cast['licenseTemplateNumbers'] = props.licenseTemplateNumbers.join(',');\r\n }\r\n\r\n return serialize({ ...props, ...cast }, { ignore: ['staleLicenseTemplateNumbers'] });\r\n },\r\n };\r\n\r\n return defineEntity(props as BundleProps<T>, methods, Bundle);\r\n};\r\n\r\nexport default Bundle;\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nimport itemToObject from '@/converters/itemToObject';\r\nimport Bundle from '@/entities/Bundle';\r\n\r\n// types\r\nimport { Item } from '@/types/api/response';\r\nimport { BundleProps } from '@/types/entities/Bundle';\r\n\r\nexport default <T extends object = BundleProps>(item?: Item) => {\r\n const props = itemToObject<Record<string, unknown>>(item,{\r\n active: 'boolean',\r\n number: 'string',\r\n name: 'string',\r\n price: 'number',\r\n currency: 'string',\r\n productNumber: 'string',\r\n licenseTemplateNumbers: 'string',\r\n staleLicenseTemplateNumbers: 'string',\r\n });\r\n\r\n const { licenseTemplateNumbers, staleLicenseTemplateNumbers } = props;\r\n\r\n if (licenseTemplateNumbers && typeof licenseTemplateNumbers === 'string') {\r\n props.licenseTemplateNumbers = licenseTemplateNumbers.split(',');\r\n }\r\n\r\n if (staleLicenseTemplateNumbers && typeof staleLicenseTemplateNumbers === 'string') {\r\n props.staleLicenseTemplateNumbers = staleLicenseTemplateNumbers.split(',');\r\n }\r\n\r\n return Bundle<T>(props as BundleProps<T>);\r\n};\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\n// types\r\nimport type { CountryProps, CountryMethods, CountryEntity } from '@/types/entities/Country';\r\n\r\n// entity factory\r\nimport defineEntity from './defineEntity';\r\n\r\n/**\r\n * Country entity used internally by NetLicensing.\r\n *\r\n * Properties visible via NetLicensing API:\r\n *\r\n * @property code - Unique code of country.\r\n * @property name - Unique name of country\r\n * @property vatPercent - Country vat.\r\n * @property isEu - is country in EU.\r\n */\r\nconst Country = function (properties: CountryProps = {} as CountryProps): CountryEntity {\r\n const defaults: CountryProps = {\r\n code: '',\r\n name: '',\r\n vatPercent: 0,\r\n isEu: false,\r\n };\r\n\r\n const props: CountryProps = { ...defaults, ...properties };\r\n\r\n const methods: CountryMethods = {\r\n getCode(this: void): string {\r\n return props.code;\r\n },\r\n\r\n getName(this: void): string {\r\n return props.name;\r\n },\r\n\r\n getVatPercent(this: void): number {\r\n return props.vatPercent as number;\r\n },\r\n\r\n getIsEu(this: void): boolean {\r\n return props.isEu;\r\n },\r\n };\r\n\r\n return defineEntity(props, methods, Country);\r\n};\r\n\r\nexport default Country;\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nimport itemToObject from '@/converters/itemToObject';\r\n\r\n// entities\r\nimport Country from '@/entities/Country';\r\n\r\n// types\r\nimport { Item } from '@/types/api/response';\r\nimport { CountryProps } from '@/types/entities/Country';\r\n\r\nexport default (item?: Item) =>\r\n Country(\r\n itemToObject<CountryProps>(item, {\r\n code: 'string',\r\n name: 'string',\r\n vatPercent: 'number',\r\n isEu: 'boolean',\r\n }),\r\n );\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\n// types\r\nimport { LicenseMethods, LicenseProps, LicenseEntity } from '@/types/entities/License';\r\n\r\n// utils\r\nimport { set, get } from '@/utils/helpers';\r\nimport serialize from '@/utils/serialize';\r\n\r\n// entity factory\r\nimport defineEntity from './defineEntity';\r\n\r\n/**\r\n * License entity used internally by NetLicensing.\r\n *\r\n * Properties visible via NetLicensing API:\r\n *\r\n * Unique number (across all products/licensees of a vendor) that identifies the license. Vendor can\r\n * assign this number when creating a license or let NetLicensing generate one. Read-only after corresponding creation\r\n * transaction status is set to closed.\r\n * @property string number\r\n *\r\n * Name for the licensed item. Set from license template on creation, if not specified explicitly.\r\n * @property string name\r\n *\r\n * If set to false, the license is disabled. License can be re-enabled, but as long as it is disabled,\r\n * the license is excluded from the validation process.\r\n * @property boolean active\r\n *\r\n * price for the license. If >0, it must always be accompanied by the currency specification. Read-only,\r\n * set from license template on creation.\r\n * @property number price\r\n *\r\n * specifies currency for the license price. Check data types to discover which currencies are\r\n * supported. Read-only, set from license template on creation.\r\n * @property string currency\r\n *\r\n * If set to true, this license is not shown in NetLicensing Shop as purchased license. Set from license\r\n * template on creation, if not specified explicitly.\r\n * @property boolean hidden\r\n *\r\n * The unique identifier assigned to the licensee (the entity to whom the license is issued). This number is typically\r\n * associated with a specific customer or organization. It is used internally to reference the licensee and cannot be\r\n * changed after the license is created.\r\n * @property string licenseeNumber\r\n *\r\n * The unique identifier for the license template from which this license was created.\r\n * @property string licenseTemplateNumber\r\n *\r\n * A boolean flag indicating whether the license is actively being used. If true, it means the license is currently in\r\n * use. If false, the license is not currently assigned or in use.\r\n * @property boolean inUse\r\n *\r\n * This parameter is specific to TimeVolume licenses and indicates the total volume of time (e.g., in hours, days, etc.)\r\n * associated with the license. This value defines the amount of time the license covers, which may affect the usage\r\n * period and limits associated with the license.\r\n * @property number timeVolume\r\n *\r\n * Also, specific to TimeVolume licenses, this field defines the period of time for the timeVolume\r\n * (e.g., \"DAY\", \"WEEK\", \"MONTH\", \"YEAR\"). It provides the time unit for the timeVolume value, clarifying whether the\r\n * time is measured in days, weeks, or any other defined period.\r\n * @property string timeVolumePeriod\r\n *\r\n * For TimeVolume licenses, this field indicates the start date of the license’s validity period. This date marks when\r\n * the license becomes active and the associated time volume starts being consumed.\r\n * It can be represented as a string \"now\" or a Date object.\r\n * @property string|Date Date startDate\r\n *\r\n * Parent(Feature) license number\r\n * @property string parentfeature\r\n *\r\n * Arbitrary additional user properties of string type may be associated with each license. The name of user property\r\n * must not be equal to any of the fixed property names listed above and must be none of id, deleted, licenseeNumber,\r\n * licenseTemplateNumber.\r\n */\r\nconst License = function <T extends object>(properties: LicenseProps<T> = {} as LicenseProps<T>): LicenseEntity<T> {\r\n const props: LicenseProps = { ...(properties as T) };\r\n\r\n const methods: LicenseMethods = {\r\n setActive(this: void, active: boolean): void {\r\n set(props, 'active', active);\r\n },\r\n\r\n getActive<D = undefined>(this: void, def?: D): boolean | D {\r\n return get(props, 'active', def) as boolean | D;\r\n },\r\n\r\n setNumber(this: void, number: string): void {\r\n set(props, 'number', number);\r\n },\r\n\r\n getNumber<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'number', def) as string | D;\r\n },\r\n\r\n setName(this: void, name: string): void {\r\n set(props, 'name', name);\r\n },\r\n\r\n getName<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'name', def) as string | D;\r\n },\r\n\r\n setPrice(this: void, price: number): void {\r\n set(props, 'price', price);\r\n },\r\n\r\n getPrice<D = undefined>(this: void, def?: D): number | D {\r\n return get(props, 'price', def) as number | D;\r\n },\r\n\r\n setCurrency(this: void, currency: string): void {\r\n set(props, 'currency', currency);\r\n },\r\n\r\n getCurrency<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'currency', def) as string | D;\r\n },\r\n\r\n setHidden(this: void, hidden: boolean): void {\r\n set(props, 'hidden', hidden);\r\n },\r\n\r\n getHidden<D = undefined>(this: void, def?: D): boolean | D {\r\n return get(props, 'hidden', def) as boolean | D;\r\n },\r\n\r\n setLicenseeNumber(this: void, number: string): void {\r\n set(props, 'licenseeNumber', number);\r\n },\r\n\r\n getLicenseeNumber<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'licenseeNumber', def) as string | D;\r\n },\r\n\r\n setLicenseTemplateNumber(this: void, number: string): void {\r\n set(props, 'licenseTemplateNumber', number);\r\n },\r\n\r\n getLicenseTemplateNumber<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'licenseTemplateNumber', def) as string | D;\r\n },\r\n\r\n setProductModuleNumber(this: void, number: string): void {\r\n set(props, 'productModuleNumber', number);\r\n },\r\n\r\n getProductModuleNumber<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'productModuleNumber', def) as string | D;\r\n },\r\n\r\n serialize(this: void): Record<string, string> {\r\n return serialize(props, { ignore: ['inUse'] });\r\n },\r\n };\r\n\r\n return defineEntity(props as LicenseProps<T>, methods, License);\r\n};\r\n\r\nexport default License;\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nimport itemToObject from '@/converters/itemToObject';\r\nimport License from '@/entities/License';\r\n\r\n// types\r\nimport { Item } from '@/types/api/response';\r\nimport { LicenseProps } from '@/types/entities/License';\r\n\r\nexport default <T extends object = LicenseProps>(item?: Item) => {\r\n const props = itemToObject<Record<string, unknown>>(item, {\r\n active: 'boolean',\r\n number: 'string',\r\n name: 'string',\r\n price: 'number',\r\n currency: 'string',\r\n hidden: 'boolean',\r\n licenseeNumber: 'string',\r\n licenseTemplateNumber: 'string',\r\n productModuleNumber: 'string',\r\n startDate: 'string',\r\n inUse: 'boolean',\r\n });\r\n\r\n const { startDate } = props;\r\n\r\n if (startDate && typeof startDate === 'string') {\r\n props.startDate = startDate === 'now' ? startDate : new Date(startDate);\r\n }\r\n\r\n return License<T>(props as LicenseProps<T>);\r\n};\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\n\r\n// entity factory\r\nimport defineEntity from '@/entities/defineEntity';\r\n\r\n// types\r\nimport { LicenseeMethods, LicenseeProps, LicenseeEntity } from '@/types/entities/Licensee';\r\n\r\n// utils\r\nimport { set, get } from '@/utils/helpers';\r\nimport serialize from '@/utils/serialize';\r\n\r\n/**\r\n * Licensee entity used internally by NetLicensing.\r\n *\r\n * Properties visible via NetLicensing API:\r\n *\r\n * Unique number (across all products of a vendor) that identifies the licensee. Vendor can assign this\r\n * number when creating a licensee or let NetLicensing generate one. Read-only after creation of the first license for\r\n * the licensee.\r\n * @property string number\r\n *\r\n * Licensee name.\r\n * @property string name\r\n *\r\n * If set to false, the licensee is disabled. Licensee can not obtain new licenses, and validation is\r\n * disabled (tbd).\r\n * @property boolean active\r\n *\r\n * Licensee Secret for licensee deprecated use Node-Locked Licensing Model instead\r\n * @property string licenseeSecret\r\n *\r\n * Mark licensee for transfer.\r\n * @property boolean markedForTransfer\r\n *\r\n * Arbitrary additional user properties of string type may be associated with each licensee. The name of user property\r\n * must not be equal to any of the fixed property names listed above and must be none of id, deleted, productNumber\r\n */\r\n\r\nconst Licensee = function <T extends object>(properties: LicenseeProps<T> = {} as LicenseeProps<T>): LicenseeEntity<T> {\r\n const props: LicenseeProps = { ...properties };\r\n\r\n const methods: LicenseeMethods = {\r\n setActive(this: void, active: boolean): void {\r\n set(props, 'active', active);\r\n },\r\n\r\n getActive<D = undefined>(this: void, def?: D): boolean | D {\r\n return get(props, 'active', def) as boolean | D;\r\n },\r\n\r\n setNumber(this: void, number: string): void {\r\n set(props, 'number', number);\r\n },\r\n getNumber<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'number', def) as string | D;\r\n },\r\n\r\n setName(this: void, name: string): void {\r\n set(props, 'name', name);\r\n },\r\n\r\n getName<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'name', def) as string | D;\r\n },\r\n\r\n setProductNumber(this: void, number: string): void {\r\n set(props, 'productNumber', number);\r\n },\r\n\r\n getProductNumber<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'productNumber', def) as string | D;\r\n },\r\n\r\n setMarkedForTransfer(this: void, mark: boolean): void {\r\n set(props, 'markedForTransfer', mark);\r\n },\r\n\r\n getMarkedForTransfer<D = undefined>(this: void, def?: D): boolean | D {\r\n return get(props, 'markedForTransfer', def) as boolean | D;\r\n },\r\n\r\n serialize(this: void): Record<string, string> {\r\n return serialize(props, { ignore: ['inUse'] });\r\n },\r\n };\r\n\r\n return defineEntity(props as LicenseeProps<T>, methods, Licensee);\r\n};\r\n\r\nexport default Licensee;\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nimport itemToObject from '@/converters/itemToObject';\r\nimport Licensee from '@/entities/Licensee';\r\n\r\n// types\r\nimport { Item } from '@/types/api/response';\r\nimport { LicenseeProps } from '@/types/entities/Licensee';\r\n\r\nexport default <T extends object = LicenseeProps>(item?: Item) => {\r\n const props = itemToObject<Record<string, unknown>>(item, {\r\n active: 'boolean',\r\n number: 'string',\r\n name: 'string',\r\n markedForTransfer: 'boolean',\r\n productNumber: 'string',\r\n aliases: 'string',\r\n inUse: 'boolean',\r\n });\r\n\r\n const { aliases } = props;\r\n\r\n if (aliases && typeof aliases === 'string') {\r\n props.aliases = aliases.split(',');\r\n }\r\n \r\n return Licensee<T>(props as LicenseeProps<T>);\r\n};\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\n// entity factory\r\nimport defineEntity from '@/entities/defineEntity';\r\n\r\n// types\r\nimport { LicenseTypeValues } from '@/types/constants/LicenseType';\r\nimport {\r\n LicenseTemplateMethods,\r\n LicenseTemplateProps,\r\n LicenseTemplateEntity,\r\n} from '@/types/entities/LicenseTemplate';\r\n\r\n// utils\r\nimport { set, get } from '@/utils/helpers';\r\nimport serialize from '@/utils/serialize';\r\n\r\n/**\r\n * License template entity used internally by NetLicensing.\r\n *\r\n * Properties visible via NetLicensing API:\r\n *\r\n * Unique number (across all products of a vendor) that identifies the license template. Vendor can\r\n * assign this number when creating a license template or let NetLicensing generate one.\r\n * Read-only after creation of the first license from this license template.\r\n * @property string number\r\n *\r\n * If set to false, the license template is disabled. Licensee can not obtain any new licenses off this\r\n * license template.\r\n * @property boolean active\r\n *\r\n * Name for the licensed item.\r\n * @property string name\r\n *\r\n * Type of licenses created from this license template. Supported types: \"FEATURE\", \"TIMEVOLUME\",\r\n * \"FLOATING\", \"QUANTITY\"\r\n * @property string licenseType\r\n *\r\n * Price for the license. If >0, it must always be accompanied by the currency specification.\r\n * @property number price\r\n *\r\n * Specifies currency for the license price. Check data types to discover which currencies are\r\n * supported.\r\n * @property string currency\r\n *\r\n * If set to true, every new licensee automatically gets one license out of this license template on\r\n * creation. Automatic licenses must have their price set to 0.\r\n * @property boolean automatic\r\n *\r\n * If set to true, this license template is not shown in NetLicensing Shop as offered for purchase.\r\n * @property boolean hidden\r\n *\r\n * If set to true, licenses from this license template are not visible to the end customer, but\r\n * participate in validation.\r\n * @property boolean hideLicenses\r\n *\r\n * If set to true, this license template defines grace period of validity granted after subscription expiration.\r\n * @property boolean gracePeriod\r\n *\r\n * Mandatory for 'TIMEVOLUME' license type.\r\n * @property number timeVolume\r\n *\r\n * Time volume period for 'TIMEVOLUME' license type. Supported types: \"DAY\", \"WEEK\", \"MONTH\", \"YEAR\"\r\n * @property string timeVolumePeriod\r\n *\r\n * Mandatory for 'FLOATING' license type.\r\n * @property number maxSessions\r\n *\r\n * Mandatory for 'QUANTITY' license type.\r\n * @property number quantity\r\n */\r\n\r\nconst LicenseTemplate = function <T extends object>(\r\n properties: LicenseTemplateProps<T> = {} as LicenseTemplateProps<T>,\r\n): LicenseTemplateEntity<T> {\r\n const props: LicenseTemplateProps = { ...properties };\r\n\r\n const methods: LicenseTemplateMethods = {\r\n setActive(this: void, active: boolean): void {\r\n set(props, 'active', active);\r\n },\r\n\r\n getActive<D = undefined>(this: void, def?: D): boolean | D {\r\n return get(props, 'active', def) as boolean | D;\r\n },\r\n\r\n setNumber(this: void, number: string): void {\r\n set(props, 'number', number);\r\n },\r\n\r\n getNumber<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'number', def) as string | D;\r\n },\r\n\r\n setName(this: void, name: string): void {\r\n set(props, 'name', name);\r\n },\r\n\r\n getName<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'name', def) as string | D;\r\n },\r\n\r\n setLicenseType(this: void, type: LicenseTypeValues): void {\r\n set(props, 'licenseType', type);\r\n },\r\n\r\n getLicenseType<D = undefined>(this: void, def?: D): LicenseTypeValues | D {\r\n return get(props, 'licenseType', def) as LicenseTypeValues | D;\r\n },\r\n\r\n setPrice(this: void, price: number): void {\r\n set(props, 'price', price);\r\n },\r\n\r\n getPrice<D = undefined>(this: void, def?: D): number | D {\r\n return get(props, 'price', def) as number | D;\r\n },\r\n\r\n setCurrency(this: void, currency: string): void {\r\n set(props, 'currency', currency);\r\n },\r\n\r\n getCurrency<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'currency', def) as string | D;\r\n },\r\n\r\n setAutomatic(this: void, automatic: boolean): void {\r\n set(props, 'automatic', automatic);\r\n },\r\n\r\n getAutomatic<D = undefined>(this: void, def?: D): boolean | D {\r\n return get(props, 'automatic', def) as boolean | D;\r\n },\r\n\r\n setHidden(this: void, hidden: boolean): void {\r\n set(props, 'hidden', hidden);\r\n },\r\n\r\n getHidden<D = undefined>(this: void, def?: D): boolean | D {\r\n return get(props, 'hidden', def) as boolean | D;\r\n },\r\n\r\n setHideLicenses(this: void, hideLicenses: boolean): void {\r\n set(props, 'hideLicenses', hideLicenses);\r\n },\r\n\r\n getHideLicenses<D = undefined>(this: void, def?: D): boolean | D {\r\n return get(props, 'hideLicenses', def) as boolean | D;\r\n },\r\n\r\n setProductModuleNumber(this: void, productModuleNumber: string): void {\r\n set(props, 'productModuleNumber', productModuleNumber);\r\n },\r\n\r\n getProductModuleNumber<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'productModuleNumber', def) as string | D;\r\n },\r\n\r\n serialize(this: void): Record<string, string> {\r\n return serialize(props, { ignore: ['inUse'] });\r\n },\r\n };\r\n\r\n return defineEntity(props as LicenseTemplateProps<T>, methods, LicenseTemplate);\r\n};\r\n\r\nexport default LicenseTemplate;\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nimport itemToObject from '@/converters/itemToObject';\r\nimport LicenseTemplate from '@/entities/LicenseTemplate';\r\n\r\n// types\r\nimport { Item } from '@/types/api/response';\r\nimport { LicenseTemplateProps } from '@/types/entities/LicenseTemplate';\r\n\r\nexport default <T extends object = LicenseTemplateProps>(item?: Item) =>\r\n LicenseTemplate<T>(\r\n itemToObject<T>(item, {\r\n active: 'boolean',\r\n number: 'string',\r\n name: 'string',\r\n licenseType: 'string',\r\n price: 'number',\r\n currency: 'string',\r\n automatic: 'boolean',\r\n hidden: 'boolean',\r\n hideLicenses: 'boolean',\r\n productModuleNumber: 'string',\r\n inUse: 'boolean',\r\n }),\r\n );\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\n// entity factory\r\nimport defineEntity from '@/entities/defineEntity';\r\nimport { NotificationEventValues } from '@/types/constants/NotificationEvent';\r\nimport { NotificationProtocolValues } from '@/types/constants/NotificationProtocol';\r\n\r\n// types\r\nimport { NotificationMethods, NotificationProps, NotificationEntity } from '@/types/entities/Notification';\r\n\r\n// utils\r\nimport { set, get } from '@/utils/helpers';\r\nimport serialize from '@/utils/serialize';\r\n\r\n/**\r\n * NetLicensing Notification entity.\r\n *\r\n * Properties visible via NetLicensing API:\r\n *\r\n * Unique number that identifies the notification. Vendor can assign this number when creating a notification or\r\n * let NetLicensing generate one.\r\n * @property string number\r\n *\r\n * If set to false, the notification is disabled. The notification will not be fired when the event triggered.\r\n * @property boolean active\r\n *\r\n * Notification name.\r\n * @property string name\r\n *\r\n * Notification type. Indicate the method of transmitting notification, ex: EMAIL, WEBHOOK.\r\n * @property float type\r\n *\r\n * Comma separated string of events that fire the notification when emitted.\r\n * @property string events\r\n *\r\n * Notification response payload.\r\n * @property string payload\r\n *\r\n * Notification response url. Optional. Uses only for WEBHOOK type notification.\r\n * @property string url\r\n *\r\n * Arbitrary additional user properties of string type may be associated with each notification.\r\n * The name of user property must not be equal to any of the fixed property names listed above and must be none of id,\r\n * deleted.\r\n */\r\n\r\nconst Notification = function <T extends object>(\r\n properties: NotificationProps<T> = {} as NotificationProps<T>,\r\n): NotificationEntity<T> {\r\n const props: NotificationProps = { ...properties };\r\n\r\n const methods: NotificationMethods = {\r\n setActive(this: void, active: boolean): void {\r\n set(props, 'active', active);\r\n },\r\n\r\n getActive<D = undefined>(this: void, def?: D): boolean | D {\r\n return get(props, 'active', def) as boolean | D;\r\n },\r\n\r\n setNumber(this: void, number: string): void {\r\n set(props, 'number', number);\r\n },\r\n\r\n getNumber<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'number', def) as string | D;\r\n },\r\n\r\n setName(this: void, name: string): void {\r\n set(props, 'name', name);\r\n },\r\n\r\n getName<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'name', def) as string | D;\r\n },\r\n\r\n setProtocol(this: void, protocol: NotificationProtocolValues): void {\r\n set(props, 'protocol', protocol);\r\n },\r\n\r\n getProtocol<D = undefined>(this: void, def?: D): NotificationProtocolValues | D {\r\n return get(props, 'protocol', def) as NotificationProtocolValues | D;\r\n },\r\n\r\n setEvents(this: void, events: NotificationEventValues[]): void {\r\n set(props, 'events', events);\r\n },\r\n\r\n getEvents<D = undefined>(this: void, def?: D): NotificationEventValues[] | D {\r\n return get(props, 'events', def) as NotificationEventValues[] | D;\r\n },\r\n\r\n addEvent(event: NotificationEventValues): void {\r\n const events = this.getEvents([]) as NotificationEventValues[];\r\n events.push(event);\r\n\r\n this.setEvents(events);\r\n },\r\n\r\n setPayload(this: void, payload: string): void {\r\n set(props, 'payload', payload);\r\n },\r\n\r\n getPayload<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'payload', def) as string | D;\r\n },\r\n\r\n setEndpoint(this: void, endpoint: string): void {\r\n set(props, 'endpoint', endpoint);\r\n },\r\n\r\n getEndpoint<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'endpoint', def) as string | D;\r\n },\r\n\r\n serialize(): Record<string, string> {\r\n const data = serialize(props);\r\n\r\n if (data.events) {\r\n data.events = this.getEvents([]).join(',');\r\n }\r\n\r\n return data;\r\n },\r\n };\r\n\r\n return defineEntity(props as NotificationProps<T>, methods, Notification);\r\n};\r\n\r\nexport default Notification;\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nimport itemToObject from '@/converters/itemToObject';\r\nimport Notification from '@/entities/Notification';\r\n\r\n// types\r\nimport { Item } from '@/types/api/response';\r\nimport { NotificationProps } from '@/types/entities/Notification';\r\n\r\nexport default <T extends object = NotificationProps>(item?: Item) => {\r\n const props = itemToObject<Record<string, unknown>>(item, {\r\n active: 'boolean',\r\n number: 'string',\r\n name: 'string',\r\n protocol: 'string',\r\n events: 'string',\r\n payload: 'string',\r\n endpoint: 'string',\r\n });\r\n\r\n const { events } = props;\r\n\r\n if (events && typeof events === 'string') {\r\n props.events = events.split(',');\r\n }\r\n\r\n return Notification<T>(props as NotificationProps<T>);\r\n};\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\n// entity factory\r\nimport defineEntity from '@/entities/defineEntity';\r\n\r\n// types\r\nimport { PaymentMethodMethods, PaymentMethodProps, PaymentMethodEntity } from '@/types/entities/PaymentMethod';\r\n\r\n// utils\r\nimport { set, get } from '@/utils/helpers';\r\n\r\n/**\r\n * PaymentMethod entity used internally by NetLicensing.\r\n *\r\n * @property string number\r\n * @property boolean active\r\n * @property string paypal.subject\r\n */\r\nconst PaymentMethod = function <T extends object>(\r\n properties: PaymentMethodProps<T> = {} as PaymentMethodProps<T>,\r\n): PaymentMethodEntity<T> {\r\n const props: PaymentMethodProps = { ...properties };\r\n\r\n const methods: PaymentMethodMethods = {\r\n setActive(this: void, active: boolean): void {\r\n set(props, 'active', active);\r\n },\r\n\r\n getActive<D = undefined>(this: void, def?: D): boolean | D {\r\n return get(props, 'active', def) as boolean | D;\r\n },\r\n\r\n setNumber(this: void, number: string): void {\r\n set(props, 'number', number);\r\n },\r\n\r\n getNumber<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'number', def) as string | D;\r\n },\r\n };\r\n\r\n return defineEntity(props as PaymentMethodProps<T>, methods, PaymentMethod);\r\n};\r\n\r\nexport default PaymentMethod;\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nimport itemToObject from '@/converters/itemToObject';\r\nimport PaymentMethod from '@/entities/PaymentMethod';\r\n\r\n// types\r\nimport { Item } from '@/types/api/response';\r\nimport { PaymentMethodProps } from '@/types/entities/PaymentMethod';\r\n\r\nexport default <T extends object = PaymentMethodProps>(item?: Item) =>\r\n PaymentMethod<T>(\r\n itemToObject<T>(item, {\r\n active: 'boolean',\r\n number: 'string',\r\n }),\r\n );\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\n// entity factory\r\nimport defineEntity from '@/entities/defineEntity';\r\n\r\n// types\r\nimport { ProductProps, ProductEntity, ProductMethods } from '@/types/entities/Product';\r\nimport { ProductDiscountEntity } from '@/types/entities/ProductDiscount';\r\n\r\n// utils\r\nimport { set, get } from '@/utils/helpers';\r\nimport serialize from '@/utils/serialize';\r\n\r\n/**\r\n * NetLicensing Product entity.\r\n *\r\n * Properties visible via NetLicensing API:\r\n *\r\n * Unique number that identifies the product. Vendor can assign this number when creating a product or\r\n * let NetLicensing generate one. Read-only after creation of the first licensee for the product.\r\n * @property string number\r\n *\r\n * If set to false, the product is disabled. No new licensees can be registered for the product,\r\n * existing licensees can not obtain new licenses.\r\n * @property boolean active\r\n *\r\n * Product name. Together with the version identifies the product for the end customer.\r\n * @property string name\r\n *\r\n * Product version. Convenience parameter, additional to the product name.\r\n * @property string version\r\n *\r\n * If set to 'true', non-existing licensees will be created at first validation attempt.\r\n * @property boolean licenseeAutoCreate\r\n *\r\n * Licensee secret mode for product.Supported types: \"DISABLED\", \"PREDEFINED\", \"CLIENT\"\r\n * @property boolean licenseeSecretMode\r\n *\r\n * Product description. Optional.\r\n * @property string description\r\n *\r\n * Licensing information. Optional.\r\n * @property string licensingInfo\r\n *\r\n * @property boolean inUse\r\n *\r\n * Arbitrary additional user properties of string type may be associated with each product. The name of user property\r\n * must not be equal to any of the fixed property names listed above and must be none of id, deleted.\r\n */\r\nconst Product = function <T extends object = object>(\r\n properties: ProductProps<T> = {} as ProductProps<T>,\r\n): ProductEntity<T> {\r\n const props: ProductProps = { ...properties };\r\n\r\n const methods: ProductMethods = {\r\n setActive(this: void, active: boolean): void {\r\n set(props, 'active', active);\r\n },\r\n\r\n getActive<D = undefined>(this: void, def?: D): boolean | D {\r\n return get(props, 'active', def) as boolean | D;\r\n },\r\n\r\n setNumber(this: void, number: string): void {\r\n set(props, 'number', number);\r\n },\r\n\r\n getNumber<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'number', def) as string | D;\r\n },\r\n\r\n setName(this: void, name: string): void {\r\n set(props, 'name', name);\r\n },\r\n\r\n getName<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'name', def) as string | D;\r\n },\r\n\r\n setVersion(this: void, version: string): void {\r\n set(props, 'version', version);\r\n },\r\n\r\n getVersion<D = undefined>(this: void, def?: D): string | number | D {\r\n return get(props, 'version', def) as string | number | D;\r\n },\r\n\r\n setDescription(this: void, description: string): void {\r\n set(props, 'description', description);\r\n },\r\n\r\n getDescription<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'description', def) as string | D;\r\n },\r\n\r\n setLicensingInfo(this: void, licensingInfo: string): void {\r\n set(props, 'licensingInfo', licensingInfo);\r\n },\r\n\r\n getLicensingInfo<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'licensingInfo', def) as string | D;\r\n },\r\n\r\n setLicenseeAutoCreate(this: void, licenseeAutoCreate: boolean): void {\r\n set(props, 'licenseeAutoCreate', licenseeAutoCreate);\r\n },\r\n\r\n getLicenseeAutoCreate<D = undefined>(this: void, def?: D): boolean | D {\r\n return get(props, 'licenseeAutoCreate', def) as boolean | D;\r\n },\r\n\r\n setDiscounts(this: void, discounts: ProductDiscountEntity[]): void {\r\n set(props, 'discounts', discounts);\r\n },\r\n\r\n getDiscounts<D = undefined>(this: void, def?: D): ProductDiscountEntity[] | D {\r\n return get(props, 'discounts', def) as ProductDiscountEntity[] | D;\r\n },\r\n\r\n addDiscount(discount: ProductDiscountEntity): void {\r\n const discounts = this.getDiscounts([] as ProductDiscountEntity[]);\r\n discounts.push(discount);\r\n\r\n this.setDiscounts(discounts);\r\n },\r\n\r\n removeDiscount(discount: ProductDiscountEntity): void {\r\n const discounts = this.getDiscounts();\r\n\r\n if (Array.isArray(discounts) && discounts.length > 0) {\r\n discounts.splice(discounts.indexOf(discount), 1);\r\n this.setDiscounts(discounts);\r\n }\r\n },\r\n\r\n setProductDiscounts(productDiscounts: ProductDiscountEntity[]): void {\r\n this.setDiscounts(productDiscounts);\r\n },\r\n\r\n getProductDiscounts<D = undefined>(def?: D): ProductDiscountEntity[] | D {\r\n return this.getDiscounts(def);\r\n },\r\n\r\n serialize(): Record<string, string | string[]> {\r\n const map: Record<string, string | string[]> = serialize(props, { ignore: ['discounts', 'inUse'] });\r\n const discounts = this.getDiscounts();\r\n\r\n if (discounts) {\r\n map.discount = discounts.length > 0 ? discounts.map((discount) => discount.toString()) : '';\r\n }\r\n\r\n return map;\r\n },\r\n };\r\n\r\n return defineEntity(props as ProductProps<T>, methods, Product);\r\n};\r\n\r\nexport default Product;\r\n","import { AxiosError, AxiosResponse, InternalAxiosRequestConfig } from 'axios';\r\n\r\nexport default class NlicError<T = unknown, D = unknown> extends AxiosError<T, D> {\r\n isNlicError = true;\r\n\r\n constructor(\r\n message?: string,\r\n code?: string,\r\n config?: InternalAxiosRequestConfig<D>,\r\n request?: unknown,\r\n response?: AxiosResponse<T, D>,\r\n stack?: string,\r\n ) {\r\n super(message, code, config, request, response);\r\n this.name = 'NlicError';\r\n\r\n if (stack) {\r\n this.stack = stack;\r\n }\r\n\r\n Object.setPrototypeOf(this, NlicError.prototype);\r\n }\r\n}\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\n// entity factory\r\nimport defineEntity from '@/entities/defineEntity';\r\n\r\n// errors\r\nimport NlicError from '@/errors/NlicError';\r\n\r\n// types\r\nimport { ProductDiscountMethods, ProductDiscountProps, ProductDiscountEntity } from '@/types/entities/ProductDiscount';\r\n\r\n// utils\r\nimport { set, get } from '@/utils/helpers';\r\n\r\nconst ProductDiscount = function (\r\n properties: ProductDiscountProps = {} as ProductDiscountProps,\r\n): ProductDiscountEntity {\r\n const props: ProductDiscountProps = { ...properties };\r\n\r\n if (props.amountFix && props.amountPercent) {\r\n throw new NlicError('Properties \"amountFix\" and \"amountPercent\" cannot be used at the same time');\r\n }\r\n\r\n const methods: ProductDiscountMethods = {\r\n setTotalPrice(this: void, totalPrice: number): void {\r\n set(props, 'totalPrice', totalPrice);\r\n },\r\n\r\n getTotalPrice<D>(this: void, def?: D): number | D {\r\n return get(props, 'totalPrice', def) as number | D;\r\n },\r\n\r\n setCurrency(currency: string): void {\r\n set(props, 'currency', currency);\r\n },\r\n\r\n getCurrency<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'currency', def) as string | D;\r\n },\r\n\r\n setAmountFix(this: void, amountFix: number): void {\r\n set(props, 'amountFix', amountFix);\r\n },\r\n\r\n getAmountFix<D = undefined>(this: void, def?: D): number | D {\r\n return get(props, 'amountFix', def) as number | D;\r\n },\r\n\r\n setAmountPercent(this: void, amountPercent: number): void {\r\n set(props, 'amountPercent', amountPercent);\r\n },\r\n\r\n getAmountPercent<D = undefined>(this: void, def?: D): number | D {\r\n return get(props, 'amountPercent', def) as number | D;\r\n },\r\n\r\n toString() {\r\n const total = this.getTotalPrice();\r\n const currency = this.getCurrency();\r\n const amount = this.getAmountPercent() ? `${this.getAmountPercent()}%` : this.getAmountFix();\r\n\r\n return total && currency && amount ? `${total};${currency};${amount}` : '';\r\n },\r\n };\r\n\r\n return defineEntity(props, methods, ProductDiscount, {\r\n set: (obj, prop) => {\r\n if (prop === 'amountFix') {\r\n delete obj.amountPercent;\r\n }\r\n\r\n if (prop === 'amountPercent') {\r\n delete obj.amountFix;\r\n }\r\n },\r\n });\r\n};\r\n\r\nexport default ProductDiscount;\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nimport itemToObject from '@/converters/itemToObject';\r\nimport Product from '@/entities/Product';\r\nimport ProductDiscount from '@/entities/ProductDiscount';\r\n\r\n// types\r\nimport { Item } from '@/types/api/response';\r\nimport { ProductProps } from '@/types/entities/Product';\r\nimport { ProductDiscountEntity } from '@/types/entities/ProductDiscount';\r\n\r\nexport default <T extends object = ProductProps>(item?: Item) => {\r\n const props = itemToObject<Record<string, unknown>>(item, {\r\n number: 'string',\r\n name: 'string',\r\n version: 'string',\r\n description: 'string',\r\n licensingInfo: 'string',\r\n licenseeAutoCreate: 'boolean',\r\n inUse: 'boolean',\r\n });\r\n\r\n const discounts: ProductDiscountEntity[] | undefined = props.discount as ProductDiscountEntity[] | undefined;\r\n delete props.discount;\r\n\r\n if (discounts) {\r\n props.discounts = discounts.map((d) => ProductDiscount(d));\r\n }\r\n\r\n return Product<T>(props as ProductProps<T>);\r\n};\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\n// entity factory\r\nimport defineEntity from '@/entities/defineEntity';\r\nimport { LicensingModelValues } from '@/types/constants/LicensingModel';\r\n\r\n// types\r\nimport {\r\n ProductModuleEntity,\r\n ProductModuleMethods,\r\n ProductModuleProps,\r\n} from '@/types/entities/ProductModule';\r\n\r\n// utils\r\nimport { set, get } from '@/utils/helpers';\r\nimport serialize from '@/utils/serialize';\r\n\r\n/**\r\n * Product module entity used internally by NetLicensing.\r\n *\r\n * Properties visible via NetLicensing API:\r\n *\r\n * Unique number (across all products of a vendor) that identifies the product module. Vendor can assign\r\n * this number when creating a product module or let NetLicensing generate one. Read-only after creation of the first\r\n * licensee for the product.\r\n * @property string number\r\n *\r\n * If set to false, the product module is disabled. Licensees can not obtain any new licenses for this\r\n * product module.\r\n * @property boolean active\r\n *\r\n * Product module name that is visible to the end customers in NetLicensing Shop.\r\n * @property string name\r\n *\r\n * Licensing model applied to this product module. Defines what license templates can be\r\n * configured for the product module and how licenses for this product module are processed during validation.\r\n * @property string licensingModel\r\n *\r\n * Maximum checkout validity (days). Mandatory for 'Floating' licensing model.\r\n * @property number maxCheckoutValidity\r\n *\r\n * Remaining time volume for yellow level. Mandatory for 'Rental' licensing model.\r\n * @property number yellowThreshold\r\n *\r\n * Remaining time volume for red level. Mandatory for 'Rental' licensing model.\r\n * @property number redThreshold\r\n */\r\n\r\nconst ProductModule = function <T extends object = object>(\r\n properties: ProductModuleProps<T> = {} as ProductModuleProps<T>,\r\n): ProductModuleEntity<T> {\r\n const props: ProductModuleProps = { ...properties };\r\n\r\n const methods: ProductModuleMethods = {\r\n setActive(this: void, active: boolean): void {\r\n set(props, 'active', active);\r\n },\r\n\r\n getActive<D = undefined>(this: void, def?: D): boolean | D {\r\n return get(props, 'active', def) as boolean | D;\r\n },\r\n\r\n setNumber(this: void, number: string): void {\r\n set(props, 'number', number);\r\n },\r\n\r\n getNumber<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'number', def) as string | D;\r\n },\r\n\r\n setName(this: void, name: string): void {\r\n set(props, 'name', name);\r\n },\r\n\r\n getName<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'name', def) as string | D;\r\n },\r\n\r\n setLicensingModel(licensingModel: LicensingModelValues): void {\r\n set(props, 'licensingModel', licensingModel);\r\n },\r\n\r\n getLicensingModel<D = undefined>(this: void, def?: D): LicensingModelValues | D {\r\n return get(props, 'licensingModel', def) as LicensingModelValues | D;\r\n },\r\n\r\n setProductNumber(this: void, productNumber: string): void {\r\n set(props, 'productNumber', productNumber);\r\n },\r\n\r\n getProductNumber<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'productNumber', def) as string | D;\r\n },\r\n\r\n serialize(this: void): Record<string, string> {\r\n return serialize(props, { ignore: ['inUse'] });\r\n },\r\n };\r\n\r\n return defineEntity(props as ProductModuleProps<T>, methods, ProductModule);\r\n};\r\n\r\nexport default ProductModule;\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nimport itemToObject from '@/converters/itemToObject';\r\nimport ProductModule from '@/entities/ProductModule';\r\n\r\n// types\r\nimport { Item } from '@/types/api/response';\r\nimport { ProductModuleProps } from '@/types/entities/ProductModule';\r\n\r\nexport default <T extends object = ProductModuleProps>(item?: Item) =>\r\n ProductModule<T>(\r\n itemToObject<T>(item, {\r\n active: 'boolean',\r\n number: 'string',\r\n name: 'string',\r\n licensingModel: 'string',\r\n productNumber: 'string',\r\n inUse: 'boolean',\r\n }),\r\n );\r\n","/**\r\n * Token\r\n *\r\n * @see https://netlicensing.io/wiki/token-services#create-token\r\n *\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n *\r\n */\r\n// entity factory\r\nimport defineEntity from '@/entities/defineEntity';\r\n\r\n// types\r\nimport { ApiKeyRoleValues } from '@/types/constants/ApiKeyRole';\r\nimport { TokenTypeValues } from '@/types/constants/TokenType';\r\nimport { TokenProps, TokenEntity, TokenMethods } from '@/types/entities/Token';\r\n\r\n// utils\r\nimport { set, get } from '@/utils/helpers';\r\nimport serialize from '@/utils/serialize';\r\n\r\nconst Token = function <T extends object = object>(properties: TokenProps<T> = {} as TokenProps<T>): TokenEntity<T> {\r\n const props: TokenProps = { ...properties };\r\n\r\n const methods: TokenMethods = {\r\n setActive(this: void, active: boolean): void {\r\n set(props, 'active', active);\r\n },\r\n\r\n getActive<D = undefined>(this: void, def?: D): boolean | D {\r\n return get(props, 'active', def) as boolean | D;\r\n },\r\n\r\n setNumber(this: void, number: string): void {\r\n set(props, 'number', number);\r\n },\r\n\r\n getNumber<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'number', def) as string | D;\r\n },\r\n\r\n setExpirationTime(this: void, expirationTime: Date): void {\r\n set(props, 'expirationTime', expirationTime);\r\n },\r\n\r\n getExpirationTime<D = undefined>(this: void, def?: D): Date | D {\r\n return get(props, 'expirationTime', def) as Date | D;\r\n },\r\n\r\n setTokenType(this: void, tokenType: TokenTypeValues): void {\r\n set(props, 'tokenType', tokenType);\r\n },\r\n\r\n getTokenType<D = undefined>(this: void, def?: D): TokenTypeValues | D {\r\n return get(props, 'tokenType', def) as TokenTypeValues | D;\r\n },\r\n\r\n setLicenseeNumber(this: void, licenseeNumber: string): void {\r\n set(props, 'licenseeNumber', licenseeNumber);\r\n },\r\n\r\n getLicenseeNumber<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'licenseeNumber', def) as string | D;\r\n },\r\n\r\n setAction(this: void, action: string): void {\r\n set(props, 'action', action);\r\n },\r\n\r\n getAction<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'action', def) as string | D;\r\n },\r\n\r\n setApiKeyRole(this: void, apiKeyRole: ApiKeyRoleValues): void {\r\n set(props, 'apiKeyRole', apiKeyRole);\r\n },\r\n\r\n getApiKeyRole<D = undefined>(this: void, def?: D): ApiKeyRoleValues | D {\r\n return get(props, 'apiKeyRole', def) as ApiKeyRoleValues | D;\r\n },\r\n\r\n setBundleNumber(this: void, bundleNumber: string): void {\r\n set(props, 'bundleNumber', bundleNumber);\r\n },\r\n\r\n getBundleNumber<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'bundleNumber', def) as string | D;\r\n },\r\n\r\n setBundlePrice(this: void, bundlePrice: number): void {\r\n set(props, 'bundlePrice', bundlePrice);\r\n },\r\n\r\n getBundlePrice<D = undefined>(this: void, def?: D): number | D {\r\n return get(props, 'bundlePrice', def) as number | D;\r\n },\r\n\r\n setProductNumber(this: void, productNumber: string): void {\r\n set(props, 'productNumber', productNumber);\r\n },\r\n\r\n getProductNumber<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'productNumber', def) as string | D;\r\n },\r\n\r\n setPredefinedShoppingItem(this: void, predefinedShoppingItem: string): void {\r\n set(props, 'predefinedShoppingItem', predefinedShoppingItem);\r\n },\r\n\r\n getPredefinedShoppingItem<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'predefinedShoppingItem', def) as string | D;\r\n },\r\n\r\n setSuccessURL(this: void, successURL: string): void {\r\n set(props, 'successURL', successURL);\r\n },\r\n\r\n getSuccessURL<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'successURL', def) as string | D;\r\n },\r\n\r\n setSuccessURLTitle(this: void, successURLTitle: string): void {\r\n set(props, 'successURLTitle', successURLTitle);\r\n },\r\n\r\n getSuccessURLTitle<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'successURLTitle', def) as string | D;\r\n },\r\n\r\n setCancelURL(this: void, cancelURL: string): void {\r\n set(props, 'cancelURL', cancelURL);\r\n },\r\n\r\n getCancelURL<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'cancelURL', def) as string | D;\r\n },\r\n\r\n setCancelURLTitle(this: void, cancelURLTitle: string): void {\r\n set(props, 'cancelURLTitle', cancelURLTitle);\r\n },\r\n\r\n getCancelURLTitle<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'cancelURLTitle', def) as string | D;\r\n },\r\n\r\n getShopURL<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'shopURL', def) as string | D;\r\n },\r\n\r\n serialize(this: void): Record<string, string> {\r\n return serialize(props, { ignore: ['shopURL'] });\r\n },\r\n };\r\n\r\n return defineEntity(props as TokenProps<T>, methods, Token);\r\n};\r\n\r\nexport default Token;\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nimport itemToObject from '@/converters/itemToObject';\r\nimport Token from '@/entities/Token';\r\n\r\n// types\r\nimport { Item } from '@/types/api/response';\r\nimport { TokenProps } from '@/types/entities/Token';\r\n\r\nexport default <T extends object = TokenProps>(item?: Item) => {\r\n const props = itemToObject<Record<string, unknown>>(item, {\r\n active: 'boolean',\r\n number: 'string',\r\n expirationTime: 'string',\r\n tokenType: 'string',\r\n licenseeNumber: 'string',\r\n action: 'string',\r\n apiKeyRole: 'string',\r\n bundleNumber: 'string',\r\n bundlePrice: 'number',\r\n productNumber: 'string',\r\n predefinedShoppingItem: 'string',\r\n successURL: 'string',\r\n successURLTitle: 'string',\r\n cancelURL: 'string',\r\n cancelURLTitle: 'string',\r\n shopURL: 'string',\r\n });\r\n\r\n const { expirationTime } = props;\r\n\r\n if (expirationTime && typeof expirationTime === 'string') {\r\n props.expirationTime = new Date(expirationTime);\r\n }\r\n\r\n return Token<T>(props as TokenProps<T>);\r\n};\r\n","// types\r\nimport type { LicenseEntity } from '@/types/entities/License';\r\nimport type { LicenseTransactionJoinEntity as ILicenseTransactionJoin } from '@/types/entities/LicenseTransactionJoin';\r\nimport type { TransactionEntity } from '@/types/entities/Transaction';\r\n\r\n/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\n\r\nclass LicenseTransactionJoin implements ILicenseTransactionJoin {\r\n transaction: TransactionEntity;\r\n license: LicenseEntity;\r\n\r\n constructor(transaction: TransactionEntity, license: LicenseEntity) {\r\n this.transaction = transaction;\r\n this.license = license;\r\n }\r\n\r\n setTransaction(transaction: TransactionEntity): void {\r\n this.transaction = transaction;\r\n }\r\n\r\n getTransaction(): TransactionEntity {\r\n return this.transaction;\r\n }\r\n\r\n setLicense(license: LicenseEntity): void {\r\n this.license = license;\r\n }\r\n\r\n getLicense(): LicenseEntity {\r\n return this.license;\r\n }\r\n}\r\n\r\nexport default (transaction: TransactionEntity, license: LicenseEntity) =>\r\n new LicenseTransactionJoin(transaction, license);\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\n// entity factory\r\nimport defineEntity from '@/entities/defineEntity';\r\n\r\n// types\r\nimport { PaymentMethodValues } from '@/types/constants/PaymentMethodEnum';\r\nimport { TransactionSourceValues } from '@/types/constants/TransactionSource';\r\nimport { TransactionStatusValues } from '@/types/constants/TransactionStatus';\r\nimport { LicenseTransactionJoinEntity } from '@/types/entities/LicenseTransactionJoin';\r\nimport { TransactionMethods, TransactionProps, TransactionEntity } from '@/types/entities/Transaction';\r\n\r\n// utils\r\nimport { set, get } from '@/utils/helpers';\r\nimport serialize from '@/utils/serialize';\r\n\r\n/**\r\n * Transaction entity used internally by NetLicensing.\r\n *\r\n * Properties visible via NetLicensing API:\r\n *\r\n * Unique number (across all products of a vendor) that identifies the transaction. This number is\r\n * always generated by NetLicensing.\r\n * @property string number\r\n *\r\n * always true for transactions\r\n * @property boolean active\r\n *\r\n * Status of transaction. \"CANCELLED\", \"CLOSED\", \"PENDING\".\r\n * @property string status\r\n *\r\n * \"SHOP\". AUTO transaction for internal use only.\r\n * @property string source\r\n *\r\n * grand total for SHOP transaction (see source).\r\n * @property number grandTotal\r\n *\r\n * discount for SHOP transaction (see source).\r\n * @property number discount\r\n *\r\n * specifies currency for money fields (grandTotal and discount). Check data types to discover which\r\n * @property string currency\r\n *\r\n * Date created. Optional.\r\n * @property string dateCreated\r\n *\r\n * Date closed. Optional.\r\n * @property string dateClosed\r\n */\r\n\r\nconst Transaction = function <T extends object>(\r\n properties: TransactionProps<T> = {} as TransactionProps<T>,\r\n): TransactionEntity<T> {\r\n const props: TransactionProps = { ...properties };\r\n\r\n const methods: TransactionMethods = {\r\n setActive(this: void, active: boolean) {\r\n set(props, 'active', active);\r\n },\r\n\r\n getActive<D = undefined>(this: void, def?: D): boolean | D {\r\n return get(props, 'active', def) as boolean | D;\r\n },\r\n\r\n setNumber(this: void, number: string): void {\r\n set(props, 'number', number);\r\n },\r\n\r\n getNumber<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'number', def) as string | D;\r\n },\r\n\r\n setStatus(this: void, status: TransactionStatusValues): void {\r\n set(props, 'status', status);\r\n },\r\n\r\n getStatus<D = undefined>(this: void, def?: D): TransactionStatusValues | D {\r\n return get(props, 'status', def) as TransactionStatusValues | D;\r\n },\r\n\r\n setSource(this: void, source: TransactionSourceValues): void {\r\n set(props, 'source', source);\r\n },\r\n getSource<D = undefined>(this: void, def?: D): TransactionSourceValues | D {\r\n return get(props, 'source', def) as TransactionSourceValues | D;\r\n },\r\n setGrandTotal(this: void, grandTotal: number): void {\r\n set(props, 'grandTotal', grandTotal);\r\n },\r\n getGrandTotal<D = undefined>(this: void, def?: D): number | D {\r\n return get(props, 'grandTotal', def) as number | D;\r\n },\r\n\r\n setDiscount(this: void, discount: number): void {\r\n set(props, 'discount', discount);\r\n },\r\n\r\n getDiscount<D = undefined>(this: void, def?: D): number | D {\r\n return get(props, 'discount', def) as number | D;\r\n },\r\n\r\n setCurrency(this: void, currency: string): void {\r\n set(props, 'currency', currency);\r\n },\r\n\r\n getCurrency<D = undefined>(this: void, def?: D): string | D {\r\n return get(props, 'currency', def) as string | D;\r\n },\r\n\r\n setDateCreated(this: void, dateCreated: Date): void {\r\n set(props, 'dateCreated', dateCreated);\r\n },\r\n\r\n getDateCreated<D = undefined>(this: void, def?: D): Date | D {\r\n return get(props, 'dateCreated', def) as Date | D;\r\n },\r\n\r\n setDateClosed(this: void, dateCreated: Date): void {\r\n set(props, 'dateClosed', dateCreated);\r\n },\r\n\r\n getDateClosed<D = undefined>(this: void, def?: D): Date | D {\r\n return get(props, 'dateClosed', def) as Date | D;\r\n },\r\n\r\n setPaymentMethod(this: void, paymentMethod: PaymentMethodValues): void {\r\n set(props, 'paymentMethod', paymentMethod);\r\n },\r\n\r\n getPaymentMethod<D = undefined>(this: void, def?: D): PaymentMethodValues | D {\r\n return get(props, 'paymentMethod', def) as PaymentMethodValues | D;\r\n },\r\n\r\n setLicenseTransactionJoins(this: void, joins: LicenseTransactionJoinEntity[]): void {\r\n set(props, 'licenseTransactionJoins', joins);\r\n },\r\n\r\n getLicenseTransactionJoins<D = undefined>(this: void, def?: D): LicenseTransactionJoinEntity[] | D {\r\n return get(props, 'licenseTransactionJoins', def) as LicenseTransactionJoinEntity[] | D;\r\n },\r\n\r\n serialize(this: void) {\r\n const clone: Record<string, unknown> = {...props};\r\n\r\n clone.datecreated = props.dateCreated;\r\n clone.dateclosed = props.dateClosed\r\n\r\n delete clone.dateCreated;\r\n delete clone.dateClosed;\r\n\r\n return serialize(clone, { ignore: ['licenseTransactionJoins', 'inUse'] });\r\n },\r\n };\r\n\r\n return defineEntity(props as TransactionProps<T>, methods, Transaction);\r\n};\r\n\r\nexport default Transaction;\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nimport itemToObject from '@/converters/itemToObject';\r\n\r\n// entities\r\nimport License from '@/entities/License';\r\nimport LicenseTransactionJoin from '@/entities/LicenseTransactionJoin';\r\nimport Transaction from '@/entities/Transaction';\r\n\r\n// types\r\nimport { Item } from '@/types/api/response';\r\nimport { TransactionProps } from '@/types/entities/Transaction';\r\n\r\nexport default <T extends object = TransactionProps>(item?: Item) => {\r\n const props = itemToObject<Record<string, unknown>>(item, {\r\n active: 'boolean',\r\n number: 'string',\r\n status: 'string',\r\n source: 'string',\r\n grandTotal: 'number',\r\n discount: 'number',\r\n currency: 'string',\r\n datecreated: 'string',\r\n dateclosed: 'string',\r\n paymentMethod: 'string',\r\n licenseTransactionJoins: 'json',\r\n inUse: 'boolean',\r\n });\r\n\r\n const { datecreated: dateCreated, dateclosed: dateClosed } = props;\r\n\r\n if (dateCreated && typeof dateCreated === 'string') {\r\n props.dateCreated = new Date(dateCreated);\r\n delete props.datecreated;\r\n }\r\n\r\n if (dateClosed && typeof dateClosed === 'string') {\r\n props.dateClosed = new Date(dateClosed);\r\n delete props.dateclosed;\r\n }\r\n\r\n type LicenseTransactionJoins = { licenseNumber: string | number; transactionNumber: string | number }[] | undefined;\r\n const licenseTransactionJoins: LicenseTransactionJoins = props.licenseTransactionJoin as LicenseTransactionJoins;\r\n\r\n delete props.licenseTransactionJoin;\r\n\r\n if (licenseTransactionJoins) {\r\n props.licenseTransactionJoins = licenseTransactionJoins.map(({ transactionNumber, licenseNumber }) => {\r\n const transaction = Transaction({ number: String(transactionNumber) });\r\n const license = License({ number: String(licenseNumber) });\r\n\r\n return LicenseTransactionJoin(transaction, license);\r\n });\r\n }\r\n\r\n return Transaction<T>(props as TransactionProps<T>);\r\n};\r\n","import axios, { AxiosInstance, AxiosResponse } from 'axios';\r\nimport { Info } from '@/types/api/response';\r\n\r\nlet axiosInstance: AxiosInstance = axios.create();\r\nlet lastResponse: AxiosResponse | null = null;\r\nlet info: Info[] = [];\r\n\r\nexport const setAxiosInstance = (instance: AxiosInstance): void => {\r\n axiosInstance = instance;\r\n};\r\n\r\nexport const getAxiosInstance = (): AxiosInstance => axiosInstance;\r\n\r\nexport const setLastResponse = (response: AxiosResponse | null): void => {\r\n lastResponse = response;\r\n};\r\n\r\nexport const getLastResponse = (): AxiosResponse | null => lastResponse;\r\n\r\nexport const setInfo = (infos: Info[]): void => {\r\n info = infos;\r\n};\r\n\r\nexport const getInfo = (): Info[] => info;\r\n","{\r\n \"name\": \"netlicensing-client\",\r\n \"version\": \"2.0.2\",\r\n \"description\": \"JavaScript Wrapper for Labs64 NetLicensing RESTful API\",\r\n \"keywords\": [\r\n \"labs64\",\r\n \"netlicensing\",\r\n \"licensing\",\r\n \"licensing-as-a-service\",\r\n \"license\",\r\n \"license-management\",\r\n \"software-license\",\r\n \"client\",\r\n \"restful\",\r\n \"restful-api\",\r\n \"javascript\",\r\n \"wrapper\",\r\n \"api\",\r\n \"client\"\r\n ],\r\n \"license\": \"Apache-2.0\",\r\n \"author\": \"Labs64 GmbH\",\r\n \"homepage\": \"https://netlicensing.io\",\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"git+https://github.com/Labs64/NetLicensingClient-javascript.git\"\r\n },\r\n \"bugs\": {\r\n \"url\": \"https://github.com/Labs64/NetLicensingClient-javascript/issues\"\r\n },\r\n \"contributors\": [\r\n {\r\n \"name\": \"Ready Brown\",\r\n \"email\": \"ready.brown@hotmail.de\",\r\n \"url\": \"https://github.com/r-brown\"\r\n },\r\n {\r\n \"name\": \"Viacheslav Rudkovskiy\",\r\n \"email\": \"viachaslau.rudkovski@labs64.de\",\r\n \"url\": \"https://github.com/v-rudkovskiy\"\r\n },\r\n {\r\n \"name\": \"Andrei Yushkevich\",\r\n \"email\": \"yushkevich@me.com\",\r\n \"url\": \"https://github.com/yushkevich\"\r\n }\r\n ],\r\n \"main\": \"dist/index.cjs\",\r\n \"module\": \"dist/index.mjs\",\r\n \"types\": \"dist/index.d.ts\",\r\n \"exports\": {\r\n \".\": {\r\n \"types\": \"./dist/index.d.ts\",\r\n \"import\": \"./dist/index.mjs\",\r\n \"require\": \"./dist/index.cjs\"\r\n }\r\n },\r\n \"files\": [\r\n \"dist\"\r\n ],\r\n \"scripts\": {\r\n \"build\": \"tsup\",\r\n \"release\": \"npm run lint:typecheck && npm run test && npm run build\",\r\n \"dev\": \"tsup --watch\",\r\n \"test\": \"vitest run\",\r\n \"test:dev\": \"vitest watch\",\r\n \"lint\": \"eslint --ext .js,.mjs,.ts src\",\r\n \"typecheck\": \"tsc --noEmit\",\r\n \"lint:typecheck\": \"npm run lint && npm run typecheck\"\r\n },\r\n \"peerDependencies\": {\r\n \"axios\": \"^1.9.0\"\r\n },\r\n \"dependencies\": {},\r\n \"devDependencies\": {\r\n \"@eslint/js\": \"^9.39.4\",\r\n \"@types/node\": \"^25.3.5\",\r\n \"@typescript-eslint/eslint-plugin\": \"^8.29.1\",\r\n \"@typescript-eslint/parser\": \"^8.29.1\",\r\n \"@vitest/eslint-plugin\": \"^1.1.43\",\r\n \"axios\": \"^1.13.6\",\r\n \"eslint\": \"^9.39.4\",\r\n \"eslint-plugin-import\": \"^2.31.0\",\r\n \"prettier\": \"3.8.1\",\r\n \"tsup\": \"^8.4.0\",\r\n \"typescript\": \"^5.8.3\",\r\n \"typescript-eslint\": \"^8.29.1\",\r\n \"vitest\": \"^3.2.4\"\r\n },\r\n \"engines\": {\r\n \"node\": \">= 16.9.0\",\r\n \"npm\": \">= 8.0.0\"\r\n },\r\n \"browserslist\": [\r\n \"> 1%\",\r\n \"last 2 versions\",\r\n \"not ie <= 10\"\r\n ]\r\n}\r\n","export default <T extends Record<string, unknown>>(data: T): string => {\r\n const query: string[] = [];\r\n\r\n const build = (obj: unknown, keyPrefix?: string): void => {\r\n if (obj === null || obj === undefined) {\r\n return;\r\n }\r\n\r\n if (Array.isArray(obj)) {\r\n obj.forEach((item) => {\r\n build(item, keyPrefix ? `${keyPrefix}` : '');\r\n });\r\n\r\n return;\r\n }\r\n\r\n if (obj instanceof Date) {\r\n query.push(`${keyPrefix}=${encodeURIComponent(obj.toISOString())}`);\r\n return;\r\n }\r\n\r\n if (typeof obj === 'object') {\r\n Object.keys(obj).forEach((key) => {\r\n const value = obj[key as keyof typeof obj];\r\n build(value, keyPrefix ? `${keyPrefix}[${encodeURIComponent(key)}]` : encodeURIComponent(key));\r\n });\r\n\r\n return;\r\n }\r\n\r\n query.push(`${keyPrefix}=${encodeURIComponent(obj as string)}`);\r\n };\r\n\r\n build(data);\r\n\r\n return query.join('&');\r\n};\r\n","import { AxiosRequestConfig, Method, AxiosRequestHeaders, AxiosResponse, AxiosError } from 'axios';\r\n\r\n// constants\r\nimport SecurityMode from '@/constants/SecurityMode';\r\n\r\n// errors\r\nimport NlicError from '@/errors/NlicError';\r\n\r\n// types\r\nimport type { NlicResponse } from '@/types/api/response';\r\nimport type { AxiosRequestClient, RequestConfig } from '@/types/services/Service';\r\nimport { ContextInstance } from '@/types/vo/Context';\r\n\r\n// package.json\r\nimport pkg from '../../../package.json';\r\n\r\n// service\r\nimport { getAxiosInstance, setLastResponse, setInfo } from './instance';\r\nimport toQueryString from './toQueryString';\r\n\r\nexport default async (\r\n context: ContextInstance,\r\n method: Method,\r\n endpoint: string,\r\n data?: Record<string, unknown>,\r\n config?: RequestConfig,\r\n): Promise<AxiosResponse<NlicResponse>> => {\r\n const headers: Record<string, string> = {\r\n Accept: 'application/json',\r\n 'X-Requested-With': 'XMLHttpRequest',\r\n };\r\n\r\n // only node.js has a process variable that is of [[Class]] process\r\n if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\r\n headers['User-agent'] = `NetLicensing/Javascript ${pkg.version}/node&${process.version}`;\r\n }\r\n\r\n const req: AxiosRequestConfig = {\r\n method,\r\n headers,\r\n url: encodeURI(`${context.getBaseUrl()}/${endpoint}`),\r\n responseType: 'json',\r\n transformRequest: (d: unknown, h: AxiosRequestHeaders) => {\r\n if (h['Content-Type'] === 'application/x-www-form-urlencoded') {\r\n return toQueryString(d as Record<string, unknown>);\r\n }\r\n\r\n if (!h['NetLicensing-Origin']) {\r\n h['NetLicensing-Origin'] = `NetLicensing/Javascript ${pkg.version}`;\r\n }\r\n\r\n return d;\r\n },\r\n };\r\n\r\n if (['put', 'post', 'patch'].indexOf(method.toLowerCase()) >= 0) {\r\n if (req.method === 'post') {\r\n headers['Content-Type'] = 'application/x-www-form-urlencoded';\r\n }\r\n req.data = data;\r\n } else {\r\n req.params = data;\r\n }\r\n\r\n switch (context.getSecurityMode()) {\r\n // Basic Auth\r\n case SecurityMode.BASIC_AUTHENTICATION:\r\n {\r\n if (!context.getUsername()) {\r\n throw new NlicError('Missing parameter \"username\"');\r\n }\r\n\r\n if (!context.getPassword()) {\r\n throw new NlicError('Missing parameter \"password\"');\r\n }\r\n\r\n req.auth = {\r\n username: context.getUsername(),\r\n password: context.getPassword(),\r\n };\r\n }\r\n break;\r\n // ApiKey Auth\r\n case SecurityMode.APIKEY_IDENTIFICATION:\r\n if (!context.getApiKey()) {\r\n throw new NlicError('Missing parameter \"apiKey\"');\r\n }\r\n\r\n headers.Authorization = `Basic ${btoa(`apiKey:${context.getApiKey()}`)}`;\r\n break;\r\n // without authorization\r\n case SecurityMode.ANONYMOUS_IDENTIFICATION:\r\n break;\r\n default:\r\n throw new NlicError('Unknown security mode');\r\n }\r\n\r\n const instance: AxiosRequestClient = config?.axiosInstance || getAxiosInstance();\r\n\r\n try {\r\n const response: AxiosResponse<NlicResponse> = await instance.request(req);\r\n const info = response.data.infos?.info || [];\r\n\r\n setLastResponse(response);\r\n setInfo(info);\r\n\r\n if (config?.onResponse) {\r\n config.onResponse(response);\r\n }\r\n\r\n if (info.length > 0) {\r\n if (config?.onInfo) {\r\n config.onInfo(info);\r\n }\r\n\r\n const eInfo = info.find(({ type }) => type === 'ERROR');\r\n\r\n if (eInfo) {\r\n throw new NlicError(eInfo.value, eInfo.id, response.config, response.request, response);\r\n }\r\n }\r\n\r\n return response;\r\n } catch (e) {\r\n const error = e as AxiosError;\r\n\r\n const response = error.response;\r\n const info = (response?.data as NlicResponse)?.infos?.info || [];\r\n\r\n setLastResponse(response || null);\r\n setInfo(info);\r\n\r\n if ((e as AxiosError).isAxiosError) {\r\n let message = (e as AxiosError).message;\r\n\r\n if (response?.data && info.length > 0) {\r\n const eInfo = info.find(({ type }) => type === 'ERROR');\r\n\r\n if (eInfo) {\r\n message = eInfo.value;\r\n }\r\n }\r\n\r\n throw new NlicError(\r\n message,\r\n error.code,\r\n error.config,\r\n error.request,\r\n error.response as AxiosResponse<NlicResponse>,\r\n );\r\n }\r\n\r\n throw e;\r\n }\r\n};\r\n","import type { AxiosResponse } from 'axios';\r\n\r\n// types\r\nimport type { NlicResponse } from '@/types/api/response';\r\nimport type { RequestConfig } from '@/types/services/Service';\r\nimport type { ContextInstance } from '@/types/vo/Context';\r\n\r\n// service\r\nimport request from './request';\r\n\r\nexport const get = (\r\n context: ContextInstance,\r\n endpoint: string,\r\n data?: Record<string, unknown>,\r\n config?: RequestConfig,\r\n): Promise<AxiosResponse<NlicResponse>> => request(context, 'get', endpoint, data, config);\r\n\r\nexport const post = (\r\n context: ContextInstance,\r\n endpoint: string,\r\n data?: Record<string, unknown>,\r\n config?: RequestConfig,\r\n): Promise<AxiosResponse<NlicResponse>> => request(context, 'post', endpoint, data, config);\r\n\r\nexport const del = (\r\n context: ContextInstance,\r\n endpoint: string,\r\n data?: Record<string, unknown>,\r\n config?: RequestConfig,\r\n): Promise<AxiosResponse<NlicResponse>> => request(context, 'delete', endpoint, data, config);\r\n","import { AxiosInstance, AxiosResponse, Method } from 'axios';\r\n\r\n// service\r\nimport { setAxiosInstance, getAxiosInstance, getLastResponse, getInfo } from '@/services/Service/instance';\r\nimport { get, post, del } from '@/services/Service/methods';\r\nimport request from '@/services/Service/request';\r\nimport toQueryString from '@/services/Service/toQueryString';\r\n\r\n// types\r\nimport { Info, NlicResponse } from '@/types/api/response';\r\nimport { RequestConfig, IService } from '@/types/services/Service';\r\nimport { ContextInstance } from '@/types/vo/Context';\r\n\r\nexport { get, post, del, request, toQueryString };\r\n\r\nconst service: IService = {\r\n setAxiosInstance(this: void, instance: AxiosInstance) {\r\n setAxiosInstance(instance);\r\n },\r\n\r\n getAxiosInstance(this: void): AxiosInstance {\r\n return getAxiosInstance();\r\n },\r\n\r\n getLastHttpRequestInfo(this: void): AxiosResponse | null {\r\n return getLastResponse();\r\n },\r\n\r\n getInfo(this: void): Info[] {\r\n return getInfo();\r\n },\r\n\r\n get(\r\n this: void,\r\n context: ContextInstance,\r\n endpoint: string,\r\n data?: Record<string, unknown>,\r\n config?: RequestConfig,\r\n ): Promise<AxiosResponse<NlicResponse>> {\r\n return get(context, endpoint, data, config);\r\n },\r\n\r\n post(\r\n this: void,\r\n context: ContextInstance,\r\n endpoint: string,\r\n data?: Record<string, unknown>,\r\n config?: RequestConfig,\r\n ): Promise<AxiosResponse<NlicResponse>> {\r\n return post(context, endpoint, data, config);\r\n },\r\n\r\n delete(\r\n this: void,\r\n context: ContextInstance,\r\n endpoint: string,\r\n data?: Record<string, unknown>,\r\n config?: RequestConfig,\r\n ): Promise<AxiosResponse<NlicResponse>> {\r\n return del(context, endpoint, data, config);\r\n },\r\n\r\n request(\r\n this: void,\r\n context: ContextInstance,\r\n method: Method,\r\n endpoint: string,\r\n data?: Record<string, unknown>,\r\n config?: RequestConfig,\r\n ): Promise<AxiosResponse<NlicResponse>> {\r\n return request(context, method, endpoint, data, config);\r\n },\r\n\r\n toQueryString<T extends Record<string, unknown>>(this: void, data: T): string {\r\n return toQueryString(data);\r\n },\r\n};\r\n\r\nexport default service;\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nconst FILTER_DELIMITER = ';';\r\nconst FILTER_PAIR_DELIMITER = '=';\r\n\r\nexport const encode = (filter: Record<string, string | boolean | number>): string => {\r\n return Object.keys(filter)\r\n .map((key) => `${key}${FILTER_PAIR_DELIMITER}${String(filter[key])}`)\r\n .join(FILTER_DELIMITER);\r\n};\r\n\r\nexport const decode = (filter: string): Record<string, string> => {\r\n const result: Record<string, string> = {};\r\n\r\n filter.split(FILTER_DELIMITER).forEach((v) => {\r\n const [name, value] = v.split(FILTER_PAIR_DELIMITER);\r\n result[name] = value;\r\n });\r\n\r\n return result;\r\n};\r\n\r\nexport default { encode, decode };\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\n\r\nexport const isDefined = (value: unknown): boolean => {\r\n return typeof value !== 'undefined' && typeof value !== 'function';\r\n};\r\n\r\nexport const isValid = (value: unknown): boolean => {\r\n if (!isDefined(value)) {\r\n return false;\r\n }\r\n\r\n if (typeof value === 'number') {\r\n return !Number.isNaN(value);\r\n }\r\n\r\n return true;\r\n};\r\n\r\nexport const ensureNotNull = (value: unknown, name: string): void => {\r\n if (value === null) {\r\n throw new TypeError(`Parameter \"${name}\" cannot be null.`);\r\n }\r\n\r\n if (!isValid(value)) {\r\n throw new TypeError(`Parameter \"${name}\" has an invalid value.`);\r\n }\r\n};\r\n\r\nexport const ensureNotEmpty = (value: unknown, name: string): void => {\r\n ensureNotNull(value, name);\r\n\r\n if (!value) {\r\n throw new TypeError(`Parameter \"${name}\" cannot be empty.`);\r\n }\r\n};\r\n\r\nexport default {\r\n isDefined,\r\n isValid,\r\n ensureNotNull,\r\n ensureNotEmpty,\r\n};\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nimport { ItemPagination } from '@/types/api/response';\r\nimport { PageInstance, Pagination, PaginationMethods } from '@/types/vo/Page';\r\n\r\nconst Page = function <T extends object>(content: T, pagination?: Partial<ItemPagination>) {\r\n const pageNumber = parseInt(pagination?.pagenumber || '0', 10);\r\n const itemsNumber = parseInt(pagination?.itemsnumber || '0', 10);\r\n const totalPages = parseInt(pagination?.totalpages || '0', 10);\r\n const totalItems = parseInt(pagination?.totalitems || '0', 10);\r\n\r\n const page: PaginationMethods<T> = {\r\n getContent(this: void): T {\r\n return content;\r\n },\r\n\r\n getPagination(this: void): Pagination {\r\n return {\r\n pageNumber,\r\n itemsNumber,\r\n totalPages,\r\n totalItems,\r\n hasNext: totalPages > pageNumber + 1,\r\n };\r\n },\r\n\r\n getPageNumber(this: void): number {\r\n return pageNumber;\r\n },\r\n\r\n getItemsNumber(this: void): number {\r\n return itemsNumber;\r\n },\r\n\r\n getTotalPages(this: void): number {\r\n return totalPages;\r\n },\r\n\r\n getTotalItems(this: void): number {\r\n return totalItems;\r\n },\r\n\r\n hasNext(this: void): boolean {\r\n return totalPages > pageNumber + 1;\r\n },\r\n };\r\n\r\n return new Proxy(content, {\r\n get(obj: T, prop: string | symbol, receiver) {\r\n if (Object.hasOwn(page, prop)) {\r\n return page[prop as keyof typeof page];\r\n }\r\n\r\n return Reflect.get(obj, prop, receiver);\r\n },\r\n\r\n set(obj, prop, value, receiver) {\r\n return Reflect.set(obj, prop, value, receiver);\r\n },\r\n\r\n getPrototypeOf() {\r\n return (Page.prototype as object) || null;\r\n },\r\n }) as PageInstance<T>;\r\n};\r\n\r\nexport default Page;\r\n","/**\r\n * JS representation of the Bundle Service. See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/bundle-services\r\n *\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nimport { AxiosResponse } from 'axios';\r\n\r\n// constants\r\nimport Constants from '@/constants';\r\n\r\n// converters\r\nimport itemToBundle from '@/converters/itemToBundle';\r\n\r\n// services\r\nimport itemToLicense from '@/converters/itemToLicense';\r\nimport Service from '@/services/Service';\r\n\r\n// types\r\nimport { ItemPagination } from '@/types/api/response';\r\nimport { BundleEntity, BundleProps, SavedBundleProps } from '@/types/entities/Bundle';\r\nimport { LicenseEntity, LicenseProps, SavedLicenseProps } from '@/types/entities/License';\r\nimport { IBundleService } from '@/types/services/BundleService';\r\nimport { RequestConfig } from '@/types/services/Service';\r\nimport { ContextInstance } from '@/types/vo/Context';\r\nimport { PageInstance } from '@/types/vo/Page';\r\n\r\n// utils\r\nimport { encode } from '@/utils/filter';\r\nimport { ensureNotEmpty, ensureNotNull } from '@/utils/validation';\r\n\r\n// vo\r\nimport Page from '@/vo/Page';\r\n\r\nconst endpoint = Constants.Bundle.ENDPOINT_PATH;\r\nconst endpointObtain = Constants.Bundle.ENDPOINT_OBTAIN_PATH;\r\nconst type = Constants.Bundle.TYPE;\r\n\r\nconst bundleService: IBundleService = {\r\n /**\r\n * Gets a bundle by its number.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/bundle-services#get-bundle\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * the bundle number\r\n * @param number string\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return the bundle object in promise\r\n * @returns {Promise}\r\n */\r\n async get<T extends object = BundleProps>(\r\n context: ContextInstance,\r\n number: string,\r\n config?: RequestConfig,\r\n ): Promise<BundleEntity<SavedBundleProps<T>>> {\r\n ensureNotEmpty(number, 'number');\r\n\r\n const response = await Service.get(context, `${endpoint}/${number}`, {}, config);\r\n const item = response.data.items?.item.find((v) => v.type === type);\r\n\r\n return itemToBundle<SavedBundleProps<T>>(item);\r\n },\r\n\r\n /**\r\n * Returns bundle of a vendor.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/bundle-services#bundles-list\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * reserved for the future use, must be omitted / set to NULL\r\n * @param filter string|null\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * array of bundle entities or empty array if nothing found in promise.\r\n * @returns {Promise}\r\n */\r\n async list<T extends object = BundleProps>(\r\n context: ContextInstance,\r\n filter?: Record<string, string | boolean | number> | string | null,\r\n config?: RequestConfig,\r\n ): Promise<PageInstance<BundleEntity<SavedBundleProps<T>>[]>> {\r\n const data: { [Constants.FILTER]: string } = {};\r\n\r\n if (filter) {\r\n data[Constants.FILTER] = typeof filter === 'string' ? filter : encode(filter);\r\n }\r\n\r\n const response = await Service.get(context, endpoint, data, config);\r\n const items = response.data.items;\r\n\r\n const bundles: BundleEntity<SavedBundleProps<T>>[] | undefined = items?.item\r\n .filter((v) => v.type === type)\r\n .map((v) => itemToBundle<SavedBundleProps<T>>(v));\r\n\r\n return Page(bundles || [], items as ItemPagination);\r\n },\r\n\r\n /**\r\n * Creates a new bundle with given properties.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/bundle-services#create-bundle\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * non-null properties will be taken for the new object, null properties will either stay null, or will\r\n * be set to a default value, depending on property.\r\n * @param bundle NetLicensing.Bundle\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return the newly created bundle object in promise\r\n * @returns {Promise}\r\n */\r\n async create<T extends object = BundleProps>(\r\n context: ContextInstance,\r\n bundle: BundleEntity<T>,\r\n config?: RequestConfig,\r\n ): Promise<BundleEntity<SavedBundleProps<T>>> {\r\n ensureNotNull(bundle, 'bundle');\r\n\r\n const response = await Service.post(context, endpoint, bundle.serialize(), config);\r\n const item = response.data.items?.item.find((v) => v.type === type);\r\n\r\n return itemToBundle<SavedBundleProps<T>>(item);\r\n },\r\n\r\n /**\r\n * Updates bundle properties.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/bundle-services#update-bundle\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * bundle number\r\n * @param number string\r\n *\r\n * non-null properties will be updated to the provided values, null properties will stay unchanged.\r\n * @param bundle NetLicensing.Bundle\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * updated bundle in promise.\r\n * @returns {Promise}\r\n */\r\n async update<T extends object = BundleProps>(\r\n context: ContextInstance,\r\n number: string,\r\n bundle: BundleEntity<T>,\r\n config?: RequestConfig,\r\n ): Promise<BundleEntity<SavedBundleProps<T>>> {\r\n ensureNotEmpty(number, 'number');\r\n ensureNotNull(bundle, 'bundle');\r\n\r\n const response = await Service.post(context, `${endpoint}/${number}`, bundle.serialize(), config);\r\n const item = response.data.items?.item.find((v) => v.type === type);\r\n\r\n return itemToBundle<SavedBundleProps<T>>(item);\r\n },\r\n\r\n /**\r\n * Deletes bundle.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/bundle-services#delete-bundle\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * bundle number\r\n * @param number string\r\n *\r\n * if true, any entities that depend on the one being deleted will be deleted too\r\n * @param forceCascade boolean\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return boolean state of delete in promise\r\n * @returns {Promise}\r\n */\r\n delete(\r\n context: ContextInstance,\r\n number: string,\r\n forceCascade?: boolean,\r\n config?: RequestConfig,\r\n ): Promise<AxiosResponse> {\r\n ensureNotEmpty(number, 'number');\r\n\r\n return Service.delete(context, `${endpoint}/${number}`, { forceCascade: Boolean(forceCascade) }, config);\r\n },\r\n\r\n /**\r\n * Obtain bundle.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/bundle-services#obtain-bundle\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * bundle number\r\n * @param number string\r\n *\r\n * licensee number\r\n * @param licenseeNumber String\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return array of licenses\r\n * @returns {Promise}\r\n */\r\n async obtain<T extends object = LicenseProps>(\r\n context: ContextInstance,\r\n number: string,\r\n licenseeNumber: string,\r\n config?: RequestConfig,\r\n ): Promise<LicenseEntity<SavedLicenseProps<T>>[]> {\r\n ensureNotEmpty(number, 'number');\r\n ensureNotEmpty(licenseeNumber, 'licenseeNumber');\r\n\r\n const data = { [Constants.Licensee.LICENSEE_NUMBER]: licenseeNumber };\r\n\r\n const response = await Service.post(context, `${endpoint}/${number}/${endpointObtain}`, data, config);\r\n const items = response.data.items;\r\n\r\n const licenses = items?.item.filter((v) => v.type === Constants.License.TYPE);\r\n\r\n return licenses?.map((v) => itemToLicense<SavedLicenseProps<T>>(v)) || [];\r\n },\r\n};\r\n\r\nexport default bundleService;\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\n// types\r\nimport { ProductModuleValidation, ValidationResultsInstance } from '@/types/vo/ValidationResults';\r\n\r\n// utils\r\nimport { isValid } from '@/utils/validation';\r\n\r\nclass ValidationResults implements ValidationResultsInstance {\r\n readonly validations: Record<string, ProductModuleValidation>;\r\n ttl?: Date;\r\n\r\n constructor() {\r\n this.validations = {};\r\n }\r\n\r\n getValidators(): Record<string, ProductModuleValidation> {\r\n return this.validations;\r\n }\r\n\r\n setValidation(validation: ProductModuleValidation): this {\r\n this.validations[validation.productModuleNumber] = validation;\r\n return this;\r\n }\r\n\r\n getValidation<D = undefined>(productModuleNumber: string, def?: D): ProductModuleValidation | D {\r\n return this.validations[productModuleNumber] || def;\r\n }\r\n\r\n setProductModuleValidation(validation: ProductModuleValidation): this {\r\n return this.setValidation(validation);\r\n }\r\n\r\n getProductModuleValidation<D = undefined>(productModuleNumber: string, def?: D): ProductModuleValidation | D {\r\n return this.getValidation(productModuleNumber, def);\r\n }\r\n\r\n setTtl(ttl: Date | string): this {\r\n if (!isValid(ttl)) {\r\n throw new TypeError(`Bad ttl:${ttl.toString()}`);\r\n }\r\n\r\n this.ttl = new Date(ttl);\r\n return this;\r\n }\r\n\r\n getTtl(): Date | undefined {\r\n return this.ttl;\r\n }\r\n\r\n toString(): string {\r\n let data = 'ValidationResult [';\r\n\r\n Object.keys(this.validations).forEach((pmNumber) => {\r\n data += `ProductModule<${pmNumber}>`;\r\n\r\n if (pmNumber in this.validations) {\r\n data += JSON.stringify(this.validations[pmNumber]);\r\n }\r\n });\r\n\r\n data += ']';\r\n\r\n return data;\r\n }\r\n}\r\n\r\nexport default (): ValidationResultsInstance => new ValidationResults();\r\n","/**\r\n * Licensee Service. See NetLicensingAPI for details:\r\n * https://netlicensing.io/wiki/licensee-services\r\n *\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nimport { AxiosResponse } from 'axios';\r\n\r\n// constants\r\nimport Constants from '@/constants';\r\n\r\n// converters\r\nimport itemToLicensee from '@/converters/itemToLicensee';\r\nimport itemToObject from '@/converters/itemToObject';\r\n\r\n// services\r\nimport Service from '@/services/Service';\r\n\r\n// types\r\nimport { ItemPagination, NlicResponse } from '@/types/api/response';\r\nimport { LicenseeProps, LicenseeEntity, SavedLicenseeProps } from '@/types/entities/Licensee';\r\nimport { ILicenseeService } from '@/types/services/LicenseeService';\r\nimport { RequestConfig } from '@/types/services/Service';\r\nimport { ContextInstance } from '@/types/vo/Context';\r\nimport { PageInstance } from '@/types/vo/Page';\r\nimport { ValidationParametersInstance } from '@/types/vo/ValidationParameters';\r\nimport { ValidationResultsInstance as IValidationResults } from '@/types/vo/ValidationResults';\r\n\r\n// utils\r\nimport { encode } from '@/utils/filter';\r\nimport { ensureNotEmpty, ensureNotNull } from '@/utils/validation';\r\n\r\n// vo\r\nimport Page from '@/vo/Page';\r\nimport ValidationResults from '@/vo/ValidationResults';\r\n\r\nconst endpoint = Constants.Licensee.ENDPOINT_PATH;\r\nconst endpointValidate = Constants.Licensee.ENDPOINT_PATH_VALIDATE;\r\nconst endpointTransfer = Constants.Licensee.ENDPOINT_PATH_TRANSFER;\r\nconst type = Constants.Licensee.TYPE;\r\n\r\nconst licenseeService: ILicenseeService = {\r\n /**\r\n * Gets licensee by its number.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/licensee-services#get-licensee\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * the licensee number\r\n * @param number string\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return the licensee in promise\r\n * @returns {Promise}\r\n */\r\n async get<T extends object = LicenseeProps>(\r\n context: ContextInstance,\r\n number: string,\r\n config?: RequestConfig,\r\n ): Promise<LicenseeEntity<SavedLicenseeProps<T>>> {\r\n ensureNotEmpty(number, 'number');\r\n\r\n const response = await Service.get(context, `${endpoint}/${number}`, {}, config);\r\n const item = response.data.items?.item.find((v) => v.type === type);\r\n\r\n return itemToLicensee<SavedLicenseeProps<T>>(item);\r\n },\r\n\r\n /**\r\n * Returns all licensees of a vendor.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/licensee-services#licensees-list\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * reserved for the future use, must be omitted / set to NULL\r\n * @param filter string|null\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * array of licensees (of all products) or empty array if nothing found in promise.\r\n * @returns {Promise}\r\n */\r\n async list<T extends object = LicenseeProps>(\r\n context: ContextInstance,\r\n filter?: Record<string, string | boolean | number> | string | null,\r\n config?: RequestConfig,\r\n ): Promise<PageInstance<LicenseeEntity<SavedLicenseeProps<T>>[]>> {\r\n const data: { [Constants.FILTER]: string } = {};\r\n\r\n if (filter) {\r\n data[Constants.FILTER] = typeof filter === 'string' ? filter : encode(filter);\r\n }\r\n\r\n const response = await Service.get(context, endpoint, data, config);\r\n const items = response.data.items;\r\n\r\n const list: LicenseeEntity<SavedLicenseeProps<T>>[] | undefined = items?.item\r\n .filter((v) => v.type === type)\r\n .map((v) => itemToLicensee<SavedLicenseeProps<T>>(v));\r\n\r\n return Page(list || [], items as ItemPagination);\r\n },\r\n\r\n /**\r\n * Creates new licensee object with given properties.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/licensee-services#create-licensee\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * parent product to which the new licensee is to be added\r\n * @param productNumber string\r\n *\r\n * non-null properties will be taken for the new object, null properties will either stay null, or will\r\n * be set to a default value, depending on property.\r\n * @param licensee NetLicensing.Licensee\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return the newly created licensee object in promise\r\n * @returns {Promise}\r\n */\r\n async create<T extends object = LicenseeProps>(\r\n context: ContextInstance,\r\n productNumber: string,\r\n licensee: LicenseeEntity<T>,\r\n config?: RequestConfig,\r\n ): Promise<LicenseeEntity<SavedLicenseeProps<T>>> {\r\n ensureNotNull(licensee, 'licensee');\r\n\r\n const data = licensee.serialize();\r\n\r\n if (productNumber) {\r\n data.productNumber = productNumber;\r\n }\r\n\r\n const response = await Service.post(context, endpoint, data, config);\r\n const item = response.data.items?.item.find((v) => v.type === type);\r\n\r\n return itemToLicensee<SavedLicenseeProps<T>>(item);\r\n },\r\n\r\n /**\r\n * Updates licensee properties.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/licensee-services#update-licensee\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * licensee number\r\n * @param number string\r\n *\r\n * non-null properties will be updated to the provided values, null properties will stay unchanged.\r\n * @param licensee NetLicensing.Licensee\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return updated licensee in promise.\r\n * @returns {Promise}\r\n */\r\n async update<T extends object = LicenseeProps>(\r\n context: ContextInstance,\r\n number: string,\r\n licensee: LicenseeEntity<T>,\r\n config?: RequestConfig,\r\n ): Promise<LicenseeEntity<SavedLicenseeProps<T>>> {\r\n ensureNotEmpty(number, 'number');\r\n ensureNotNull(licensee, 'licensee');\r\n\r\n const response = await Service.post(context, `${endpoint}/${number}`, licensee.serialize(), config);\r\n const item = response.data.items?.item.find((v) => v.type === type);\r\n\r\n return itemToLicensee<SavedLicenseeProps<T>>(item);\r\n },\r\n\r\n /**\r\n * Deletes licensee.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/licensee-services#delete-licensee\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * licensee number\r\n * @param number string\r\n *\r\n * if true, any entities that depend on the one being deleted will be deleted too\r\n * @param forceCascade boolean\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return boolean state of delete in promise\r\n * @returns {Promise}\r\n */\r\n delete(\r\n context: ContextInstance,\r\n number: string,\r\n forceCascade?: boolean,\r\n config?: RequestConfig,\r\n ): Promise<AxiosResponse<NlicResponse>> {\r\n ensureNotEmpty(number, 'number');\r\n\r\n return Service.delete(context, `${endpoint}/${number}`, { forceCascade: Boolean(forceCascade) }, config);\r\n },\r\n\r\n /**\r\n * Validates active licenses of the licensee.\r\n * In the case of multiple product modules validation,\r\n * required parameters indexes will be added automatically.\r\n * See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/licensee-services#validate-licensee\r\n *\r\n * @param context NetLicensing.Context\r\n *\r\n * licensee number\r\n * @param number string\r\n *\r\n * optional validation parameters. See ValidationParameters and licensing model documentation for\r\n * details.\r\n * @param validationParameters NetLicensing.ValidationParameters.\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * @returns {ValidationResults}\r\n */\r\n async validate(\r\n context: ContextInstance,\r\n number: string,\r\n validationParameters?: ValidationParametersInstance,\r\n config?: RequestConfig,\r\n ): Promise<IValidationResults> {\r\n ensureNotEmpty(number, 'number');\r\n\r\n const data: Record<string, string | boolean> = {};\r\n\r\n if (validationParameters) {\r\n const productNumber: string | undefined = validationParameters.productNumber;\r\n\r\n if (productNumber) {\r\n data.productNumber = productNumber;\r\n }\r\n\r\n const licenseeProperties = validationParameters.licenseeProperties;\r\n\r\n Object.keys(licenseeProperties).forEach((key: string) => {\r\n data[key] = validationParameters.getLicenseeProperty(key);\r\n });\r\n\r\n if (validationParameters.isForOfflineUse()) {\r\n data.forOfflineUse = true;\r\n }\r\n\r\n if (validationParameters.isDryRun()) {\r\n data.dryRun = true;\r\n }\r\n\r\n const parameters = validationParameters.getParameters();\r\n\r\n Object.keys(parameters).forEach((pmNumber, i) => {\r\n data[`${Constants.ProductModule.PRODUCT_MODULE_NUMBER}${i}`] = pmNumber;\r\n\r\n const parameter = parameters[pmNumber];\r\n\r\n if (parameter) {\r\n Object.keys(parameter).forEach((key: string) => {\r\n data[key + i] = parameter[key];\r\n });\r\n }\r\n });\r\n }\r\n\r\n const response = await Service.post(context, `${endpoint}/${number}/${endpointValidate}`, data, config);\r\n\r\n const validationResults = ValidationResults();\r\n\r\n const ttl = response.data.ttl;\r\n\r\n if (ttl) {\r\n validationResults.setTtl(ttl);\r\n }\r\n\r\n const items = response.data.items?.item.filter((v) => v.type === Constants.Validation.TYPE);\r\n\r\n items?.forEach((v) => {\r\n validationResults.setValidation(itemToObject(v));\r\n });\r\n\r\n return validationResults;\r\n },\r\n\r\n /**\r\n * Transfer licenses between licensees.\r\n * @see https://netlicensing.io/wiki/licensee-services#transfer-licenses\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * the number of the licensee receiving licenses\r\n * @param number string\r\n *\r\n * the number of the licensee delivering licenses\r\n * @param sourceLicenseeNumber string\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * @returns {Promise}\r\n */\r\n transfer(\r\n context: ContextInstance,\r\n number: string,\r\n sourceLicenseeNumber: string,\r\n config?: RequestConfig,\r\n ): Promise<AxiosResponse<NlicResponse>> {\r\n ensureNotEmpty(number, 'number');\r\n ensureNotEmpty(sourceLicenseeNumber, 'sourceLicenseeNumber');\r\n\r\n const data = { sourceLicenseeNumber };\r\n\r\n return Service.post(context, `${endpoint}/${number}/${endpointTransfer}`, data, config);\r\n },\r\n};\r\n\r\nexport default licenseeService;\r\n","/**\r\n * JS representation of the License Service. See NetLicensingAPI for details:\r\n * https://netlicensing.io/wiki/license-services\r\n *\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nimport { AxiosResponse } from 'axios';\r\n\r\n// constants\r\nimport Constants from '@/constants';\r\n\r\n// converters\r\nimport itemToLicense from '@/converters/itemToLicense';\r\n\r\n// services\r\nimport Service from '@/services/Service';\r\n\r\n// types\r\nimport { ItemPagination, NlicResponse } from '@/types/api/response';\r\nimport { LicenseProps, LicenseEntity, SavedLicenseProps } from '@/types/entities/License';\r\nimport { ILicenseService } from '@/types/services/LicenseService';\r\nimport { RequestConfig } from '@/types/services/Service';\r\nimport { ContextInstance } from '@/types/vo/Context';\r\nimport { PageInstance } from '@/types/vo/Page';\r\n\r\n// utils\r\nimport { encode } from '@/utils/filter';\r\nimport { ensureNotEmpty, ensureNotNull } from '@/utils/validation';\r\n\r\n// vo\r\nimport Page from '@/vo/Page';\r\n\r\nconst endpoint = Constants.License.ENDPOINT_PATH;\r\nconst type = Constants.License.TYPE;\r\n\r\nconst licenseService: ILicenseService = {\r\n /**\r\n * Gets license by its number.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/license-services#get-license\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * the license number\r\n * @param number string\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return the license in promise\r\n * @returns {Promise}\r\n */\r\n async get<T extends object = LicenseProps>(\r\n context: ContextInstance,\r\n number: string,\r\n config?: RequestConfig,\r\n ): Promise<LicenseEntity<SavedLicenseProps<T>>> {\r\n ensureNotEmpty(number, 'number');\r\n\r\n const response = await Service.get(context, `${endpoint}/${number}`, {}, config);\r\n const item = response.data.items?.item.find((v) => v.type === type);\r\n\r\n return itemToLicense<SavedLicenseProps<T>>(item);\r\n },\r\n\r\n /**\r\n * Returns licenses of a vendor.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/license-services#licenses-list\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * reserved for the future use, must be omitted / set to NULL\r\n * @param filter string|undefined\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return array of licenses (of all products) or empty array if nothing found in promise.\r\n * @returns {Promise}\r\n */\r\n async list<T extends object = LicenseProps>(\r\n context: ContextInstance,\r\n filter?: Record<string, string | boolean | number> | string | null,\r\n config?: RequestConfig,\r\n ): Promise<PageInstance<LicenseEntity<SavedLicenseProps<T>>[]>> {\r\n const data: { [Constants.FILTER]: string } = {};\r\n\r\n if (filter) {\r\n data[Constants.FILTER] = typeof filter === 'string' ? filter : encode(filter);\r\n }\r\n\r\n const response = await Service.get(context, endpoint, data, config);\r\n const items = response.data.items;\r\n\r\n const list: LicenseEntity<SavedLicenseProps<T>>[] | undefined = items?.item\r\n .filter((v) => v.type === type)\r\n .map((v) => itemToLicense<SavedLicenseProps<T>>(v));\r\n\r\n return Page(list || [], items as ItemPagination);\r\n },\r\n\r\n /**\r\n * Creates new license object with given properties.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/license-services#create-license\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * parent licensee to which the new license is to be added\r\n * @param licenseeNumber string\r\n *\r\n * license template that the license is created from\r\n * @param licenseTemplateNumber string\r\n *\r\n * For privileged logins specifies transaction for the license creation. For regular logins new\r\n * transaction always created implicitly, and the operation will be in a separate transaction.\r\n * Transaction is generated with the provided transactionNumber, or, if transactionNumber is null, with\r\n * auto-generated number.\r\n * @param transactionNumber null|string\r\n *\r\n * non-null properties will be taken for the new object, null properties will either stay null, or will\r\n * be set to a default value, depending on property.\r\n * @param license NetLicensing.License\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return the newly created license object in promise\r\n * @returns {Promise}\r\n */\r\n async create<T extends object = LicenseProps>(\r\n context: ContextInstance,\r\n licenseeNumber: string | null,\r\n licenseTemplateNumber: string | null,\r\n transactionNumber: string | null,\r\n license: LicenseEntity<T>,\r\n config?: RequestConfig,\r\n ): Promise<LicenseEntity<SavedLicenseProps<T>>> {\r\n ensureNotNull(license, 'license');\r\n\r\n const data = license.serialize();\r\n\r\n if (licenseeNumber) {\r\n data.licenseeNumber = licenseeNumber;\r\n }\r\n\r\n if (licenseTemplateNumber) {\r\n data.licenseTemplateNumber = licenseTemplateNumber;\r\n }\r\n\r\n if (transactionNumber) {\r\n data.transactionNumber = transactionNumber;\r\n }\r\n\r\n const response = await Service.post(context, endpoint, data, config);\r\n const item = response.data.items?.item.find((v) => v.type === type);\r\n\r\n return itemToLicense<SavedLicenseProps<T>>(item);\r\n },\r\n\r\n /**\r\n * Updates license properties.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/license-services#update-license\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * license number\r\n * @param number string\r\n *\r\n * transaction for the license update. Created implicitly if transactionNumber is null. In this case the\r\n * operation will be in a separate transaction.\r\n * @param transactionNumber string|null\r\n *\r\n * non-null properties will be updated to the provided values, null properties will stay unchanged.\r\n * @param license NetLicensing.License\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return updated license in promise.\r\n * @returns {Promise}\r\n */\r\n async update<T extends object = LicenseProps>(\r\n context: ContextInstance,\r\n number: string,\r\n transactionNumber: string | null,\r\n license: LicenseEntity<T>,\r\n config?: RequestConfig,\r\n ): Promise<LicenseEntity<SavedLicenseProps<T>>> {\r\n ensureNotEmpty(number, 'number');\r\n ensureNotNull(license, 'license');\r\n\r\n const data = license.serialize();\r\n\r\n if (transactionNumber) {\r\n data.transactionNumber = transactionNumber;\r\n }\r\n\r\n const response = await Service.post(context, `${endpoint}/${number}`, data, config);\r\n const item = response.data.items?.item.find((v) => v.type === type);\r\n\r\n return itemToLicense<SavedLicenseProps<T>>(item);\r\n },\r\n\r\n /**\r\n * Deletes license.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/license-services#delete-license\r\n *\r\n * When any license is deleted, corresponding transaction is created automatically.\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * license number\r\n * @param number string\r\n *\r\n * if true, any entities that depend on the one being deleted will be deleted too\r\n * @param forceCascade boolean\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return boolean state of delete in promise\r\n * @returns {Promise}\r\n */\r\n delete(\r\n context: ContextInstance,\r\n number: string,\r\n forceCascade?: boolean,\r\n config?: RequestConfig,\r\n ): Promise<AxiosResponse<NlicResponse>> {\r\n ensureNotEmpty(number, 'number');\r\n\r\n return Service.delete(context, `${endpoint}/${number}`, { forceCascade: Boolean(forceCascade) }, config);\r\n },\r\n};\r\n\r\nexport default licenseService;\r\n","/**\r\n * JS representation of the ProductModule Service. See NetLicensingAPI for details:\r\n * https://netlicensing.io/wiki/license-template-services\r\n *\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nimport { AxiosResponse } from 'axios';\r\n\r\n// constants\r\nimport Constants from '@/constants';\r\n\r\n// converters\r\nimport itemToLicenseTemplate from '@/converters/itemToLicenseTemplate';\r\n\r\n// services\r\nimport Service from '@/services/Service';\r\n\r\n// types\r\nimport { ItemPagination, NlicResponse } from '@/types/api/response';\r\nimport {\r\n LicenseTemplateProps,\r\n LicenseTemplateEntity,\r\n SavedLicenseTemplateProps,\r\n} from '@/types/entities/LicenseTemplate';\r\nimport { ILicenseTemplateService } from '@/types/services/LicenseTemplateService';\r\nimport { RequestConfig } from '@/types/services/Service';\r\nimport { ContextInstance } from '@/types/vo/Context';\r\nimport { PageInstance } from '@/types/vo/Page';\r\n\r\n// utils\r\nimport { encode } from '@/utils/filter';\r\nimport { ensureNotEmpty, ensureNotNull } from '@/utils/validation';\r\n\r\n// vo\r\nimport Page from '@/vo/Page';\r\n\r\nconst endpoint = Constants.LicenseTemplate.ENDPOINT_PATH;\r\nconst type = Constants.LicenseTemplate.TYPE;\r\n\r\nconst licenseTemplateService: ILicenseTemplateService = {\r\n /**\r\n * Gets license template by its number.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/license-template-services#get-license-template\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * the license template number\r\n * @param number string\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return the license template object in promise\r\n * @returns {Promise}\r\n */\r\n async get<T extends object = LicenseTemplateProps>(\r\n context: ContextInstance,\r\n number: string,\r\n config?: RequestConfig,\r\n ): Promise<LicenseTemplateEntity<SavedLicenseTemplateProps<T>>> {\r\n ensureNotEmpty(number, 'number');\r\n\r\n const response = await Service.get(context, `${endpoint}/${number}`, {}, config);\r\n const item = response.data.items?.item.find((v) => v.type === type);\r\n\r\n return itemToLicenseTemplate<SavedLicenseTemplateProps<T>>(item);\r\n },\r\n\r\n /**\r\n * Returns all license templates of a vendor.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/license-template-services#license-templates-list\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * reserved for the future use, must be omitted / set to NULL\r\n * @param filter string|null\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * array of license templates (of all products/modules) or null/empty list if nothing found in promise.\r\n * @returns {Promise}\r\n */\r\n async list<T extends object = LicenseTemplateProps>(\r\n context: ContextInstance,\r\n filter?: Record<string, string | boolean | number> | string | null,\r\n config?: RequestConfig,\r\n ): Promise<PageInstance<LicenseTemplateEntity<SavedLicenseTemplateProps<T>>[]>> {\r\n const data: { [Constants.FILTER]: string } = {};\r\n\r\n if (filter) {\r\n data[Constants.FILTER] = typeof filter === 'string' ? filter : encode(filter);\r\n }\r\n\r\n const response = await Service.get(context, endpoint, data, config);\r\n const items = response.data.items;\r\n\r\n const list: LicenseTemplateEntity<SavedLicenseTemplateProps<T>>[] | undefined = items?.item\r\n .filter((v) => v.type === type)\r\n .map((v) => itemToLicenseTemplate<SavedLicenseTemplateProps<T>>(v));\r\n\r\n return Page(list || [], items as ItemPagination);\r\n },\r\n\r\n /**\r\n * Creates new license template object with given properties.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/license-template-services#create-license-template\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * parent product module to which the new license template is to be added\r\n * @param productModuleNumber\r\n *\r\n * non-null properties will be taken for the new object, null properties will either stay null, or will\r\n * be set to a default value, depending on property.\r\n * @param licenseTemplate NetLicensing.LicenseTemplate\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * the newly created license template object in promise\r\n * @returns {Promise}\r\n */\r\n async create<T extends object = LicenseTemplateProps>(\r\n context: ContextInstance,\r\n productModuleNumber: string | null,\r\n licenseTemplate: LicenseTemplateEntity<T>,\r\n config?: RequestConfig,\r\n ): Promise<LicenseTemplateEntity<SavedLicenseTemplateProps<T>>> {\r\n ensureNotNull(licenseTemplate, 'licenseTemplate');\r\n\r\n const data = licenseTemplate.serialize();\r\n\r\n if (productModuleNumber) {\r\n data.productModuleNumber = productModuleNumber;\r\n }\r\n\r\n const response = await Service.post(context, endpoint, data, config);\r\n const item = response.data.items?.item.find((v) => v.type === type);\r\n\r\n return itemToLicenseTemplate<SavedLicenseTemplateProps<T>>(item);\r\n },\r\n\r\n /**\r\n * Updates license template properties.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/license-template-services#update-license-template\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * license template number\r\n * @param number string\r\n *\r\n * non-null properties will be updated to the provided values, null properties will stay unchanged.\r\n * @param licenseTemplate NetLicensing.LicenseTemplate\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * updated license template in promise.\r\n * @returns {Promise}\r\n */\r\n async update<T extends object = LicenseTemplateProps>(\r\n context: ContextInstance,\r\n number: string,\r\n licenseTemplate: LicenseTemplateEntity<T>,\r\n config?: RequestConfig,\r\n ): Promise<LicenseTemplateEntity<SavedLicenseTemplateProps<T>>> {\r\n ensureNotEmpty(number, 'number');\r\n ensureNotNull(licenseTemplate, 'licenseTemplate');\r\n\r\n const response = await Service.post(context, `${endpoint}/${number}`, licenseTemplate.serialize(), config);\r\n const item = response.data.items?.item.find((v) => v.type === type);\r\n\r\n return itemToLicenseTemplate<SavedLicenseTemplateProps<T>>(item);\r\n },\r\n\r\n /**\r\n * Deletes license template.See NetLicensingAPI JavaDoc for details:\r\n * @see https://netlicensing.io/wiki/license-template-services#delete-license-template\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * license template number\r\n * @param number string\r\n *\r\n * if true, any entities that depend on the one being deleted will be deleted too\r\n * @param forceCascade boolean\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return boolean state of delete in promise\r\n * @returns {Promise}\r\n */\r\n delete(\r\n context: ContextInstance,\r\n number: string,\r\n forceCascade?: boolean,\r\n config?: RequestConfig,\r\n ): Promise<AxiosResponse<NlicResponse>> {\r\n ensureNotEmpty(number, 'number');\r\n\r\n return Service.delete(context, `${endpoint}/${number}`, { forceCascade: Boolean(forceCascade) }, config);\r\n },\r\n};\r\n\r\nexport default licenseTemplateService;\r\n","/**\r\n * JS representation of the Notification Service. See NetLicensingAPI for details:\r\n * https://netlicensing.io/wiki/notification-services\r\n *\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nimport { AxiosResponse } from 'axios';\r\n\r\n// constants\r\nimport Constants from '@/constants';\r\n\r\n// converters\r\nimport itemToNotification from '@/converters/itemToNotification';\r\n\r\n// services\r\nimport Service from '@/services/Service';\r\n\r\n// types\r\nimport { ItemPagination, NlicResponse } from '@/types/api/response';\r\nimport { NotificationProps, NotificationEntity, SavedNotificationProps } from '@/types/entities/Notification';\r\nimport { INotificationService } from '@/types/services/NotificationService';\r\nimport { RequestConfig } from '@/types/services/Service';\r\nimport { ContextInstance } from '@/types/vo/Context';\r\nimport { PageInstance } from '@/types/vo/Page';\r\n\r\n// utils\r\nimport { encode } from '@/utils/filter';\r\nimport { ensureNotEmpty, ensureNotNull } from '@/utils/validation';\r\n\r\n// vo\r\nimport Page from '@/vo/Page';\r\n\r\nconst endpoint = Constants.Notification.ENDPOINT_PATH;\r\nconst type = Constants.Notification.TYPE;\r\n\r\nconst notificationService: INotificationService = {\r\n /**\r\n * Gets notification by its number.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/notification-services#get-notification\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * the notification number\r\n * @param number string\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return the notification object in promise\r\n * @returns {Promise}\r\n */\r\n async get<T extends object = NotificationProps>(\r\n context: ContextInstance,\r\n number: string,\r\n config?: RequestConfig,\r\n ): Promise<NotificationEntity<SavedNotificationProps<T>>> {\r\n ensureNotEmpty(number, 'number');\r\n\r\n const response = await Service.get(context, `${endpoint}/${number}`, {}, config);\r\n const item = response.data.items?.item.find((v) => v.type === type);\r\n\r\n return itemToNotification<SavedNotificationProps<T>>(item);\r\n },\r\n\r\n /**\r\n * Returns notifications of a vendor.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/notification-services#notifications-list\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * reserved for the future use, must be omitted / set to NULL\r\n * @param filter string|null\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * array of notification entities or empty array if nothing found in promise.\r\n * @returns {Promise}\r\n */\r\n async list<T extends object = NotificationProps>(\r\n context: ContextInstance,\r\n filter?: Record<string, string | boolean | number> | string | null,\r\n config?: RequestConfig,\r\n ): Promise<PageInstance<NotificationEntity<SavedNotificationProps<T>>[]>> {\r\n const data: { [Constants.FILTER]: string } = {};\r\n\r\n if (filter) {\r\n data[Constants.FILTER] = typeof filter === 'string' ? filter : encode(filter);\r\n }\r\n\r\n const response = await Service.get(context, endpoint, data, config);\r\n const items = response.data.items;\r\n\r\n const list: NotificationEntity<SavedNotificationProps<T>>[] | undefined = items?.item\r\n .filter((v) => v.type === type)\r\n .map((v) => itemToNotification<SavedNotificationProps<T>>(v));\r\n\r\n return Page(list || [], items as ItemPagination);\r\n },\r\n\r\n /**\r\n * Creates new notification with given properties.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/notification-services#create-notification\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * non-null properties will be taken for the new object, null properties will either stay null, or will\r\n * be set to a default value, depending on property.\r\n * @param notification NetLicensing.Notification\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return the newly created notification object in promise\r\n * @returns {Promise}\r\n */\r\n async create<T extends object = NotificationProps>(\r\n context: ContextInstance,\r\n notification: NotificationEntity<T>,\r\n config?: RequestConfig,\r\n ): Promise<NotificationEntity<SavedNotificationProps<T>>> {\r\n ensureNotNull(notification, 'notification');\r\n\r\n const response = await Service.post(context, endpoint, notification.serialize(), config);\r\n const item = response.data.items?.item.find((v) => v.type === type);\r\n\r\n return itemToNotification<SavedNotificationProps<T>>(item);\r\n },\r\n\r\n /**\r\n * Updates notification properties.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/notification-services#update-notification\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * notification number\r\n * @param number string\r\n *\r\n * non-null properties will be updated to the provided values, null properties will stay unchanged.\r\n * @param notification NetLicensing.Notification\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * updated notification in promise.\r\n * @returns {Promise}\r\n */\r\n async update<T extends object = NotificationProps>(\r\n context: ContextInstance,\r\n number: string,\r\n notification: NotificationEntity<T>,\r\n config?: RequestConfig,\r\n ): Promise<NotificationEntity<SavedNotificationProps<T>>> {\r\n ensureNotEmpty(number, 'number');\r\n ensureNotNull(notification, 'notification');\r\n\r\n const response = await Service.post(context, `${endpoint}/${number}`, notification.serialize(), config);\r\n const item = response.data.items?.item.find((v) => v.type === type);\r\n\r\n return itemToNotification<SavedNotificationProps<T>>(item);\r\n },\r\n\r\n /**\r\n * Deletes notification.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/notification-services#delete-notification\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * notification number\r\n * @param number string\r\n *\r\n * if true, any entities that depend on the one being deleted will be deleted too\r\n * @param forceCascade boolean\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return boolean state of delete in promise\r\n * @returns {Promise}\r\n */\r\n delete(\r\n context: ContextInstance,\r\n number: string,\r\n forceCascade?: boolean,\r\n config?: RequestConfig,\r\n ): Promise<AxiosResponse<NlicResponse>> {\r\n ensureNotEmpty(number, 'number');\r\n\r\n return Service.delete(context, `${endpoint}/${number}`, { forceCascade: Boolean(forceCascade) }, config);\r\n },\r\n};\r\n\r\nexport default notificationService;\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\n// constants\r\nimport Constants from '@/constants';\r\n\r\n// converters\r\nimport itemToPaymentMethod from '@/converters/itemToPaymentMethod';\r\n\r\n// services\r\nimport Service from '@/services/Service';\r\n\r\n// types\r\nimport { ItemPagination } from '@/types/api/response';\r\nimport { PaymentMethodProps, PaymentMethodEntity, SavedPaymentMethodProps } from '@/types/entities/PaymentMethod';\r\nimport { IPaymentMethodService } from '@/types/services/PaymentMethodService';\r\nimport { RequestConfig } from '@/types/services/Service';\r\nimport { ContextInstance } from '@/types/vo/Context';\r\nimport { PageInstance } from '@/types/vo/Page';\r\n\r\n// utils\r\nimport { encode } from '@/utils/filter';\r\nimport { ensureNotEmpty, ensureNotNull } from '@/utils/validation';\r\n\r\n// vo\r\nimport Page from '@/vo/Page';\r\n\r\nconst endpoint = Constants.PaymentMethod.ENDPOINT_PATH;\r\nconst type = Constants.PaymentMethod.TYPE;\r\n\r\nconst paymentMethodService: IPaymentMethodService = {\r\n /**\r\n * Gets payment method by its number.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/payment-method-services#get-payment-method\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * the payment method number\r\n * @param number string\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return the payment method in promise\r\n * @returns {Promise}\r\n */\r\n async get<T extends object = PaymentMethodProps>(\r\n context: ContextInstance,\r\n number: string,\r\n config?: RequestConfig,\r\n ): Promise<PaymentMethodEntity<SavedPaymentMethodProps<T>>> {\r\n ensureNotEmpty(number, 'number');\r\n\r\n const response = await Service.get(context, `${endpoint}/${number}`, {}, config);\r\n const item = response.data.items?.item.find((v) => v.type === type);\r\n\r\n return itemToPaymentMethod<SavedPaymentMethodProps<T>>(item);\r\n },\r\n\r\n /**\r\n * Returns payment methods of a vendor.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/payment-method-services#payment-methods-list\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * reserved for the future use, must be omitted / set to NULL\r\n * @param filter string|null\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * array of payment method entities or empty array if nothing found in promise.\r\n * @returns {Promise}\r\n */\r\n async list<T extends object = PaymentMethodProps>(\r\n context: ContextInstance,\r\n filter?: Record<string, string | boolean | number> | string | null,\r\n config?: RequestConfig,\r\n ): Promise<PageInstance<PaymentMethodEntity<SavedPaymentMethodProps<T>>[]>> {\r\n const data: { [Constants.FILTER]: string } = {};\r\n\r\n if (filter) {\r\n data[Constants.FILTER] = typeof filter === 'string' ? filter : encode(filter);\r\n }\r\n\r\n const response = await Service.get(context, endpoint, data, config);\r\n const items = response.data.items;\r\n\r\n const list: PaymentMethodEntity<SavedPaymentMethodProps<T>>[] | undefined = items?.item\r\n .filter((v) => v.type === type)\r\n .map((v) => itemToPaymentMethod<SavedPaymentMethodProps<T>>(v));\r\n\r\n return Page(list || [], items as ItemPagination);\r\n },\r\n\r\n /**\r\n * Updates payment method properties.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/payment-method-services#update-payment-method\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * the payment method number\r\n * @param number string\r\n *\r\n * non-null properties will be updated to the provided values, null properties will stay unchanged.\r\n * @param paymentMethod NetLicensing.PaymentMethod\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return updated payment method in promise.\r\n * @returns {Promise}\r\n */\r\n async update<T extends object = PaymentMethodProps>(\r\n context: ContextInstance,\r\n number: string,\r\n paymentMethod: PaymentMethodEntity<T>,\r\n config?: RequestConfig,\r\n ): Promise<PaymentMethodEntity<SavedPaymentMethodProps<T>>> {\r\n ensureNotEmpty(number, 'number');\r\n ensureNotNull(paymentMethod, 'paymentMethod');\r\n\r\n const response = await Service.post(context, `${endpoint}/${number}`, paymentMethod.serialize(), config);\r\n const item = response.data.items?.item.find((v) => v.type === type);\r\n\r\n return itemToPaymentMethod<SavedPaymentMethodProps<T>>(item);\r\n },\r\n};\r\n\r\nexport default paymentMethodService;\r\n","/**\r\n * JS representation of the ProductModule Service. See NetLicensingAPI for details:\r\n * https://netlicensing.io/wiki/product-module-services\r\n *\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nimport { AxiosResponse } from 'axios';\r\n\r\n// constants\r\nimport Constants from '@/constants';\r\n\r\n// converters\r\nimport itemToProductModule from '@/converters/itemToProductModule';\r\n\r\n// services\r\nimport Service from '@/services/Service';\r\n\r\n// types\r\nimport { ItemPagination, NlicResponse } from '@/types/api/response';\r\nimport { ProductModuleProps, ProductModuleEntity, SavedProductModuleProps } from '@/types/entities/ProductModule';\r\nimport { IProductModuleService } from '@/types/services/ProductModuleService';\r\nimport { RequestConfig } from '@/types/services/Service';\r\nimport { ContextInstance } from '@/types/vo/Context';\r\nimport { PageInstance } from '@/types/vo/Page';\r\n\r\n// utils\r\nimport { encode } from '@/utils/filter';\r\nimport { ensureNotEmpty, ensureNotNull } from '@/utils/validation';\r\n\r\n// vo\r\nimport Page from '@/vo/Page';\r\n\r\nconst endpoint = Constants.ProductModule.ENDPOINT_PATH;\r\nconst type = Constants.ProductModule.TYPE;\r\n\r\nconst productModuleService: IProductModuleService = {\r\n /**\r\n * Gets product module by its number.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/product-module-services#get-product-module\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * the product module number\r\n * @param number string\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return the product module object in promise\r\n * @returns {Promise}\r\n */\r\n async get<T extends object = ProductModuleProps>(\r\n context: ContextInstance,\r\n number: string,\r\n config?: RequestConfig,\r\n ): Promise<ProductModuleEntity<SavedProductModuleProps<T>>> {\r\n ensureNotEmpty(number, 'number');\r\n\r\n const response = await Service.get(context, `${endpoint}/${number}`, {}, config);\r\n const item = response.data.items?.item.find((v) => v.type === type);\r\n\r\n return itemToProductModule<SavedProductModuleProps<T>>(item);\r\n },\r\n\r\n /**\r\n * Returns products of a vendor.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/product-module-services#product-modules-list\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * reserved for the future use, must be omitted / set to NULL\r\n * @param filter string|null\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * array of product modules entities or empty array if nothing found in promise.\r\n * @returns {Promise}\r\n */\r\n async list<T extends object = ProductModuleProps>(\r\n context: ContextInstance,\r\n filter?: Record<string, string | boolean | number> | string | null,\r\n config?: RequestConfig,\r\n ): Promise<PageInstance<ProductModuleEntity<SavedProductModuleProps<T>>[]>> {\r\n const data: { [Constants.FILTER]: string } = {};\r\n\r\n if (filter) {\r\n data[Constants.FILTER] = typeof filter === 'string' ? filter : encode(filter);\r\n }\r\n\r\n const response = await Service.get(context, endpoint, data, config);\r\n const items = response.data.items;\r\n\r\n const list: ProductModuleEntity<SavedProductModuleProps<T>>[] | undefined = items?.item\r\n .filter((v) => v.type === type)\r\n .map((v) => itemToProductModule<SavedProductModuleProps<T>>(v));\r\n\r\n return Page(list || [], items as ItemPagination);\r\n },\r\n\r\n /**\r\n * Creates new product module object with given properties.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/product-module-services#create-product-module\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * parent product to which the new product module is to be added\r\n * @param productNumber string\r\n *\r\n * non-null properties will be taken for the new object, null properties will either stay null, or will\r\n * be set to a default value, depending on property.\r\n * @param productModule NetLicensing.ProductModule\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * the newly created product module object in promise\r\n * @returns {Promise}\r\n */\r\n async create<T extends object = ProductModuleProps>(\r\n context: ContextInstance,\r\n productNumber: string | null,\r\n productModule: ProductModuleEntity<T>,\r\n config?: RequestConfig,\r\n ): Promise<ProductModuleEntity<SavedProductModuleProps<T>>> {\r\n ensureNotNull(productModule, 'productModule');\r\n\r\n const data = productModule.serialize();\r\n\r\n if (productNumber) {\r\n data.productNumber = productNumber;\r\n }\r\n\r\n const response = await Service.post(context, endpoint, data, config);\r\n const item = response.data.items?.item.find((v) => v.type === type);\r\n\r\n return itemToProductModule<SavedProductModuleProps<T>>(item);\r\n },\r\n\r\n /**\r\n * Updates product module properties.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/product-module-services#update-product-module\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * product module number\r\n * @param number string\r\n *\r\n * non-null properties will be updated to the provided values, null properties will stay unchanged.\r\n * @param productModule NetLicensing.ProductModule\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * updated product module in promise.\r\n * @returns {Promise}\r\n */\r\n async update<T extends object = ProductModuleProps>(\r\n context: ContextInstance,\r\n number: string,\r\n productModule: ProductModuleEntity<T>,\r\n config?: RequestConfig,\r\n ): Promise<ProductModuleEntity<SavedProductModuleProps<T>>> {\r\n ensureNotEmpty(number, 'number');\r\n ensureNotNull(productModule, 'productModule');\r\n\r\n const response = await Service.post(context, `${endpoint}/${number}`, productModule.serialize(), config);\r\n const item = response.data.items?.item.find((v) => v.type === type);\r\n\r\n return itemToProductModule<SavedProductModuleProps<T>>(item);\r\n },\r\n\r\n /**\r\n * Deletes product module.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/product-module-services#delete-product-module\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * product module number\r\n * @param number string\r\n *\r\n * if true, any entities that depend on the one being deleted will be deleted too\r\n * @param forceCascade boolean\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return boolean state of delete in promise\r\n * @returns {Promise}\r\n */\r\n delete(\r\n context: ContextInstance,\r\n number: string,\r\n forceCascade?: boolean,\r\n config?: RequestConfig,\r\n ): Promise<AxiosResponse<NlicResponse>> {\r\n ensureNotEmpty(number, 'number');\r\n\r\n return Service.delete(context, `${endpoint}/${number}`, { forceCascade: Boolean(forceCascade) }, config);\r\n },\r\n};\r\n\r\nexport default productModuleService;\r\n","/**\r\n * JS representation of the Product Service. See NetLicensingAPI for details:\r\n * https://netlicensing.io/wiki/product-services\r\n *\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nimport { AxiosResponse } from 'axios';\r\n\r\n// constants\r\nimport Constants from '@/constants';\r\n\r\n// converters\r\nimport itemToProduct from '@/converters/itemToProduct';\r\n\r\n// services\r\nimport Service from '@/services/Service';\r\n\r\n// types\r\nimport { ItemPagination, NlicResponse } from '@/types/api/response';\r\nimport { ProductProps, ProductEntity, SavedProductProps } from '@/types/entities/Product';\r\nimport { IProductService } from '@/types/services/ProductService';\r\nimport { RequestConfig } from '@/types/services/Service';\r\nimport { ContextInstance } from '@/types/vo/Context';\r\nimport { PageInstance } from '@/types/vo/Page';\r\n\r\n// utils\r\nimport { encode } from '@/utils/filter';\r\nimport { ensureNotEmpty, ensureNotNull } from '@/utils/validation';\r\n\r\n// vo\r\nimport Page from '@/vo/Page';\r\n\r\nconst endpoint = Constants.Product.ENDPOINT_PATH;\r\nconst type = Constants.Product.TYPE;\r\n\r\nconst productService: IProductService = {\r\n /**\r\n * Gets product by its number.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/product-services#get-product\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * the product number\r\n * @param number string\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return the product object in promise\r\n * @returns {Promise}\r\n */\r\n async get<T extends object = ProductProps>(\r\n context: ContextInstance,\r\n number: string,\r\n config?: RequestConfig,\r\n ): Promise<ProductEntity<SavedProductProps<T>>> {\r\n ensureNotEmpty(number, 'number');\r\n\r\n const response = await Service.get(context, `${endpoint}/${number}`, {}, config);\r\n const item = response.data.items?.item.find((v) => v.type === type);\r\n\r\n return itemToProduct<SavedProductProps<T>>(item);\r\n },\r\n\r\n /**\r\n * Returns products of a vendor.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/product-services#products-list\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * reserved for the future use, must be omitted / set to NULL\r\n * @param filter string|null\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * array of product entities or empty array if nothing found in promise.\r\n * @returns {Promise}\r\n */\r\n async list<T extends object = ProductProps>(\r\n context: ContextInstance,\r\n filter?: Record<string, string | boolean | number> | string | null,\r\n config?: RequestConfig,\r\n ): Promise<PageInstance<ProductEntity<SavedProductProps<T>>[]>> {\r\n const data: { [Constants.FILTER]: string } = {};\r\n\r\n if (filter) {\r\n data[Constants.FILTER] = typeof filter === 'string' ? filter : encode(filter);\r\n }\r\n\r\n const response = await Service.get(context, endpoint, data, config);\r\n const items = response.data.items;\r\n\r\n const list: ProductEntity<SavedProductProps<T>>[] | undefined = items?.item\r\n .filter((v) => v.type === type)\r\n .map((v) => itemToProduct<SavedProductProps<T>>(v));\r\n\r\n return Page(list || [], items as ItemPagination);\r\n },\r\n\r\n /**\r\n * Creates new product with given properties.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/product-services#create-product\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * non-null properties will be taken for the new object, null properties will either stay null, or will\r\n * be set to a default value, depending on property.\r\n * @param product NetLicensing.Product\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return the newly created product object in promise\r\n * @returns {Promise}\r\n */\r\n async create<T extends object = ProductProps>(\r\n context: ContextInstance,\r\n product: ProductEntity<T>,\r\n config?: RequestConfig,\r\n ): Promise<ProductEntity<SavedProductProps<T>>> {\r\n ensureNotNull(product, 'product');\r\n\r\n const response = await Service.post(context, endpoint, product.serialize(), config);\r\n const item = response.data.items?.item.find((v) => v.type === type);\r\n\r\n return itemToProduct<SavedProductProps<T>>(item);\r\n },\r\n\r\n /**\r\n * Updates product properties.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/product-services#update-product\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * product number\r\n * @param number string\r\n *\r\n * non-null properties will be updated to the provided values, null properties will stay unchanged.\r\n * @param product NetLicensing.Product\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * updated product in promise.\r\n * @returns {Promise}\r\n */\r\n async update<T extends object = ProductProps>(\r\n context: ContextInstance,\r\n number: string,\r\n product: ProductEntity<T>,\r\n config?: RequestConfig,\r\n ): Promise<ProductEntity<SavedProductProps<T>>> {\r\n ensureNotEmpty(number, 'number');\r\n ensureNotNull(product, 'product');\r\n\r\n const response = await Service.post(context, `${endpoint}/${number}`, product.serialize(), config);\r\n const item = response.data.items?.item.find((v) => v.type === type);\r\n\r\n return itemToProduct<SavedProductProps<T>>(item);\r\n },\r\n\r\n /**\r\n * Deletes product.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/product-services#delete-product\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * product number\r\n * @param number string\r\n *\r\n * if true, any entities that depend on the one being deleted will be deleted too\r\n * @param forceCascade boolean\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return boolean state of delete in promise\r\n * @returns {Promise}\r\n */\r\n delete(\r\n context: ContextInstance,\r\n number: string,\r\n forceCascade?: boolean,\r\n config?: RequestConfig,\r\n ): Promise<AxiosResponse<NlicResponse>> {\r\n ensureNotEmpty(number, 'number');\r\n\r\n return Service.delete(context, `${endpoint}/${number}`, { forceCascade: Boolean(forceCascade) }, config);\r\n },\r\n};\r\n\r\nexport default productService;\r\n","/**\r\n * JS representation of the Token Service. See NetLicensingAPI for details:\r\n * https://netlicensing.io/wiki/token-services\r\n *\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nimport { AxiosResponse } from 'axios';\r\n\r\n// constants\r\nimport Constants from '@/constants';\r\n\r\n// converters\r\nimport itemToToken from '@/converters/itemToToken';\r\n\r\n// services\r\nimport Service from '@/services/Service';\r\n\r\n// types\r\nimport { ItemPagination, NlicResponse } from '@/types/api/response';\r\nimport { TokenProps, TokenEntity, SavedTokenProps } from '@/types/entities/Token';\r\nimport { RequestConfig } from '@/types/services/Service';\r\nimport { ITokenService } from '@/types/services/TokenService';\r\nimport { ContextInstance } from '@/types/vo/Context';\r\nimport { PageInstance } from '@/types/vo/Page';\r\n\r\n// utils\r\nimport { encode } from '@/utils/filter';\r\nimport { ensureNotEmpty, ensureNotNull } from '@/utils/validation';\r\n\r\n// vo\r\nimport Page from '@/vo/Page';\r\n\r\nconst endpoint = Constants.Token.ENDPOINT_PATH;\r\nconst type = Constants.Token.TYPE;\r\n\r\nconst tokenService: ITokenService = {\r\n /**\r\n * Gets token by its number.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/token-services#get-token\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * the token number\r\n * @param number\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return the token in promise\r\n * @returns {Promise}\r\n */\r\n async get<T extends object = TokenProps>(\r\n context: ContextInstance,\r\n number: string,\r\n config?: RequestConfig,\r\n ): Promise<TokenEntity<SavedTokenProps<T>>> {\r\n ensureNotEmpty(number, 'number');\r\n\r\n const response = await Service.get(context, `${endpoint}/${number}`, {}, config);\r\n const item = response.data.items?.item.find((v) => v.type === type);\r\n\r\n return itemToToken<SavedTokenProps<T>>(item);\r\n },\r\n\r\n /**\r\n * Returns tokens of a vendor.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/token-services#tokens-list\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context Context\r\n *\r\n * reserved for the future use, must be omitted / set to NULL\r\n * @param filter string|undefined|null\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * array of token entities or empty array if nothing found.\r\n * @return array\r\n */\r\n async list<T extends object = TokenProps>(\r\n context: ContextInstance,\r\n filter?: Record<string, string | boolean | number> | string | null,\r\n config?: RequestConfig,\r\n ): Promise<PageInstance<TokenEntity<SavedTokenProps<T>>[]>> {\r\n const data: { [Constants.FILTER]: string } = {};\r\n\r\n if (filter) {\r\n data[Constants.FILTER] = typeof filter === 'string' ? filter : encode(filter);\r\n }\r\n\r\n const response = await Service.get(context, endpoint, data, config);\r\n const items = response.data.items;\r\n\r\n const list: TokenEntity<SavedTokenProps<T>>[] | undefined = items?.item\r\n .filter((v) => v.type === type)\r\n .map((v) => itemToToken<SavedTokenProps<T>>(v));\r\n\r\n return Page(list || [], items as ItemPagination);\r\n },\r\n\r\n /**\r\n * Creates new token.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/token-services#create-token\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context Context\r\n *\r\n * non-null properties will be updated to the provided values, null properties will stay unchanged.\r\n * @param token Token\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return created token in promise\r\n * @returns {Promise}\r\n */\r\n async create<T extends object = TokenProps>(\r\n context: ContextInstance,\r\n token: TokenEntity<T>,\r\n config?: RequestConfig,\r\n ): Promise<TokenEntity<SavedTokenProps<T>>> {\r\n ensureNotNull(token, 'token');\r\n\r\n const response = await Service.post(context, endpoint, token.serialize(), config);\r\n const item = response.data.items?.item.find((v) => v.type === type);\r\n\r\n return itemToToken<SavedTokenProps<T>>(item);\r\n },\r\n\r\n /**\r\n * Delete token by its number.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/token-services#delete-token\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * the token number\r\n * @param number string\r\n *\r\n * if true, any entities that depend on the one being deleted will be deleted too\r\n * @param forceCascade boolean\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return boolean state of delete in promise\r\n * @returns {Promise}\r\n */\r\n delete(\r\n context: ContextInstance,\r\n number: string,\r\n forceCascade?: boolean,\r\n config?: RequestConfig,\r\n ): Promise<AxiosResponse<NlicResponse>> {\r\n ensureNotEmpty(number, 'number');\r\n\r\n return Service.delete(context, `${endpoint}/${number}`, { forceCascade: Boolean(forceCascade) }, config);\r\n },\r\n};\r\n\r\nexport default tokenService;\r\n","/**\r\n * JS representation of the Transaction Service. See NetLicensingAPI for details:\r\n * https://netlicensing.io/wiki/transaction-services\r\n *\r\n * Transaction is created each time change to LicenseService licenses happens. For instance licenses are\r\n * obtained by a licensee, licenses disabled by vendor, licenses deleted, etc. Transaction is created no matter what\r\n * source has initiated the change to licenses: it can be either a direct purchase of licenses by a licensee via\r\n * NetLicensing Shop, or licenses can be given to a licensee by a vendor. Licenses can also be assigned implicitly by\r\n * NetLicensing if it is defined so by a license model (e.g. evaluation license may be given automatically). All these\r\n * events are reflected in transactions. Of all the transaction handling routines only read-only routines are exposed to\r\n * the public API, as transactions are only allowed to be created and modified by NetLicensing internally.\r\n *\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nimport Constants from '@/constants';\r\n\r\n// converters\r\nimport itemToTransaction from '@/converters/itemToTransaction';\r\n\r\n// services\r\nimport Service from '@/services/Service';\r\n\r\n// types\r\nimport type { ItemPagination } from '@/types/api/response';\r\nimport { TransactionProps, TransactionEntity, SavedTransactionProps } from '@/types/entities/Transaction';\r\nimport type { RequestConfig } from '@/types/services/Service';\r\nimport type { ITransactionService } from '@/types/services/TransactionService';\r\nimport type { ContextInstance } from '@/types/vo/Context';\r\nimport type { PageInstance } from '@/types/vo/Page';\r\n\r\n// utils\r\nimport { encode } from '@/utils/filter';\r\nimport { ensureNotEmpty, ensureNotNull } from '@/utils/validation';\r\n\r\n// vo\r\nimport Page from '@/vo/Page';\r\n\r\nconst endpoint = Constants.Transaction.ENDPOINT_PATH;\r\nconst type = Constants.Transaction.TYPE;\r\n\r\nconst transactionService: ITransactionService = {\r\n /**\r\n * Gets transaction by its number.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/transaction-services#get-transaction\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * the transaction number\r\n * @param number string\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return the transaction in promise\r\n * @returns {Promise}\r\n */\r\n async get<T extends object = TransactionProps>(\r\n context: ContextInstance,\r\n number: string,\r\n config?: RequestConfig,\r\n ): Promise<TransactionEntity<SavedTransactionProps<T>>> {\r\n ensureNotEmpty(number, 'number');\r\n\r\n const response = await Service.get(context, `${endpoint}/${number}`, {}, config);\r\n const item = response.data.items?.item.find((v) => v.type === type);\r\n\r\n return itemToTransaction<SavedTransactionProps<T>>(item);\r\n },\r\n\r\n /**\r\n * Returns all transactions of a vendor.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/transaction-services#transactions-list\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * reserved for the future use, must be omitted / set to NULL\r\n * @param filter string\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * array of transaction entities or empty array if nothing found in promise.\r\n * @returns {Promise}\r\n */\r\n async list<T extends object = TransactionProps>(\r\n context: ContextInstance,\r\n filter?: Record<string, string | boolean | number> | string | null,\r\n config?: RequestConfig,\r\n ): Promise<PageInstance<TransactionEntity<SavedTransactionProps<T>>[]>> {\r\n const data: { [Constants.FILTER]: string } = {};\r\n\r\n if (filter) {\r\n data[Constants.FILTER] = typeof filter === 'string' ? filter : encode(filter);\r\n }\r\n\r\n const response = await Service.get(context, endpoint, data, config);\r\n const items = response.data.items;\r\n\r\n const list: TransactionEntity<SavedTransactionProps<T>>[] | undefined = items?.item\r\n .filter((v) => v.type === type)\r\n .map((v) => itemToTransaction<SavedTransactionProps<T>>(v));\r\n\r\n return Page(list || [], items as ItemPagination);\r\n },\r\n\r\n /**\r\n * Creates new transaction object with given properties.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/transaction-services#create-transaction\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * non-null properties will be taken for the new object, null properties will either stay null, or will\r\n * be set to a default value, depending on property.\r\n * @param transaction NetLicensing.Transaction\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return the newly created transaction object in promise\r\n * @returns {Promise}\r\n */\r\n async create<T extends object = TransactionProps>(\r\n context: ContextInstance,\r\n transaction: TransactionEntity<T>,\r\n config?: RequestConfig,\r\n ): Promise<TransactionEntity<SavedTransactionProps<T>>> {\r\n ensureNotNull(transaction, 'transaction');\r\n\r\n const response = await Service.post(context, endpoint, transaction.serialize(), config);\r\n const item = response.data.items?.item.find((v) => v.type === type);\r\n\r\n return itemToTransaction<SavedTransactionProps<T>>(item);\r\n },\r\n\r\n /**\r\n * Updates transaction properties.See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/transaction-services#update-transaction\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * transaction number\r\n * @param number string\r\n *\r\n * non-null properties will be updated to the provided values, null properties will stay unchanged.\r\n * @param transaction NetLicensing.Transaction\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * return updated transaction in promise.\r\n * @returns {Promise}\r\n */\r\n async update<T extends object = TransactionProps>(\r\n context: ContextInstance,\r\n number: string,\r\n transaction: TransactionEntity<T>,\r\n config?: RequestConfig,\r\n ): Promise<TransactionEntity<SavedTransactionProps<T>>> {\r\n ensureNotEmpty(number, 'number');\r\n ensureNotNull(transaction, 'transaction');\r\n\r\n const response = await Service.post(context, `${endpoint}/${number}`, transaction.serialize(), config);\r\n const item = response.data.items?.item.find((v) => v.type === type);\r\n\r\n return itemToTransaction<SavedTransactionProps<T>>(item);\r\n },\r\n};\r\n\r\nexport default transactionService;\r\n","/**\r\n * JS representation of the Utility Service. See NetLicensingAPI for details:\r\n * https://netlicensing.io/wiki/utility-services\r\n *\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nimport Constants from '@/constants';\r\n\r\n// converters\r\nimport itemToCountry from '@/converters/itemToCountry';\r\nimport itemToObject from '@/converters/itemToObject';\r\n\r\n// services\r\nimport Service from '@/services/Service';\r\n\r\n// types\r\nimport { ItemPagination } from '@/types/api/response';\r\nimport { LicenseTypeValues } from '@/types/constants/LicenseType';\r\nimport { LicensingModelValues } from '@/types/constants/LicensingModel';\r\nimport { CountryEntity } from '@/types/entities/Country';\r\nimport { RequestConfig } from '@/types/services/Service';\r\nimport { IUtilityService } from '@/types/services/UtilityService';\r\nimport { ContextInstance } from '@/types/vo/Context';\r\nimport { PageInstance } from '@/types/vo/Page';\r\n\r\n// utils\r\nimport { encode } from '@/utils/filter';\r\n\r\n// vo\r\nimport Page from '@/vo/Page';\r\n\r\nconst baseEndpoint = Constants.Utility.ENDPOINT_PATH;\r\n\r\nconst utilityService: IUtilityService = {\r\n /**\r\n * Returns all license types. See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/utility-services#license-types-list\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * array of available license types or empty array if nothing found in promise.\r\n * @returns {Promise}\r\n */\r\n async listLicenseTypes(context: ContextInstance, config?: RequestConfig): Promise<PageInstance<LicenseTypeValues[]>> {\r\n const endpoint = `${baseEndpoint}/${Constants.Utility.ENDPOINT_PATH_LICENSE_TYPES}`;\r\n\r\n const response = await Service.get(context, endpoint, undefined, config);\r\n const items = response.data.items;\r\n\r\n const type = Constants.Utility.LICENSE_TYPE;\r\n\r\n const licenseTypes: string[] | undefined = items?.item\r\n .filter((v) => v.type === type)\r\n .map((v) => itemToObject<{ name: string }>(v).name);\r\n\r\n return Page((licenseTypes as LicenseTypeValues[]) || [], items as ItemPagination);\r\n },\r\n\r\n /**\r\n * Returns all license models. See NetLicensingAPI for details:\r\n * @see https://netlicensing.io/wiki/utility-services#licensing-models-list\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context NetLicensing.Context\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * array of available license models or empty array if nothing found in promise.\r\n * @returns {Promise}\r\n */\r\n async listLicensingModels(\r\n context: ContextInstance,\r\n config?: RequestConfig,\r\n ): Promise<PageInstance<LicensingModelValues[]>> {\r\n const endpoint = `${baseEndpoint}/${Constants.Utility.ENDPOINT_PATH_LICENSING_MODELS}`;\r\n\r\n const response = await Service.get(context, endpoint, undefined, config);\r\n const items = response.data.items;\r\n\r\n const type = Constants.Utility.LICENSING_MODEL_TYPE;\r\n\r\n const licensingModels: string[] | undefined = items?.item\r\n .filter((v) => v.type === type)\r\n .map((v) => itemToObject<{ name: string }>(v).name);\r\n\r\n return Page((licensingModels as LicensingModelValues[]) || [], items as ItemPagination);\r\n },\r\n\r\n /**\r\n * Returns all countries.\r\n *\r\n * determines the vendor on whose behalf the call is performed\r\n * @param context\r\n *\r\n * reserved for the future use, must be omitted / set to NULL\r\n * @param filter\r\n *\r\n * (optional) service request config\r\n * @param config\r\n *\r\n * collection of available countries or null/empty list if nothing found in promise.\r\n * @returns {Promise}\r\n */\r\n async listCountries(\r\n context: ContextInstance,\r\n filter?: Record<string, string | boolean | number> | string | null,\r\n config?: RequestConfig,\r\n ): Promise<PageInstance<CountryEntity[]>> {\r\n const data: { [Constants.FILTER]: string } = {};\r\n\r\n if (filter) {\r\n data[Constants.FILTER] = typeof filter === 'string' ? filter : encode(filter);\r\n }\r\n\r\n const endpoint = `${baseEndpoint}/${Constants.Utility.ENDPOINT_PATH_COUNTRIES}`;\r\n\r\n const response = await Service.get(context, endpoint, data, config);\r\n const items = response.data.items;\r\n\r\n const type = Constants.Utility.COUNTRY_TYPE;\r\n\r\n const countries: CountryEntity[] | undefined = items?.item\r\n .filter((v) => v.type === type)\r\n .map((v) => itemToCountry(v));\r\n\r\n return Page(countries || [], items as ItemPagination);\r\n },\r\n};\r\n\r\nexport default utilityService;\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\nimport SecurityModeEnum from '@/constants/SecurityMode';\r\n\r\n// types\r\nimport type { SecurityModeValues } from '@/types/constants/SecurityMode';\r\nimport type { ContextConfig, ContextInstance } from '@/types/vo/Context';\r\n\r\nclass Context implements ContextInstance {\r\n baseUrl: string;\r\n securityMode: SecurityModeValues;\r\n username?: string;\r\n password?: string;\r\n apiKey?: string;\r\n publicKey?: string;\r\n\r\n constructor(props?: ContextConfig) {\r\n this.baseUrl = props?.baseUrl || 'https://go.netlicensing.io/core/v2/rest';\r\n this.securityMode = props?.securityMode || SecurityModeEnum.BASIC_AUTHENTICATION;\r\n this.username = props?.username;\r\n this.password = props?.password;\r\n this.apiKey = props?.apiKey;\r\n this.publicKey = props?.publicKey;\r\n }\r\n\r\n setBaseUrl(baseUrl: string): this {\r\n this.baseUrl = baseUrl;\r\n return this;\r\n }\r\n\r\n getBaseUrl(): string {\r\n return this.baseUrl;\r\n }\r\n\r\n setSecurityMode(securityMode: SecurityModeValues): this {\r\n this.securityMode = securityMode;\r\n return this;\r\n }\r\n\r\n getSecurityMode(): SecurityModeValues {\r\n return this.securityMode;\r\n }\r\n\r\n setUsername(username: string): this {\r\n this.username = username;\r\n return this;\r\n }\r\n\r\n getUsername<D = undefined>(def?: D): string | D {\r\n return (this.username || def) as string | D;\r\n }\r\n\r\n setPassword(password: string): this {\r\n this.password = password;\r\n return this;\r\n }\r\n\r\n getPassword<D = undefined>(def?: D): string | D {\r\n return (this.password || def) as string | D;\r\n }\r\n\r\n setApiKey(apiKey: string): this {\r\n this.apiKey = apiKey;\r\n return this;\r\n }\r\n\r\n getApiKey<D = undefined>(def?: D): string | D {\r\n return (this.apiKey || def) as string | D;\r\n }\r\n\r\n setPublicKey(publicKey: string): this {\r\n this.publicKey = publicKey;\r\n return this;\r\n }\r\n\r\n getPublicKey<D = undefined>(def?: D): string | D {\r\n return (this.publicKey || def) as string | D;\r\n }\r\n}\r\n\r\nexport default (props?: ContextConfig): ContextInstance => new Context(props);\r\n","/**\r\n * @author Labs64 <netlicensing@labs64.com>\r\n * @license Apache-2.0\r\n * @link https://netlicensing.io\r\n * @copyright 2017 Labs64 NetLicensing\r\n */\r\n// types\r\nimport {\r\n ValidationParametersInstance,\r\n Parameter,\r\n Parameters,\r\n LicenseeProperties,\r\n} from '@/types/vo/ValidationParameters';\r\n\r\nclass ValidationParameters implements ValidationParametersInstance {\r\n productNumber?: string;\r\n dryRun?: boolean;\r\n forOfflineUse?: boolean;\r\n licenseeProperties: LicenseeProperties;\r\n parameters: Parameters;\r\n\r\n constructor() {\r\n this.parameters = {};\r\n this.licenseeProperties = {};\r\n }\r\n\r\n setProductNumber(productNumber: string): this {\r\n this.productNumber = productNumber;\r\n return this;\r\n }\r\n\r\n getProductNumber(): string | undefined {\r\n return this.productNumber;\r\n }\r\n\r\n setLicenseeName(licenseeName: string): this {\r\n this.licenseeProperties.licenseeName = licenseeName;\r\n return this;\r\n }\r\n\r\n getLicenseeName(): string | undefined {\r\n return this.licenseeProperties.licenseeName;\r\n }\r\n\r\n setLicenseeSecret(licenseeSecret: string): this {\r\n this.licenseeProperties.licenseeSecret = licenseeSecret;\r\n return this;\r\n }\r\n\r\n getLicenseeSecret(): string | undefined {\r\n return this.licenseeProperties.licenseeSecret;\r\n }\r\n\r\n getLicenseeProperties(): LicenseeProperties {\r\n return this.licenseeProperties;\r\n }\r\n\r\n setLicenseeProperty(key: string, value: string): this {\r\n this.licenseeProperties[key] = value;\r\n return this;\r\n }\r\n\r\n getLicenseeProperty<D = undefined>(key: string, def?: D): string | D {\r\n return (this.licenseeProperties[key] || def) as string | D;\r\n }\r\n\r\n setForOfflineUse(forOfflineUse: boolean): this {\r\n this.forOfflineUse = forOfflineUse;\r\n return this;\r\n }\r\n\r\n isForOfflineUse() {\r\n return !!this.forOfflineUse;\r\n }\r\n\r\n setDryRun(dryRun: boolean): this {\r\n this.dryRun = dryRun;\r\n return this;\r\n }\r\n\r\n isDryRun(): boolean {\r\n return !!this.dryRun;\r\n }\r\n\r\n getParameters(): Parameters {\r\n return this.parameters;\r\n }\r\n\r\n setParameter(productModuleNumber: string, parameter: Parameter): this {\r\n this.parameters[productModuleNumber] = parameter;\r\n return this;\r\n }\r\n\r\n getParameter(productModuleNumber: string): Parameter | undefined {\r\n return this.parameters[productModuleNumber];\r\n }\r\n\r\n getProductModuleValidationParameters(productModuleNumber: string): Parameter | undefined {\r\n return this.getParameter(productModuleNumber);\r\n }\r\n\r\n setProductModuleValidationParameters(productModuleNumber: string, productModuleParameters: Parameter): this {\r\n return this.setParameter(productModuleNumber, productModuleParameters);\r\n }\r\n}\r\n\r\nexport default (): ValidationParametersInstance => new ValidationParameters();\r\n"],"mappings":"AAMA,IAAMA,GAAqB,OAAO,OAAO,CAEvC,SAAU,WACV,WAAY,aACZ,OAAQ,QACV,CAAC,EAEMC,GAAQD,GCPf,IAAME,GAAc,OAAO,OAAO,CAChC,QAAS,UACT,WAAY,aACZ,SAAU,WACV,SAAU,UACZ,CAAC,EAEMC,EAAQD,GCPf,IAAME,GAAoB,OAAO,OAAO,CACtC,iBAAkB,mBAClB,gBAAiB,kBACjB,sBAAuB,wBACvB,8BAA+B,+BACjC,CAAC,EAEMC,EAAQD,GCPf,IAAME,GAAuB,OAAO,OAAO,CACzC,QAAS,SACX,CAAC,EAEMC,EAAQD,GCJf,IAAME,GAAe,OAAO,OAAO,CACjC,qBAAsB,aACtB,sBAAuB,SACvB,yBAA0B,WAC5B,CAAC,EAEMC,EAAQD,GCNf,IAAME,GAAmB,OAAO,OAAO,CACrC,IAAK,M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D,CACvF,OAAO,KAAK,aAAaA,CAAmB,CAC9C,CAEA,qCAAqCA,EAA6BE,EAA0C,CAC1G,OAAO,KAAK,aAAaF,EAAqBE,CAAuB,CACvE,CACF,EAEOC,GAAQ,IAAoC,IAAIZ","names":["LicenseeSecretMode","LicenseeSecretMode_default","LicenseType","LicenseType_default","NotificationEvent","NotificationEvent_default","NotificationProtocol","NotificationProtocol_default","SecurityMode","SecurityMode_default","TimeVolumePeriod","TimeVolumePeriod_default","TokenType","TokenType_default","TransactionSource","TransactionSource_default","TransactionStatus","TransactionStatus_default","constants_default","LicenseeSecretMode_default","LicenseType_default","NotificationEvent_default","NotificationProtocol_default","SecurityMode_default","TimeVolumePeriod_default","TokenType_default","TransactionSource_default","TransactionStatus_default","ApiKeyRole","ApiKeyRole_default","LicensingModel","LicensingModel_default","NodeSecretMode","NodeSecretMode_default","PaymentMethodEnum","PaymentMethodEnum_default","isBooleanString","value","isNullString","isJsonStructure","trimmed","isNumericString","parsed","parseNumber","parseBoolean","parseNull","parseJson","parseAuto","cast","type","cast_default","extractProperties","properties","castMap","result","name","value","cast_default","extractLists","lists","list","itemToObject","item","itemToObject_default","has","obj","key","set","value","get","def","serialize_default","obj","options","map","ignore","k","v","defineEntity","props","methods","proto","options","listeners","base","key","value","set","def","get","has","properties","k","v","serialize_default","obj","prop","receiver","l","defineEntity_default","Bundle","properties","props","defineEntity_default","active","set","def","get","number","name","price","currency","numbers","cast","serialize_default","Bundle_default","itemToBundle_default","item","props","itemToObject_default","licenseTemplateNumbers","staleLicenseTemplateNumbers","Bundle_default","Country","properties","props","defineEntity_default","Country_default","itemToCountry_default","item","Country_default","itemToObject_default","License","properties","props","defineEntity_default","active","set","def","get","number","name","price","currency","hidden","serialize_default","License_default","itemToLicense_default","item","props","itemToObject_default","startDate","License_default","Licensee","properties","props","defineEntity_default","active","set","def","get","number","name","mark","serialize_default","Licensee_default","itemToLicensee_default","item","props","itemToObject_default","aliases","Licensee_default","LicenseTemplate","properties","props","defineEntity_default","active","set","def","get","number","name","type","price","currency","automatic","hidden","hideLicenses","productModuleNumber","serialize_default","LicenseTemplate_default","itemToLicenseTemplate_default","item","LicenseTemplate_default","itemToObject_default","Notification","properties","props","defineEntity_default","active","set","def","get","number","name","protocol","events","event","payload","endpoint","data","serialize_default","Notification_default","itemToNotification_default","item","props","itemToObject_default","events","Notification_default","PaymentMethod","properties","props","defineEntity_default","active","set","def","get","number","PaymentMethod_default","itemToPaymentMethod_default","item","PaymentMethod_default","itemToObject_default","Product","properties","props","defineEntity_default","active","set","def","get","number","name","version","description","licensingInfo","licenseeAutoCreate","discounts","discount","productDiscounts","map","serialize_default","Product_default","AxiosError","NlicError","_NlicError","message","code","config","request","response","stack","ProductDiscount","properties","props","NlicError","defineEntity_default","totalPrice","set","def","get","currency","amountFix","amountPercent","total","amount","obj","prop","ProductDiscount_default","itemToProduct_default","item","props","itemToObject_default","discounts","d","ProductDiscount_default","Product_default","ProductModule","properties","props","defineEntity_default","active","set","def","get","number","name","licensingModel","productNumber","serialize_default","ProductModule_default","itemToProductModule_default","item","ProductModule_default","itemToObject_default","Token","properties","props","defineEntity_default","active","set","def","get","number","expirationTime","tokenType","licenseeNumber","action","apiKeyRole","bundleNumber","bundlePrice","productNumber","predefinedShoppingItem","successURL","successURLTitle","cancelURL","cancelURLTitle","serialize_default","Token_default","itemToToken_default","item","props","itemToObject_default","expirationTime","Token_default","LicenseTransactionJoin","transaction","license","LicenseTransactionJoin_default","Transaction","properties","props","defineEntity_default","active","set","def","get","number","status","source","grandTotal","discount","currency","dateCreated","paymentMethod","joins","clone","serialize_default","Transaction_default","itemToTransaction_default","item","props","itemToObject_default","dateCreated","dateClosed","licenseTransactionJoins","transactionNumber","licenseNumber","transaction","Transaction_default","license","License_default","LicenseTransactionJoin_default","axios","axiosInstance","lastResponse","info","setAxiosInstance","instance","getAxiosInstance","setLastResponse","response","getLastResponse","setInfo","infos","getInfo","package_default","toQueryString_default","data","query","build","obj","keyPrefix","item","key","value","request_default","context","method","endpoint","data","config","headers","package_default","req","d","h","toQueryString_default","SecurityMode_default","NlicError","instance","getAxiosInstance","response","info","setLastResponse","setInfo","eInfo","type","e","error","message","get","context","endpoint","data","config","request_default","post","del","service","instance","setAxiosInstance","getAxiosInstance","getLastResponse","getInfo","context","endpoint","data","config","get","post","del","method","request_default","toQueryString_default","Service_default","encode","filter","key","decode","result","v","name","value","isDefined","value","isValid","ensureNotNull","name","ensureNotEmpty","Page","content","pagination","pageNumber","itemsNumber","totalPages","totalItems","page","obj","prop","receiver","value","Page_default","endpoint","constants_default","endpointObtain","type","bundleService","context","number","config","ensureNotEmpty","item","Service_default","v","itemToBundle_default","filter","data","encode","items","bundles","Page_default","bundle","ensureNotNull","forceCascade","licenseeNumber","itemToLicense_default","BundleService_default","ValidationResults","validation","productModuleNumber","def","ttl","isValid","data","pmNumber","ValidationResults_default","endpoint","constants_default","endpointValidate","endpointTransfer","type","licenseeService","context","number","config","ensureNotEmpty","item","Service_default","v","itemToLicensee_default","filter","data","encode","items","list","Page_default","productNumber","licensee","ensureNotNull","forceCascade","validationParameters","licenseeProperties","key","parameters","pmNumber","i","parameter","response","validationResults","ValidationResults_default","ttl","itemToObject_default","sourceLicenseeNumber","LicenseeService_default","endpoint","constants_default","type","licenseService","context","number","config","ensureNotEmpty","item","Service_default","v","itemToLicense_default","filter","data","encode","items","list","Page_default","licenseeNumber","licenseTemplateNumber","transactionNumber","license","ensureNotNull","forceCascade","LicenseService_default","endpoint","constants_default","type","licenseTemplateService","context","number","config","ensureNotEmpty","item","Service_default","v","itemToLicenseTemplate_default","filter","data","encode","items","list","Page_default","productModuleNumber","licenseTemplate","ensureNotNull","forceCascade","LicenseTemplateService_default","endpoint","constants_default","type","notificationService","context","number","config","ensureNotEmpty","item","Service_default","v","itemToNotification_default","filter","data","encode","items","list","Page_default","notification","ensureNotNull","forceCascade","NotificationService_default","endpoint","constants_default","type","paymentMethodService","context","number","config","ensureNotEmpty","item","Service_default","v","itemToPaymentMethod_default","filter","data","encode","items","list","Page_default","paymentMethod","ensureNotNull","PaymentMethodService_default","endpoint","constants_default","type","productModuleService","context","number","config","ensureNotEmpty","item","Service_default","v","itemToProductModule_default","filter","data","encode","items","list","Page_default","productNumber","productModule","ensureNotNull","forceCascade","ProductModuleService_default","endpoint","constants_default","type","productService","context","number","config","ensureNotEmpty","item","Service_default","v","itemToProduct_default","filter","data","encode","items","list","Page_default","product","ensureNotNull","forceCascade","ProductService_default","endpoint","constants_default","type","tokenService","context","number","config","ensureNotEmpty","item","Service_default","v","itemToToken_default","filter","data","encode","items","list","Page_default","token","ensureNotNull","forceCascade","TokenService_default","endpoint","constants_default","type","transactionService","context","number","config","ensureNotEmpty","item","Service_default","v","itemToTransaction_default","filter","data","encode","items","list","Page_default","transaction","ensureNotNull","TransactionService_default","baseEndpoint","constants_default","utilityService","context","config","endpoint","items","Service_default","type","licenseTypes","v","itemToObject_default","Page_default","licensingModels","filter","data","encode","countries","itemToCountry_default","UtilityService_default","Context","props","SecurityMode_default","baseUrl","securityMode","username","def","password","apiKey","publicKey","Context_default","ValidationParameters","productNumber","licenseeName","licenseeSecret","key","value","def","forOfflineUse","dryRun","productModuleNumber","parameter","productModuleParameters","ValidationParameters_default"]}