# ml-uservices

> Deploy remote proxies of uServices from Marklogic

Latest version **0.2.3** (published 2015-07-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install ml-uservices
pnpm add ml-uservices
yarn add ml-uservices
bun add ml-uservices
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.3 |
| Published | 2015-07-16 |
| First published | 2015-06-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Christy Haragan |
| Maintainers | christyharagan |
| Keywords | marklogic, uservices, service, portable, asynchronous, observable, actor, micro |

## Links

- npm: https://www.npmjs.com/package/ml-uservices
- Repository: https://github.com/christyharagan/ml-uservices
- Homepage: https://github.com/christyharagan/ml-uservices#readme
- Issues: https://github.com/christyharagan/ml-uservices/issues
- npm.io page: https://npm.io/package/ml-uservices

## Dependencies (9)

- [rx](https://npm.io/package/rx.md) ^2.5.3
- [speckle](https://npm.io/package/speckle.md) ^0.1.0
- [tschuss](https://npm.io/package/tschuss.md) ^0.1.0
- [ml-admin](https://npm.io/package/ml-admin.md) ^0.2.0
- [marklogic](https://npm.io/package/marklogic.md) 1.0.2
- [uservices](https://npm.io/package/uservices.md) ^0.3.0
- [typescript](https://npm.io/package/typescript.md) ^1.5.0-beta
- [typescript-schema](https://npm.io/package/typescript-schema.md) ^0.3.0
- [ml-typescript-definitions](https://npm.io/package/ml-typescript-definitions.md) ^0.2.0

## Alternatives

- [promise-throttle](https://npm.io/package/promise-throttle.md) — 44.2K weekly downloads
- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads

## Recent versions

- 0.2.3 (latest) — 2015-07-16
- 0.2.2 — 2015-07-16
- 0.2.1 — 2015-07-14
- 0.2.0 — 2015-07-08
- 0.1.0 — 2015-06-22

## README

Marklogic uServices Library
==

Overview
--

Deploy remote proxies of [uServices](https://github.com/christyharagan/uservices) from Marklogic.


Usage
--

Install:
```
npm install ml-uservices
```

Basic Usage:

For a uService on Marklogic:

```TypeScript
import * as mlu from 'ml-uservices'
import {Observable} from 'uservices'
import {Message} from '../common/models/message'
import {ChatService} from '../common/services/chatService'

export class MessageBroadcast extends mlu.AlertObservable<Message, Message> {
  transform(uri: string, content: any) {
    return content
  }
}

@mlu.mlService()
export class ChatServiceML implements ChatService {
  private contentSearch = new ContentSearch()

  @mlu.mlMethod({
    method: 'put'
  })
  sendMessage(message: Message) {
    xdmp.documentInsert('/chatMessages/' + message.timestamp, message)
  }

  @mlu.mlEvent({
    states: ['create', 'modify'],
    scope: '/chatMessages/'
  })
  messageBroadcast() {
    return new MessageBroadcast()
  }
}

```

Then to proxy that to another tier:

```TypeScript
import {createRemoteProxy} from 'ml-uservices'
import * as RxRouter from 'koa-rx-router'

let router = new RxRouter({
    prefix: '/mlListener'
})
let chatService = createRemoteProxy(chatSpec, client, router)

```

---
_Source: https://npm.io/package/ml-uservices · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
