netlicensing-client
Version:
JavaScript Wrapper for Labs64 NetLicensing RESTful API
1,281 lines (1,183 loc) • 73.3 kB
TypeScript
import { AxiosInstance, AxiosResponse, Method, AxiosError, InternalAxiosRequestConfig } from 'axios';
declare const _default$g: {
LicenseeSecretMode: Readonly<{
DISABLED: "DISABLED";
PREDEFINED: "PREDEFINED";
CLIENT: "CLIENT";
}>;
LicenseType: Readonly<{
FEATURE: "FEATURE";
TIMEVOLUME: "TIMEVOLUME";
FLOATING: "FLOATING";
QUANTITY: "QUANTITY";
}>;
NotificationEvent: Readonly<{
LICENSEE_CREATED: "LICENSEE_CREATED";
LICENSE_CREATED: "LICENSE_CREATED";
WARNING_LEVEL_CHANGED: "WARNING_LEVEL_CHANGED";
PAYMENT_TRANSACTION_PROCESSED: "PAYMENT_TRANSACTION_PROCESSED";
}>;
NotificationProtocol: Readonly<{
WEBHOOK: "WEBHOOK";
}>;
SecurityMode: Readonly<{
BASIC_AUTHENTICATION: "BASIC_AUTH";
APIKEY_IDENTIFICATION: "APIKEY";
ANONYMOUS_IDENTIFICATION: "ANONYMOUS";
}>;
TimeVolumePeriod: Readonly<{
DAY: "DAY";
WEEK: "WEEK";
MONTH: "MONTH";
YEAR: "YEAR";
}>;
TokenType: Readonly<{
DEFAULT: "DEFAULT";
SHOP: "SHOP";
APIKEY: "APIKEY";
ACTION: "ACTION";
}>;
TransactionSource: Readonly<{
SHOP: "SHOP";
AUTO_LICENSE_CREATE: "AUTO_LICENSE_CREATE";
AUTO_LICENSE_UPDATE: "AUTO_LICENSE_UPDATE";
AUTO_LICENSE_DELETE: "AUTO_LICENSE_DELETE";
AUTO_LICENSEE_CREATE: "AUTO_LICENSEE_CREATE";
AUTO_LICENSEE_DELETE: "AUTO_LICENSEE_DELETE";
AUTO_LICENSEE_VALIDATE: "AUTO_LICENSEE_VALIDATE";
AUTO_LICENSETEMPLATE_DELETE: "AUTO_LICENSETEMPLATE_DELETE";
AUTO_PRODUCTMODULE_DELETE: "AUTO_PRODUCTMODULE_DELETE";
AUTO_PRODUCT_DELETE: "AUTO_PRODUCT_DELETE";
AUTO_LICENSES_TRANSFER: "AUTO_LICENSES_TRANSFER";
SUBSCRIPTION_UPDATE: "SUBSCRIPTION_UPDATE";
RECURRING_PAYMENT: "RECURRING_PAYMENT";
CANCEL_RECURRING_PAYMENT: "CANCEL_RECURRING_PAYMENT";
OBTAIN_BUNDLE: "OBTAIN_BUNDLE";
}>;
TransactionStatus: Readonly<{
PENDING: "PENDING";
CLOSED: "CLOSED";
CANCELLED: "CANCELLED";
}>;
BASIC_AUTHENTICATION: string;
APIKEY_IDENTIFICATION: string;
ANONYMOUS_IDENTIFICATION: string;
FILTER: string;
Product: {
TYPE: string;
ENDPOINT_PATH: string;
};
ProductModule: {
TYPE: string;
ENDPOINT_PATH: string;
PRODUCT_MODULE_NUMBER: string;
};
Licensee: {
TYPE: string;
ENDPOINT_PATH: string;
ENDPOINT_PATH_VALIDATE: string;
ENDPOINT_PATH_TRANSFER: string;
LICENSEE_NUMBER: string;
};
LicenseTemplate: {
TYPE: string;
ENDPOINT_PATH: string;
LicenseType: Readonly<{
FEATURE: "FEATURE";
TIMEVOLUME: "TIMEVOLUME";
FLOATING: "FLOATING";
QUANTITY: "QUANTITY";
}>;
};
License: {
TYPE: string;
ENDPOINT_PATH: string;
};
Validation: {
TYPE: string;
};
Token: {
TYPE: string;
ENDPOINT_PATH: string;
Type: Readonly<{
DEFAULT: "DEFAULT";
SHOP: "SHOP";
APIKEY: "APIKEY";
ACTION: "ACTION";
}>;
};
PaymentMethod: {
TYPE: string;
ENDPOINT_PATH: string;
};
Bundle: {
TYPE: string;
ENDPOINT_PATH: string;
ENDPOINT_OBTAIN_PATH: string;
};
Notification: {
TYPE: string;
ENDPOINT_PATH: string;
Protocol: Readonly<{
WEBHOOK: "WEBHOOK";
}>;
Event: Readonly<{
LICENSEE_CREATED: "LICENSEE_CREATED";
LICENSE_CREATED: "LICENSE_CREATED";
WARNING_LEVEL_CHANGED: "WARNING_LEVEL_CHANGED";
PAYMENT_TRANSACTION_PROCESSED: "PAYMENT_TRANSACTION_PROCESSED";
}>;
};
Transaction: {
TYPE: string;
ENDPOINT_PATH: string;
Status: Readonly<{
PENDING: "PENDING";
CLOSED: "CLOSED";
CANCELLED: "CANCELLED";
}>;
};
Utility: {
ENDPOINT_PATH: string;
ENDPOINT_PATH_LICENSE_TYPES: string;
ENDPOINT_PATH_LICENSING_MODELS: string;
ENDPOINT_PATH_COUNTRIES: string;
LICENSING_MODEL_TYPE: string;
LICENSE_TYPE: string;
COUNTRY_TYPE: string;
};
};
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
declare const ApiKeyRole: Readonly<{
ROLE_APIKEY_LICENSEE: "ROLE_APIKEY_LICENSEE";
ROLE_APIKEY_ANALYTICS: "ROLE_APIKEY_ANALYTICS";
ROLE_APIKEY_OPERATION: "ROLE_APIKEY_OPERATION";
ROLE_APIKEY_MAINTENANCE: "ROLE_APIKEY_MAINTENANCE";
ROLE_APIKEY_ADMIN: "ROLE_APIKEY_ADMIN";
}>;
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
declare const LicenseeSecretMode: Readonly<{
DISABLED: "DISABLED";
PREDEFINED: "PREDEFINED";
CLIENT: "CLIENT";
}>;
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
declare const LicenseType: Readonly<{
FEATURE: "FEATURE";
TIMEVOLUME: "TIMEVOLUME";
FLOATING: "FLOATING";
QUANTITY: "QUANTITY";
}>;
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
declare const LicensingModel: Readonly<{
TRY_AND_BUY: "TryAndBuy";
SUBSCRIPTION: "Subscription";
RENTAL: "Rental";
FLOATING: "Floating";
MULTI_FEATURE: "MultiFeature";
PAY_PER_USE: "PayPerUse";
PRICING_TABLE: "PricingTable";
QUOTA: "Quota";
NODE_LOCKED: "NodeLocked";
DISCOUNT: "Discount";
}>;
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
declare const NodeSecretMode: Readonly<{
PREDEFINED: "PREDEFINED";
CLIENT: "CLIENT";
}>;
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
declare const NotificationEvent: Readonly<{
LICENSEE_CREATED: "LICENSEE_CREATED";
LICENSE_CREATED: "LICENSE_CREATED";
WARNING_LEVEL_CHANGED: "WARNING_LEVEL_CHANGED";
PAYMENT_TRANSACTION_PROCESSED: "PAYMENT_TRANSACTION_PROCESSED";
}>;
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
declare const NotificationProtocol: Readonly<{
WEBHOOK: "WEBHOOK";
}>;
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
declare const PaymentMethodEnum: Readonly<{
NULL: "NULL";
PAYPAL: "PAYPAL";
PAYPAL_SANDBOX: "PAYPAL_SANDBOX";
STRIPE: "STRIPE";
STRIPE_TESTING: "STRIPE_TESTING";
}>;
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
declare const SecurityMode: Readonly<{
BASIC_AUTHENTICATION: "BASIC_AUTH";
APIKEY_IDENTIFICATION: "APIKEY";
ANONYMOUS_IDENTIFICATION: "ANONYMOUS";
}>;
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
declare const TimeVolumePeriod: Readonly<{
DAY: "DAY";
WEEK: "WEEK";
MONTH: "MONTH";
YEAR: "YEAR";
}>;
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
declare const TokenType: Readonly<{
DEFAULT: "DEFAULT";
SHOP: "SHOP";
APIKEY: "APIKEY";
ACTION: "ACTION";
}>;
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
declare const TransactionSource: Readonly<{
SHOP: "SHOP";
AUTO_LICENSE_CREATE: "AUTO_LICENSE_CREATE";
AUTO_LICENSE_UPDATE: "AUTO_LICENSE_UPDATE";
AUTO_LICENSE_DELETE: "AUTO_LICENSE_DELETE";
AUTO_LICENSEE_CREATE: "AUTO_LICENSEE_CREATE";
AUTO_LICENSEE_DELETE: "AUTO_LICENSEE_DELETE";
AUTO_LICENSEE_VALIDATE: "AUTO_LICENSEE_VALIDATE";
AUTO_LICENSETEMPLATE_DELETE: "AUTO_LICENSETEMPLATE_DELETE";
AUTO_PRODUCTMODULE_DELETE: "AUTO_PRODUCTMODULE_DELETE";
AUTO_PRODUCT_DELETE: "AUTO_PRODUCT_DELETE";
AUTO_LICENSES_TRANSFER: "AUTO_LICENSES_TRANSFER";
SUBSCRIPTION_UPDATE: "SUBSCRIPTION_UPDATE";
RECURRING_PAYMENT: "RECURRING_PAYMENT";
CANCEL_RECURRING_PAYMENT: "CANCEL_RECURRING_PAYMENT";
OBTAIN_BUNDLE: "OBTAIN_BUNDLE";
}>;
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
declare const TransactionStatus: Readonly<{
PENDING: "PENDING";
CLOSED: "CLOSED";
CANCELLED: "CANCELLED";
}>;
interface Info {
id: string;
type: 'ERROR' | 'WARNING' | 'INFO';
value: string;
}
interface List {
property: {
value: string;
name: string;
}[];
list: List[];
name: string;
}
interface Item {
property: {
value: string;
name: string;
}[];
list: List[];
type: string;
}
interface ItemPagination {
pagenumber: string | null;
itemsnumber: string | null;
totalpages: string | null;
totalitems: string | null;
hasnext: string | null;
}
type Items = {
item: Item[];
} & ItemPagination;
interface NlicResponse {
signature: null | string;
infos: {
info: Info[];
};
items: Items | null;
ttl: string | null;
}
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
type ApiKeyRoleKeys = keyof typeof ApiKeyRole;
type ApiKeyRoleValues = (typeof ApiKeyRole)[ApiKeyRoleKeys];
type LicenseeSecretModeKeys = keyof typeof LicenseeSecretMode;
type LicenseeSecretModeValues = (typeof LicenseeSecretMode)[LicenseeSecretModeKeys];
type NodeSecretModeKeys = keyof typeof NodeSecretMode;
type NodeSecretModeValues = (typeof NodeSecretMode)[NodeSecretModeKeys];
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
type LicenseTypeKeys = keyof typeof LicenseType;
type LicenseTypeValues = (typeof LicenseType)[LicenseTypeKeys];
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
type LicensingModelKeys = keyof typeof LicensingModel;
type LicensingModelValues = (typeof LicensingModel)[LicensingModelKeys];
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
type NotificationEventKeys = keyof typeof NotificationEvent;
type NotificationEventValues = (typeof NotificationEvent)[NotificationEventKeys];
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
type NotificationProtocolKeys = keyof typeof NotificationProtocol;
type NotificationProtocolValues = (typeof NotificationProtocol)[NotificationProtocolKeys];
type PaymentMethodKeys = keyof typeof PaymentMethodEnum;
type PaymentMethodValues = (typeof PaymentMethodEnum)[PaymentMethodKeys];
type SecurityModeKeys = keyof typeof SecurityMode;
type SecurityModeValues = (typeof SecurityMode)[SecurityModeKeys];
type TimeVolumePeriodKeys = keyof typeof TimeVolumePeriod;
type TimeVolumePeriodValues = (typeof TimeVolumePeriod)[TimeVolumePeriodKeys];
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
type TokenTypeKeys = keyof typeof TokenType;
type TokenTypeValues = (typeof TokenType)[TokenTypeKeys];
type TransactionSourceKeys = keyof typeof TransactionSource;
type TransactionSourceValues = (typeof TransactionSource)[TransactionSourceKeys];
type TransactionStatusKeys = keyof typeof TransactionStatus;
type TransactionStatusValues = (typeof TransactionStatus)[TransactionStatusKeys];
type RequiredProps<Base, Keys extends keyof Base> = Required<Pick<Base, Keys>>;
type DateField = Date | 'now';
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
interface EntityMethods<T extends object> {
set<K extends keyof T>(key: K, value: T[K]): void;
get<K extends keyof T, D = undefined>(key: K, def?: D): T[K] | D;
has<K extends keyof T>(key: K): boolean;
setProperty<K extends keyof T>(key: K, value: T[K]): void;
addProperty<K extends keyof T>(key: K, value: T[K]): void;
getProperty<K extends keyof T, D = undefined>(key: K, def?: D): T[K] | D;
hasProperty<K extends keyof T>(key: K): boolean;
setProperties(properties: Partial<T>): void;
serialize(): Record<string, string>;
}
interface Proto {
prototype: object;
}
type PropGetEventListener<T> = (obj: T, prop: string | symbol, receiver: unknown) => void;
type PropSetEventListener<T> = (obj: T, prop: string | symbol, value: unknown, receiver: unknown) => void;
type Entity<T extends object, M extends object> = T & M & EntityMethods<T>;
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
interface CountryProps {
readonly code: string;
readonly name: string;
readonly vatPercent?: number;
readonly isEu: boolean;
}
interface CountryMethods {
getCode(): string;
getName(): string;
getVatPercent(): number;
getIsEu(): boolean;
}
type CountryEntity = Entity<CountryProps, CountryMethods>;
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
type LicenseProps<T extends object = object> = {
active?: boolean;
number?: string;
name?: string;
price?: number;
currency?: string;
hidden?: boolean;
licenseeNumber?: string;
licenseTemplateNumber?: string;
productModuleNumber?: string;
readonly inUse?: boolean;
} & T;
type SavedLicenseProps<T extends object = object> = RequiredProps<LicenseProps, 'active' | 'number'> & LicenseProps<T>;
interface LicenseMethods {
setActive(active: boolean): void;
getActive<D = undefined>(def?: D): boolean | D;
setNumber(number: string): void;
getNumber<D = undefined>(def?: D): string | D;
setName(name: string): void;
getName<D = undefined>(def?: D): string | D;
setPrice(price: number): void;
getPrice<D = undefined>(def?: D): number | D;
setCurrency(currency: string): void;
getCurrency<D = undefined>(def?: D): string | D;
setHidden(hidden: boolean): void;
getHidden<D = undefined>(def?: D): boolean | D;
setLicenseeNumber(number: string): void;
getLicenseeNumber<D = undefined>(def?: D): string | D;
setLicenseTemplateNumber(number: string): void;
getLicenseTemplateNumber<D = undefined>(def?: D): string | D;
setProductModuleNumber(number: string): void;
getProductModuleNumber<D = undefined>(def?: D): string | D;
serialize(): Record<string, string>;
}
type LicenseEntity<T extends object = object> = Entity<LicenseProps<T>, LicenseMethods>;
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
interface WarningLevelSummary {
RED: string[];
YELLOW: string[];
GREEN: string[];
}
type LicenseeProps<T extends object = object> = {
active?: boolean;
number?: string;
name?: string;
markedForTransfer?: boolean;
productNumber?: string;
aliases?: string[];
readonly inUse?: boolean;
readonly warningLevelSummary?: WarningLevelSummary;
} & T;
type SavedLicenseeProps<T extends object = object> = RequiredProps<LicenseeProps, 'active' | 'number' | 'productNumber' | 'inUse' | 'warningLevelSummary'> & LicenseeProps<T>;
interface LicenseeMethods {
setActive(active: boolean): void;
getActive<D = undefined>(def?: D): boolean | D;
setNumber(number: string): void;
getNumber<D = undefined>(def?: D): string | D;
setName(name: string): void;
getName<D = undefined>(def?: D): string | D;
setProductNumber(number: string): void;
getProductNumber<D = undefined>(def?: D): string | D;
setMarkedForTransfer(mark: boolean): void;
getMarkedForTransfer<D = undefined>(def?: D): boolean | D;
serialize(): Record<string, string>;
}
type LicenseeEntity<T extends object = object> = Entity<LicenseeProps<T>, LicenseeMethods>;
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
type LicenseTemplateProps<T extends object = object> = {
active?: boolean;
number?: string;
name?: string;
licenseType?: LicenseTypeValues;
price?: number;
currency?: string;
automatic?: boolean;
hidden?: boolean;
hideLicenses?: boolean;
productModuleNumber?: string;
readonly inUse?: boolean;
} & T;
type SavedLicenseTemplateProps<T extends object = object> = RequiredProps<LicenseTemplateProps, 'active' | 'number' | 'licenseType'> & LicenseTemplateProps<T>;
interface LicenseTemplateMethods {
setActive(active: boolean): void;
getActive<D = undefined>(def?: D): boolean | D;
setNumber(number: string): void;
getNumber<D = undefined>(def?: D): string | D;
setName(name: string): void;
getName<D = undefined>(def?: D): string | D;
setLicenseType(type: LicenseTypeValues): void;
getLicenseType<D = undefined>(def?: D): LicenseTypeValues | D;
setPrice(price: number): void;
getPrice<D = undefined>(def?: D): number | D;
setCurrency(currency: string): void;
getCurrency<D = undefined>(def?: D): string | D;
setAutomatic(automatic: boolean): void;
getAutomatic<D = undefined>(def?: D): boolean | D;
setHidden(hidden: boolean): void;
getHidden<D = undefined>(def?: D): boolean | D;
setHideLicenses(hideLicenses: boolean): void;
getHideLicenses<D = undefined>(def?: D): boolean | D;
setProductModuleNumber(productModuleNumber: string): void;
getProductModuleNumber<D = undefined>(def?: D): string | D;
serialize(): Record<string, string>;
}
type LicenseTemplateEntity<T extends object = object> = Entity<LicenseTemplateProps<T>, LicenseTemplateMethods>;
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
type TransactionProps<T extends object = object> = {
active?: boolean;
number?: string;
status?: TransactionStatusValues;
source?: TransactionSourceValues;
grandTotal?: number;
discount?: number;
currency?: string;
dateCreated?: Date;
dateClosed?: Date;
paymentMethod?: PaymentMethodValues;
licenseTransactionJoins?: LicenseTransactionJoinEntity[];
readonly inUse?: boolean;
} & T;
type SavedTransactionProps<T extends object = object> = RequiredProps<TransactionProps, 'active' | 'number' | 'status' | 'dateCreated'> & TransactionProps<T>;
interface TransactionMethods {
setActive(active: boolean): void;
getActive<D = undefined>(def?: D): boolean | D;
setNumber(number: string): void;
getNumber<D = undefined>(def?: D): string | D;
setStatus(status: TransactionStatusValues): void;
getStatus<D = undefined>(def?: D): TransactionStatusValues | D;
setSource(source: TransactionSourceValues): void;
getSource<D = undefined>(def?: D): TransactionSourceValues | D;
setGrandTotal(grandTotal: number): void;
getGrandTotal<D = undefined>(def?: D): number | D;
setDiscount(discount: number): void;
getDiscount<D = undefined>(def?: D): number | D;
setCurrency(currency: string): void;
getCurrency<D = undefined>(def?: D): string | D;
setDateCreated(dateCreated: Date): void;
getDateCreated<D = undefined>(def?: D): Date | D;
setDateClosed(dateCreated: Date): void;
getDateClosed<D = undefined>(def?: D): Date | D;
setPaymentMethod(paymentMethod: PaymentMethodValues): void;
getPaymentMethod<D = undefined>(def?: D): PaymentMethodValues | D;
setLicenseTransactionJoins(joins: LicenseTransactionJoinEntity[]): void;
getLicenseTransactionJoins<D = undefined>(def?: D): LicenseTransactionJoinEntity[] | D;
serialize(): Record<string, string>;
}
type TransactionEntity<T extends object = object> = Entity<TransactionProps<T>, TransactionMethods>;
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
interface LicenseTransactionJoinProps {
transaction: TransactionEntity;
license: LicenseEntity;
}
interface LicenseTransactionJoinMethods {
setTransaction(t: TransactionEntity): void;
getTransaction(): TransactionEntity;
setLicense(l: LicenseEntity): void;
getLicense(): LicenseEntity;
}
type LicenseTransactionJoinEntity = LicenseTransactionJoinProps & LicenseTransactionJoinMethods;
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
type NotificationProps<T extends object = object> = {
active?: boolean;
number?: string;
name?: string;
protocol?: NotificationProtocolValues;
events?: NotificationEventValues[];
payload?: string;
endpoint?: string;
} & T;
type SavedNotificationProps<T extends object = object> = RequiredProps<NotificationProps, 'active' | 'number' | 'name' | 'protocol' | 'events' | 'endpoint'> & NotificationProps<T>;
interface NotificationMethods {
setActive(active: boolean): void;
getActive<D = undefined>(def?: D): boolean | D;
setNumber(number: string): void;
getNumber<D = undefined>(def?: D): string | D;
setName(name: string): void;
getName<D = undefined>(def?: D): string | D;
setProtocol(protocol: NotificationProtocolValues): void;
getProtocol<D = undefined>(def?: D): NotificationProtocolValues | D;
setEvents(events: NotificationEventValues[]): void;
getEvents<D = undefined>(def?: D): NotificationEventValues[] | D;
addEvent(event: NotificationEventValues): void;
setPayload(payload: string): void;
getPayload<D = undefined>(def?: D): string | D;
setEndpoint(endpoint: string): void;
getEndpoint<D = undefined>(def?: D): string | D;
serialize(): Record<string, string>;
}
type NotificationEntity<T extends object = object> = Entity<NotificationProps<T>, NotificationMethods>;
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
type PaymentMethodProps<T = object> = T & {
active?: boolean;
number?: string;
};
type SavedPaymentMethodProps<T extends object = object> = RequiredProps<PaymentMethodProps, 'active' | 'number'> & PaymentMethodProps<T>;
interface PaymentMethodMethods {
setActive(active: boolean): void;
getActive<D = undefined>(def?: D): boolean | D;
setNumber(number: string): void;
getNumber<D = undefined>(def?: D): string | D;
}
type PaymentMethodEntity<T = object> = Entity<PaymentMethodProps<T>, PaymentMethodMethods>;
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
interface ProductDiscountProps {
totalPrice?: number;
currency?: string;
amountFix?: number;
amountPercent?: number;
}
interface ProductDiscountMethods {
setTotalPrice(totalPrice: number): void;
getTotalPrice<D = undefined>(def?: D): number | D;
setCurrency(currency: string): void;
getCurrency<D = undefined>(def?: D): string | D;
setAmountFix(amountFix: number): void;
getAmountFix<D = undefined>(def?: D): number | D;
setAmountPercent(amountPercent: number): void;
getAmountPercent<D = undefined>(def?: D): number | D;
toString(): string;
}
type ProductDiscountEntity = Entity<ProductDiscountProps, ProductDiscountMethods>;
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
type ProductProps<T extends object = object> = {
active?: boolean;
number?: string;
name?: string;
version?: string;
description?: string;
licensingInfo?: string;
licenseeAutoCreate?: boolean;
discounts?: ProductDiscountEntity[];
readonly inUse?: boolean;
} & T;
type SavedProductProps<T extends object = object> = RequiredProps<ProductProps, 'active' | 'number' | 'inUse'> & ProductProps<T>;
interface ProductMethods {
setActive(active: boolean): void;
getActive<D = undefined>(def?: D): boolean | D;
setNumber(number: string): void;
getNumber<D = undefined>(def?: D): string | D;
setName(name: string): void;
getName<D = undefined>(def?: D): string | D;
setVersion(version: string): void;
getVersion<D = undefined>(def?: D): string | number | D;
setDescription(description: string): void;
getDescription<D = undefined>(def?: D): string | D;
setLicensingInfo(licensingInfo: string): void;
getLicensingInfo<D = undefined>(def?: D): string | D;
setLicenseeAutoCreate(licenseeAutoCreate: boolean): void;
getLicenseeAutoCreate<D = undefined>(def?: D): boolean | D;
setDiscounts(discounts: ProductDiscountEntity[]): void;
getDiscounts<D = undefined>(def?: D): ProductDiscountEntity[] | D;
addDiscount(discount: ProductDiscountEntity): void;
removeDiscount(discount: ProductDiscountEntity): void;
setProductDiscounts(productDiscounts: ProductDiscountEntity[]): void;
getProductDiscounts<D = undefined>(def?: D): ProductDiscountEntity[] | D;
serialize(): Record<string, string | string[]>;
}
type ProductEntity<T extends object = object> = Entity<ProductProps<T>, ProductMethods>;
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
type ProductModuleProps<T extends object = object> = {
active?: boolean;
number?: string;
name?: string;
licensingModel?: LicensingModelValues;
productNumber?: string;
readonly inUse?: boolean;
} & T;
type SavedProductModuleProps<T extends object = object> = RequiredProps<ProductModuleProps, 'active' | 'number' | 'licensingModel' | 'productNumber' | 'inUse'> & ProductModuleProps<T>;
interface ProductModuleMethods {
setActive(active: boolean): void;
getActive<D = undefined>(def?: D): boolean | D;
setNumber(number: string): void;
getNumber<D = undefined>(def?: D): string | D;
setName(name: string): void;
getName<D = undefined>(def?: D): string | D;
setLicensingModel(licensingModel: LicensingModelValues): void;
getLicensingModel<D = undefined>(def?: D): LicensingModelValues | D;
setProductNumber(productNumber: string): void;
getProductNumber<D = undefined>(def?: D): string | D;
serialize(): Record<string, string>;
}
type ProductModuleEntity<T extends object = object> = Entity<ProductModuleProps<T>, ProductModuleMethods>;
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
type TokenProps<T extends object = object> = {
active?: boolean;
number?: string;
expirationTime?: Date;
tokenType?: TokenTypeValues;
licenseeNumber?: string;
action?: string;
apiKeyRole?: ApiKeyRoleValues;
bundleNumber?: string;
bundlePrice?: number;
productNumber?: string;
predefinedShoppingItem?: string;
successURL?: string;
successURLTitle?: string;
cancelURL?: string;
cancelURLTitle?: string;
readonly shopURL?: string;
} & T;
type SavedTokenProps<T extends object = object> = RequiredProps<TokenProps, 'active' | 'number' | 'tokenType'> & TokenProps<T>;
interface TokenMethods {
setActive(active: boolean): void;
getActive<D = undefined>(def?: D): boolean | D;
setNumber(number: string): void;
getNumber<D = undefined>(def?: D): string | D;
setExpirationTime(expirationTime: Date): void;
getExpirationTime<D = undefined>(def?: D): Date | D;
setTokenType(tokenType: TokenTypeValues): void;
getTokenType<D = undefined>(def?: D): TokenTypeValues | D;
setLicenseeNumber(licenseeNumber: string): void;
getLicenseeNumber<D = undefined>(def?: D): string | D;
setAction(action: string): void;
getAction<D = undefined>(def?: D): string | D;
setApiKeyRole(apiKeyRole: ApiKeyRoleValues): void;
getApiKeyRole<D = undefined>(def?: D): ApiKeyRoleValues | D;
setBundleNumber(bundleNumber: string): void;
getBundleNumber<D = undefined>(def?: D): string | D;
setBundlePrice(bundlePrice: number): void;
getBundlePrice<D = undefined>(def?: D): number | D;
setProductNumber(productNumber: string): void;
getProductNumber<D = undefined>(def?: D): string | D;
setPredefinedShoppingItem(predefinedShoppingItem: string): void;
getPredefinedShoppingItem<D = undefined>(def?: D): string | D;
setSuccessURL(successURL: string): void;
getSuccessURL<D = undefined>(def?: D): string | D;
setSuccessURLTitle(successURLTitle: string): void;
getSuccessURLTitle<D = undefined>(def?: D): string | D;
setCancelURL(cancelURL: string): void;
getCancelURL<D = undefined>(def?: D): string | D;
setCancelURLTitle(cancelURLTitle: string): void;
getCancelURLTitle<D = undefined>(def?: D): string | D;
getShopURL<D = undefined>(def?: D): string | D;
serialize(): Record<string, string>;
}
type TokenEntity<T extends object = object> = Entity<TokenProps<T>, TokenMethods>;
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
interface ContextConfig {
baseUrl?: string;
securityMode?: SecurityModeValues;
username?: string;
password?: string;
apiKey?: string;
publicKey?: string;
}
interface ContextInstance extends ContextConfig {
baseUrl: string;
securityMode: SecurityModeValues;
setBaseUrl(baseUrl: string): this;
getBaseUrl(): string;
setSecurityMode(securityMode: SecurityModeValues): this;
getSecurityMode(): SecurityModeValues;
setUsername(username: string): this;
getUsername<D = undefined>(def?: D): string | D;
setPassword(password: string): this;
getPassword<D = undefined>(def?: D): string | D;
setApiKey(apiKey: string): this;
getApiKey<D = undefined>(def?: D): string | D;
setPublicKey(publicKey: string): this;
getPublicKey<D = undefined>(def?: D): string | D;
}
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
type AxiosRequestClient = Pick<AxiosInstance, 'request'>;
interface RequestConfig {
onInfo?: (info: Info[]) => void;
onResponse?: (response: AxiosResponse) => void;
axiosInstance?: AxiosRequestClient;
}
interface IService {
setAxiosInstance(this: void, instance: AxiosRequestClient): void;
getAxiosInstance(this: void): AxiosRequestClient;
getLastHttpRequestInfo(this: void): AxiosResponse | null;
getInfo(this: void): Info[];
/**
* this: void
* @param context
* @param endpoint
* @param data
* @param config
*/
get(this: void, context: ContextInstance, endpoint: string, data?: Record<string, unknown>, config?: RequestConfig): Promise<AxiosResponse<NlicResponse>>;
post(this: void, context: ContextInstance, endpoint: string, data?: Record<string, unknown>, config?: RequestConfig): Promise<AxiosResponse<NlicResponse>>;
delete(this: void, context: ContextInstance, endpoint: string, data?: Record<string, unknown>, config?: RequestConfig): Promise<AxiosResponse<NlicResponse>>;
request(this: void, context: ContextInstance, method: Method, endpoint: string, data?: Record<string, unknown>, config?: RequestConfig): Promise<AxiosResponse<NlicResponse>>;
toQueryString<T extends Record<string, unknown>>(data: T): string;
}
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
interface Pagination {
pageNumber: number;
itemsNumber: number;
totalPages: number;
totalItems: number;
hasNext: boolean;
}
interface PaginationMethods<T extends object> {
getContent(): T;
getPagination(): Pagination;
getPageNumber(): number;
getItemsNumber(): number;
getTotalPages(): number;
getTotalItems(): number;
hasNext(): boolean;
}
type PageInstance<T extends object> = PaginationMethods<T> & T;
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
interface IBundleService {
get<T extends object = BundleProps>(context: ContextInstance, number: string, config?: RequestConfig): Promise<BundleEntity<SavedBundleProps<T>>>;
list<T extends object = BundleProps>(context: ContextInstance, filter?: Record<string, string | boolean | number> | string | null, config?: RequestConfig): Promise<PageInstance<BundleEntity<SavedBundleProps<T>>[]>>;
create<T extends object = BundleProps>(context: ContextInstance, bundle: BundleEntity<T>, config?: RequestConfig): Promise<BundleEntity<SavedBundleProps<T>>>;
update<T extends object = BundleProps>(context: ContextInstance, number: string, bundle: BundleEntity<T>, config?: RequestConfig): Promise<BundleEntity<SavedBundleProps<T>>>;
delete(context: ContextInstance, number: string, forceCascade?: boolean, config?: RequestConfig): Promise<AxiosResponse<NlicResponse>>;
obtain<T extends object = LicenseProps>(context: ContextInstance, number: string, licenseeNumber: string, config?: RequestConfig): Promise<LicenseEntity<SavedLicenseProps<T>>[]>;
}
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
type Parameter = Record<string, string>;
type Parameters = Record<string, Parameter>;
interface LicenseeProperties {
licenseeName?: string;
licenseeSecret?: string;
[key: string]: string | undefined;
}
interface ValidationParametersInstance {
productNumber?: string;
dryRun?: boolean;
forOfflineUse?: boolean;
licenseeProperties: LicenseeProperties;
parameters: Parameters;
setProductNumber(productNumber: string): this;
getProductNumber(): string | undefined;
setLicenseeName(name: string): this;
getLicenseeName(): string | undefined;
setLicenseeSecret(secret: string): this;
getLicenseeSecret(): string | undefined;
getLicenseeProperties(): LicenseeProperties;
setLicenseeProperty(key: string, value: string): this;
getLicenseeProperty<D = undefined>(key: string, def?: D): string | D;
setForOfflineUse(forOfflineUse: boolean): this;
isForOfflineUse(): boolean;
setDryRun(dryRun: boolean): this;
isDryRun(): boolean;
setParameter(productModuleNumber: string, parameter: Parameter): this;
getParameters(): Parameters;
getParameter(productModuleNumber: string): Parameter | undefined;
setProductModuleValidationParameters(productModuleNumber: string, productModuleParameters: Parameter): this;
getProductModuleValidationParameters(productModuleNumber: string): Parameter | undefined;
}
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
interface ProductModuleValidation {
productModuleNumber: string;
[key: string]: string;
}
interface ValidationResultsInstance {
readonly validations: Record<string, ProductModuleValidation>;
ttl?: Date;
getValidators(): Record<string, ProductModuleValidation>;
setValidation(validation: ProductModuleValidation): this;
getValidation<D = undefined>(productModuleNumber: string, def?: D): ProductModuleValidation | D;
setProductModuleValidation(validation: ProductModuleValidation): this;
getProductModuleValidation<D = undefined>(productModuleNumber: string, def?: D): ProductModuleValidation | D;
setTtl(ttl: Date | string): this;
getTtl(): Date | undefined;
toString(): string;
}
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
interface ILicenseeService {
get<T extends object = LicenseeProps>(context: ContextInstance, number: string, config?: RequestConfig): Promise<LicenseeEntity<SavedLicenseeProps<T>>>;
list<T extends object = LicenseeProps>(context: ContextInstance, filter?: Record<string, string | boolean | number> | string | null, config?: RequestConfig): Promise<PageInstance<LicenseeEntity<SavedLicenseeProps<T>>[]>>;
create<T extends object = LicenseeProps>(context: ContextInstance, productNumber: string, licensee: LicenseeEntity<T>, config?: RequestConfig): Promise<LicenseeEntity<SavedLicenseeProps<T>>>;
update<T extends object = LicenseeProps>(context: ContextInstance, number: string, licensee: LicenseeEntity<T>, config?: RequestConfig): Promise<LicenseeEntity<SavedLicenseeProps<T>>>;
delete(context: ContextInstance, number: string, forceCascade?: boolean, config?: RequestConfig): Promise<AxiosResponse<NlicResponse>>;
validate(context: ContextInstance, number: string, parameters?: ValidationParametersInstance, config?: RequestConfig): Promise<ValidationResultsInstance>;
transfer(context: ContextInstance, number: string, sourceLicenseeNumber: string, config?: RequestConfig): Promise<AxiosResponse<NlicResponse>>;
}
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
interface ILicenseService {
get<T extends object = LicenseProps>(context: ContextInstance, number: string, config?: RequestConfig): Promise<LicenseEntity<SavedLicenseProps<T>>>;
list<T extends object = LicenseProps>(context: ContextInstance, filter?: Record<string, string | boolean | number> | string | null, config?: RequestConfig): Promise<PageInstance<LicenseEntity<SavedLicenseProps<T>>[]>>;
create<T extends object = LicenseProps>(context: ContextInstance, licenseeNumber: string | null, licenseTemplateNumber: string | null, transactionNumber: string | null, license: LicenseEntity<T>, config?: RequestConfig): Promise<LicenseEntity<SavedLicenseProps<T>>>;
update<T extends object = LicenseProps>(context: ContextInstance, number: string, transactionNumber: string | null, license: LicenseEntity<T>, config?: RequestConfig): Promise<LicenseEntity<SavedLicenseProps<T>>>;
delete(context: ContextInstance, number: string, forceCascade?: boolean, config?: RequestConfig): Promise<AxiosResponse<NlicResponse>>;
}
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
interface ILicenseTemplateService {
get<T extends object = LicenseTemplateProps>(context: ContextInstance, number: string, config?: RequestConfig): Promise<LicenseTemplateEntity<SavedLicenseTemplateProps<T>>>;
list<T extends object = LicenseTemplateProps>(context: ContextInstance, filter?: Record<string, string | boolean | number> | string | null, config?: RequestConfig): Promise<PageInstance<LicenseTemplateEntity<SavedLicenseTemplateProps<T>>[]>>;
create<T extends object = LicenseTemplateProps>(context: ContextInstance, productModuleNumber: string | null, licenseTemplate: LicenseTemplateEntity<T>, config?: RequestConfig): Promise<LicenseTemplateEntity<SavedLicenseTemplateProps<T>>>;
update<T extends object = LicenseTemplateProps>(context: ContextInstance, number: string, licenseTemplate: LicenseTemplateEntity<T>, config?: RequestConfig): Promise<LicenseTemplateEntity<SavedLicenseTemplateProps<T>>>;
delete(context: ContextInstance, number: string, forceCascade?: boolean, config?: RequestConfig): Promise<AxiosResponse<NlicResponse>>;
}
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
interface INotificationService {
get<T extends object = NotificationProps>(context: ContextInstance, number: string, config?: RequestConfig): Promise<NotificationEntity<SavedNotificationProps<T>>>;
list<T extends object = NotificationProps>(context: ContextInstance, filter?: Record<string, string | boolean | number> | string | null, config?: RequestConfig): Promise<PageInstance<NotificationEntity<SavedNotificationProps<T>>[]>>;
create<T extends object = NotificationProps>(context: ContextInstance, notification: NotificationEntity<T>, config?: RequestConfig): Promise<NotificationEntity<SavedNotificationProps<T>>>;
update<T extends object = NotificationProps>(context: ContextInstance, number: string, notification: NotificationEntity<T>, config?: RequestConfig): Promise<NotificationEntity<SavedNotificationProps<T>>>;
delete(context: ContextInstance, number: string, forceCascade?: boolean, config?: RequestConfig): Promise<AxiosResponse<NlicResponse>>;
}
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
interface IPaymentMethodService {
get<T extends object = PaymentMethodProps>(context: ContextInstance, number: string, config?: RequestConfig): Promise<PaymentMethodEntity<SavedPaymentMethodProps<T>>>;
list<T extends object = PaymentMethodProps>(context: ContextInstance, filter?: Record<string, string | boolean | number> | string | null, config?: RequestConfig): Promise<PageInstance<PaymentMethodEntity<SavedPaymentMethodProps<T>>[]>>;
update<T extends object = PaymentMethodProps>(context: ContextInstance, number: string, paymentMethod: PaymentMethodEntity<T>, config?: RequestConfig): Promise<PaymentMethodEntity<SavedPaymentMethodProps<T>>>;
}
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
interface IProductModuleService {
get<T extends object = ProductModuleProps>(context: ContextInstance, number: string, config?: RequestConfig): Promise<ProductModuleEntity<SavedProductModuleProps<T>>>;
list<T extends object = ProductModuleProps>(context: ContextInstance, filter?: Record<string, string | boolean | number> | string | null, config?: RequestConfig): Promise<PageInstance<ProductModuleEntity<SavedProductModuleProps<T>>[]>>;
create<T extends object = ProductModuleProps>(context: ContextInstance, productNumber: string | null, productModule: ProductModuleEntity<T>, config?: RequestConfig): Promise<ProductModuleEntity<SavedProductModuleProps<T>>>;
update<T extends object = ProductModuleProps>(context: ContextInstance, number: string, productModule: ProductModuleEntity<T>, config?: RequestConfig): Promise<ProductModuleEntity<SavedProductModuleProps<T>>>;
delete(context: ContextInstance, number: string, forceCascade?: boolean, config?: RequestConfig): Promise<AxiosResponse<NlicResponse>>;
}
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
interface IProductService {
get<T extends object = ProductProps>(context: ContextInstance, number: string, config?: RequestConfig): Promise<ProductEntity<SavedProductProps<T>>>;
list<T extends object = ProductProps>(context: ContextInstance, filter?: Record<string, string | boolean | number> | string | null, config?: RequestConfig): Promise<PageInstance<ProductEntity<SavedProductProps<T>>[]>>;
create<T extends object = ProductProps>(context: ContextInstance, product: ProductEntity<T>, config?: RequestConfig): Promise<ProductEntity<SavedProductProps<T>>>;
update<T extends object = ProductProps>(context: ContextInstance, number: string, product: ProductEntity<T>, config?: RequestConfig): Promise<ProductEntity<SavedProductProps<T>>>;
delete(context: ContextInstance, number: string, forceCascade?: boolean, config?: RequestConfig): Promise<AxiosResponse<NlicResponse>>;
}
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
interface ITokenService {
get<T extends object = TokenProps>(context: ContextInstance, number: string, config?: RequestConfig): Promise<TokenEntity<SavedTokenProps<T>>>;
list<T extends object = TokenProps>(context: ContextInstance, filter?: Record<string, string | boolean | number> | string | null, config?: RequestConfig): Promise<PageInstance<TokenEntity<SavedTokenProps<T>>[]>>;
create<T extends object = TokenProps>(context: ContextInstance, token: TokenEntity<T>, config?: RequestConfig): Promise<TokenEntity<SavedTokenProps<T>>>;
delete(context: ContextInstance, number: string, forceCascade?: boolean, config?: RequestConfig): Promise<AxiosResponse<NlicResponse>>;
}
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
interface ITransactionService {
get<T extends object = TransactionProps>(context: ContextInstance, number: string, config?: RequestConfig): Promise<TransactionEntity<SavedTransactionProps<T>>>;
list<T extends object = TransactionProps>(context: ContextInstance, filter?: Record<string, string | boolean | number> | string | null, config?: RequestConfig): Promise<PageInstance<TransactionEntity<SavedTransactionProps<T>>[]>>;
create<T extends object = TransactionProps>(context: ContextInstance, transaction: TransactionEntity<T>, config?: RequestConfig): Promise<TransactionEntity<SavedTransactionProps<T>>>;
update<T extends object = TransactionProps>(context: ContextInstance, number: string, transaction: TransactionEntity<T>, config?: RequestConfig): Promise<TransactionEntity<SavedTransactionProps<T>>>;
}
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
interface IUtilityService {
listLicenseTypes(context: ContextInstance, config?: RequestConfig): Promise<PageInstance<LicenseTypeValues[]>>;
listLicensingModels(context: ContextInstance, config?: RequestConfig): Promise<PageInstance<LicensingModelValues[]>>;
listCountries(context: ContextInstance, filter?: Record<string, string | boolean | number> | string | null, config?: RequestConfig): Promise<PageInstance<CountryEntity[]>>;
}
/**
* @author Labs64 <netlicensing@labs64.com>
* @license Apache-2.0
* @link https://netlicensing.io
* @copyright 2017 Labs64 NetLicensing
*/
type BundleProps<T extends object = object> = T & {
active?: boolean;
number?: string;
name?: string;
price?: number;
currency?: string;
productNumber?: string;
licenseTemplateNumbers?: string[];
readonly staleLicenseTemplateNumbers?: string[];
};
type SavedBundleProps<T extends object = object> = RequiredProps<BundleProps, 'active' | 'number' | 'name'> & BundleProps<T>;
interface BundleMethods {
setActive(active: boolean): void;
getActive<D = undefined>(def?: D): boolean | D;
setNumber(number: string): void;
getNumber<D = undefined>(def?: D): string | D;
setName(name: string): void;
getName<D = undefined>(def?: D): string | D;
setPrice(price: number): void;
getPrice<D = undefined>(def?: D): number | D;
setCurrency(currency: string): void;
getCurrency<D = undefined>(def?: D): string | D;
setProductNumber(number: string): void;
getProductNumber<D = undefined>(def?: D): string | D;
setLicenseTemplateNumbers(numbers: string[]): void;
getLicenseTemplateNumbers<D = undefined>(def?: D): string[] | D;
addLicenseTemplateNumber(number: string): void;
removeLicenseTemplateNumber(number: string): void;
getStaleLicenseTemplateNumbers<D = undefined>(def?: D): string[] | D;
serialize(): Record<string, string>;
}
type BundleEntity<T extends object = object> = Entity<BundleProps<T>, BundleMethods>;
declare const _default$f: <T extends object = BundleProps>(item?: Item) => BundleEntity<T>;
declare const _default$e: (item?: Item) => CountryEntity;
declare const _default$d: <T extends object = LicenseProps>(item?: Item) => LicenseEntity<T>;
declare const _default$c: <T extends object = LicenseeProps>(item?: Item) => LicenseeEntity<T>;
declare const _default$b: <T extends object = LicenseTemplateProps>(item?: Item) => LicenseTemplateEntity<T>;
declare const _default$a: <T extends object = NotificationProps>(item?: Item) => NotificationEntity<T>;
type CastType = 'auto' | 'string' | 'number' | 'boolean' | 'null' | 'json';
type ItemToObjectCas