
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
A uService is just an object with asynchronous functions (returning either Promises or Observables). Functions returning Promises are referred to as methods, and functions returning Observables (which must currently be compatible with rxjs) are referred to as events.
This library defines a specification that allows easy creation of proxies of these uServices, e.g. for remote use.
This specification is just a JSON format, which can be either created directly, or generated from code analysis. The example provided below uses the typescript-schema library to analyse TypeScript code in order to output a corresponding specification.
Moreover, this specification format is extensible. For example, the markscript-uservices library extends this to allow uServices to be implemented in, or proxies deployed to, a MarkLogic server.
A javascript model of a spec can be found under the model module in this library, and allows for easy programmatic usage of a spec.
A number of libraries also provide abstractions over various transports to easily create remote proxies for uServices; some of these are listed at the end.
Install:
npm install uservices
Basic Usage:
An example specification: (All fields are optional)
{
"myService": {
"implementation": {
"moduleName": "my/javascript/module",
"className": "MyService"
},
"methods": {
"someMethod": {
"type": {}
}
},
"events": {
"someEvent": {}
}
}
}
To parse a JSON spec into a javascript model:
import * as u from 'uservices'
let someSpecJSON
let spec = u.parse(someSpecJSON)
To easily navigate a specification (javascript model):
import * as u from 'uservices'
let someSpec
u.visitServices(someSpec, {
onService: function(serviceSpec){
return {
onMethod: function(methodSpec){
let name = methodSpec.name
},
onEvent: function(eventSpec){
let name = eventSpec.name
}
}
}
})
To generate a spec from a typescript-schema model:
import * as u from 'uservices'
import * as s from 'typescript-schema'
let module:s.Map<s.Module>
let specs = u.generateServiceSpecs(modules)
Various libraries exist for making the services deployable as remote proxies. Some of them are listed below:
FAQs
Library to enable remoting of an object with asynchronous functions.
The npm package uservices receives a total of 19 weekly downloads. As such, uservices popularity was classified as not popular.
We found that uservices demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.