Skip to content

Latest commit

 

History

History
1000 lines (560 loc) · 27.8 KB

File metadata and controls

1000 lines (560 loc) · 27.8 KB

@onzag/itemize / Modules / server/services/ipstack / IPStackService

Class: IPStackService

server/services/ipstack.IPStackService

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new IPStackService(config, registry, configs): IPStackService

Parameters

Name Type
config IPStackConfig
registry RegistryService
configs Object
configs.config IConfigRawJSONDataType
configs.dbConfig IDBConfigRawJSONDataType
configs.redisConfig IRedisConfigRawJSONDataType
configs.sensitiveConfig ISensitiveConfigRawJSONDataType

Returns

IPStackService

Inherited from

default.constructor

Defined in

server/services/index.ts:58

Properties

appConfig

appConfig: IConfigRawJSONDataType

Inherited from

default.appConfig

Defined in

server/services/index.ts:35


appDbConfig

appDbConfig: IDBConfigRawJSONDataType

Inherited from

default.appDbConfig

Defined in

server/services/index.ts:37


appRedisConfig

appRedisConfig: IRedisConfigRawJSONDataType

Inherited from

default.appRedisConfig

Defined in

server/services/index.ts:38


appSensitiveConfig

appSensitiveConfig: ISensitiveConfigRawJSONDataType

Inherited from

default.appSensitiveConfig

Defined in

server/services/index.ts:36


config

config: IPStackConfig

Inherited from

default.config

Defined in

server/services/index.ts:33


globalCustomServices

globalCustomServices: Object

Index signature

▪ [name: string]: ServiceProvider<any>

Inherited from

default.globalCustomServices

Defined in

server/services/index.ts:48


globalDatabaseConnection

globalDatabaseConnection: DatabaseConnection

Inherited from

default.globalDatabaseConnection

Defined in

server/services/index.ts:40


globalInstance

globalInstance: boolean = false

Inherited from

default.globalInstance

Defined in

server/services/index.ts:55


globalMailProvider

globalMailProvider: default<any>

Inherited from

default.globalMailProvider

Defined in

server/services/index.ts:46


globalPhoneProvider

globalPhoneProvider: default<any>

Inherited from

default.globalPhoneProvider

Defined in

server/services/index.ts:47


globalRawDB

globalRawDB: ItemizeRawDB

Inherited from

default.globalRawDB

Defined in

server/services/index.ts:44


globalRedis

globalRedis: ItemizeRedisClient

Inherited from

default.globalRedis

Defined in

server/services/index.ts:43


globalRedisPub

globalRedisPub: ItemizeRedisClient

Inherited from

default.globalRedisPub

Defined in

server/services/index.ts:41


globalRedisSub

globalRedisSub: ItemizeRedisClient

Inherited from

default.globalRedisSub

Defined in

server/services/index.ts:42


globalRoot

globalRoot: default

Inherited from

default.globalRoot

Defined in

server/services/index.ts:45


instanceName

instanceName: string

Inherited from

default.instanceName

Defined in

server/services/index.ts:54


localAppData

localAppData: IAppDataType

Inherited from

default.localAppData

Defined in

server/services/index.ts:52


localInstance

localInstance: boolean = false

Inherited from

default.localInstance

Defined in

server/services/index.ts:56


registry

registry: RegistryService

Inherited from

default.registry

Defined in

server/services/index.ts:34

Methods

execute

execute(): void

Performs the execution of the service, basically it will do the run function and then re-run as specified

Returns

void

Inherited from

default.execute

Defined in

server/services/index.ts:170


expressRouter

expressRouter(options?): Router

Parameters

Name Type
options? RouterOptions

Returns

Router

Inherited from

default.expressRouter

Defined in

server/services/index.ts:116


getInstanceName

getInstanceName(): string

Returns

string

Inherited from

default.getInstanceName

Defined in

server/services/index.ts:80


getLocalizationFor

getLocalizationFor(ip, fallback): Promise<IUserLocalizationType>

Should provide the localization for the user

Parameters

Name Type Description
ip string the ip address
fallback IUserLocalizationType -

Returns

Promise<IUserLocalizationType>

Overrides

default.getLocalizationFor

Defined in

server/services/ipstack.ts:118


getRouter

getRouter(appData): Router | Promise<Router>

Provides a router endpoint, the router endpoint will exist directly under the rest services this enables to create webhooks and other subservices that are attached to this service

If the service provider if executed on a global environment the endpoint does not get created, this means that in the global manager this won't be executed, or anything that is meant for the global manager

The router gets attached to /rest/service

Parameters

Name Type
appData IAppDataType

Returns

Router | Promise<Router>

Inherited from

default.getRouter

Defined in

server/services/index.ts:266


getRunCycleTime

getRunCycleTime(): number

Determines whether the run function should run over again

Returns

number

Inherited from

default.getRunCycleTime

Defined in

