This commit is contained in:
GotPPay
2017-10-16 20:21:19 +02:00
parent 8a7f8794cf
commit a75ea978f9
2554 changed files with 804218 additions and 109 deletions

View File

@@ -0,0 +1,76 @@
"use strict";
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* jshint maxlen: false */
const apirequest_1 = require("../../lib/apirequest");
/**
* Google Search Console URL Testing Tools API
*
* Provides tools for running validation tests against single URLs
*
* @example
* const google = require('googleapis');
* const searchconsole = google.searchconsole('v1');
*
* @namespace searchconsole
* @type {Function}
* @version v1
* @variation v1
* @param {object=} options Options for Searchconsole
*/
function Searchconsole(options) {
const self = this;
self._options = options || {};
self.urlTestingTools = {
mobileFriendlyTest: {
/**
* searchconsole.urlTestingTools.mobileFriendlyTest.run
*
* @desc Runs Mobile-Friendly Test for a given URL.
*
* @alias searchconsole.urlTestingTools.mobileFriendlyTest.run
* @memberOf! searchconsole(v1)
*
* @param {object} params Parameters for request
* @param {searchconsole(v1).RunMobileFriendlyTestRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
run: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://searchconsole.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/v1/urlTestingTools/mobileFriendlyTest:run').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: [],
pathParams: [],
context: self
};
return apirequest_1.default(parameters, callback);
}
}
};
}
module.exports = Searchconsole;
//# sourceMappingURL=v1.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"v1.js","sourceRoot":"","sources":["v1.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,0BAA0B;AAE1B,qDAAoD;AAEpD;;;;;;;;;;;;;;GAcG;AACH,uBAAuB,OAAO;IAC5B,MAAM,IAAI,GAAG,IAAI,CAAC;IAClB,IAAI,CAAC,QAAQ,GAAG,OAAO,IAAI,EAAE,CAAC;IAE9B,IAAI,CAAC,eAAe,GAAG;QACrB,kBAAkB,EAAE;YAElB;;;;;;;;;;;;;eAaG;YACH,GAAG,EAAE,UAAU,MAAM,EAAE,OAAO,EAAE,QAAQ;gBACtC,EAAE,CAAC,CAAC,OAAO,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC;oBAClC,QAAQ,GAAG,OAAO,CAAC;oBACnB,OAAO,GAAG,EAAE,CAAC;gBACf,CAAC;gBACD,OAAO,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;gBAE1B,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,uCAAuC,CAAC;gBAE3E,MAAM,UAAU,GAAG;oBACjB,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;wBACrB,GAAG,EAAE,CAAC,OAAO,GAAG,4CAA4C,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,IAAI,CAAC;wBAC3F,MAAM,EAAE,MAAM;qBACf,EAAE,OAAO,CAAC;oBACX,MAAM,EAAE,MAAM;oBACd,cAAc,EAAE,EAAE;oBAClB,UAAU,EAAE,EAAE;oBACd,OAAO,EAAE,IAAI;iBACd,CAAC;gBAEF,MAAM,CAAC,oBAAgB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;YAChD,CAAC;SACF;KACF,CAAC;AACJ,CAAC;AA0DD,iBAAS,aAAa,CAAC"}

View File

@@ -0,0 +1,139 @@
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* jshint maxlen: false */
import createAPIRequest from '../../lib/apirequest';
/**
* Google Search Console URL Testing Tools API
*
* Provides tools for running validation tests against single URLs
*
* @example
* const google = require('googleapis');
* const searchconsole = google.searchconsole('v1');
*
* @namespace searchconsole
* @type {Function}
* @version v1
* @variation v1
* @param {object=} options Options for Searchconsole
*/
function Searchconsole(options) { // eslint-disable-line
const self = this;
self._options = options || {};
self.urlTestingTools = {
mobileFriendlyTest: {
/**
* searchconsole.urlTestingTools.mobileFriendlyTest.run
*
* @desc Runs Mobile-Friendly Test for a given URL.
*
* @alias searchconsole.urlTestingTools.mobileFriendlyTest.run
* @memberOf! searchconsole(v1)
*
* @param {object} params Parameters for request
* @param {searchconsole(v1).RunMobileFriendlyTestRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
run: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
const rootUrl = options.rootUrl || 'https://searchconsole.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/v1/urlTestingTools/mobileFriendlyTest:run').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: [],
pathParams: [],
context: self
};
return createAPIRequest(parameters, callback);
}
}
};
}
/**
* @typedef BlockedResource
* @memberOf! searchconsole(v1)
* @type object
* @property {string} url URL of the blocked resource.
*/
/**
* @typedef Image
* @memberOf! searchconsole(v1)
* @type object
* @property {string} data Image data in format determined by the mime type. Currently, the format
will always be "image/png", but this might change in the future.
* @property {string} mimeType The mime-type of the image data.
*/
/**
* @typedef MobileFriendlyIssue
* @memberOf! searchconsole(v1)
* @type object
* @property {string} rule Rule violated.
*/
/**
* @typedef ResourceIssue
* @memberOf! searchconsole(v1)
* @type object
* @property {searchconsole(v1).BlockedResource} blockedResource Describes a blocked resource issue.
*/
/**
* @typedef RunMobileFriendlyTestRequest
* @memberOf! searchconsole(v1)
* @type object
* @property {boolean} requestScreenshot Whether or not screenshot is requested. Default is false.
* @property {string} url URL for inspection.
*/
/**
* @typedef RunMobileFriendlyTestResponse
* @memberOf! searchconsole(v1)
* @type object
* @property {string} mobileFriendliness Test verdict, whether the page is mobile friendly or not.
* @property {searchconsole(v1).MobileFriendlyIssue[]} mobileFriendlyIssues List of mobile-usability issues.
* @property {searchconsole(v1).ResourceIssue[]} resourceIssues Information about embedded resources issues.
* @property {searchconsole(v1).Image} screenshot Screenshot of the requested URL.
* @property {searchconsole(v1).TestStatus} testStatus Final state of the test, can be either complete or an error.
*/
/**
* @typedef TestStatus
* @memberOf! searchconsole(v1)
* @type object
* @property {string} details Error details if applicable.
* @property {string} status Status of the test.
*/
export = Searchconsole;