This repository has been archived by the owner on Nov 21, 2024. It is now read-only.
forked from js-data/js-data-documentdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4c8e3d2
Showing
18 changed files
with
1,608 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Contributing to js-data-documentdb | ||
|
||
[Read the general Contributing Guide](http://js-data.io/docs/contributing). | ||
|
||
## Project structure | ||
|
||
* `dist/` - Contains final build files for distribution | ||
* `doc/` - Output folder for JSDocs | ||
* `src/` - Project source code | ||
* `test/` - Project tests | ||
|
||
## Clone, build & test | ||
|
||
1. `clone [email protected]:js-data/js-data-documentdb.git` | ||
1. `cd js-data-documentdb` | ||
1. `npm install` | ||
1. `npm run build` - Lint and build distribution files | ||
1. `npm run mocha` - Run tests (must set `DOCUMENT_DB_ENDPOINT` and `DOCUMENT_DB_KEY` environment variables) | ||
|
||
## To cut a release | ||
|
||
1. Checkout master | ||
1. Bump version in `package.json` appropriately | ||
1. Update `CHANGELOG.md` appropriately | ||
1. Run `npm run release` | ||
1. Commit and push changes | ||
1. Checkout `release`, merge `master` into `release` | ||
1. Run `npm run release` again | ||
1. Commit and push changes | ||
1. Make a GitHub release | ||
- tag from `release` branch | ||
- set tag name to version | ||
- set release name to version | ||
- set release body to changelog entry for the version | ||
1. `npm publish .` | ||
|
||
See also [Community & Support](http://js-data.io/docs/community). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
(delete this line) Find out how to get help here: http://js-data.io/docs/community. | ||
|
||
<your detailed, actionable, and helpful text goes here> | ||
|
||
Thanks! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Fixes #<issue_number_goes_here> (it's a good idea to open an issue first for discussion) | ||
|
||
- [ ] - `npm test` succeeds | ||
- [ ] - Code coverage does not decrease (if any source code was changed) | ||
- [ ] - Appropriate JSDoc comments were updated in source code (if applicable) | ||
- [ ] - Approprate changes to js-data.io docs have been suggested ("Suggest Edits" button) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
dist/*.js | ||
dist/*.map | ||
# Logs | ||
logs | ||
*.log | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directory | ||
# Commenting this out is preferred by some people, see | ||
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- | ||
node_modules/ | ||
bower_components/ | ||
|
||
# Users Environment Variables | ||
.lock-wscript | ||
|
||
.idea/ | ||
*.iml | ||
|
||
doc/ | ||
.nyc_output/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Jason Dobry <[email protected]> Jason Dobry <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# This is the official list of js-data-documentdb project authors. | ||
# | ||
# Names are formatted as: | ||
# Name or Organization <email address> | ||
# | ||
# The email address is not required for organizations. | ||
# | ||
Jason Dobry <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
##### 0.1.0 - 15 August 2016 | ||
|
||
- Initial Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# This is the official list of js-data-documentdb project contributors. | ||
# | ||
# Names are formatted as: | ||
# Name <email address> | ||
# | ||
InternalFX <[email protected]> | ||
Jason Dobry <[email protected]> | ||
Ollie Relph <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2014-2016 js-data-documentdb project authors | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<img src="https://raw.githubusercontent.com/js-data/js-data/master/js-data.png" alt="js-data logo" title="js-data" align="right" width="96" height="96" /> | ||
|
||
# js-data-documentdb | ||
|
||
[![Slack Status][sl_b]][sl_l] | ||
[![npm version][npm_b]][npm_l] | ||
[![Circle CI][circle_b]][circle_l] | ||
[![npm downloads][dn_b]][dn_l] | ||
[![Coverage Status][cov_b]][cov_l] | ||
|
||
Azure DocumentDB adapter for [js-data](http://www.js-data.io/). | ||
|
||
To get started, visit __[http://js-data.io](http://www.js-data.io/docs/js-data-documentdb)__. | ||
|
||
## Links | ||
|
||
* [Quick start](http://www.js-data.io/docs/home#quick-start) - Get started in 5 minutes | ||
* [Guides and Tutorials](http://www.js-data.io/docs/home) - Learn how to use JSData | ||
* [`DocumentDBAdapter` Guide](http://www.js-data.io/docs/js-data-documentdb) - Learn how to use `DocumentDBAdapter` | ||
* [API Reference Docs](http://api.js-data.io) - Explore components, methods, options, etc. | ||
* [Community & Support](http://js-data.io/docs/community) - Find solutions and chat with the community | ||
* [General Contributing Guide](http://js-data.io/docs/contributing) - Give back and move the project forward | ||
* [Contributing to js-data-documentdb](https://github.com/js-data/js-data-documentdb/blob/master/.github/CONTRIBUTING.md) | ||
|
||
## License | ||
|
||
The MIT License (MIT) | ||
|
||
Copyright (c) 2014-2016 js-data-documentdb project authors | ||
|
||
* [LICENSE](https://github.com/js-data/js-data-documentdb/blob/master/LICENSE) | ||
* [AUTHORS](https://github.com/js-data/js-data-documentdb/blob/master/AUTHORS) | ||
* [CONTRIBUTORS](https://github.com/js-data/js-data-documentdb/blob/master/CONTRIBUTORS) | ||
|
||
[sl_b]: http://slack.js-data.io/badge.svg | ||
[sl_l]: http://slack.js-data.io | ||
[npm_b]: https://img.shields.io/npm/v/js-data-documentdb.svg?style=flat | ||
[npm_l]: https://www.npmjs.org/package/js-data-documentdb | ||
[circle_b]: https://img.shields.io/circleci/project/js-data/js-data-documentdb.svg?style=flat | ||
[circle_l]: https://circleci.com/gh/js-data/js-data-documentdb | ||
[dn_b]: https://img.shields.io/npm/dm/js-data-documentdb.svg?style=flat | ||
[dn_l]: https://www.npmjs.org/package/js-data-documentdb | ||
[cov_b]: https://img.shields.io/codecov/c/github/js-data/js-data-documentdb.svg?style=flat | ||
[cov_l]: https://codecov.io/github/js-data/js-data-documentdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
general: | ||
branches: | ||
ignore: | ||
- gh-pages | ||
machine: | ||
node: | ||
version: 5.7.0 | ||
dependencies: | ||
pre: | ||
- npm i -g npm codecov nyc | ||
- npm i js-data@^3.0.0-rc.4 documentdb | ||
test: | ||
post: | ||
- nyc report --reporter=lcov | codecov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"source": { | ||
"includePattern": ".*js$" | ||
}, | ||
"plugins": ["plugins/markdown"], | ||
"opts": { | ||
"template": "./node_modules/ink-docstrap/template", | ||
"destination": "./doc/", | ||
"recurse": true, | ||
"verbose": true, | ||
"readme": "./README.md", | ||
"package": "./package.json" | ||
}, | ||
"templates": { | ||
"theme": "jsdata", | ||
"systemName": "js-data-documentdb", | ||
"copyright": "js-data-documentdb Copyright © 2014-2016 js-data-documentdb project authors", | ||
"outputSourceFiles": true, | ||
"linenums": true, | ||
"footer": "<div style=\"text-align:center\"><a href=\"/\">api.js-data.io</a> • <a href=\"http://js-data.io\">js-data.io</a></div>", | ||
"analytics": { | ||
"ua": "UA-55528236-2", | ||
"domain": "api.js-data.io" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import {Adapter} from 'js-data-adapter' | ||
|
||
interface IDict { | ||
[key: string]: any; | ||
} | ||
interface IBaseAdapter extends IDict { | ||
debug?: boolean, | ||
raw?: boolean | ||
} | ||
interface IBaseDocumentDBAdapter extends IBaseAdapter { | ||
documentOpts?: any | ||
} | ||
export class DocumentDBAdapter extends Adapter { | ||
static extend(instanceProps?: IDict, classProps?: IDict): typeof DocumentDBAdapter | ||
constructor(opts?: IBaseDocumentDBAdapter) | ||
} | ||
export interface OPERATORS { | ||
'==': Function | ||
'===': Function | ||
'!=': Function | ||
'!==': Function | ||
'>': Function | ||
'>=': Function | ||
'<': Function | ||
'<=': Function | ||
'isectEmpty': Function | ||
'isectNotEmpty': Function | ||
'in': Function | ||
'notIn': Function | ||
'contains': Function | ||
'notContains': Function | ||
} | ||
export interface version { | ||
full: string | ||
minor: string | ||
major: string | ||
patch: string | ||
alpha: string | boolean | ||
beta: string | boolean | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/*global assert:true */ | ||
'use strict' | ||
|
||
// prepare environment for js-data-adapter-tests | ||
import 'babel-polyfill' | ||
|
||
import * as JSData from 'js-data' | ||
import JSDataAdapterTests from './node_modules/js-data-adapter/dist/js-data-adapter-tests' | ||
import * as JSDataDocumentDB from './src/index' | ||
|
||
const assert = global.assert = JSDataAdapterTests.assert | ||
global.sinon = JSDataAdapterTests.sinon | ||
|
||
JSDataAdapterTests.init({ | ||
debug: false, | ||
JSData: JSData, | ||
Adapter: JSDataDocumentDB.DocumentDBAdapter, | ||
adapterConfig: { | ||
documentOpts: { | ||
urlConnection: process.env.DOCUMENT_DB_ENDPOINT, | ||
auth: { | ||
masterKey: process.env.DOCUMENT_DB_KEY | ||
} | ||
} | ||
}, | ||
methods: [ | ||
'create', | ||
'createMany', | ||
'count', | ||
'destroy', | ||
'destroyAll', | ||
'find', | ||
'findAll', | ||
'sum' | ||
], | ||
// js-data-documentdb does NOT support these features | ||
// xfeatures: [ | ||
// 'findAllLikeOp', | ||
// 'filterOnRelations' | ||
// ] | ||
features: [] | ||
}) | ||
|
||
describe('exports', function () { | ||
it('should have correct exports', function () { | ||
assert(JSDataDocumentDB.DocumentDBAdapter) | ||
assert(JSDataDocumentDB.OPERATORS) | ||
assert(JSDataDocumentDB.OPERATORS['==']) | ||
assert(JSDataDocumentDB.version) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
{ | ||
"name": "js-data-documentdb", | ||
"description": "DocumentDB adapter for js-data.", | ||
"version": "0.1.0", | ||
"homepage": "https://github.com/js-data/js-data-documentdb", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/js-data/js-data-documentdb.git" | ||
}, | ||
"author": "js-data-documentdb project authors", | ||
"license": "MIT", | ||
"main": "./dist/js-data-documentdb.js", | ||
"typings": "./dist/js-data-documentdb.d.ts", | ||
"files": [ | ||
"dist/", | ||
"src/", | ||
"AUTHORS", | ||
"CONTRIBUTORS" | ||
], | ||
"keywords": [ | ||
"data", | ||
"datastore", | ||
"store", | ||
"database", | ||
"adapter", | ||
"documentdb", | ||
"azure" | ||
], | ||
"standard": { | ||
"parser": "babel-eslint", | ||
"globals": [ | ||
"describe", | ||
"it", | ||
"sinon", | ||
"assert", | ||
"before", | ||
"after", | ||
"beforeEach", | ||
"afterEach" | ||
], | ||
"ignore": [ | ||
"dist/", | ||
"doc/" | ||
] | ||
}, | ||
"babel": { | ||
"presets": [ | ||
"es2015" | ||
] | ||
}, | ||
"scripts": { | ||
"lint": "repo-tools lint \"**/*.js\"", | ||
"bundle": "rollup -c rollup.config.js -f cjs -o dist/js-data-documentdb.js -m dist/js-data-documentdb.js.map src/index.js && repo-tools write-version dist/js-data-documentdb.js", | ||
"doc": "jsdoc -c conf.json src node_modules/js-data-adapter/src", | ||
"watch": "watch \"npm run bundle\" src/", | ||
"build": "npm run lint && npm run bundle", | ||
"mocha": "mocha -t 20000 -R dot -r babel-core/register -r babel-polyfill mocha.start.js", | ||
"cover": "nyc --require babel-core/register --require babel-polyfill --cache mocha -t 20000 -R dot mocha.start.js && nyc report --reporter=html", | ||
"test": "npm run build && npm run cover", | ||
"release": "npm test && npm run doc && repo-tools updates && repo-tools changelog && repo-tools authors" | ||
}, | ||
"dependencies": { | ||
"js-data-adapter": "~0.8.2", | ||
"mout": "1.0.0" | ||
}, | ||
"peerDependencies": { | ||
"js-data": "^3.0.0-rc.4", | ||
"documentdb": "1.x.x" | ||
}, | ||
"devDependencies": { | ||
"js-data-repo-tools": "0.5.6" | ||
} | ||
} |
Oops, something went wrong.