server/services/index.ts:239


getTriggerRegistry

getTriggerRegistry(): ITriggerRegistry | Promise<ITriggerRegistry>

Allows to setup trigger registries via the service so that they trigger just as normal trigger will do

Returns

ITriggerRegistry | Promise<ITriggerRegistry>

Inherited from

default.getTriggerRegistry

Defined in

server/services/index.ts:293


initialize

initialize(): void | Promise<void>

This function is executed during the initialization of the service

If your service is a global service you will have access to the global resources while this function executes

Returns

void | Promise<void>

Inherited from

default.initialize

Defined in

server/services/index.ts:230


isInstanceGlobal

isInstanceGlobal(): boolean

Returns

boolean

Inherited from

default.isInstanceGlobal

Defined in

server/services/index.ts:84


isInstanceLocal

isInstanceLocal(): boolean

Returns

boolean

Inherited from

default.isInstanceLocal

Defined in

server/services/index.ts:88


logDebug

logDebug<T>(data): void

Type parameters

Name
T

Parameters

Name Type
data IItemizeLoggingStructure<T>

Returns

void

Inherited from

default.logDebug

Defined in

server/services/index.ts:96


logError

logError<T>(data): void

Type parameters

Name
T

Parameters

Name Type
data IItemizeLoggingErrorStructure<T>

Returns

void

Inherited from

default.logError

Defined in

server/services/index.ts:100


logInfo

logInfo<T>(data): void

Type parameters

Name
T

Parameters

Name Type
data IItemizeLoggingStructure<T>

Returns

void

Inherited from

default.logInfo

Defined in

server/services/index.ts:92


requestInfoFor

requestInfoFor(ip): Promise<IPStackResponse>

Parameters

Name Type
ip string

Returns

Promise<IPStackResponse>

Defined in

server/services/ipstack.ts:44


run

run(): void | Promise<void>

Executes some code

Returns

void | Promise<void>

Inherited from

default.run

Defined in

server/services/index.ts:247


setInstanceName

setInstanceName(n): void

Parameters

Name Type
n string

Returns

void

Inherited from

default.setInstanceName

Defined in

server/services/index.ts:76


setupGlobalResources

setupGlobalResources(globalDatabaseConnection, globalClient, globalPub, globalSub, globalMailProvider, globalPhoneProvider, globalCustomServices, root): void

Parameters

Name Type
globalDatabaseConnection DatabaseConnection
globalClient ItemizeRedisClient
globalPub ItemizeRedisClient
globalSub ItemizeRedisClient
globalMailProvider default<any>
globalPhoneProvider default<any>
globalCustomServices Object
root default

Returns

void

Inherited from

default.setupGlobalResources

Defined in

server/services/index.ts:124


setupLocalResources

setupLocalResources(appData): void

Parameters

Name Type
appData IAppDataType

Returns

void

Inherited from

default.setupLocalResources

Defined in

server/services/index.ts:148


expressRouter

expressRouter(options?): Router

Parameters

Name Type
options? RouterOptions

Returns

Router

Inherited from

default.expressRouter

Defined in

server/services/index.ts:120


getRouter

getRouter(appData): Router | Promise<Router>

Provides a router endpoint, but this method is static, which means it only gets added once

If the service provider if executed on a global environment the endpoint does not get created, this means that in the global manager this won't be executed, or anything that is meant for the global manager

the router gets attached to /rest/service

Parameters

Name Type
appData IAppDataType

Returns

Router | Promise<Router>

Inherited from

default.getRouter

Defined in

server/services/index.ts:283


getTriggerRegistry

getTriggerRegistry(): ITriggerRegistry | Promise<ITriggerRegistry>

Allows to setup trigger registries via the service so that they trigger just as normal trigger will do

This gets attached if a class is used rather than per instance

Returns

ITriggerRegistry | Promise<ITriggerRegistry>

Inherited from

default.getTriggerRegistry

Defined in

server/services/index.ts:305


getType

getType(): ServiceProviderType

Specifies whether the current service is a global service if true global services will only execute initialize and a router will not be extracted from them

it will instead have access to the global resources

Returns

ServiceProviderType

Overrides

default.getType

Defined in

server/services/ipstack.ts:41


logDebug

logDebug<T>(data): void

Type parameters

Name
T

Parameters

Name Type
data IItemizeLoggingStructure<T>

Returns

void

Inherited from

default.logDebug

Defined in

server/services/index.ts:108


logError

logError<T>(data): void

Type parameters

Name
T

Parameters

Name Type
data IItemizeLoggingErrorStructure<T>

Returns

void

Inherited from

default.logError

Defined in

server/services/index.ts:112


logInfo

logInfo<T>(data): void

Type parameters

Name
T

Parameters

Name Type
data IItemizeLoggingStructure<T>

Returns

void

Inherited from

default.logInfo

Defined in

server/services/index.ts:104