Skip to content

Commit f1d8e5f

Browse files
committed
docs: initial
1 parent cd426ba commit f1d8e5f

File tree

11 files changed

+654
-2
lines changed

11 files changed

+654
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ Vuex ORM can be extended via plugins to add additional features. Here is a list
129129

130130
## Contribution
131131

132-
We are excited that you are interested in contributing to Vuex ORM Axios! Anything from raising an issue, submitting an idea of a new feature, or making a pull request is welcome!
132+
We are excited that you are interested in contributing to Vuex ORM Soft Delete! Anything from raising an issue, submitting an idea of a new feature, or making a pull request is welcome!
133133

134134
### Development
135135

@@ -165,4 +165,4 @@ Generate test coverage in `coverage` directory.
165165

166166
## License
167167

168-
The Vuex ORM Plugin Axios is open-sourced software licensed under the [MIT license](LICENSE).
168+
Vuex ORM Soft Delete is open-sourced software licensed under the [MIT license](LICENSE).

docs/.vuepress/config.js

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
const sidebars = {
2+
guide: [
3+
{
4+
title: 'Guide',
5+
collapsable: false,
6+
children: [
7+
'/guide/installation',
8+
'/guide/setup',
9+
'/guide/usage',
10+
'/guide/options',
11+
'/guide/sponsors'
12+
]
13+
},
14+
],
15+
16+
api: [
17+
{
18+
title: 'API',
19+
collapsable: false,
20+
children: [
21+
'/api/model',
22+
'/api/query'
23+
]
24+
}
25+
]
26+
}
27+
28+
module.exports = {
29+
title: 'Vuex ORM Soft Delete',
30+
description: 'Vuex ORM plugin for adding soft delete feature to model entities.',
31+
32+
base: '/plugin-soft-delete/',
33+
34+
themeConfig: {
35+
repo: 'vuex-orm/plugin-soft-delete',
36+
docsDir: 'docs',
37+
38+
nav: [
39+
{
40+
text: 'Guide',
41+
link: '/guide/installation'
42+
},
43+
{
44+
text: 'API Reference',
45+
link: '/api/model'
46+
},
47+
{
48+
text: 'Release Notes',
49+
link: 'https://github.com/vuex-orm/plugin-soft-delete/releases'
50+
}
51+
],
52+
53+
sidebar: {
54+
'/guide/': sidebars.guide,
55+
'/api/': sidebars.api,
56+
'/': sidebars.guide
57+
}
58+
}
59+
}

