# @bfwk/data-service

> LBF Data Services

Latest version **0.10.11** (published 2022-09-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install @bfwk/data-service
pnpm add @bfwk/data-service
yarn add @bfwk/data-service
bun add @bfwk/data-service
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.10.11 |
| Published | 2022-09-22 |
| First published | 2021-04-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 28.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | treywashington, lwc-admin |

## Links

- npm: https://www.npmjs.com/package/@bfwk/data-service
- Repository: https://github.com/salesforce/builder-framework
- Homepage: https://github.com/salesforce/builder-framework#readme
- Issues: https://github.com/salesforce/builder-framework/issues
- npm.io page: https://npm.io/package/@bfwk/data-service

## Dependencies (3)

- [@bfwk/utils](https://npm.io/package/@bfwk/utils.md) 0.10.11
- [@lcem/meta-schemas](https://npm.io/package/@lcem/meta-schemas.md) 0.10.1
- [@lcem/declarative-type](https://npm.io/package/@lcem/declarative-type.md) 0.10.1

## Recent versions

- 0.10.11 (latest) — 2022-09-22
- 0.6.11-alpha.1259 (canary) — 2021-04-27
- 0.10.10 — 2022-09-19
- 0.10.9 — 2022-09-16
- 0.10.8 — 2022-09-15
- 0.10.7 — 2022-09-12
- 0.10.6 — 2022-08-26
- 0.10.5 — 2022-08-18
- 0.10.4 — 2022-08-17
- 0.10.3 — 2022-08-17
- 0.10.2 — 2022-08-11
- 0.10.1 — 2022-08-09
- 0.10.0 — 2022-08-08
- 0.9.15 — 2022-07-22
- 0.9.14 — 2022-07-21
- … 107 more at https://npm.io/package/@bfwk/data-service/versions

## README

# Data Services

[![npm](https://img.shields.io/npm/v/@bfwk/data-service)](https://www.npmjs.com/package/@bfwk/data-service)

In order to communicate with external data sources, the framework will provide a single interface to interact with any
external data source called a data service.

The responsibility of each data service implementation is to act as the interface for interacting with data coming from
a specific data source.

Additional documentation can be found [here](https://salesforce.quip.com/JX6TAyvFkaAI)

## API

```typescript
export interface DataServiceConfig {
  [key: string]: any;
}

export interface Payload {
  [key: string]: any;
}

export type ResourceKind = string;
export type ResourceId = string;

export interface URI {
  resource: ResourceKind;
  id: ResourceId;
}

export interface DataService<T = any> {
  get(target: URI, config: DataServiceConfig): Promise<T>;
  post(target: URI, payload: Payload, config: DataServiceConfig): Promise<any>;
  put(target: URI, payload: Payload, config: DataServiceConfig): Promise<any>;
  delete(target: URI, config: DataServiceConfig): Promise<any>;
}
```

## Usage

Currently these are the data service implementations we provide and will maintain. More data services to come.

- [Aura Controller Data Service](/packages/sf-data-service/README.md)

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