Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
@kronos-integration/service
Advanced tools
Base service implementation
Endpoint accessor mixin. Manages endpoints in a container.
superclass
Class class to be extendedReturns Class extended class
Default set of endpoints to create.
Returns Object {} empty set
Keeps track of all in flight object creations and loose ends during config initialization.
outstandingServices
Map<string, Promise<Service>>outstandingFactories
Map<string, Promise<Function>>outstandingEndpointConnections
Map<string, Promise<Endpoint>>if config belongs to the provider we represent ourselfs
Extends Service
Config providing service. Dispatches config requests to services; or preserves them until a maching service becomes avaliable.
config
ic
Deliver configuration for a given service.
Forget about preserved config of a service.
name
string service nameSet config entry.
key
string path to the valuevalue
anyWe always start immediate.
Returns boolean true
Returns string 'config'
Merge from b into a. When a and b are arrays of values only the none duplicates are appendend to a.
a
anyb
anyReturns any merged b into a
Assign services based on a configuration.
target
Object objectconfig
Object service defintionprovider
Object service providerwaitUntilFactoryPresent
booleanExtends Service
Log receiving service.
We always start immediate.
Returns boolean true
Returns string 'logger'
Adds a log input endpoint to the set of Service endpoints.
Returns Object predefined endpoints
Provide services and hold service configuration. By default a service provider has two build in services 'logger' and 'config'.
superclass
serviceLoggerClass
Class where the logging houtd go (optional, default ServiceLogger
)serviceConfigClass
Class where the config comes from (optional, default ServiceConfig
)Key of the service description.
Extends EndpointsMixin(StateTransitionMixin(LogLevelMixin(class {}), prepareActions({ start: { stopped: rsfDefault }, restart: { stopped: rsfDefault, running: { target: "running", during: "restarting", timeout } }, stop: { running: ssfDefault, starting: ssfDefault, failed: ssfDefault } }), "stopped"))
Service The initial state is 'stopped'. All services have at least three endpoints:
config
Object
Used in human readable state messages. Besides the actual service name it may contain additional short hints.
Returns string
Called when the service state changes. Emits a serviceStateChanged event to the owner.
Called when state transition is not allowed.
action
string originating action nameDeliver transition timeout.
transition
ObjectReturns number milliseconds before throwing for a long running transition
Opens all endpoint connections.
Closes all endpoint connections.
Restart action. default implementation does a _stop() and a _start()
Returns Promise fulfills after start
Restarts if in running mode. Otherwise does nothing.
Returns Promise resolves when restart is done (or immediate if no restart triggered)
Mapping of properties used in toString.
Returns Object
Base service is not a provider.
Returns boolean false
Returns the string representation of this service.
Returns string human readable name
Deliver json representation.
options
Object
options.includeRuntimeInfo
boolean include runtime informtion like stateoptions.includeDefaults
boolean include default endpointsoptions.includeName
boolean include name of the serviceoptions.includeConfig
boolean include config attributesoptions.includePrivate
boolean include private config attributesReturns Object json representation
Defaults to the type.
Returns string type
Should we start when beeing registered.
Returns boolean false
Takes attribute values from config parameters and copies them over to the object. Copying is done according to configurationAttributes. Which means we loop over all configuration attributes. and then for each attribute decide if we use the default, call a setter function or simply assign the attribute value.
config
ObjectReturns Set of modified attributes
Use new configuration. Internally calls _configure(config) as the constructor does. If attribute with needsRestart are touched the restartIfRunning method will be called.
config
ObjectReturns Promise fillfills when config is applied
Adds service name to the log event.
Meta information for the config attributes.
The Service class only defines the logLevel, and start/stop/restart timeout attribute
Returns Object
Definition of the predefined endpoints.
Returns Object predefined endpoints
Extends ServiceProviderMixin(Service)
Simple service manager (for examples and testing only).
Returns string 'standalone-provider'
With npm do:
npm install @kronos-integration/service
BSD-2-Clause
FAQs
Base service implementation
The npm package @kronos-integration/service receives a total of 968 weekly downloads. As such, @kronos-integration/service popularity was classified as not popular.
We found that @kronos-integration/service demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.