docs/README.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Vuex ORM Soft Delete
2+
3+
Vuex ORM Soft Delete plugin adds soft delete capabilities on model entities.
4+
5+
## Table of Contents
6+
7+
- Guide
8+
- [Installation](/guide/installation.md)
9+
- [Setup](/guide/setup.md)
10+
- [Usage](/guide/usage.md)
11+
- [Options](/guide/options.md)
12+
- [Sponsors](/guide/sponsors)
13+
14+
## Sponsors
15+
16+
Vuex ORM is sponsored by awesome folks. Big love to all of them from the whole Vuex ORM community :two_hearts:
17+
18+
#### Super Love Sponsors
19+
20+
<br>
21+
22+
<a href="https://github.com/petertoth">
23+
<img src="https://avatars2.githubusercontent.com/u/3661783?s=460&v=4" alt="Peter Tóth" width="88" style="border-radius: 8px;">
24+
</a>
25+
<a href="https://github.com/phaust">
26+
<img src="https://avatars1.githubusercontent.com/u/2367770?s=460&v=4" alt="Mario Kolli" width="88" style="border-radius: 8px;">
27+
</a>
28+
<a href="https://github.com/cannikan">
29+
<img src="https://avatars2.githubusercontent.com/u/21893904?s=460&v=4" alt="Cannikan" width="88" style="border-radius: 8px;">
30+
</a>
31+
<a href="https://github.com/somazx">
32+
<img src="https://avatars0.githubusercontent.com/u/7306?s=460&v=4" alt="Andy Koch" width="88" style="border-radius: 8px;">
33+
</a>
34+
<a href="https://github.com/dylancopeland">
35+
<img src="https://avatars1.githubusercontent.com/u/99355?s=460&v=4" alt="Dylan Copeland" width="88" style="border-radius: 8px;">
36+
</a>
37+
38+
#### Big Love Sponsors
39+
40+
<br>
41+
42+
<a href="https://github.com/geraldbiggs">
43+
<img src="https://avatars1.githubusercontent.com/u/3213608?s=460&v=4" alt="geraldbiggs" width="64" style="border-radius: 8px;">
44+
</a>
45+
<a href="https://github.com/cuebit">
46+
<img src="https://avatars0.githubusercontent.com/u/1493221?s=460&v=4" alt="Cue" width="64" style="border-radius: 8px;">
47+
</a>
48+
49+
#### A Love Sponsors
50+
51+
<br>
52+
53+
<a href="https://github.com/georgechaduneli">
54+
<img src="https://avatars1.githubusercontent.com/u/9340753?s=460&v=4" alt="George Chaduneli" width="48" style="border-radius: 8px;">
55+
</a>
56+
<a href="https://github.com/bpuig">
57+
<img src="https://avatars3.githubusercontent.com/u/22938625?s=460&v=4" alt="bpuig" width="48" style="border-radius: 8px;">
58+
</a>
59+
<a href="https://github.com/robokozo">
60+
<img src="https://avatars2.githubusercontent.com/u/1719221?s=400&u=b5739798ee9a3d713f5ca3bd3d6a086c13d229a3&v=4" alt="John" width="48" style="border-radius: 8px;">
61+
</a>
62+
63+
## Questions & Discussions
64+
65+
Join us on our [Slack Channel](https://join.slack.com/t/vuex-orm/shared_invite/enQtNDQ0NjE3NTgyOTY2LTc1YTI2N2FjMGRlNGNmMzBkMGZlMmYxOTgzYzkzZDM2OTQ3OGExZDRkN2FmMGQ1MGJlOWM1NjU0MmRiN2VhYzQ) for any questions and discussions.
66+
67+
Although there is the Slack Channel, do not hesitate to open an [issue](https://github.com/vuex-orm/plugin-soft-delete/issues) for any question you might have. We're always more than happy to hear any feedback, and we don't care what kind of form they are.
68+
69+
## Plugins
70+
71+
Vuex ORM can be extended via plugins to add additional features. Here is a list of available plugins.
72+
73+
- [Vuex ORM Axios](https://github.com/vuex-orm/plugin-axios) – The plugin to sync the store against a RESTful API with [axios](https://github.com/axios/axios).
74+
- [Vuex ORM GraphQL](https://github.com/vuex-orm/plugin-graphql) – The plugin to sync the store against a [GraphQL](https://graphql.org) API.
75+
- [Vuex ORM Search](https://github.com/vuex-orm/plugin-search) – The plugin adds a search method to filter records using fuzzy search logic with [Fuse.js](http://fusejs.io).
76+
- [Vuex ORM Change Flags](https://github.com/vuex-orm/plugin-change-flags) - The plugin adds IsDirty / IsNew flags to model entities.
77+
78+
## Resources
79+
80+
- [Vue](https://vuejs.org)
81+
- [Vuex](https://vuex.vuejs.org)
82+
- [Vuex ORM](https://vuex-orm.github.io/vuex-orm/)
83+
84+
You may find a list of awesome things related to Vuex ORM at [Awesome Vuex ORM](https://github.com/vuex-orm/awesome-vuex-orm).

docs/api/model.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
sidebarDepth: 2
3+
---
4+
5+
# Model
6+
7+
## Static Properties
8+
9+
### `softDeleteConfig`
10+
11+
- **Type**: `Object`
12+
13+
The property that holds the model configuration.
14+
15+
- **See also**: [Available Options](/guide/options.md#available-options)
16+
17+
18+
## Static Methods
19+
20+
### `softDelete`
21+
22+
- **Type**: `(id: string | number | Array | Function) => Promise`
23+
24+
Soft delete a model by primary key(s), composite primary key(s), or expression function.
25+
26+
Returns a Promise that resolves with the soft deleted models.
27+
28+
- **See also**: [Deleting](/guide/usage.md#deleting)
29+
30+
## Instance Methods
31+
32+
### `$softDelete`
33+
34+
- **Type**: `() => Promise`
35+
36+
Soft delete the model instance. Updates the `key` and `flagName` attribute values accordingly.
37+
38+
Returns a Promise that resolves with the soft deleted model.
39+
40+
### `$trashed`
41+
42+
- **Type**: `() => boolean`
43+
44+
Determine whether the model has been soft deleted. This method essentially checks whether the [`flagName`](/guide/options.md#flagname) option value is true or false.
45+
46+
- **See also**: [Usage](/guide/usage.md)

docs/api/query.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
sidebarDepth: 2
3+
---
4+
5+
# Query
6+
7+
## Filters
8+
9+
### `withTrashed`
10+
11+
- **Type**: `() => Query`
12+
13+
Filters the result set to include soft deleted models.
14+
15+
- **See also**: [Including Soft Deleted Models](/guide/usage.md#including-soft-deleted-models)
16+
17+
### `onlyTrashed`
18+
19+
- **Type**: `() => Query`
20+
21+
Filters the result set so the query chain applies to **only** soft deleted models.
22+
23+
- **See also**: [Retrieving Only Soft Deleted Models](/guide/usage.md#retrieving-only-soft-deleted-models)
24+
25+
26+
## Results
27+
28+
### `allTrashed`
29+
30+
- **Type**: `() => Array`
31+
32+
Execute the query chain and return only soft deleted models.
33+
34+
- **See also**: [Retrieving All Soft Deleted Models](/guide/usage.md#retrieving-all-soft-deleted-models)

docs/deploy.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env sh
2+
3+
set -e
4+
5+
npm run docs:build
6+
7+
cd docs/.vuepress/dist
8+
9+
git init
10+
git add -A
11+
git commit -m 'deploy'
12+
13+
git push -f [email protected]:vuex-orm/plugin-soft-delete.git master:gh-pages
14+
15+
cd -

docs/guide/installation.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Installation
2+
3+
You can install Vuex ORM Soft Delete via NPM, Yarn, or download it directly. This is a plugin for Vuex ORM, therefore you must ensure [Vuex ORM](https://github.com/vuex-orm/vuex-orm) and [Vuex](https://vuex.vuejs.org/) are installed.
4+
5+
## NPM
6+
7+
```bash
8+
npm install @vuex-orm/plugin-soft-delete --save
9+
```
10+
11+
## Yarn
12+
13+
```bash
14+
yarn add @vuex-orm/plugin-soft-delete
15+
```
16+
17+
## Direct Download / CDN
18+
19+
[Unpkg.com](https://unpkg.com) provides NPM-based CDN links. Simply download and include with a script tag.
20+
21+
For development environments, testing and learning purposes, you can use the latest uncompressed version with:
22+
23+
```html
24+
<script src="https://unpkg.com/@vuex-orm/plugin-soft-delete"></script>
25+
```
26+
27+
For production, it's recommended to link to a specific version number and build to avoid unexpected breakage from newer versions:
28+
29+
```html
30+
<script src="https://unpkg.com/@vuex-orm/[email protected]/vuex-orm-soft-delete.min.js"></script>
31+
```
32+
33+
See the [releases](https://github.com/vuex-orm/plugin-soft-delete/releases) for available versions.
34+
35+
If you are using native ES Modules, there is also an ESM compatible build:
36+
37+
```html
38+
<script type="module">
39+
import VuexORMSoftDelete from 'https://unpkg.com/@vuex-orm/plugin-soft-delete/dist/vuex-orm-soft-delete.esm.js'
40+
</script>
41+
```
42+
43+
### Build Variants
44+
45+
In the `dist/` directory of the NPM package you will find many different builds. Each of them have their use depending on your build environment and may help to reduce bundle sizes.
46+
47+
| | URL |
48+
|----------------------------|:---------------------------------------------------------------------------------------------------------------------|
49+
| Development (uncompressed) | [vuex-orm-soft-delete.js](https://unpkg.com/@vuex-orm/plugin-soft-delete) |
50+
| Production (compressed) | [vuex-orm-soft-delete.min.js](https://unpkg.com/@vuex-orm/plugin-soft-delete/dist/vuex-orm-soft-delete.min.js) |
51+
| CommonJS | [vuex-orm-soft-delete.common.js](https://unpkg.com/@vuex-orm/plugin-soft-delete/dist/vuex-orm-soft-delete.common.js) |
52+
| ES Module | [vuex-orm-soft-delete.esm.js](https://unpkg.com/@vuex-orm/plugin-soft-delete/dist/vuex-orm-soft-delete.esm.js) |
53+
54+
55+
## Dev Build
56+
57+
The built files in `/dist` folder are only checked-in during releases. To use the latest source code on GitHub, you will have to run a build yourself.
58+
59+
```bash
60+
git clone https://github.com/vuex-orm/plugin-soft-delete.git node_modules/@vuex-orm/plugin-soft-delete
61+
cd node_modules/@vuex-orm/plugin-soft-delete
62+
yarn && yarn build
63+
```

0 commit comments

Comments
 (0)