diff --git a/nix/config.nix b/nix/.nixpkgs/config.nix similarity index 100% rename from nix/config.nix rename to nix/.nixpkgs/config.nix diff --git a/nix/dot.json b/nix/dot.json deleted file mode 100644 index 13b67c5..0000000 --- a/nix/dot.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "symlinks": [ - { - "source": "config.nix", - "target": "~/.nixpkgs/config.nix" - }, - ] -} \ No newline at end of file diff --git a/node_modules/googleclientlogin/.npmignore b/node_modules/googleclientlogin/.npmignore deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/googleclientlogin/COPYING.MIT b/node_modules/googleclientlogin/COPYING.MIT deleted file mode 100644 index a96fb3e..0000000 --- a/node_modules/googleclientlogin/COPYING.MIT +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011 Lajos Koszti http://ajnasz.hu - -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. diff --git a/node_modules/googleclientlogin/README b/node_modules/googleclientlogin/README deleted file mode 100644 index e61a05a..0000000 --- a/node_modules/googleclientlogin/README +++ /dev/null @@ -1,144 +0,0 @@ -Google's ClientLogin authentication implementation for Node.js - -Requires at least nodejs 0.4.1 - -Properties: - errors: That is an object, filled with the possible error messages. - accountTypes: An object, where you can set the type of account to request authorization for. - properties are: google, hosted, hostedOrGoogle - default is hostedOrGoogle - -Events: - login: emitted when login was success - error: emitted when an error occured. Has two parameters, the response object and the received data - You can access to their names via constants: GoogleClientLogin.events.login or GoogleClientLogin.events.error - or you can use 'login' and 'error' as string. - -Methods: - login - Starts the login process. It has one optional parameter, which should be an object with two properties: - logincaptcha, logintoken. - The logincaptcha is the user's answer to the captcha question - You will receive the logintoken if the login failed and the CaptchaRequired error code arrived - You must pass both the logincaptcha and logintoken if you must pass a captcha challange - - getAuthId - Returns the value of the authId key from the response. If the login was success you will need to use this value to perform additional requests. You must put it into a the Authorization header like this: - 'Authorization': 'GoogleLogin auth=' + googleAuth.getAuthId(), - - getSID - Returns the value of SID key from the response. - - getLSID - Returns the value of LSID key from the response. - - isCaptchaRequired - If the login was not success and the user need to pass a captcha challenge this method will return true - - getCaptchaUrl - Url of the captcha image - - getCaptchaToken - You will need to pass it back to the google with the user's answer to the captcha if the login failed and captcha authentication required. - - getError - If the login was not success, google will send back an error code what you can get with this method - - -After the login was success, you should use the AuthId in each of your requests, see example below - -http://code.google.com/apis/gdata/faq.html#clientlogin -list of services: - - -Name |name in googleclientlogin module |value ------------------------------------------------------|-------------------------------------|--------------- -Google Adwords APIs: |adwords: |'adwords' ------------------------------------------------------|-------------------------------------|--------------- -Google Analytics Data APIs: |analytics: |'analytics' ------------------------------------------------------|-------------------------------------|--------------- -Google Apps APIs (Domain Information & Management): |apps: |'apps' ------------------------------------------------------|-------------------------------------|--------------- -Google Base Data API: |base: |'gbase' ------------------------------------------------------|-------------------------------------|--------------- -Google Sites Data API: |sites: |'jotspot' ------------------------------------------------------|-------------------------------------|--------------- -Blogger Data API: |blogger: |'blogger' ------------------------------------------------------|-------------------------------------|--------------- -Book Search Data API: |book: |'print' ------------------------------------------------------|-------------------------------------|--------------- -Calendar Data API: |calendar: |'cl' ------------------------------------------------------|-------------------------------------|--------------- -Google Code Search Data API: |codesearch: |'codesearch' ------------------------------------------------------|-------------------------------------|--------------- -Contacts Data API: |contacts: |'cp' ------------------------------------------------------|-------------------------------------|--------------- -Documents List Data API: |docs: |'writely' ------------------------------------------------------|-------------------------------------|--------------- -Finance Data API: |finance: |'finance' ------------------------------------------------------|-------------------------------------|--------------- -Gmail Atom feed: |mail: |'mail' ------------------------------------------------------|-------------------------------------|--------------- -Health Data API: |health: |'health' ------------------------------------------------------|-------------------------------------|--------------- -Health Data API H9 Sandbox |weaver: |'weaver' ------------------------------------------------------|-------------------------------------|--------------- -Maps Data APIs: |maps: |'local' ------------------------------------------------------|-------------------------------------|--------------- -Picasa Web Albums Data API: |picasaweb: |'lh2' ------------------------------------------------------|-------------------------------------|--------------- -Sidewiki Data API: |sidewiki: |'annotateweb' ------------------------------------------------------|-------------------------------------|--------------- -Spreadsheets Data API: |spreadsheets: |'wise' ------------------------------------------------------|-------------------------------------|--------------- -Webmaster Tools API: |webmastertools: |'sitemaps' ------------------------------------------------------|-------------------------------------|--------------- -YouTube Data API: |youtube: |'youtube' ------------------------------------------------------|-------------------------------------|--------------- -C2DM Push Notification Service: |c2dm: |'ac2dm' ------------------------------------------------------|-------------------------------------|--------------- -Google Reader Data API (unofficial): |reader: |'reader' ------------------------------------------------------|-------------------------------------|--------------- -Google Voice API (unoffical): |voice: |'grandcentral' - - -How to use: - -var GoogleClientLogin = import('googleclientlogin').GoogleClientLogin; -var googleAuth = new GoogleClientLogin({ - email: 'yourmail@gmail.com', - password: 'yourpassword', - service: 'contacts', - accountType: GoogleClientLogin.accountTypes.google -}); -googleAuth.on(GoogleClientLogin.events.login, function(){ - // do things with google services - require('https').request({ - host: 'www.google.com', - port: 443, - path: path, - method: 'GET', - headers: { - 'Authorization': 'GoogleLogin auth=' + googleAuth.getAuthId(), - ... - } - }); -}); -googleAuth.on(GoogleClientLogin.events.error, function(e) { - switch(e.message) { - case GoogleClientLogin.errors.loginFailed: - if (this.isCaptchaRequired()) { - requestCaptchaFromUser(this.getCaptchaUrl(), this.getCaptchaToken()); - } else { - requestLoginDetailsAgain(); - } - break; - case GoogleClientLogin.errors.tokenMissing: - case GoogleClientLogin.errors.captchaMissing: - throw new Error('You must pass the both captcha token and the captcha') - break; - } - throw new Error('Unknown error'); - // damn.. -}); -googleAuth.login(); diff --git a/node_modules/googleclientlogin/index.js b/node_modules/googleclientlogin/index.js deleted file mode 100644 index 4a70fd3..0000000 --- a/node_modules/googleclientlogin/index.js +++ /dev/null @@ -1,313 +0,0 @@ -/*jslint indent: 2*/ -/*global require: true*/ -/** - * For more details about the ClientLogin authentication check out this: - * http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html - */ -var EventEmitter = require('events').EventEmitter, - util = require('util'); - -// useragent string -const userAgent = 'GCLNodejs'; -// version string -const ver = '0.2.2'; - -const loginURL = '/accounts/ClientLogin'; -const googleHost = 'www.google.com'; -const captchaRequiredError = 'CaptchaRequired'; - -// error messages -const errors = { - captchaMissing: 'User entered captcha is missing', - tokenMissing: 'Login token is missing', - loginFailed: 'Login failed' -}; - -const events = { - login: 'login', - error: 'error' -}; - -// Google account types -const accountTypes = { - google: 'GOOGLE', // get authorization for a Google account only - hosted: 'HOSTED', // get authorization for a hosted account only - hostedOrGoogle: 'HOSTED_OR_GOOGLE' // get authorization first for a hosted account; if attempt fails, get authorization for a Google account -}; -// http://code.google.com/apis/gdata/faq.html#clientlogin -const services = { - adwords: 'adwords', - analytics: 'analytics', - apps: 'apps', - base: 'gbase', - sites: 'jotspot', - blogger: 'blogger', - book: 'print', - calendar: 'cl', - codesearch: 'codesearch', - contacts: 'cp', - docs: 'writely', - finance: 'finance', - mail: 'mail', - health: 'health', - weaver: 'weaver', - maps: 'local', - picasaweb: 'lh2', - reader: 'reader', - sidewiki: 'annotateweb', - spreadsheets: 'wise', - webmastertools: 'sitemaps', - youtube: 'youtube', - c2dm: 'ac2dm', - voice: 'grandcentral', - fusiontables: 'fusiontables' -}; - - -/** - * Helps to log in to any google service with the clientlogin method - * Google returns 3 values when login was success: - * Auth, SID, LSID - * - * After the login you need to include the Auth value into - * the Authorization HTTP header on each request: - * - * client.request('GET', '...', { - * ..., - * 'Authorization':'GoogleLogin auth=' + googleClientLoginInstance.getAuthId() - * }) - * - * @class GoogleClientLogin - * @constructor - * @param Object conf An object, with two properties: email and password - */ -var GoogleClientLogin = function (conf) { - this.conf = conf || {}; - // stores the authentication data - this.auths = {}; - this.loginProcessing = false; -}; -GoogleClientLogin.prototype = {}; -util.inherits(GoogleClientLogin, EventEmitter); - -/** - * Splits response data into key-value pairs, - * Only for internal usage - * @method _parseData - */ -GoogleClientLogin.prototype._parseData = function (data) { - this.auths = {}; - data.split('\n').forEach(function (dataStr) { - var data = dataStr.split('='); - this.auths[data[0]] = data[1]; - }.bind(this)); -}; - -/** - * Parses the response of the login - * emits error and login event - * @method _parseLoginResponse - * @param {http.ClientResponse} response The response object - */ -GoogleClientLogin.prototype._parseLoginResponse = function (response) { - - var data = ''; - - response.on('data', function (chunk) { - data += chunk; - }.bind(this)); - - response.on('error', function (e) { - this.emit(events.error, e); - }.bind(this)); - - response.on('end', function () { - this.loginProcessing = false; - var statusCode = response.statusCode, error; - this._parseData(data); - if (statusCode >= 200 && statusCode < 300) { - /** - * Fires when login was success - * @event login - */ - this.emit(events.login); - } else { - /** - * Fires when login failed - * @event loginFailed - */ - error = new Error(errors.loginFailed); - error.data = data; - error.response = response; - this.emit(events.error, error); - } - }.bind(this)); -}; - -/** - * Method to find out which account type should we use, default is HOSTED_OR_GOOGLE - * Only for internal usage - * @method _getAccountType - * @returns string - */ -GoogleClientLogin.prototype._getAccountType = function (params) { - var output = accountTypes.hostedOrGoogle; - - if (typeof params === 'object' && params.accountType === 'string' && - typeof accountTypes[params.accountType] === 'string') { - output = accountTypes[params.accountType]; - } else if (typeof this.conf.accountType === 'string') { - output = accountTypes[this.conf.accountType]; - } - - return output; -}; - -/** - * Method to create the content of the login request - * Only for internal usage - * @method _getRequestContent - * @param {Object} params (Optional) You can pass the logincaptcha and - * logintoken and the accountType as properties - * @returns string - */ -GoogleClientLogin.prototype._getRequestContent = function (params) { - var output, hasCaptcha, hasToken, error; - - output = { - accountType: this._getAccountType(params), - Email: this.conf.email, - Passwd: this.conf.password, - service: services[this.conf.service], - source: userAgent + '_' + ver - }; - - if (typeof params === 'object') { - - hasCaptcha = typeof params.logincaptcha === 'string'; - hasToken = typeof params.logintoken === 'string'; - - if (hasCaptcha && hasToken) { - output.logincaptcha = params.logincaptcha; - output.logintoken = params.logintoken; - // if the captcha or the token is given the other also required - } else if (!hasCaptcha && hasToken) { - error = errors.captchaMissing; - } else if (!hasToken && hasCaptcha) { - error = errors.tokenMissing; - } - } - - if (error) { - this.emit(events.error, new Error(error)); - output = false; - } else { - output = require('querystring').stringify(output); - } - - return output; -}; - -/** - * Logs in the user - * @method login - * @param {Object} params (optional) You can pass the logincaptcha and - * logintoken and the accountType as properties - */ -GoogleClientLogin.prototype.login = function (params) { - // don't try to log in, if one is already in progress - if (!this.loginProcessing) { - this.loginProcessing = true; - - var content, request; - - content = this._getRequestContent(params); - - if (content !== false) { - request = require('https').request( - { - host: 'www.google.com', - port: 443, - path: loginURL, - method: 'POST', - headers: { - 'Content-Length': content.length, - 'Content-Type': 'application/x-www-form-urlencoded' - } - }, - this._parseLoginResponse.bind(this) - ); - request.write(content); - request.end(); - } - } -}; - -/** - * Method to get the AuthId property - * @method getAuthId - * @returns the AuthId or undefined - */ -GoogleClientLogin.prototype.getAuthId = function () { - return this.auths.Auth; -}; - -/** - * Method to ge the SID property - * @method getSID - * @returns the value of the SID property or undefined - */ -GoogleClientLogin.prototype.getSID = function () { - return this.auths.SID; -}; - -/** - * Method to get the LSID property - * @method getLSID - * @returns the value of the LSID property or undefined - */ -GoogleClientLogin.prototype.getLSID = function () { - return this.auths.LSID; -}; - -/** - * Method to get the error code - * @method getError - * @returns the error code or undefined - */ -GoogleClientLogin.prototype.getError = function () { - return this.auths.Error; -}; - -/** - * Method to know if captcha is required - * @method isCaptchaRequired - * @returns boolean - */ -GoogleClientLogin.prototype.isCaptchaRequired = function () { - return this.getError() === captchaRequiredError; -}; - -/** - * Method to get the captcha url - * @method getCaptchaUrl - * @returns the value of the CaptchaUrl property or undefined - */ -GoogleClientLogin.prototype.getCaptchaUrl = function () { - return this.auths.CaptchaUrl; -}; - -/** - * Returns the value of the CaptchaToken property - * @method getCaptchaToken - * @returns string or undefined - */ -GoogleClientLogin.prototype.getCaptchaToken = function () { - return this.auths.CaptchaToken; -}; - -GoogleClientLogin.errors = errors; -GoogleClientLogin.events = events; -GoogleClientLogin.accountTypes = accountTypes; - -exports.GoogleClientLogin = GoogleClientLogin; diff --git a/node_modules/googleclientlogin/package.json b/node_modules/googleclientlogin/package.json deleted file mode 100644 index f9663e6..0000000 --- a/node_modules/googleclientlogin/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "googleclientlogin", - "description": "Log in to Google services using CllientLogin method", - "url": "https://github.com/Ajnasz/GoogleClientLogin", - "keywords": [ - "google", - "service", - "authentication", - "api", - "clientlogin" - ], - "repository": { - "type": "git", - "url": "git://github.com/Ajnasz/GoogleClientLogin.git" - }, - "bugs": { - "url": "https://github.com/Ajnasz/GoogleClientLogin/issues" - }, - "engines": { - "node": ">=0.4.1" - }, - "author": { - "name": "Lajos Koszti", - "email": "ajnasz@ajnasz.hu", - "url": "http://ajnasz.hu" - }, - "version": "0.2.4", - "readme": "Google's ClientLogin authentication implementation for Node.js\n\nRequires at least nodejs 0.4.1\n\nProperties:\n errors: That is an object, filled with the possible error messages.\n accountTypes: An object, where you can set the type of account to request authorization for.\n properties are: google, hosted, hostedOrGoogle\n default is hostedOrGoogle\n\nEvents:\n login: emitted when login was success\n error: emitted when an error occured. Has two parameters, the response object and the received data\n You can access to their names via constants: GoogleClientLogin.events.login or GoogleClientLogin.events.error\n or you can use 'login' and 'error' as string.\n\nMethods:\n login\n Starts the login process. It has one optional parameter, which should be an object with two properties:\n logincaptcha, logintoken.\n The logincaptcha is the user's answer to the captcha question\n You will receive the logintoken if the login failed and the CaptchaRequired error code arrived\n You must pass both the logincaptcha and logintoken if you must pass a captcha challange\n\n getAuthId\n Returns the value of the authId key from the response. If the login was success you will need to use this value to perform additional requests. You must put it into a the Authorization header like this:\n 'Authorization': 'GoogleLogin auth=' + googleAuth.getAuthId(),\n\n getSID\n Returns the value of SID key from the response.\n\n getLSID\n Returns the value of LSID key from the response.\n\n isCaptchaRequired\n If the login was not success and the user need to pass a captcha challenge this method will return true\n\n getCaptchaUrl\n Url of the captcha image\n\n getCaptchaToken\n You will need to pass it back to the google with the user's answer to the captcha if the login failed and captcha authentication required.\n\n getError\n If the login was not success, google will send back an error code what you can get with this method\n\n\nAfter the login was success, you should use the AuthId in each of your requests, see example below\n\nhttp://code.google.com/apis/gdata/faq.html#clientlogin\nlist of services:\n\n\nName |name in googleclientlogin module |value\n-----------------------------------------------------|-------------------------------------|---------------\nGoogle Adwords APIs: |adwords: |'adwords'\n-----------------------------------------------------|-------------------------------------|---------------\nGoogle Analytics Data APIs: |analytics: |'analytics'\n-----------------------------------------------------|-------------------------------------|---------------\nGoogle Apps APIs (Domain Information & Management): |apps: |'apps'\n-----------------------------------------------------|-------------------------------------|---------------\nGoogle Base Data API: |base: |'gbase'\n-----------------------------------------------------|-------------------------------------|---------------\nGoogle Sites Data API: |sites: |'jotspot'\n-----------------------------------------------------|-------------------------------------|---------------\nBlogger Data API: |blogger: |'blogger'\n-----------------------------------------------------|-------------------------------------|---------------\nBook Search Data API: |book: |'print'\n-----------------------------------------------------|-------------------------------------|---------------\nCalendar Data API: |calendar: |'cl'\n-----------------------------------------------------|-------------------------------------|---------------\nGoogle Code Search Data API: |codesearch: |'codesearch'\n-----------------------------------------------------|-------------------------------------|---------------\nContacts Data API: |contacts: |'cp'\n-----------------------------------------------------|-------------------------------------|---------------\nDocuments List Data API: |docs: |'writely'\n-----------------------------------------------------|-------------------------------------|---------------\nFinance Data API: |finance: |'finance'\n-----------------------------------------------------|-------------------------------------|---------------\nGmail Atom feed: |mail: |'mail'\n-----------------------------------------------------|-------------------------------------|---------------\nHealth Data API: |health: |'health'\n-----------------------------------------------------|-------------------------------------|---------------\nHealth Data API H9 Sandbox |weaver: |'weaver'\n-----------------------------------------------------|-------------------------------------|---------------\nMaps Data APIs: |maps: |'local'\n-----------------------------------------------------|-------------------------------------|---------------\nPicasa Web Albums Data API: |picasaweb: |'lh2'\n-----------------------------------------------------|-------------------------------------|---------------\nSidewiki Data API: |sidewiki: |'annotateweb'\n-----------------------------------------------------|-------------------------------------|---------------\nSpreadsheets Data API: |spreadsheets: |'wise'\n-----------------------------------------------------|-------------------------------------|---------------\nWebmaster Tools API: |webmastertools: |'sitemaps'\n-----------------------------------------------------|-------------------------------------|---------------\nYouTube Data API: |youtube: |'youtube'\n-----------------------------------------------------|-------------------------------------|---------------\nC2DM Push Notification Service: |c2dm: |'ac2dm'\n-----------------------------------------------------|-------------------------------------|---------------\nGoogle Reader Data API (unofficial): |reader: |'reader'\n-----------------------------------------------------|-------------------------------------|---------------\nGoogle Voice API (unoffical): |voice: |'grandcentral'\n\n\nHow to use:\n\nvar GoogleClientLogin = import('googleclientlogin').GoogleClientLogin;\nvar googleAuth = new GoogleClientLogin({\n email: 'yourmail@gmail.com',\n password: 'yourpassword',\n service: 'contacts',\n accountType: GoogleClientLogin.accountTypes.google\n});\ngoogleAuth.on(GoogleClientLogin.events.login, function(){\n // do things with google services\n require('https').request({\n host: 'www.google.com',\n port: 443,\n path: path,\n method: 'GET',\n headers: {\n 'Authorization': 'GoogleLogin auth=' + googleAuth.getAuthId(),\n ...\n }\n });\n});\ngoogleAuth.on(GoogleClientLogin.events.error, function(e) {\n switch(e.message) {\n case GoogleClientLogin.errors.loginFailed:\n if (this.isCaptchaRequired()) {\n requestCaptchaFromUser(this.getCaptchaUrl(), this.getCaptchaToken());\n } else {\n requestLoginDetailsAgain();\n }\n break;\n case GoogleClientLogin.errors.tokenMissing:\n case GoogleClientLogin.errors.captchaMissing:\n throw new Error('You must pass the both captcha token and the captcha')\n break;\n }\n throw new Error('Unknown error');\n // damn..\n});\ngoogleAuth.login();\n", - "readmeFilename": "README", - "_id": "googleclientlogin@0.2.4", - "dist": { - "shasum": "4e552c0bfef0859171b6edc2603eaf3afc6c1a61" - }, - "_from": "googleclientlogin" -} diff --git a/node_modules/googleclientlogin/tests/test.js b/node_modules/googleclientlogin/tests/test.js deleted file mode 100644 index b295f76..0000000 --- a/node_modules/googleclientlogin/tests/test.js +++ /dev/null @@ -1,57 +0,0 @@ -/*global console:true, require:true*/ -/*jslint indent:2*/ -var assert = require('assert'); -var IniReader = require('inireader').IniReader; -var GoogleClientLogin = require('../index').GoogleClientLogin; -var userini = new IniReader('/home/ajnasz/.google.ini'); - -var finishedTests = 0; - -userini.on('fileParse', function () { - var account = this.param('account1'), googleAuth; - - googleAuth = new GoogleClientLogin({ - email: account.email, - password: account.password, - service: 'contacts', - accountType: account.type - }); - googleAuth.on(GoogleClientLogin.events.login, function () { - assert.equal(this.getSID().length, 267, 'Something wrong with the SID length'); - assert.equal(this.getLSID().length, 267, 'Something wrong with the LSID length'); - assert.equal(this.getAuthId().length, 267, 'Something wrong with the AuthId length'); - console.log('test 1 finished'); - finishedTests++; - // do things with google services - }); - googleAuth.on(GoogleClientLogin.events.error, function (e) { - assert.ok(false, 'Login failed!'); - console.log('on error: ', e.message); - // damn.. - }); - googleAuth.login(); -}); -userini.load(); - - -var googleAuth = new GoogleClientLogin({ - email: 'ajnasz@gmail.com', - password: 'foobar', - service: 'contacts', - accountType: GoogleClientLogin.accountTypes.google -}); -googleAuth.on(GoogleClientLogin.events.login, function () { - assert.ok(false, 'Login were success, however it should fail!'); - console.log('login success'); -}); -googleAuth.on(GoogleClientLogin.events.error, function (e) { - assert.equal(e.message, GoogleClientLogin.errors.loginFailed); - assert.equal(this.getError(), 'BadAuthentication', 'Wrong error returned'); - console.log('test 2 finished'); - finishedTests++; - // damn.. -}); -googleAuth.login(); -process.on('exit', function () { - assert.deepEqual(finishedTests, 2, 'finished tests num differs'); -}); diff --git a/node_modules/googleclientlogin/tests/testcaptcha.js b/node_modules/googleclientlogin/tests/testcaptcha.js deleted file mode 100644 index e86eb7c..0000000 --- a/node_modules/googleclientlogin/tests/testcaptcha.js +++ /dev/null @@ -1,65 +0,0 @@ -/*jslint indent: 2*/ -/*global require: true, console: true*/ -var assert = require('assert'); -var pw = function () { - return 'foobar' + Date.now() + Math.random(); -}; -var GoogleClientLogin = require('googleclientlogin').GoogleClientLogin; -(function () { - var googleAuth = new GoogleClientLogin({ - email: 'ajnasz@gmail.com', - password: pw(), - service: 'contacts', - accountType: GoogleClientLogin.accountTypes.google - }); - googleAuth.on(GoogleClientLogin.events.login, function () { - console.log('login success'); - }); - googleAuth.on(GoogleClientLogin.events.error, function (e) { - assert.equal(e.message, GoogleClientLogin.errors.tokenMissing); - console.log('test 2 finished', JSON.stringify(this.auths), this.isCaptchaRequired()); - // damn.. - }); - googleAuth.login({logincaptcha: 'asdf'}); -}()); - - - -(function () { - var googleAuth = new GoogleClientLogin({ - email: 'ajnasz@gmail.com', - password: pw(), - service: 'contacts', - accountType: GoogleClientLogin.accountTypes.google - }); - googleAuth.on(GoogleClientLogin.events.login, function () { - console.log('login success'); - }); - googleAuth.on(GoogleClientLogin.events.error, function (e) { - assert.equal(e.message, GoogleClientLogin.errors.captchaMissing); - console.log('test 2 finished', JSON.stringify(this.auths), this.isCaptchaRequired()); - // damn.. - }); - googleAuth.login({logintoken: 'asdf'}); -}()); - - - - -(function () { - var googleAuth = new GoogleClientLogin({ - email: 'ajnasz@gmail.com', - password: pw(), - service: 'contacts', - accountType: GoogleClientLogin.accountTypes.google - }); - googleAuth.on(GoogleClientLogin.events.login, function () { - console.log('login success'); - }); - googleAuth.on(GoogleClientLogin.events.error, function (e) { - console.log('test 2 finished', JSON.stringify(e.response.headers), - JSON.stringify(this.auths), this.isCaptchaRequired()); - // damn.. - }); - googleAuth.login({logintoken: 'asdf', logincaptcha: 'askdfljasf'}); -}());