Skip to content

Commit 9d04413

Browse files
committed
initial docs
1 parent e4f023e commit 9d04413

12 files changed

Lines changed: 107 additions & 46 deletions

File tree

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# @dataparty/api
2+
[![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)[![license](https://img.shields.io/github/license/datapartyjs/api)](https://github.com/datapartyjs/dataparty-api/blob/master/LICENSE)
3+
4+
@dataparty/api is an ad-hoc cloud solution for the Web3.0 generation.
5+
6+
* Documentation - [datapartyjs.github.io/dataparty-api](https://datapartyjs.github.io/dataparty-api)
7+
* NPM - [npmjs.com/package/@dataparty/api](https://www.npmjs.com/package/@dataparty/api)
8+
* Code - [github.com/datapartyjs/dataparty-api](https://github.com/datapartyjs/dataparty-api)
9+
* Support - [ko-fi/dataparty](https://ko-fi.com/dataparty)
10+
11+
# Goals
12+
13+
The primary goal of @dataparty/api is to push

jsdoc.json

Lines changed: 58 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,61 @@
11
{
2-
"tags": {
3-
"allowUnknownTags": true,
4-
"dictionaries": ["jsdoc"]
5-
},
6-
"source": {
7-
"include": ["src", "package.json", "README.md"],
8-
"includePattern": ".js$",
9-
"excludePattern": "(node_modules/|docs)"
10-
},
11-
"plugins": [
12-
"plugins/markdown"
13-
],
14-
"templates": {
15-
"cleverLinks": false,
16-
"monospaceLinks": true,
17-
"useLongnameInNav": false,
18-
"showInheritedInNav": true
19-
},
20-
"opts": {
21-
"destination": "./docs/",
22-
"encoding": "utf8",
23-
"private": true,
24-
"recurse": true,
25-
"template": "../../node_modules/docdash"
2+
"source": {
3+
"include": ["src", "package.json", "README.md"],
4+
"includePattern": ".(js)$",
5+
"excludePattern": "(node_modules/|docs)"
6+
},
7+
8+
"plugins": ["plugins/markdown"],
9+
10+
"opts": {
11+
"encoding": "utf8",
12+
"readme": "./README.md",
13+
"tutorials": "tutorials",
14+
"destination": "docs/",
15+
"recurse": true,
16+
"verbose": true,
17+
"template": "./node_modules/clean-jsdoc-theme",
18+
"theme_opts": {
19+
"homepageTitle": "@dataparty/api - cloud services for the Web3.0 generation",
20+
"title": "@dataparty/api",
21+
"sections": ["Classes", "Global", "Tutorials"],
22+
"default_theme": "dark",
23+
"displayModuleHeader": true,
24+
"menu": [
25+
{
26+
"title": "Github",
27+
"id": "github",
28+
"link": "https://github.com/datapartyjs/api"
29+
},
30+
{
31+
"title": "npm",
32+
"id": "npm",
33+
"link": "https://www.npmjs.com/package/@dataparty/api"
34+
}
35+
],
36+
"meta": [
37+
{
38+
"name": "Author",
39+
"content": "dataparty"
40+
},
41+
{
42+
"name": "Description",
43+
"content": "dependency solving task runner for javascript"
44+
}
45+
],
46+
"codepen": {
47+
"enable_for": ["tutorials"],
48+
"options": {
49+
"js_pre_processor": "babel"
50+
}
51+
},
52+
"footer": "<div style='margin-bottom: 0.5rem;'>@dataparty/api</div> Fork: <a href='https://github.com/datapartyjs/dataparty-api'>https://github.com/datapartyjs/dataparty-api</a><br>Built by <a href='https://www.dataparty.xyz'>dataparty</a> with 🖤"
2653
}
54+
},
55+
56+
57+
"markdown": {
58+
"hardwrap": false,
59+
"idInHeadings": true
60+
}
2761
}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
"clean": "rm -rf node_modules; rm package-lock.json; npm i",
5656
"build-test": "node ./examples/party/example-build.js",
5757
"watch-test": "DEBUG=* nodemon --ignore service test/test-service-compile.js",
58-
"build-docs": "npx jsdoc -c jsdoc.json"
58+
"build-docs": "./scripts/build-docs.sh",
59+
"generate-docs": "npx jsdoc --configure jsdoc.json --verbose"
5960
},
6061
"dependencies": {
6162
"@dataparty/bouncer-db": "1.0.1",
@@ -116,6 +117,7 @@
116117
"assert": "^2.0.0",
117118
"better-docs": "^1.1.6",
118119
"browserify-zlib": "^0.2.0",
120+
"clean-jsdoc-theme": "^4.2.6",
119121
"crypto-browserify": "^3.12.0",
120122
"docdash": "^1.1.1",
121123
"fake-indexeddb": "^4.0.0",

src/bouncer/idb.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const reach = require('../utils/reach')
33
const debug = require('debug')('bouncer.idb')
44
const EventEmitter = require('eventemitter3')
55

6-
module.exports = class IDb extends EventEmitter {
6+
class IDb extends EventEmitter {
77

88
/**
99
*
@@ -97,3 +97,5 @@ module.exports = class IDb extends EventEmitter {
9797
async findAndRemove(collectionName, msg){ throw new Error('not implemented') }
9898

9999
}
100+
101+
module.exports = IDb

src/bouncer/mongo-query.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ const ObjectId = require('bson-objectid')
44
const debug = require('debug')('bouncer.mongo-query')
55

66
// mongoose adapter for data party query specification
7-
module.exports = class MongoQuery {
7+
class MongoQuery {
88

99
/**
10-
* generates a mongodb query doc from a roshub query spec
10+
* generates a mongodb query doc from a dataparty query spec
1111
*
1212
* @constructor
13-
* @param spec - roshub query spec (wire format for data party queries)
13+
* @param spec - dataparty query spec (wire format for data party queries)
1414
*/
1515
constructor (spec) {
1616
this.spec = Object.assign({}, spec)
@@ -190,4 +190,6 @@ const buildQueryDoc = (node, cursor) => {
190190
return
191191
}
192192
throw new Error(`unrecognized query op: ${node.op}`)
193-
}
193+
}
194+
195+
module.exports = MongoQuery

src/config/json-file.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ const Path = require('path')
55
const mkdirp = require('mkdirp')
66
const deepSet = require('deep-set')
77
const reach = require('../utils/reach')
8-
const logger = require('debug')('dataparty.config.json-file');
8+
const logger = require('debug')('dataparty.config.json-file')
9+
10+
const IConfig = require('./iconfig')
911

1012
/**
1113
* @class
12-
* @implements {Config}
14+
* @implements {IConfig}
1315
*/
14-
class JsonFileConfig {
16+
class JsonFileConfig extends IConfig {
1517

1618
constructor(defaults={}){
1719
this.basePath = reach(defaults, 'basePath')

src/config/local-storage.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ const deepSet = require('deep-set')
44
const reach = require('../utils/reach')
55
const logger = require('debug')('dataparty.config.local-storage');
66

7+
const IConfig = require('./iconfig')
78
/**
89
* @class
9-
* @implements {Config}
10+
* @implements {IConfig}
1011
*/
11-
class LocalStorageConfig {
12+
class LocalStorageConfig extends IConfig {
1213

1314
constructor(defaults, whitelist){
1415
this.whitelist = whitelist || []

src/config/memory.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ const deepSet = require('deep-set')
44
const reach = require('../utils/reach')
55
const logger = require('debug')('dataparty.config.memory');
66

7+
const IConfig = require('./iconfig')
78
/**
89
* @class
9-
* @implements {Config}
10+
* @implements {IConfig}
1011
*/
11-
class MemoryConfig {
12+
class MemoryConfig extends IConfig {
1213

1314
constructor(defaults){
1415
defaults = defaults || {}

src/config/nconf.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ const touch = require('touch')
88
const mkdirp = require('mkdirp')
99
const sanitize = require('sanitize-filename')
1010

11-
const logger = require('debug')('dataparty.config.nconf');
11+
const logger = require('debug')('dataparty.config.nconf')
12+
13+
const IConfig = require('./iconfig')
1214

1315
var BASE_PATH = process.env.SNAP_COMMON || ((process.env.HOME) ? (process.env.HOME + '/.dataparty-api') : '.' )
1416

1517
/**
1618
* @class
17-
* @implements {Config}
19+
* @implements {IConfig}
1820
*/
19-
class NconfConfig {
21+
class NconfConfig extends IConfig {
2022

2123
constructor(defaults, whitelist){
2224
this.whitelist = whitelist || []

src/party/idocument.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class IDocument extends EventEmitter {
6666

6767
/**
6868
* @typedef {Object} IdObj
69-
* @property {string} id <mongo-id>
69+
* @property {string} id mongo-id or UUID
7070
* @property {string} type Document type
7171
*/
7272

0 commit comments

Comments
 (0)