Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sguilly committed Jul 17, 2015
0 parents commit bfb005f
Show file tree
Hide file tree
Showing 19 changed files with 8,750 additions and 0 deletions.
1 change: 1 addition & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/node_modules/
/coverage/
/.idea/
27 changes: 27 additions & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"requireCurlyBraces": ["else", "for", "while", "do", "try", "catch"],
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"],
"requireSpacesInFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"disallowMultipleVarDecl": true,
"disallowSpacesInsideArrayBrackets": true,
"disallowSpacesInsideParentheses": true,
"disallowSpaceAfterObjectKeys": true,
"disallowQuotedKeysInObjects": true,
"requireSpaceBeforeBinaryOperators": ["?", "+", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
"disallowSpaceAfterBinaryOperators": ["!"],
"requireSpaceAfterBinaryOperators": ["?", ",", "+", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
"disallowSpaceBeforeBinaryOperators": [","],
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
"requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
"disallowImplicitTypeConversion": ["numeric", "binary", "string"],
"disallowKeywords": ["with", "eval"],
"disallowMultipleLineBreaks": true,
"disallowKeywordsOnNewLine": ["else"],
"requireLineFeedAtFileEnd": true,
"excludeFiles": ["node_modules/**"],
"validateIndentation": 2
}
11 changes: 11 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"node": true,
"esnext": true,
"camelcase": true,
"immed": true,
"newcap": true,
"undef": true,
"unused": "vars",
"strict": true,
"mocha": true
}
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sudo: false
language: node_js
node_js:
- '0.10'
- '0.12'
- 'iojs'
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2015 Stéphane GUILLY <[email protected]>

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.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# onvif-soap [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url]
> ONVIF CLIENT TO MANAGE CAMERA

## Install

```sh
$ npm install --save onvif-soap
```


## Usage

```js
var onvifSoap = require('onvif-soap');

onvifSoap('Rainbow');
```

## License

MIT © [Stéphane GUILLY]()


[npm-image]: https://badge.fury.io/js/onvif-soap.svg
[npm-url]: https://npmjs.org/package/onvif-soap
[travis-image]: https://travis-ci.org/sguilly/onvif-soap.svg?branch=master
[travis-url]: https://travis-ci.org/sguilly/onvif-soap
[daviddm-image]: https://david-dm.org/sguilly/onvif-soap.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/sguilly/onvif-soap
[coveralls-image]: https://coveralls.io/repos/sguilly/onvif-soap/badge.svg
[coveralls-url]: https://coveralls.io/r/sguilly/onvif-soap
59 changes: 59 additions & 0 deletions example.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/**
* Created by sguilly on 16/07/2015.
*/
var Cam = require('./lib/onvif').Cam;

Cam.LoadWsdl(function () {
var cam = new Cam({
hostname: '192.168.0.31',
username: 'admin',
password: 'pbjsteam'
});

var cam1 = new Cam({
hostname: '192.168.0.19',
username: 'admin',
password: 'pbjsteam'
});

var cam2 = new Cam({
hostname: '192.168.0.33',
username: 'admin',
password: 'pbjsteam'
});



cam1.deviceCtrl('GetDeviceInformation').then(function (values) {
console.log(values);
});
/*
cam1.deviceCtrl('GetServices').then(function (values) {
console.log(values);
});
cam1.mediaCtrl('GetSnapshotUri').then(function (values) {
console.log(values);
});*/



// cam1.deviceCtrl('GetDeviceInformation').then(function(values) {
// console.log(values);
// });
//
//cam2.deviceCtrl('GetDeviceInformation').then(function(values) {
// console.log(values);
//});










});

66 changes: 66 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
'use strict';
var path = require('path');
var gulp = require('gulp');
var mocha = require('gulp-mocha');
var jshint = require('gulp-jshint');
var jscs = require('gulp-jscs');
var istanbul = require('gulp-istanbul');
var coveralls = require('gulp-coveralls');
var babel = require('gulp-babel');
var plumber = require('gulp-plumber');

var handleErr = function (err) {
console.log(err.message);
process.exit(1);
};

gulp.task('static', function () {
return gulp.src([
'**/*.js',
'!node_modules/**'
])
.pipe(jshint('.jshintrc'))
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'))
.pipe(jscs())
.on('error', handleErr);
});

gulp.task('pre-test', function () {
return gulp.src('lib/**/*.js')
.pipe(babel())
.pipe(istanbul({includeUntested: true}))
.pipe(istanbul.hookRequire());
});

gulp.task('test', ['pre-test'], function (cb) {
var mochaErr;

gulp.src('test/**/*.js')
.pipe(plumber())
.pipe(mocha({reporter: 'spec', require: ['babel-core/register']}))
.on('error', function (err) {
mochaErr = err;
})
.pipe(istanbul.writeReports())
.on('end', function () {
cb(mochaErr);
});
});

gulp.task('coveralls', ['test'], function () {
if (!process.env.CI) {
return;
}

return gulp.src(path.join(__dirname, 'coverage/lcov.info'))
.pipe(coveralls());
});

gulp.task('babel', function () {
return gulp.src('lib/**/*.js')
.pipe(babel())
.pipe(gulp.dest('dist'));
});

gulp.task('default', ['static', 'test', 'coveralls']);
Loading

0 comments on commit bfb005f

Please sign in to comment.