@typedly/data-adapter 1.0.0-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +219 -0
- package/package.json +68 -0
- package/types/typedly-data-adapter.d.ts +31 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 typedly
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
<a href="https://github.com/typescript-package">
|
|
2
|
+
<img
|
|
3
|
+
src="https://avatars.githubusercontent.com/u/189665258?s=150&u=712e292bae048947d1f7d2020d7d38875c40e63a&v=4"
|
|
4
|
+
title="@typedly/data-adapter - A TypeScript type definitions package for data adapters enabling configurable, composable, trait-driven adaptable data models."
|
|
5
|
+
/>
|
|
6
|
+
</a>
|
|
7
|
+
|
|
8
|
+
## @typedly/data-adapter
|
|
9
|
+
|
|
10
|
+
<!-- npm badge -->
|
|
11
|
+
[![npm version][package-npm-badge-svg]][package-npm-badge]
|
|
12
|
+
[![GitHub issues][package-badge-issues]][package-issues]
|
|
13
|
+
[![GitHub license][package-badge-license]][package-license]
|
|
14
|
+
|
|
15
|
+
<!-- GitHub badges -->
|
|
16
|
+
[![GitHub issues][package-badge-issues]][package-issues]
|
|
17
|
+
[![GitHub forks][package-badge-forks]][package-forks]
|
|
18
|
+
[![GitHub stars][package-badge-stars]][package-stars]
|
|
19
|
+
[![GitHub license][package-badge-license]][package-license]
|
|
20
|
+
|
|
21
|
+
<!-- Sponsors -->
|
|
22
|
+
[![GitHub Sponsors][github-badge-sponsor]][github-sponsor-link]
|
|
23
|
+
[![Patreon Sponsors][patreon-badge]][patreon-link]
|
|
24
|
+
|
|
25
|
+
A **TypeScript** type definitions package for data adapters enabling configurable, composable, trait-driven adaptable data models.
|
|
26
|
+
|
|
27
|
+
## Features
|
|
28
|
+
|
|
29
|
+
- **Configurable**: Create data adapters for data models with configuration.
|
|
30
|
+
- **Trait-based**: Mix and match interfaces like `Adaptable`, `Queryable`, `Exportable`, and [more](https://github.com/typedly/data-traits).
|
|
31
|
+
- **Ecosystem**: Works seamlessly with other [`@typedly`](https://github.com/typedly) packages.
|
|
32
|
+
|
|
33
|
+
## Table of contents
|
|
34
|
+
|
|
35
|
+
- [Related packages](#related-packages)
|
|
36
|
+
- [Installation](#installation)
|
|
37
|
+
- [Api](#api)
|
|
38
|
+
- Interface
|
|
39
|
+
- [`DataAdapterConstructor`](#dataadapterconstructor)
|
|
40
|
+
- [`DataAdapterShape`](#dataadaptershape)
|
|
41
|
+
- [Contributing](#contributing)
|
|
42
|
+
- [Support](#support)
|
|
43
|
+
- [Code of Conduct](#code-of-conduct)
|
|
44
|
+
- [Git](#git)
|
|
45
|
+
- [Commit](#commit)
|
|
46
|
+
- [Versioning](#versioning)
|
|
47
|
+
- [License](#license)
|
|
48
|
+
- [Packages](#packages)
|
|
49
|
+
|
|
50
|
+
## Related packages
|
|
51
|
+
|
|
52
|
+
### Peer dependencies
|
|
53
|
+
|
|
54
|
+
- **[@typedly/configurable-data](https://github.com/typedly/configurable-data)**: A **TypeScript** type definitions package for configurable, composable, trait-driven data models.
|
|
55
|
+
- **[@typedly/data-traits](https://github.com/typedly/data-traits)**: A **TypeScript** type definitions for data traits.
|
|
56
|
+
- **[@typedly/data](https://github.com/typedly/data)**: A **TypeScript** type definitions for [`@typescript-package/data`](https://github.com/typedly/data).
|
|
57
|
+
|
|
58
|
+
### General
|
|
59
|
+
|
|
60
|
+
- **[@typedly/adaptable-data](https://github.com/typedly/adaptable-data)**: A **TypeScript** type definitions for data adapter.
|
|
61
|
+
- **[@typedly/collection](https://github.com/typedly/collection)**: A **TypeScript** type definitions package for data collections with customizable storage.
|
|
62
|
+
- **[@typedly/data-adapter](https://github.com/typedly/data-adapter)**: A **TypeScript** type definitions for data adapter.
|
|
63
|
+
- **[@typescript-package/data](https://github.com/typescript-package/data)**: A lightweight **TypeScript** library for basic data management.
|
|
64
|
+
- **[@typescript-package/collection](https://github.com/typescript-package/collection)**: A lightweight **TypeScript** library for data collection.
|
|
65
|
+
|
|
66
|
+
## Installation
|
|
67
|
+
|
|
68
|
+
### 1. Install peer dependencies
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
npm install @typedly/configurable-data @typedly/data @typedly/data-traits --save-peer
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### 2. Install package
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
npm install @typedly/data-adapter --save-peer
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Api
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
import {
|
|
84
|
+
DataAdapterConstructor,
|
|
85
|
+
DataAdapterShape,
|
|
86
|
+
} from '@typedly/data-adapter';
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Interface
|
|
90
|
+
|
|
91
|
+
### `DataAdapterConstructor`
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
import { DataAdapterConstructor } from '@typedly/data-adapter';
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
[Source](https://github.com/typedly/data-adapter/blob/main/src/lib/data-adapter.constructor.ts)
|
|
98
|
+
|
|
99
|
+
### `DataAdapterShape`
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
import { DataAdapterShape } from '@typedly/data-adapter';
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
[Source](https://github.com/typedly/data-adapter/blob/main/src/lib/data-adapter.shape.ts)
|
|
106
|
+
|
|
107
|
+
## Contributing
|
|
108
|
+
|
|
109
|
+
Your contributions are valued! If you'd like to contribute, please feel free to submit a pull request. Help is always appreciated.
|
|
110
|
+
|
|
111
|
+
## Support
|
|
112
|
+
|
|
113
|
+
If you find this package useful and would like to support its and general development, you can contribute through one of the following payment methods. Your support helps maintain the packages and continue adding new.
|
|
114
|
+
|
|
115
|
+
Support via:
|
|
116
|
+
|
|
117
|
+
- [4Fund](https://4fund.com/bruubs)
|
|
118
|
+
- [DonorBox](https://donorbox.org/become-a-sponsor-to-the-angular-package?default_interval=o)
|
|
119
|
+
- [GitHub](https://github.com/sponsors/angular-package/sponsorships?sponsor=sciborrudnicki&tier_id=83618)
|
|
120
|
+
- [Ko-fi](https://ko-fi.com/sterblack)
|
|
121
|
+
- [OpenCollective](https://opencollective.com/sterblack)
|
|
122
|
+
- [Patreon](https://www.patreon.com/checkout/angularpackage?rid=0&fan_landing=true&view_as=public)
|
|
123
|
+
- [PayPal](https://paypal.me/sterblack)
|
|
124
|
+
- [Stripe](https://donate.stripe.com/dR614hfDZcJE3wAcMM)
|
|
125
|
+
- ~~[Revolut](https://checkout.revolut.com/pay/048b10a3-0e10-42c8-a917-e3e9cb4c8e29)~~
|
|
126
|
+
|
|
127
|
+
or via Trust Wallet
|
|
128
|
+
|
|
129
|
+
- [BNB](https://link.trustwallet.com/send?coin=20000714&address=0xA0c22A2bc7E37C1d5992dFDFFeD5E6f9298E1b94)
|
|
130
|
+
- [BTC](https://link.trustwallet.com/send?coin=0&address=bc1qnf709336tfl57ta5mfkf4t9fndhx7agxvv9svn)
|
|
131
|
+
- [ETH](https://link.trustwallet.com/send?coin=60&address=0xA0c22A2bc7E37C1d5992dFDFFeD5E6f9298E1b94)
|
|
132
|
+
- [USDT (BEP20)](https://link.trustwallet.com/send?coin=20000714&address=0xA0c22A2bc7E37C1d5992dFDFFeD5E6f9298E1b94&token_id=0x55d398326f99059fF775485246999027B3197955)
|
|
133
|
+
- [XLM](https://link.trustwallet.com/send?coin=148&address=GAFFFB7H3LG42O6JA63FJDRK4PP4JCNEOPHLGLLFH625X2KFYQ4UYVM4)
|
|
134
|
+
|
|
135
|
+
Thanks for your support!
|
|
136
|
+
|
|
137
|
+
## Code of Conduct
|
|
138
|
+
|
|
139
|
+
By participating in this data-adapter, you agree to follow **[Code of Conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct/)**.
|
|
140
|
+
|
|
141
|
+
## GIT
|
|
142
|
+
|
|
143
|
+
### Commit
|
|
144
|
+
|
|
145
|
+
- [AngularJS Git Commit Message Conventions][git-commit-angular]
|
|
146
|
+
- [Karma Git Commit Msg][git-commit-karma]
|
|
147
|
+
- [Conventional Commits][git-commit-conventional]
|
|
148
|
+
|
|
149
|
+
### Versioning
|
|
150
|
+
|
|
151
|
+
[Semantic Versioning 2.0.0][git-semver]
|
|
152
|
+
|
|
153
|
+
**Given a version number MAJOR.MINOR.PATCH, increment the:**
|
|
154
|
+
|
|
155
|
+
- MAJOR version when you make incompatible API changes,
|
|
156
|
+
- MINOR version when you add functionality in a backwards-compatible manner, and
|
|
157
|
+
- PATCH version when you make backwards-compatible bug fixes.
|
|
158
|
+
|
|
159
|
+
Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.
|
|
160
|
+
|
|
161
|
+
**FAQ**
|
|
162
|
+
How should I deal with revisions in the 0.y.z initial development phase?
|
|
163
|
+
|
|
164
|
+
> The simplest thing to do is start your initial development release at 0.1.0 and then increment the minor version for each subsequent release.
|
|
165
|
+
|
|
166
|
+
How do I know when to release 1.0.0?
|
|
167
|
+
|
|
168
|
+
> If your software is being used in production, it should probably already be 1.0.0. If you have a stable API on which users have come to depend, you should be 1.0.0. If you’re worrying a lot about backwards compatibility, you should probably already be 1.0.0.
|
|
169
|
+
|
|
170
|
+
## License
|
|
171
|
+
|
|
172
|
+
MIT © typedly ([license][package-license])
|
|
173
|
+
|
|
174
|
+
## Packages
|
|
175
|
+
|
|
176
|
+
- **[@typedly/array](https://github.com/typedly/array)**: A **TypeScript** type definitions package to handle array-related operations.
|
|
177
|
+
- **[@typedly/callback](https://github.com/typedly/callback)**: A **TypeScript** type definitions package for asynchronous and synchronous callback functions of various types.
|
|
178
|
+
- **[@typedly/character](https://github.com/typedly/character)**: A **TypeScript** type definitions package for various character types.
|
|
179
|
+
- **[@typedly/context](https://github.com/typedly/context)**: A **TypeScript** type definitions package for context data structures.
|
|
180
|
+
- **[@typedly/descriptor](https://github.com/typedly/descriptor)**: A **TypeScript** type definitions package for property descriptor.
|
|
181
|
+
- **[@typedly/digit](https://github.com/typedly/digit)**: A **TypeScript** type definitions package for digit types.
|
|
182
|
+
- **[@typedly/letter](https://github.com/typedly/letter)**: A **TypeScript** type definitions package for handling letter types.
|
|
183
|
+
- **[@typedly/object](https://github.com/typedly/object)**: A **TypeScript** type definitions package to handle object-related operations.
|
|
184
|
+
- **[@typedly/payload](https://github.com/typedly/payload)**: A **TypeScript** type definitions package for payload data structures.
|
|
185
|
+
- **[@typedly/property](https://github.com/typedly/property)**: A **TypeScript** type definitions package to handle object property-related operations.
|
|
186
|
+
- **[@typedly/regexp](https://github.com/typedly/regexp)**: A **TypeScript** type definitions package for `RegExp`.
|
|
187
|
+
- **[@typedly/symbol](https://github.com/typedly/symbol)**: A **TypeScript** type definitions package for various symbols.
|
|
188
|
+
|
|
189
|
+
<!-- Funding -->
|
|
190
|
+
[github-badge-sponsor]: https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&link=https://github.com/sponsors/angular-package
|
|
191
|
+
[github-sponsor-link]: https://github.com/sponsors/angular-package
|
|
192
|
+
[patreon-badge]: https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3Dangularpackage%26type%3Dpatrons&style=flat
|
|
193
|
+
[patreon-link]: https://www.patreon.com/join/angularpackage/checkout?fan_landing=true&rid=0
|
|
194
|
+
|
|
195
|
+
<!-- This package: typedly -->
|
|
196
|
+
<!-- GitHub: badges -->
|
|
197
|
+
[package-badge-issues]: https://img.shields.io/github/issues/typedly/data-adapter
|
|
198
|
+
[package-badge-forks]: https://img.shields.io/github/forks/typedly/data-adapter
|
|
199
|
+
[package-badge-stars]: https://img.shields.io/github/stars/typedly/data-adapter
|
|
200
|
+
[package-badge-license]: https://img.shields.io/github/license/typedly/data-adapter
|
|
201
|
+
<!-- GitHub: badges links -->
|
|
202
|
+
[package-issues]: https://github.com/typedly/data-adapter/issues
|
|
203
|
+
[package-forks]: https://github.com/typedly/data-adapter/network
|
|
204
|
+
[package-license]: https://github.com/typedly/data-adapter/blob/master/LICENSE
|
|
205
|
+
[package-stars]: https://github.com/typedly/data-adapter/stargazers
|
|
206
|
+
<!-- This package -->
|
|
207
|
+
|
|
208
|
+
<!-- Package: typedly -->
|
|
209
|
+
<!-- npm -->
|
|
210
|
+
[package-npm-badge-svg]: https://badge.fury.io/js/@typedly%2Fdata-adapter.svg
|
|
211
|
+
[package-npm-badge]: https://badge.fury.io/js/@typedly%2Fdata-adapter
|
|
212
|
+
|
|
213
|
+
<!-- GIT -->
|
|
214
|
+
[git-semver]: http://semver.org/
|
|
215
|
+
|
|
216
|
+
<!-- GIT: commit -->
|
|
217
|
+
[git-commit-angular]: https://gist.github.com/stephenparish/9941e89d80e2bc58a153
|
|
218
|
+
[git-commit-karma]: http://karma-runner.github.io/0.10/dev/git-commit-msg.html
|
|
219
|
+
[git-commit-conventional]: https://www.conventionalcommits.org/en/v1.0.0/
|
package/package.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@typedly/data-adapter",
|
|
3
|
+
"version": "1.0.0-beta",
|
|
4
|
+
"author": "wwwdev.io <dev@wwwdev.io>",
|
|
5
|
+
"description": "A TypeScript type definitions for data adapter.",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public",
|
|
9
|
+
"registry": "https://registry.npmjs.org"
|
|
10
|
+
},
|
|
11
|
+
"peerDependencies": {
|
|
12
|
+
"@typedly/configurable-data": "^1.0.0-beta.1",
|
|
13
|
+
"@typedly/data": "^5.0.0-beta.1",
|
|
14
|
+
"@typedly/data-traits": "^1.0.0"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/typedly/data-adapter.git"
|
|
19
|
+
},
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/typedly/data-adapter/issues"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"@typedly",
|
|
25
|
+
"@typedly/data-adapter"
|
|
26
|
+
],
|
|
27
|
+
"funding": [
|
|
28
|
+
{
|
|
29
|
+
"type": "stripe",
|
|
30
|
+
"url": "https://donate.stripe.com/dR614hfDZcJE3wAcMM"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"type": "Donorbox",
|
|
34
|
+
"url": "https://donorbox.org/become-a-sponsor-to-the-angular-package?default_interval=once&amount=1"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"type": "Open Collective",
|
|
38
|
+
"url": "https://opencollective.com/sterblack"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"type": "Ko-fi",
|
|
42
|
+
"url": "https://ko-fi.com/sterblack"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"type": "4Fund",
|
|
46
|
+
"url": "https://4fund.com/bruubs"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"type": "paypal",
|
|
50
|
+
"url": "https://paypal.me/sterblack"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"type": "individual",
|
|
54
|
+
"url": "https://checkout.revolut.com/pay/048b10a3-0e10-42c8-a917-e3e9cb4c8e29"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"sideEffects": false,
|
|
58
|
+
"typings": "types/typedly-data-adapter.d.ts",
|
|
59
|
+
"exports": {
|
|
60
|
+
"./package.json": {
|
|
61
|
+
"default": "./package.json"
|
|
62
|
+
},
|
|
63
|
+
".": {
|
|
64
|
+
"types": "./types/typedly-data-adapter.d.ts",
|
|
65
|
+
"default": "./fesm2022/typedly-data-adapter.mjs"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { InferConfigurableAsync, ConfigurableDataShape } from '@typedly/configurable-data';
|
|
2
|
+
import { DataSettings } from '@typedly/data';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @description The adapter interface for data types.
|
|
6
|
+
* @export
|
|
7
|
+
* @interface DataAdapterShape
|
|
8
|
+
* @template {DataSettings<R> | undefined} C The type of the configuration object.
|
|
9
|
+
* @template T The type of the data value.
|
|
10
|
+
* @template {boolean} [R=InferAsync<C>] The type of the return values for methods.
|
|
11
|
+
* @extends {ConfigurableDataShape<C, T, R>}
|
|
12
|
+
*/
|
|
13
|
+
interface DataAdapterShape<C extends DataSettings<R> | undefined, T, R extends boolean = InferConfigurableAsync<C>> extends ConfigurableDataShape<C, T, R> {
|
|
14
|
+
version?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @description The constructor interface for data adapters.
|
|
19
|
+
* @export
|
|
20
|
+
* @interface DataAdapterConstructor
|
|
21
|
+
* @template {DataAdapterShape<C, T, R> | undefined} I The adapter instance type, which can be undefined for more flexible inference.
|
|
22
|
+
* @template {DataSettings<R>} [C=InferSettings<I>] The configuration type, inferred from I if possible.
|
|
23
|
+
* @template [T=InferValue<I>] The underlying value type, inferred from I if possible.
|
|
24
|
+
* @template {boolean} [R=InferAsync<I>] The async flag, inferred from I if possible.
|
|
25
|
+
* @template {readonly any[]} [G=[]] Additional arguments.
|
|
26
|
+
*/
|
|
27
|
+
interface DataAdapterConstructor<I extends DataAdapterShape<C, T, R> | undefined, C extends DataSettings<R>, T, R extends boolean, G extends readonly any[] = []> {
|
|
28
|
+
new (settings: C, value?: T, ...args: G): I;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type { DataAdapterConstructor, DataAdapterShape };
|