From fc17f181a61ba119b825b7512a691b209ccda6c9 Mon Sep 17 00:00:00 2001 From: Diana Tkachenko Date: Wed, 26 Jun 2019 23:44:18 -0700 Subject: [PATCH 01/18] add typedoc generation, somewhat working --- docgen/content-sources/HOME.md | 3 + docgen/content-sources/toc.yaml | 75 +++ docgen/generate-docs.js | 315 +++++++++++++ docgen/theme/assets/css/firebase.css | 40 ++ docgen/theme/assets/css/main.css | 552 +++++++++++++++++++++++ docgen/theme/assets/images/lockup.png | Bin 0 -> 2646 bytes docgen/theme/layouts/default.hbs | 33 ++ docgen/theme/partials/breadcrumb.hbs | 11 + docgen/theme/partials/comment.hbs | 22 + docgen/theme/partials/header.hbs | 23 + docgen/theme/partials/member.sources.hbs | 15 + docgen/theme/partials/navigation.hbs | 22 + docgen/theme/templates/reflection.hbs | 72 +++ docgen/tsconfig.json | 3 + docgen/typedoc.js | 27 ++ package.json | 7 +- 16 files changed, 1219 insertions(+), 1 deletion(-) create mode 100644 docgen/content-sources/HOME.md create mode 100644 docgen/content-sources/toc.yaml create mode 100644 docgen/generate-docs.js create mode 100644 docgen/theme/assets/css/firebase.css create mode 100644 docgen/theme/assets/css/main.css create mode 100644 docgen/theme/assets/images/lockup.png create mode 100644 docgen/theme/layouts/default.hbs create mode 100644 docgen/theme/partials/breadcrumb.hbs create mode 100644 docgen/theme/partials/comment.hbs create mode 100644 docgen/theme/partials/header.hbs create mode 100644 docgen/theme/partials/member.sources.hbs create mode 100644 docgen/theme/partials/navigation.hbs create mode 100644 docgen/theme/templates/reflection.hbs create mode 100644 docgen/tsconfig.json create mode 100644 docgen/typedoc.js diff --git a/docgen/content-sources/HOME.md b/docgen/content-sources/HOME.md new file mode 100644 index 000000000..139c58dc0 --- /dev/null +++ b/docgen/content-sources/HOME.md @@ -0,0 +1,3 @@ +# Firebase Admin Node.js SDK Reference + +Functions SDK!!! \ No newline at end of file diff --git a/docgen/content-sources/toc.yaml b/docgen/content-sources/toc.yaml new file mode 100644 index 000000000..a8f658112 --- /dev/null +++ b/docgen/content-sources/toc.yaml @@ -0,0 +1,75 @@ +toc: +- title: "functions" + path: /docs/reference/functions/functions + +- title: "functions.analytics" + path: /docs/reference/functions/functions.analytics + section: + - title: "AnalyticsEvent" + path: /docs/reference/functions/AnalyticsEvent + - title: "AnalyticsEventBuilder" + path: /docs/reference/functions/AnalyticsEventBuilder + - title: "AppInfo" + path: /docs/reference/functions/functions.analytics.AppInfo + - title: "DeviceInfo" + path: /docs/reference/functions/functions.analytics.DeviceInfo + - title: "ExportBundleInfo" + path: /docs/reference/functions/functions.analytics.ExportBundleInfo + - title: "GeoInfo" + path: /docs/reference/functions/functions.analytics.GeoInfo + - title: "UserDimensions" + path: /docs/reference/functions/functions.analytics.UserDimensions + - title: "UserPropertyValue" + path: /docs/reference/functions/functions.analytics.UserPropertyValue + +- title: "functions.auth" + path: /docs/reference/functions/functions.auth + section: + - title: "UserBuilder" + path: /docs/reference/functions/functions.auth.UserBuilder + - title: "UserInfo" + path: /docs/reference/functions/functions.auth.UserInfo + - title: "UserMetadata" + path: /docs/reference/functions/functions.auth.UserMetadata + - title: "UserRecord" + path: /docs/reference/functions/functions.auth.UserRecord + +- title: "functions.database" + path: /docs/reference/functions/functions.database + section: + - title: "DeltaSnapshot" + path: /docs/reference/functions/functions.database.DeltaSnapshot + - title: "RefBuilder" + path: /docs/reference/functions/functions.database.RefBuilder + +- title: "functions.https" + path: /docs/reference/functions/functions.https + +- title: "functions.pubsub" + path: /docs/reference/functions/functions.pubsub + section: + - title: "Message" + path: /docs/reference/functions/functions.pubsub.Message + - title: "TopicBuilder" + path: /docs/reference/functions/functions.pubsub.TopicBuilder + +- title: "functions.storage" + path: /docs/reference/functions/functions.storage + section: + - title: "BucketBuilder" + path: /docs/reference/functions/functions.storage.BucketBuilder + - title: "ObjectBuilder" + path: /docs/reference/functions/functions.storage.ObjectBuilder + - title: "ObjectMetadata" + path: /docs/reference/functions/functions.storage.ObjectMetadata + +- title: "CloudFunction" + path: /docs/reference/functions/functions.CloudFunction +- title: "Config" + path: /docs/reference/functions/functions.config.Config +- title: "Event" + path: /docs/reference/functions/functions.Event +- title: "functions.config" + path: /docs/reference/functions/functions.config +- title: "HttpsFunction" + path: /docs/reference/functions/functions.HttpsFunction \ No newline at end of file diff --git a/docgen/generate-docs.js b/docgen/generate-docs.js new file mode 100644 index 000000000..655ba2c81 --- /dev/null +++ b/docgen/generate-docs.js @@ -0,0 +1,315 @@ +/** + * @license + * Copyright 2019 Google Inc. + * + * 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. + */ + +const { exec } = require('child-process-promise'); +const fs = require('mz/fs'); +const path = require('path'); +const yargs = require('yargs'); +const yaml = require('js-yaml'); + +const repoPath = path.resolve(`${__dirname}/..`); + +// Command-line options. +const { source: sourceFile } = yargs + .option('source', { + default: `${repoPath}/src`, + describe: 'Typescript source file(s)', + type: 'string' + }) + .version(false) + .help().argv; + +const docPath = path.resolve(`${__dirname}/html`); +const contentPath = path.resolve(`${__dirname}/content-sources`); +const tempHomePath = path.resolve(`${contentPath}/HOME_TEMP.md`); +const devsitePath = `/docs/reference/functions/`; + +/** + * Strips path prefix and returns only filename. + * @param {string} path + */ +function stripPath(path) { + const parts = path.split('/'); + return parts[parts.length - 1]; +} + +/** + * Runs Typedoc command. + * + * Additional config options come from ./typedoc.js + */ +function runTypedoc() { + const command = `${repoPath}/node_modules/.bin/typedoc ${sourceFile} \ + --out ${docPath} \ + --readme ${tempHomePath} \ + --options ${__dirname}/typedoc.js \ + --theme ${__dirname}/theme`; + + console.log('Running command:\n', command); + return exec(command); +} + +/** + * Moves files from subdir to root. + * @param {string} subdir Subdir to move files out of. + */ +function moveFilesToRoot(subdir) { + return exec(`mv ${docPath}/${subdir}/* ${docPath}`) + .then(() => { + exec(`rmdir ${docPath}/${subdir}`); + }) + .catch(e => console.error(e)); +} + +/** + * Reformat links to match flat structure. + * @param {string} file File to fix links in. + */ +function fixLinks(file) { + return fs.readFile(file, 'utf8').then(data => { + const flattenedLinks = data + .replace(/\.\.\//g, '') + .replace(/(modules|interfaces|classes)\//g, ''); + let caseFixedLinks = flattenedLinks; + for (const lower in lowerToUpperLookup) { + const re = new RegExp(lower, 'g'); + caseFixedLinks = caseFixedLinks.replace(re, lowerToUpperLookup[lower]); + } + return fs.writeFile(file, caseFixedLinks); + }); +} + +let tocText = ''; + +/** + * Generates temporary markdown file that will be sourced by Typedoc to + * create index.html. + * + * @param {string} tocRaw + * @param {string} homeRaw + */ +function generateTempHomeMdFile(tocRaw, homeRaw) { + const { toc } = yaml.safeLoad(tocRaw); + let tocPageLines = [homeRaw, '# API Reference']; + toc.forEach(group => { + console.log(group); + tocPageLines.push(`\n## [${group.title}](${stripPath(group.path)})`); + const section = group.section || []; + section.forEach(item => { + tocPageLines.push(`- [${item.title}](${stripPath(item.path)}.html)`); + }); + }); + return fs.writeFile(tempHomePath, tocPageLines.join('\n')); +} + +/** + * Mapping between lowercase file name and correctly cased name. + * Used to update links when filenames are capitalized. + */ +const lowerToUpperLookup = {}; + +/** + * Checks to see if any files listed in toc.yaml were not generated. + * If files exist, fixes filename case to match toc.yaml version. + */ +function checkForMissingFilesAndFixFilenameCase() { + // Get filenames from toc.yaml. + const filenames = tocText + .split('\n') + .filter(line => line.includes('path:')) + .map(line => line.split(devsitePath)[1]); + // Logs warning to console if a file from TOC is not found. + console.log(filenames); + const fileCheckPromises = filenames.map(filename => { + // Warns if file does not exist, fixes filename case if it does. + // Preferred filename for devsite should be capitalized and taken from + // toc.yaml. + const tocFilePath = `${docPath}/${filename}.html`; + // Generated filename from Typedoc will be lowercase. + const generatedFilePath = `${docPath}/${filename.toLowerCase()}.html`; + return fs.exists(generatedFilePath).then(exists => { + if (exists) { + // Store in a lookup table for link fixing. + lowerToUpperLookup[ + `${filename.toLowerCase()}.html` + ] = `${filename}.html`; + return fs.rename(generatedFilePath, tocFilePath); + } else { + console.warn( + `Missing file: ${filename}.html requested ` + + `in toc.yaml but not found in ${docPath}` + ); + } + }); + }); + return Promise.all(fileCheckPromises).then(() => filenames); +} + +/** + * Gets a list of html files in generated dir and checks if any are not + * found in toc.yaml. + * Option to remove the file if not found (used for node docs). + * + * @param {Array} filenamesFromToc Filenames pulled from toc.yaml + * @param {boolean} shouldRemove Should just remove the file + */ +function checkForUnlistedFiles(filenamesFromToc, shouldRemove) { + return fs.readdir(docPath).then(files => { + const htmlFiles = files + .filter(filename => filename.slice(-4) === 'html') + .map(filename => filename.slice(0, -5)); + const removePromises = []; + htmlFiles.forEach(filename => { + if ( + !filenamesFromToc.includes(filename) && + filename !== 'index' && + filename !== 'globals' + ) { + if (shouldRemove) { + console.log( + `REMOVING ${docPath}/${filename}.html - not listed in toc.yaml.` + ); + removePromises.push(fs.unlink(`${docPath}/${filename}.html`)); + } else { + // This is just a warning, it doesn't need to finish before + // the process continues. + console.warn( + `Unlisted file: ${filename} generated ` + + `but not listed in toc.yaml.` + ); + } + } + }); + if (shouldRemove) { + return Promise.all(removePromises).then(() => + htmlFiles.filter(filename => filenamesFromToc.includes(filename)) + ); + } else { + return htmlFiles; + } + }); +} + +/** + * Writes a _toc_autogenerated.yaml as a record of all files that were + * autogenerated. Helpful to tech writers. + * + * @param {Array} htmlFiles List of html files found in generated dir. + */ +function writeGeneratedFileList(htmlFiles) { + const fileList = htmlFiles.map(filename => { + return { + title: filename, + path: `${devsitePath}${filename}` + }; + }); + const generatedTocYAML = yaml.safeDump({ toc: fileList }); + return fs + .writeFile(`${docPath}/_toc_autogenerated.yaml`, generatedTocYAML) + .then(() => htmlFiles); +} + +/** + * Fix all links in generated files to other generated files to point to top + * level of generated docs dir. + * + * @param {Array} htmlFiles List of html files found in generated dir. + */ +function fixAllLinks(htmlFiles) { + const writePromises = []; + htmlFiles.forEach(file => { + // Update links in each html file to match flattened file structure. + writePromises.push(fixLinks(`${docPath}/${file}.html`)); + }); + return Promise.all(writePromises); +} + +/** + * Main document generation process. + * + * Steps for generating documentation: + * 1) Create temporary md file as source of homepage. + * 2) Run Typedoc, sourcing index.d.ts for API content and temporary md file + * for index.html content. + * 3) Write table of contents file. + * 4) Flatten file structure by moving all items up to root dir and fixing + * links as needed. + * 5) Check for mismatches between TOC list and generated file list. + */ +Promise.all([ + fs.readFile(`${contentPath}/toc.yaml`, 'utf8'), + fs.readFile(`${contentPath}/HOME.md`, 'utf8') +]) + // Read TOC and homepage text and assemble a homepage markdown file. + // This file will be sourced by Typedoc to generate index.html. + .then(([tocRaw, homeRaw]) => { + tocText = tocRaw; + return generateTempHomeMdFile(tocRaw, homeRaw); + }) + // Run main Typedoc process (uses index.d.ts and generated temp file above). + .then(runTypedoc) + .then(output => { + // Typedoc output. + console.log(output.stdout); + // Clean up temp home markdown file. (Nothing needs to wait for this.) + fs.unlink(tempHomePath); + // Devsite doesn't like css.map files. + return fs.unlink(`${docPath}/assets/css/main.css.map`); + }) + // Write out TOC file. Do this after Typedoc step to prevent Typedoc + // erroring when it finds an unexpected file in the target dir. + .then(() => fs.writeFile(`${docPath}/_toc.yaml`, tocText)) + // Flatten file structure. These categories don't matter to us and it makes + // it easier to manage the docs directory. + .then(() => { + return Promise.all([ + moveFilesToRoot('classes'), + moveFilesToRoot('modules'), + moveFilesToRoot('interfaces'), + ]); + }) + // Check for files listed in TOC that are missing and warn if so. + // Not blocking. + .then(checkForMissingFilesAndFixFilenameCase) + // Check for files that exist but aren't listed in the TOC and warn. + // (If API is node, actually remove the file.) + // Removal is blocking, warnings aren't. + .then(filenamesFromToc => + checkForUnlistedFiles(filenamesFromToc, false) + ) + // Write a _toc_autogenerated.yaml to record what files were created. + .then(htmlFiles => writeGeneratedFileList(htmlFiles)) + // Correct the links in all the generated html files now that files have + // all been moved to top level. + .then(fixAllLinks) + .then(() => { + fs.readFile(`${docPath}/index.html`, 'utf8').then(data => { + // String to include devsite local variables. + const localVariablesIncludeString = `{% include "docs/web/_local_variables.html" %}\n`; + return fs.writeFile( + `${docPath}/index.html`, + localVariablesIncludeString + data + ); + }); + }) + .catch(e => { + if (e.stdout) { + console.error(e.stdout); + } else { + console.error(e); + } + }); diff --git a/docgen/theme/assets/css/firebase.css b/docgen/theme/assets/css/firebase.css new file mode 100644 index 000000000..86c592820 --- /dev/null +++ b/docgen/theme/assets/css/firebase.css @@ -0,0 +1,40 @@ +.firebase-docs .project-name { + color: #333; + display: inline-block; + font-size: 20px; + font-weight: normal; + margin-left: 130px; +} + +.firebase-docs aside.tsd-sources { + padding: 8px; +} + +.firebase-docs .tsd-panel li { + margin: 0; +} + +.firebase-docs aside.tsd-sources:before { + content: unset; +} + +.firebase-docs dl.tsd-comment-tags dt.tag-example { + float: none; + text-transform: capitalize; + color: #000; + font-size: 1.1em; + padding: 5px; + border: none; +} + +.firebase-docs dl.tsd-comment-tags dd.tag-body-example { + padding-left: 0; +} + +.firebase-docs .tsd-breadcrumb .breadcrumb-name a { + color: #039be5; +} + +.firebase-docs .tsd-breadcrumb .model-name { + color: #333; +} \ No newline at end of file diff --git a/docgen/theme/assets/css/main.css b/docgen/theme/assets/css/main.css new file mode 100644 index 000000000..12f3d05d9 --- /dev/null +++ b/docgen/theme/assets/css/main.css @@ -0,0 +1,552 @@ +/*! normalize.css v1.1.3 | MIT License | git.io/normalize */ +/* ========================================================================== HTML5 display definitions ========================================================================== */ +/** Correct `block` display not defined in IE 6/7/8/9 and Firefox 3. */ +article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary { display: block; } + +/** Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3. */ +audio, canvas, video { display: inline-block; *display: inline; *zoom: 1; } + +/** Prevent modern browsers from displaying `audio` without controls. Remove excess height in iOS 5 devices. */ +audio:not([controls]) { display: none; height: 0; } + +/** Address styling not present in IE 7/8/9, Firefox 3, and Safari 4. Known issue: no IE 6 support. */ +[hidden] { display: none; } + +/* ========================================================================== Base ========================================================================== */ +/** 1. Correct text resizing oddly in IE 6/7 when body `font-size` is set using `em` units. 2. Prevent iOS text size adjust after orientation change, without disabling user zoom. */ +html { font-size: 100%; /* 1 */ -ms-text-size-adjust: 100%; /* 2 */ -webkit-text-size-adjust: 100%; /* 2 */ font-family: sans-serif; } + +/** Address `font-family` inconsistency between `textarea` and other form elements. */ +button, input, select, textarea { font-family: sans-serif; } + +/** Address margins handled incorrectly in IE 6/7. */ +body { margin: 0; } + +/* ========================================================================== Links ========================================================================== */ +/** Address `outline` inconsistency between Chrome and other browsers. */ +a:focus { outline: thin dotted; } +a:active, a:hover { outline: 0; } + +/** Improve readability when focused and also mouse hovered in all browsers. */ +/* ========================================================================== Typography ========================================================================== */ +/** Address font sizes and margins set differently in IE 6/7. Address font sizes within `section` and `article` in Firefox 4+, Safari 5, and Chrome. */ +h1 { font-size: 2em; margin: 0.67em 0; } + +h2 { font-size: 1.5em; margin: 0.83em 0; } + +h3 { font-size: 1.17em; margin: 1em 0; } + +h4, .tsd-index-panel h3 { font-size: 1em; margin: 1.33em 0; } + +h5 { font-size: 0.83em; margin: 1.67em 0; } + +h6 { font-size: 0.67em; margin: 2.33em 0; } + +/** Address styling not present in IE 7/8/9, Safari 5, and Chrome. */ +abbr[title] { border-bottom: 1px dotted; } + +/** Address style set to `bolder` in Firefox 3+, Safari 4/5, and Chrome. */ +b, strong { font-weight: bold; } + +blockquote { margin: 1em 40px; } + +/** Address styling not present in Safari 5 and Chrome. */ +dfn { font-style: italic; } + +/** Address differences between Firefox and other browsers. Known issue: no IE 6/7 normalization. */ +hr { box-sizing: content-box; height: 0; } + +/** Address styling not present in IE 6/7/8/9. */ +mark { background: #ff0; color: #000; } + +/** Address margins set differently in IE 6/7. */ +p, pre { margin: 1em 0; } + +/** Improve readability of pre-formatted text in all browsers. */ +pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; } + +/** Address CSS quotes not supported in IE 6/7. */ +q { quotes: none; } +q:before, q:after { content: ""; content: none; } + +/** Address `quotes` property not supported in Safari 4. */ +/** Address inconsistent and variable font size in all browsers. */ +small { font-size: 80%; } + +/** Prevent `sub` and `sup` affecting `line-height` in all browsers. */ +sub { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } + +sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; top: -0.5em; } + +sub { bottom: -0.25em; } + +/* ========================================================================== Lists ========================================================================== */ +dd { margin: 0 0 0 40px; } + +/** Address paddings set differently in IE 6/7. */ +menu, ol, ul { padding: 0 0 0 40px; } + +/** Correct list images handled incorrectly in IE 7. */ +nav ul, nav ol { list-style: none; list-style-image: none; } + +/* ========================================================================== Embedded content ========================================================================== */ +/** 1. Remove border when inside `a` element in IE 6/7/8/9 and Firefox 3. 2. Improve image quality when scaled in IE 7. */ +img { border: 0; /* 1 */ -ms-interpolation-mode: bicubic; } + +/* 2 */ +/** Correct overflow displayed oddly in IE 9. */ +svg:not(:root) { overflow: hidden; } + +/* ========================================================================== Figures ========================================================================== */ +/** Address margin not present in IE 6/7/8/9, Safari 5, and Opera 11. */ +figure, form { margin: 0; } + +/* ========================================================================== Forms ========================================================================== */ +/** Correct margin displayed oddly in IE 6/7. */ +/** Define consistent border, margin, and padding. */ +fieldset { border: 1px solid #c0c0c0; margin: 0 2px; padding: 0.35em 0.625em 0.75em; } + +/** 1. Correct color not being inherited in IE 6/7/8/9. 2. Correct text not wrapping in Firefox 3. 3. Correct alignment displayed oddly in IE 6/7. */ +legend { border: 0; /* 1 */ padding: 0; white-space: normal; /* 2 */ *margin-left: -7px; } + +/* 3 */ +/** 1. Correct font size not being inherited in all browsers. 2. Address margins set differently in IE 6/7, Firefox 3+, Safari 5, and Chrome. 3. Improve appearance and consistency in all browsers. */ +button, input, select, textarea { font-size: 100%; /* 1 */ margin: 0; /* 2 */ vertical-align: baseline; /* 3 */ *vertical-align: middle; } + +/* 3 */ +/** Address Firefox 3+ setting `line-height` on `input` using `!important` in the UA stylesheet. */ +button, input { line-height: normal; } + +/** Address inconsistent `text-transform` inheritance for `button` and `select`. All other form control elements do not inherit `text-transform` values. Correct `button` style inheritance in Chrome, Safari 5+, and IE 6+. Correct `select` style inheritance in Firefox 4+ and Opera. */ +button, select { text-transform: none; } + +/** 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` and `video` controls. 2. Correct inability to style clickable `input` types in iOS. 3. Improve usability and consistency of cursor style between image-type `input` and others. 4. Remove inner spacing in IE 7 without affecting normal text inputs. Known issue: inner spacing remains in IE 6. */ +button, html input[type="button"] { -webkit-appearance: button; /* 2 */ cursor: pointer; /* 3 */ *overflow: visible; } + +/* 4 */ +input[type="reset"], input[type="submit"] { -webkit-appearance: button; /* 2 */ cursor: pointer; /* 3 */ *overflow: visible; } + +/* 4 */ +/** Re-set default cursor for disabled elements. */ +button[disabled], html input[disabled] { cursor: default; } + +/** 1. Address box sizing set to content-box in IE 8/9. 2. Remove excess padding in IE 8/9. 3. Remove excess padding in IE 7. Known issue: excess padding remains in IE 6. */ +input { /* 3 */ } +input[type="checkbox"], input[type="radio"] { box-sizing: border-box; /* 1 */ padding: 0; /* 2 */ *height: 13px; /* 3 */ *width: 13px; } +input[type="search"] { -webkit-appearance: textfield; /* 1 */ /* 2 */ box-sizing: content-box; } +input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } + +/** 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome. 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome (include `-moz` to future-proof). */ +/** Remove inner padding and search cancel button in Safari 5 and Chrome on OS X. */ +/** Remove inner padding and border in Firefox 3+. */ +button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; } + +/** 1. Remove default vertical scrollbar in IE 6/7/8/9. 2. Improve readability and alignment in all browsers. */ +textarea { overflow: auto; /* 1 */ vertical-align: top; } + +/* 2 */ +/* ========================================================================== Tables ========================================================================== */ +/** Remove most spacing between table cells. */ +table { border-collapse: collapse; border-spacing: 0; } + +.hljs { display: inline-block; padding: 0.5em; background: white; color: #37474f; } + +.hljs-comment, +.hljs-annotation, +.hljs-template_comment, +.diff .hljs-header, +.hljs-chunk, +.apache .hljs-cbracket { color: #d81b60; } + +.hljs-keyword, +.hljs-id, +.hljs-built_in, +.css .smalltalk .hljs-class, +.hljs-winutils, +.bash .hljs-variable, +.tex .hljs-command, +.hljs-request, +.hljs-status, +.hljs-meta, +.nginx .hljs-title { color: #3b78e7; } + +.xml .hljs-tag { color: #3b78e7; } +.xml .hljs-tag .hljs-value { color: #3b78e7; } + +.hljs-string, +.hljs-title, +.hljs-parent, +.hljs-tag .hljs-value, +.hljs-rules .hljs-value { color: #0d904f; } + +.devsite-dark-code .hljs { display: inline-block; padding: 0.5em; background: white; color: #eceff1; } + +.devsite-dark-code .hljs-comment, +.devsite-dark-code .hljs-annotation, +.devsite-dark-code .hljs-template_comment, +.devsite-dark-code .diff .hljs-header, +.devsite-dark-code .hljs-chunk { color: #f06292; } + +.devsite-dark-code .hljs-keyword, +.devsite-dark-code .hljs-id, +.devsite-dark-code .hljs-built_in, +.devsite-dark-code .hljs-winutils, +.devsite-dark-code .hljs-request, +.devsite-dark-code .hljs-status, +.devsite-dark-code .hljs-meta { color: #4dd0e1; } + +.devsite-dark-code .hljs-string, +.devsite-dark-code .hljs-title, +.devsite-dark-code .hljs-parent, +.devsite-dark-code .hljs-tag .hljs-value, +.devsite-dark-code .hljs-rules .hljs-value { color: #9ccc65; } + +.col > :first-child, .col-1 > :first-child, .col-2 > :first-child, .col-3 > :first-child, .col-4 > :first-child, .col-5 > :first-child, .col-6 > :first-child, .col-7 > :first-child, .col-8 > :first-child, .col-9 > :first-child, .col-10 > :first-child, .col-11 > :first-child, .tsd-panel > :first-child, ul.tsd-descriptions > li > :first-child, .col > :first-child > :first-child, .col-1 > :first-child > :first-child, .col-2 > :first-child > :first-child, .col-3 > :first-child > :first-child, .col-4 > :first-child > :first-child, .col-5 > :first-child > :first-child, .col-6 > :first-child > :first-child, .col-7 > :first-child > :first-child, .col-8 > :first-child > :first-child, .col-9 > :first-child > :first-child, .col-10 > :first-child > :first-child, .col-11 > :first-child > :first-child, .tsd-panel > :first-child > :first-child, ul.tsd-descriptions > li > :first-child > :first-child, .col > :first-child > :first-child > :first-child, .col-1 > :first-child > :first-child > :first-child, .col-2 > :first-child > :first-child > :first-child, .col-3 > :first-child > :first-child > :first-child, .col-4 > :first-child > :first-child > :first-child, .col-5 > :first-child > :first-child > :first-child, .col-6 > :first-child > :first-child > :first-child, .col-7 > :first-child > :first-child > :first-child, .col-8 > :first-child > :first-child > :first-child, .col-9 > :first-child > :first-child > :first-child, .col-10 > :first-child > :first-child > :first-child, .col-11 > :first-child > :first-child > :first-child, .tsd-panel > :first-child > :first-child > :first-child, ul.tsd-descriptions > li > :first-child > :first-child > :first-child { margin-top: 0; } +.col > :last-child, .col-1 > :last-child, .col-2 > :last-child, .col-3 > :last-child, .col-4 > :last-child, .col-5 > :last-child, .col-6 > :last-child, .col-7 > :last-child, .col-8 > :last-child, .col-9 > :last-child, .col-10 > :last-child, .col-11 > :last-child, .tsd-panel > :last-child, ul.tsd-descriptions > li > :last-child, .col > :last-child > :last-child, .col-1 > :last-child > :last-child, .col-2 > :last-child > :last-child, .col-3 > :last-child > :last-child, .col-4 > :last-child > :last-child, .col-5 > :last-child > :last-child, .col-6 > :last-child > :last-child, .col-7 > :last-child > :last-child, .col-8 > :last-child > :last-child, .col-9 > :last-child > :last-child, .col-10 > :last-child > :last-child, .col-11 > :last-child > :last-child, .tsd-panel > :last-child > :last-child, ul.tsd-descriptions > li > :last-child > :last-child, .col > :last-child > :last-child > :last-child, .col-1 > :last-child > :last-child > :last-child, .col-2 > :last-child > :last-child > :last-child, .col-3 > :last-child > :last-child > :last-child, .col-4 > :last-child > :last-child > :last-child, .col-5 > :last-child > :last-child > :last-child, .col-6 > :last-child > :last-child > :last-child, .col-7 > :last-child > :last-child > :last-child, .col-8 > :last-child > :last-child > :last-child, .col-9 > :last-child > :last-child > :last-child, .col-10 > :last-child > :last-child > :last-child, .col-11 > :last-child > :last-child > :last-child, .tsd-panel > :last-child > :last-child > :last-child, ul.tsd-descriptions > li > :last-child > :last-child > :last-child { margin-bottom: 0; } + +.container { max-width: 1200px; margin: 0 auto; padding: 0 40px; } +@media (max-width: 640px) { .container { padding: 0 20px; } } + +.container-main { padding-bottom: 200px; } + +.row { position: relative; margin: 0 -10px; } +.row:after { visibility: hidden; display: block; content: ""; clear: both; height: 0; } + +.col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11 { box-sizing: border-box; float: left; padding: 0 10px; } + +.col-1 { width: 8.33333%; } + +.offset-1 { margin-left: 8.33333%; } + +.col-2 { width: 16.66667%; } + +.offset-2 { margin-left: 16.66667%; } + +.col-3 { width: 25%; } + +.offset-3 { margin-left: 25%; } + +.col-4 { width: 33.33333%; } + +.offset-4 { margin-left: 33.33333%; } + +.col-5 { width: 41.66667%; } + +.offset-5 { margin-left: 41.66667%; } + +.col-6 { width: 50%; } + +.offset-6 { margin-left: 50%; } + +.col-7 { width: 58.33333%; } + +.offset-7 { margin-left: 58.33333%; } + +.col-8 { width: 66.66667%; } + +.offset-8 { margin-left: 66.66667%; } + +.col-9 { width: 75%; } + +.offset-9 { margin-left: 75%; } + +.col-10 { width: 83.33333%; } + +.offset-10 { margin-left: 83.33333%; } + +.col-11 { width: 91.66667%; } + +.offset-11 { margin-left: 91.66667%; } + +.tsd-kind-icon { display: block; position: relative; padding-left: 20px; text-indent: -20px; } + +.no-transition { transition: none !important; } + +@-webkit-keyframes fade-in { from { opacity: 0; } + to { opacity: 1; } } + +@keyframes fade-in { from { opacity: 0; } + to { opacity: 1; } } +@-webkit-keyframes fade-out { from { opacity: 1; visibility: visible; } + to { opacity: 0; } } +@keyframes fade-out { from { opacity: 1; visibility: visible; } + to { opacity: 0; } } +@-webkit-keyframes fade-in-delayed { 0% { opacity: 0; } + 33% { opacity: 0; } + 100% { opacity: 1; } } +@keyframes fade-in-delayed { 0% { opacity: 0; } + 33% { opacity: 0; } + 100% { opacity: 1; } } +@-webkit-keyframes fade-out-delayed { 0% { opacity: 1; visibility: visible; } + 66% { opacity: 0; } + 100% { opacity: 0; } } +@keyframes fade-out-delayed { 0% { opacity: 1; visibility: visible; } + 66% { opacity: 0; } + 100% { opacity: 0; } } +@-webkit-keyframes shift-to-left { from { -webkit-transform: translate(0, 0); transform: translate(0, 0); } + to { -webkit-transform: translate(-25%, 0); transform: translate(-25%, 0); } } +@keyframes shift-to-left { from { -webkit-transform: translate(0, 0); transform: translate(0, 0); } + to { -webkit-transform: translate(-25%, 0); transform: translate(-25%, 0); } } +@-webkit-keyframes unshift-to-left { from { -webkit-transform: translate(-25%, 0); transform: translate(-25%, 0); } + to { -webkit-transform: translate(0, 0); transform: translate(0, 0); } } +@keyframes unshift-to-left { from { -webkit-transform: translate(-25%, 0); transform: translate(-25%, 0); } + to { -webkit-transform: translate(0, 0); transform: translate(0, 0); } } +@-webkit-keyframes pop-in-from-right { from { -webkit-transform: translate(100%, 0); transform: translate(100%, 0); } + to { -webkit-transform: translate(0, 0); transform: translate(0, 0); } } +@keyframes pop-in-from-right { from { -webkit-transform: translate(100%, 0); transform: translate(100%, 0); } + to { -webkit-transform: translate(0, 0); transform: translate(0, 0); } } +@-webkit-keyframes pop-out-to-right { from { -webkit-transform: translate(0, 0); transform: translate(0, 0); visibility: visible; } + to { -webkit-transform: translate(100%, 0); transform: translate(100%, 0); } } +@keyframes pop-out-to-right { from { -webkit-transform: translate(0, 0); transform: translate(0, 0); visibility: visible; } + to { -webkit-transform: translate(100%, 0); transform: translate(100%, 0); } } + +a { color: #4da6ff; text-decoration: none; } +a:hover { text-decoration: underline; } + +pre { padding: 10px; } +pre code { padding: 0; font-size: 100%; background-color: transparent; } + +.tsd-typography ul { list-style: square; padding: 0 0 0 20px; margin: 0; } +.tsd-typography h4, .tsd-typography .tsd-index-panel h3, .tsd-index-panel .tsd-typography h3, .tsd-typography h5, .tsd-typography h6 { font-size: 1em; margin: 0; } +.tsd-typography h5, .tsd-typography h6 { font-weight: normal; } +.tsd-typography p, .tsd-typography ul, .tsd-typography ol { margin: 1em 0; } + +@media (min-width: 901px) and (max-width: 1024px) { html.default .col-content { width: 72%; } + html.default .col-menu { width: 28%; } + html.default .tsd-navigation { padding-left: 10px; } } +@media (max-width: 900px) { html.default .col-content { float: none; width: 100%; } + html.default .col-menu { position: fixed !important; overflow: auto; -webkit-overflow-scrolling: touch; overflow-scrolling: touch; z-index: 1024; top: 0 !important; bottom: 0 !important; left: auto !important; right: 0 !important; width: 100%; padding: 20px 20px 0 0; max-width: 450px; visibility: hidden; background-color: #fff; -webkit-transform: translate(100%, 0); transform: translate(100%, 0); } + html.default .col-menu > *:last-child { padding-bottom: 20px; } + html.default .overlay { content: ""; display: block; position: fixed; z-index: 1023; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.75); visibility: hidden; } + html.default.to-has-menu .overlay { -webkit-animation: fade-in 0.4s; animation: fade-in 0.4s; } + html.default.to-has-menu header, html.default.to-has-menu footer, html.default.to-has-menu .col-content { -webkit-animation: shift-to-left 0.4s; animation: shift-to-left 0.4s; } + html.default.to-has-menu .col-menu { -webkit-animation: pop-in-from-right 0.4s; animation: pop-in-from-right 0.4s; } + html.default.from-has-menu .overlay { -webkit-animation: fade-out 0.4s; animation: fade-out 0.4s; } + html.default.from-has-menu header, html.default.from-has-menu footer, html.default.from-has-menu .col-content { -webkit-animation: unshift-to-left 0.4s; animation: unshift-to-left 0.4s; } + html.default.from-has-menu .col-menu { -webkit-animation: pop-out-to-right 0.4s; animation: pop-out-to-right 0.4s; } + html.default.has-menu body { overflow: hidden; } + html.default.has-menu .overlay { visibility: visible; } + html.default.has-menu header, html.default.has-menu footer, html.default.has-menu .col-content { -webkit-transform: translate(-25%, 0); transform: translate(-25%, 0); } + html.default.has-menu .col-menu { visibility: visible; -webkit-transform: translate(0, 0); transform: translate(0, 0); } } + +.tsd-page-title { padding: 0; margin: 0; background: #fff; } +.tsd-page-title h1 { font-weight: normal; margin: 0; } + +.tsd-breadcrumb { margin: 0; padding: 0; color: #808080; } +.tsd-breadcrumb a { color: #808080; text-decoration: none; } +.tsd-breadcrumb a:hover { text-decoration: underline; } +.tsd-breadcrumb li { display: inline; margin-right: -0.25em; } + +html.minimal .container { margin: 0; } +html.minimal .container-main { padding-top: 50px; padding-bottom: 0; } +html.minimal .content-wrap { padding-left: 300px; } +html.minimal .tsd-navigation { position: fixed !important; overflow: auto; -webkit-overflow-scrolling: touch; overflow-scrolling: touch; box-sizing: border-box; z-index: 1; left: 0; top: 40px; bottom: 0; width: 300px; padding: 20px; margin: 0; } +html.minimal .tsd-member .tsd-member { margin-left: 0; } +html.minimal .tsd-page-toolbar { position: fixed; z-index: 2; } +html.minimal #tsd-filter .tsd-filter-group { right: 0; -webkit-transform: none; transform: none; } +html.minimal footer { background-color: transparent; } +html.minimal footer .container { padding: 0; } +html.minimal .tsd-generator { padding: 0; } +@media (max-width: 900px) { html.minimal .tsd-navigation { display: none; } + html.minimal .content-wrap { padding-left: 0; } } + +dl.tsd-comment-tags { overflow: hidden; } +dl.tsd-comment-tags dt { clear: both; float: left; padding: 1px 5px; margin: 0 10px 0 0; border-radius: 4px; border: 1px solid #808080; color: #808080; font-size: 0.8em; font-weight: normal; } +dl.tsd-comment-tags dd { margin: 0 0 10px 0; } +dl.tsd-comment-tags p { margin: 0; } + +.tsd-panel.tsd-comment .lead { font-size: 1.1em; line-height: 1.333em; margin-bottom: 2em; } +.tsd-panel.tsd-comment .lead:last-child { margin-bottom: 0; } + +.toggle-protected .tsd-is-private { display: none; } + +.toggle-public .tsd-is-private, .toggle-public .tsd-is-protected, .toggle-public .tsd-is-private-protected { display: none; } + +.toggle-inherited .tsd-is-inherited { display: none; } + +.toggle-only-exported .tsd-is-not-exported { display: none; } + +.toggle-externals .tsd-is-external { display: none; } + +#tsd-filter { position: relative; display: inline-block; height: 40px; vertical-align: bottom; } +.no-filter #tsd-filter { display: none; } +#tsd-filter .tsd-filter-group { display: inline-block; height: 40px; vertical-align: bottom; white-space: nowrap; } +#tsd-filter input { display: none; } +@media (max-width: 900px) { #tsd-filter .tsd-filter-group { display: block; position: absolute; top: 40px; right: 20px; height: auto; background-color: #fff; visibility: hidden; -webkit-transform: translate(50%, 0); transform: translate(50%, 0); box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); } + .has-options #tsd-filter .tsd-filter-group { visibility: visible; } + .to-has-options #tsd-filter .tsd-filter-group { -webkit-animation: fade-in 0.2s; animation: fade-in 0.2s; } + .from-has-options #tsd-filter .tsd-filter-group { -webkit-animation: fade-out 0.2s; animation: fade-out 0.2s; } + #tsd-filter label, #tsd-filter .tsd-select { display: block; padding-right: 20px; } } + +footer { border-top: 1px solid #eee; background-color: #fff; } +footer.with-border-bottom { border-bottom: 1px solid #eee; } +footer .tsd-legend-group { font-size: 0; } +footer .tsd-legend { display: inline-block; width: 25%; padding: 0; font-size: 16px; list-style: none; line-height: 1.333em; vertical-align: top; } +@media (max-width: 900px) { footer .tsd-legend { width: 50%; } } + +.tsd-hierarchy { list-style: square; padding: 0 0 0 20px; margin: 0; } +.tsd-hierarchy .target { font-weight: bold; } + +.tsd-index-panel .tsd-index-content { margin-bottom: -30px !important; } +.tsd-index-panel .tsd-index-section { margin-bottom: 30px !important; } +.tsd-index-panel h3 { margin: 0 -20px 10px -20px; padding: 0 20px 10px 20px; border-bottom: 1px solid #eee; } +.tsd-index-panel ul.tsd-index-list { -webkit-column-count: 3; -moz-column-count: 3; -ms-column-count: 3; -o-column-count: 3; column-count: 3; -webkit-column-gap: 20px; -moz-column-gap: 20px; -ms-column-gap: 20px; -o-column-gap: 20px; column-gap: 20px; padding: 0; list-style: none; line-height: 1.333em; } +@media (max-width: 900px) { .tsd-index-panel ul.tsd-index-list { -webkit-column-count: 1; -moz-column-count: 1; -ms-column-count: 1; -o-column-count: 1; column-count: 1; } } +@media (min-width: 901px) and (max-width: 1024px) { .tsd-index-panel ul.tsd-index-list { -webkit-column-count: 2; -moz-column-count: 2; -ms-column-count: 2; -o-column-count: 2; column-count: 2; } } +.tsd-index-panel ul.tsd-index-list li { -webkit-column-break-inside: avoid; -moz-column-break-inside: avoid; -ms-column-break-inside: avoid; -o-column-break-inside: avoid; column-break-inside: avoid; -webkit-page-break-inside: avoid; -moz-page-break-inside: avoid; -ms-page-break-inside: avoid; -o-page-break-inside: avoid; page-break-inside: avoid; } + +.tsd-flag { display: inline-block; padding: 1px 5px; border-radius: 4px; color: #fff; background-color: #808080; text-indent: 0; font-size: 14px; font-weight: normal; line-height: 1.5em; } + +.tsd-anchor { position: absolute; top: -100px; } + +.tsd-member { position: relative; } +.tsd-member .tsd-anchor + h3 { margin-top: 0; margin-bottom: 0; border-bottom: none; } + +.tsd-navigation { padding: 0 0 0 40px; } +.tsd-navigation a { display: block; padding-top: 2px; padding-bottom: 2px; border-left: 2px solid transparent; color: #222; text-decoration: none; transition: border-left-color 0.1s; } +.tsd-navigation a:hover { text-decoration: underline; } +.tsd-navigation ul { margin: 0; padding: 0; list-style: none; } +.tsd-navigation li { padding: 0; } + +.tsd-navigation.primary { padding-bottom: 40px; } +.tsd-navigation.primary a { display: block; padding-top: 6px; padding-bottom: 6px; } +.tsd-navigation.primary ul li a { padding-left: 5px; } +.tsd-navigation.primary ul li li a { padding-left: 25px; } +.tsd-navigation.primary ul li li li a { padding-left: 45px; } +.tsd-navigation.primary ul li li li li a { padding-left: 65px; } +.tsd-navigation.primary ul li li li li li a { padding-left: 85px; } +.tsd-navigation.primary ul li li li li li li a { padding-left: 105px; } +.tsd-navigation.primary > ul { border-bottom: 1px solid #eee; } +.tsd-navigation.primary li { border-top: 1px solid #eee; } +.tsd-navigation.primary li.current > a { font-weight: bold; } +.tsd-navigation.primary li.label span { display: block; padding: 20px 0 6px 5px; color: #808080; } +.tsd-navigation.primary li.globals + li > span, .tsd-navigation.primary li.globals + li > a { padding-top: 20px; } + +.tsd-navigation.secondary ul { transition: opacity 0.2s; } +.tsd-navigation.secondary ul li a { padding-left: 25px; } +.tsd-navigation.secondary ul li li a { padding-left: 45px; } +.tsd-navigation.secondary ul li li li a { padding-left: 65px; } +.tsd-navigation.secondary ul li li li li a { padding-left: 85px; } +.tsd-navigation.secondary ul li li li li li a { padding-left: 105px; } +.tsd-navigation.secondary ul li li li li li li a { padding-left: 125px; } +.tsd-navigation.secondary ul.current a { border-left-color: #eee; } +.tsd-navigation.secondary li.focus > a, .tsd-navigation.secondary ul.current li.focus > a { border-left-color: #000; } +.tsd-navigation.secondary li.current { margin-top: 20px; margin-bottom: 20px; border-left-color: #eee; } +.tsd-navigation.secondary li.current > a { font-weight: bold; } + +@media (min-width: 901px) { .menu-sticky-wrap { position: static; } + .no-csspositionsticky .menu-sticky-wrap.sticky { position: fixed; } + .no-csspositionsticky .menu-sticky-wrap.sticky-current { position: fixed; } + .no-csspositionsticky .menu-sticky-wrap.sticky-current ul.before-current, .no-csspositionsticky .menu-sticky-wrap.sticky-current ul.after-current { opacity: 0; } + .no-csspositionsticky .menu-sticky-wrap.sticky-bottom { position: absolute; top: auto !important; left: auto !important; bottom: 0; right: 0; } + .csspositionsticky .menu-sticky-wrap.sticky { position: -webkit-sticky; position: sticky; } + .csspositionsticky .menu-sticky-wrap.sticky-current { position: -webkit-sticky; position: sticky; } } + +.tsd-panel { margin: 20px 0; padding: 20px; background-color: #fff; } +.tsd-panel:empty { display: none; } +.tsd-panel > h1, .tsd-panel > h2, .tsd-panel > h3 { margin: 1.5em -20px 10px -20px; padding: 0 20px 10px 20px; border-bottom: 1px solid #ebebeb; } +.tsd-panel > h1.tsd-before-signature, .tsd-panel > h2.tsd-before-signature, .tsd-panel > h3.tsd-before-signature { margin-bottom: 0; border-bottom: 0; } +.tsd-panel table { display: block; width: 100%; overflow: auto; margin-top: 10px; word-break: normal; word-break: keep-all; } +.tsd-panel table th { font-weight: bold; } +.tsd-panel table th, .tsd-panel table td { padding: 6px 13px; border: 1px solid #ddd; } +.tsd-panel table tr { background-color: #fff; border-top: 1px solid #ccc; } +.tsd-panel table tr:nth-child(2n) { background-color: #f8f8f8; } + +.tsd-panel-group { margin: 60px 0; } +.tsd-panel-group > h1, .tsd-panel-group > h2, .tsd-panel-group > h3 { padding-left: 20px; padding-right: 20px; } + +#tsd-search { transition: background-color 0.2s; } +#tsd-search .title { position: relative; z-index: 2; } +#tsd-search .field { position: absolute; left: 0; top: 0; right: 40px; height: 40px; } +#tsd-search .field input { box-sizing: border-box; position: relative; top: -50px; z-index: 1; width: 100%; padding: 0 10px; opacity: 0; outline: 0; border: 0; background: transparent; color: #222; } +#tsd-search .field label { position: absolute; overflow: hidden; right: -40px; } +#tsd-search .field input, #tsd-search .title { transition: opacity 0.2s; } +#tsd-search .results { position: absolute; visibility: hidden; top: 40px; width: 100%; margin: 0; padding: 0; list-style: none; box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); } +#tsd-search .results li { padding: 0 10px; background-color: #fdfdfd; } +#tsd-search .results li:nth-child(even) { background-color: #fff; } +#tsd-search .results li.state { display: none; } +#tsd-search .results li.current, #tsd-search .results li:hover { background-color: #eee; } +#tsd-search .results a { display: block; } +#tsd-search .results a:before { top: 10px; } +#tsd-search .results span.parent { color: #808080; font-weight: normal; } +#tsd-search.has-focus { background-color: #eee; } +#tsd-search.has-focus .field input { top: 0; opacity: 1; } +#tsd-search.has-focus .title { z-index: 0; opacity: 0; } +#tsd-search.has-focus .results { visibility: visible; } +#tsd-search.loading .results li.state.loading { display: block; } +#tsd-search.failure .results li.state.failure { display: block; } + +.tsd-signature { margin: 0 0 1em 0; padding: 10px; border: 1px solid #eee; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; } +.tsd-signature.tsd-kind-icon { padding-left: 30px; } +.tsd-panel > .tsd-signature { margin-left: -20px; margin-right: -20px; border-width: 1px 0; } +.tsd-panel > .tsd-signature.tsd-kind-icon { padding-left: 40px; } + +.tsd-signature-symbol { color: #808080; font-weight: normal; } + +.tsd-signature-type { font-style: italic; font-weight: normal; } + +.tsd-signatures { padding: 0; margin: 0 0 1em 0; border: 1px solid #eee; } +.tsd-signatures .tsd-signature { margin: 0; border-width: 1px 0 0 0; transition: background-color 0.1s; } +.tsd-signatures .tsd-signature:first-child { border-top-width: 0; } +.tsd-signatures .tsd-signature.current { background-color: #eee; } +.tsd-signatures.active > .tsd-signature { cursor: pointer; } +.tsd-panel > .tsd-signatures { margin-left: -20px; margin-right: -20px; border-width: 1px 0; } +.tsd-panel > .tsd-signatures .tsd-signature.tsd-kind-icon { padding-left: 40px; } +.tsd-panel > a.anchor + .tsd-signatures { border-top-width: 0; margin-top: -20px; } + +ul.tsd-descriptions { position: relative; overflow: hidden; transition: height 0.3s; padding: 0; list-style: none; } +ul.tsd-descriptions.active > .tsd-description { display: none; } +ul.tsd-descriptions.active > .tsd-description.current { display: block; } +ul.tsd-descriptions.active > .tsd-description.fade-in { -webkit-animation: fade-in-delayed 0.3s; animation: fade-in-delayed 0.3s; } +ul.tsd-descriptions.active > .tsd-description.fade-out { -webkit-animation: fade-out-delayed 0.3s; animation: fade-out-delayed 0.3s; position: absolute; display: block; top: 0; left: 0; right: 0; opacity: 0; visibility: hidden; } +ul.tsd-descriptions h4, ul.tsd-descriptions .tsd-index-panel h3, .tsd-index-panel ul.tsd-descriptions h3 { font-size: 16px; margin: 1em 0 0.5em 0; } + +ul.tsd-parameters, ul.tsd-type-parameters { list-style: square; margin: 0; padding-left: 20px; } +ul.tsd-parameters > li.tsd-parameter-siganture, ul.tsd-type-parameters > li.tsd-parameter-siganture { list-style: none; margin-left: -20px; } +ul.tsd-parameters h5, ul.tsd-type-parameters h5 { font-size: 16px; margin: 1em 0 0.5em 0; } +ul.tsd-parameters .tsd-comment, ul.tsd-type-parameters .tsd-comment { margin-top: -0.5em; } + +.tsd-sources { font-size: 14px; color: #808080; } +.tsd-sources a { color: #808080; text-decoration: underline; } +.tsd-sources ul, .tsd-sources p { margin: 0 !important; } +.tsd-sources ul { list-style: none; padding: 0; } + +.tsd-page-toolbar { position: absolute; z-index: 1; top: 0; left: 0; width: 100%; height: 40px; color: #333; background: #fff; border-bottom: 1px solid #eee; } +.tsd-page-toolbar a { color: #333; text-decoration: none; } +.tsd-page-toolbar a.title { font-weight: bold; } +.tsd-page-toolbar a.title:hover { text-decoration: underline; } +.tsd-page-toolbar .table-wrap { display: table; width: 100%; height: 40px; } +.tsd-page-toolbar .table-cell { display: table-cell; position: relative; white-space: nowrap; line-height: 40px; } +.tsd-page-toolbar .table-cell:first-child { width: 100%; } + +.tsd-widget:before, .tsd-select .tsd-select-label:before, .tsd-select .tsd-select-list li:before { content: ""; display: inline-block; width: 40px; height: 40px; margin: 0 -8px 0 0; background-image: url(../images/widgets.png); background-repeat: no-repeat; text-indent: -1024px; vertical-align: bottom; } +@media (-webkit-min-device-pixel-ratio: 1.5), (min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) { .tsd-widget:before, .tsd-select .tsd-select-label:before, .tsd-select .tsd-select-list li:before { background-image: url(../images/widgets@2x.png); background-size: 320px 40px; } } + +.tsd-widget { display: inline-block; overflow: hidden; opacity: 0.6; height: 40px; transition: opacity 0.1s, background-color 0.2s; vertical-align: bottom; cursor: pointer; } +.tsd-widget:hover { opacity: 0.8; } +.tsd-widget.active { opacity: 1; background-color: #eee; } +.tsd-widget.no-caption { width: 40px; } +.tsd-widget.no-caption:before { margin: 0; } +.tsd-widget.search:before { background-position: 0 0; } +.tsd-widget.menu:before { background-position: -40px 0; } +.tsd-widget.options:before { background-position: -80px 0; } +.tsd-widget.options, .tsd-widget.menu { display: none; } +@media (max-width: 900px) { .tsd-widget.options, .tsd-widget.menu { display: inline-block; } } +input[type=checkbox] + .tsd-widget:before { background-position: -120px 0; } +input[type=checkbox]:checked + .tsd-widget:before { background-position: -160px 0; } + +.tsd-select { position: relative; display: inline-block; height: 40px; transition: opacity 0.1s, background-color 0.2s; vertical-align: bottom; cursor: pointer; } +.tsd-select .tsd-select-label { opacity: 0.6; transition: opacity 0.2s; } +.tsd-select .tsd-select-label:before { background-position: -240px 0; } +.tsd-select.active .tsd-select-label { opacity: 0.8; } +.tsd-select.active .tsd-select-list { visibility: visible; opacity: 1; transition-delay: 0s; } +.tsd-select .tsd-select-list { position: absolute; visibility: hidden; top: 40px; left: 0; margin: 0; padding: 0; opacity: 0; list-style: none; box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); transition: visibility 0s 0.2s, opacity 0.2s; } +.tsd-select .tsd-select-list li { padding: 0 20px 0 0; background-color: #fdfdfd; } +.tsd-select .tsd-select-list li:before { background-position: 40px 0; } +.tsd-select .tsd-select-list li:nth-child(even) { background-color: #fff; } +.tsd-select .tsd-select-list li:hover { background-color: #eee; } +.tsd-select .tsd-select-list li.selected:before { background-position: -200px 0; } +@media (max-width: 900px) { .tsd-select .tsd-select-list { top: 0; left: auto; right: 100%; margin-right: -5px; } + .tsd-select .tsd-select-label:before { background-position: -280px 0; } } + +img { max-width: 100%; } diff --git a/docgen/theme/assets/images/lockup.png b/docgen/theme/assets/images/lockup.png new file mode 100644 index 0000000000000000000000000000000000000000..f4cdcf24a42787815f45a0fbd6b2211b69cf87a0 GIT binary patch literal 2646 zcmV-c3aRypP)qsBRaHO8(yazJJDcK~r7o->-O8-CmCY zr#`z4j)yXEeD5C+QGXbQp&O3{6EN^efRRlACm;I?A{d6LFLdL<9qEFg1D^mmd|wt3 z48znHx^b-gd_m5Ej{^+djaf9@j|hfg>IdC8+I~|`$@3orIJi9vC-!?0!7xmHsN8V! zv28Hov*eTv-U-;2So2OZ3=0|#S#nA~dXus49GuwaMTGk>3{$z`=tGHBaz6JF{69*I z)m=oa;&>=lL@*3f8!9&(+L0=gv&e@5(p@9==0-nJs{ngs~{)x zp#rjiWM$D%LcX>j=QGVWUw`b;1R|7N`%VaHLxhP)foe!;#45B0#QKRaeSRFSMqw#s z_*1l;&$dcr7ER}m?)K(!%3GAvBHfXLW4pYFAi4U@6rA4$aQRDFM3{(Mf)edf7Sv9# zpdncdqUDr$AwRqk7RG|5btEGoq;p#flcV-Ai!(uUA- zzV&HY!Zg%^);U;E4oG)otI3(i%sBV^f}BN~VDfkPXa8x&ENaOqkr{OE>chA}1mC5O%rG5Hw&F!B+JzqA`xGNCb%!$EN$Q4uA33 z(XwMkkzV8ugbeq`90Lw)O;B>?pTZ3J>xyzB4Fx8CiK70k$%&j6*CPFhFbOR|^)rx< zc#V&^K&j;#57H~!91unBaM1rGBI6Du=HN401reI(5O?si3RvT*q>t*eyJKz%nyw_L zWZ_@c<(x`xfQcVA!0d@foXUyx09@RYK!iz{CMfY|<)V1XE)-fA^|9`-+5adKsPSj$ zpMyFxMO^5!OJj}!!)=*zIj!uekn;x(Fn{RbTavRVXodw<3aa{>K7v?LoMvi}L|Se1 zKaM0_xhVC|!A~5w*M)I$am+DbWaDZ%pDtuiLQbTZIkn`JTzE8#2$L{LP(s#T#E%4! zNZExRq^4;Vgt(*11sf&%Pm?Sj&sRbKiPGm{WqzCI;4eFV7)jbZc59V>1j>#ZM3U-p zae2()c&H64xR#tnmYs7u0NE@2~W%HNyu5NX>BV>XJDvF6>Ps!W0Z$W>G}|`LzoKHKvGmvqrMY z^fGL7y)sT@qgEp0QST30!W%H=FtRCEdOs&-Pq#8B&G|>pBf=C66!Z?e$993Ry8o_> z164$EiqGM3%Xbq6k=8XEa~S;OikwT2qnJM>mQvi3)4)oufr5&4FR1z)J^FI01*LaB zDGAqo%;DIskh}*}$|-LdoBNYXODWZOv-{?r+^gT%h6n?=odgZn0AF1MwZcPAL#>@l zzA^$xgcOvHfJ0GZbscjQv|q|8SxU+5Ni3zfDQ6KB<0~v^%?0%!`cdC0Zotv@J@rNe zpUw9LkX{?Y_SS98VRUoC%ARCF$bC5_mp-3BgaNEqL4BG_2z0n#B#JAZ+Z1%Lxn942 z>g?KDmobOYjVt!IC`W|`CC-3Ky=FaZ+<)wr1MaG2TRNRXJSxwKKin!aj0mX!ML>Z6x! zP%w4)6n%=hHs&yJ2Q2-su9=gd3qSWEi7k(u7e9;m}+`GAdCKv3g8 zOdlb?-5U_1Hm3FQnvXdg35FK_)3ElL(?SXwVnH~LV?Ou4&Xf_E(?YM3%T-)@3Z*Zn>X9eU8T|*y%r$VZYzD1yw$T zjd*IJ$Bi+sc-;4fd%QQ&J*nB#TOj}D+R2%Jy$fbecEI(4O)12Sh}yywFPb0{EfXn* z^wAr_)j>SYBU+M4;>4zNonu;$#nkV&zsm6=8XFJDF?TW^D5}3Lm-c7oGF$2{=j`bY z$PI7K;6>ENA~B4`>OUOn4&4~@XBS`Uab3>&bDeNwwEg_`fz2UAFbwlS=*FS0{)xlg zx#ib-YA)x}%bhTBusw^P)35F%!?2)~q~7a8or%e#-IMt@^yOTBwF{<>cI5Eb3B;@J zAj7brN>I|a+-PTN=2Vw+IjsVa{GOR&F&RBrP@2IG{C?Vrg`{rVa?YLYEEa$^xAB0x z3B!U~qJCxKP$w3W2r-ex7r6lBIt&Y{5H&G*q$9WdswL*q%UxUmVvK+Vl?=9fk;KHo zj*Ns0K<>k^pbW#XpbW#XpbW!;G7Q6lG7JmKFpLSj52E7_O`Jf{)c^nh07*qoM6N<$ Eg8U-`K>z>% literal 0 HcmV?d00001 diff --git a/docgen/theme/layouts/default.hbs b/docgen/theme/layouts/default.hbs new file mode 100644 index 000000000..72111fb4e --- /dev/null +++ b/docgen/theme/layouts/default.hbs @@ -0,0 +1,33 @@ + + + + + + + + + + {{#ifCond model.name '==' project.name}}{{project.name}}{{else}}{{model.name}} | {{project.name}}{{/ifCond}} + + + + + + + +{{> header}} + +
+
+
+ {{{contents}}} +
+
+
+ +
+ +{{> analytics}} + + + diff --git a/docgen/theme/partials/breadcrumb.hbs b/docgen/theme/partials/breadcrumb.hbs new file mode 100644 index 000000000..db115163f --- /dev/null +++ b/docgen/theme/partials/breadcrumb.hbs @@ -0,0 +1,11 @@ + +{{#if parent}} + {{#with parent}}{{> breadcrumb}}{{/with}} + +{{/if}} \ No newline at end of file diff --git a/docgen/theme/partials/comment.hbs b/docgen/theme/partials/comment.hbs new file mode 100644 index 000000000..f92e54301 --- /dev/null +++ b/docgen/theme/partials/comment.hbs @@ -0,0 +1,22 @@ +{{#with comment}} + {{#if hasVisibleComponent}} +
+ {{#if shortText}} +
+ {{#markdown}}{{{shortText}}}{{/markdown}} +
+ {{/if}} + {{#if text}} + {{#markdown}}{{{text}}}{{/markdown}} + {{/if}} + {{#if tags}} +
+ {{#each tags}} +
{{tagName}}
+
{{#markdown}}{{{text}}}{{/markdown}}
+ {{/each}} +
+ {{/if}} +
+ {{/if}} +{{/with}} \ No newline at end of file diff --git a/docgen/theme/partials/header.hbs b/docgen/theme/partials/header.hbs new file mode 100644 index 000000000..4aee65a6b --- /dev/null +++ b/docgen/theme/partials/header.hbs @@ -0,0 +1,23 @@ +
+
+
+

+ {{#ifCond model.name '==' project.name}} + {{else}} +
    + {{#with model.parent}}{{> breadcrumb}}{{/with}} +
  • {{model.name}}
  • + {{#if model.typeParameters}} + < + {{#each model.typeParameters}} + {{#if @index}}, {{/if}} + {{name}} + {{/each}} + > + {{/if}} +
+ {{/ifCond}} +

+
+
+
\ No newline at end of file diff --git a/docgen/theme/partials/member.sources.hbs b/docgen/theme/partials/member.sources.hbs new file mode 100644 index 000000000..5a0e186f0 --- /dev/null +++ b/docgen/theme/partials/member.sources.hbs @@ -0,0 +1,15 @@ +{{#if implementationOf}} + +{{/if}} +{{#if inheritedFrom}} + +{{/if}} +{{#if overwrites}} + +{{/if}} \ No newline at end of file diff --git a/docgen/theme/partials/navigation.hbs b/docgen/theme/partials/navigation.hbs new file mode 100644 index 000000000..54704739a --- /dev/null +++ b/docgen/theme/partials/navigation.hbs @@ -0,0 +1,22 @@ +{{#if isVisible}} + {{#if isLabel}} +
  • + {{{wbr title}}} +
  • + {{else}} + {{#unless isGlobals}} +
  • + {{{wbr title}}} + {{#if isInPath}} + {{#if children}} +
      + {{#each children}} + {{> navigation}} + {{/each}} +
    + {{/if}} + {{/if}} +
  • + {{/unless}} + {{/if}} +{{/if}} diff --git a/docgen/theme/templates/reflection.hbs b/docgen/theme/templates/reflection.hbs new file mode 100644 index 000000000..53cd2879a --- /dev/null +++ b/docgen/theme/templates/reflection.hbs @@ -0,0 +1,72 @@ +{{#with model}} + {{#if hasComment}} +
    + {{> comment}} +
    + {{/if}} +{{/with}} + +{{#if model.typeParameters}} +
    +

    Type parameters

    + {{#with model}}{{> typeParameters}}{{/with}} +
    +{{/if}} + +{{#if model.implementedTypes}} +
    +

    Implements

    +
      + {{#each model.implementedTypes}} +
    • {{> type}}
    • + {{/each}} +
    +
    +{{/if}} + +{{#if model.implementedBy}} +
    +

    Implemented by

    +
      + {{#each model.implementedBy}} +
    • {{> type}}
    • + {{/each}} +
    +
    +{{/if}} + +{{#if model.signatures}} +
    +

    Callable

    + {{#with model}}{{> member.signatures}}{{/with}} +
    +{{/if}} + +{{#if model.indexSignature}} +
    +

    Indexable

    +
    {{#compact}} + [ + {{#each model.indexSignature.parameters}} + {{name}}: {{#with type}}{{>type}}{{/with}} + {{/each}} + ]:  + {{#with model.indexSignature.type}}{{>type}}{{/with}} + {{/compact}}
    + + {{#with model.indexSignature}} + {{> comment}} + {{/with}} + + {{#if model.indexSignature.type.declaration}} + {{#with model.indexSignature.type.declaration}} + {{> parameter}} + {{/with}} + {{/if}} +
    +{{/if}} + +{{#with model}} + {{> index}} + {{> members}} +{{/with}} \ No newline at end of file diff --git a/docgen/tsconfig.json b/docgen/tsconfig.json new file mode 100644 index 000000000..3c43903cf --- /dev/null +++ b/docgen/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../tsconfig.json" +} diff --git a/docgen/typedoc.js b/docgen/typedoc.js new file mode 100644 index 000000000..6d04ae747 --- /dev/null +++ b/docgen/typedoc.js @@ -0,0 +1,27 @@ +/** + * @license + * Copyright 2019 Google Inc. + * + * 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. + */ + +const options = { + includeDeclarations: true, + excludeExternals: true, + ignoreCompilerErrors: true, + name: 'Firebase Functions SDK', + mode: 'file', + hideGenerator: true +}; + +module.exports = options; diff --git a/package.json b/package.json index 2f2b38325..b241e2c63 100644 --- a/package.json +++ b/package.json @@ -49,10 +49,13 @@ "@types/sinon": "^7.0.12", "chai": "^4.2.0", "chai-as-promised": "^7.1.1", + "child-process-promise": "^2.2.1", "firebase-admin": "^8.0.0", "istanbul": "^0.4.2", + "js-yaml": "^3.13.1", "mocha": "^6.1.4", "mock-require": "^3.0.3", + "mz": "^2.7.0", "nock": "^10.0.6", "prettier": "^1.17.1", "sinon": "^7.3.2", @@ -60,7 +63,9 @@ "tslint": "^5.17.0", "tslint-no-unused-expression-chai": "^0.1.4", "tslint-plugin-prettier": "^2.0.0", - "typescript": "^3.5.1" + "typedoc": "^0.14.2", + "typescript": "^3.5.1", + "yargs": "^13.2.4" }, "peerDependencies": { "firebase-admin": "^8.0.0" From 76290486693475ff53bb7d3c5e7ffde98bd6b11c Mon Sep 17 00:00:00 2001 From: Diana Tkachenko Date: Wed, 26 Jun 2019 23:59:35 -0700 Subject: [PATCH 02/18] fix from admin => functions in a comment --- docgen/content-sources/HOME.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docgen/content-sources/HOME.md b/docgen/content-sources/HOME.md index 139c58dc0..f578cb507 100644 --- a/docgen/content-sources/HOME.md +++ b/docgen/content-sources/HOME.md @@ -1,3 +1,3 @@ -# Firebase Admin Node.js SDK Reference +# Firebase Functions SDK Reference Functions SDK!!! \ No newline at end of file From dd061237bfb80fab62d72f65c27cb8b3788da07e Mon Sep 17 00:00:00 2001 From: Diana Tkachenko Date: Thu, 27 Jun 2019 07:58:06 -0700 Subject: [PATCH 03/18] add npm run apidocs command to generate apidocs --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index b241e2c63..566ec1b37 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,8 @@ "format": "prettier --write '**/*.ts'", "lint": "tslint --project tsconfig.json --config tslint.json", "posttest": "npm run format", - "test": "mocha -r ts-node/register ./spec/index.spec.ts" + "test": "mocha -r ts-node/register ./spec/index.spec.ts", + "apidocs": "node docgen/generate-docs.js" }, "dependencies": { "@types/cors": "^2.8.5", From e4cb222d78022db3bc08c80d8dc686facb0b8f41 Mon Sep 17 00:00:00 2001 From: Diana Tkachenko Date: Tue, 9 Jul 2019 11:08:10 -0700 Subject: [PATCH 04/18] modify to use modules instead of file mode --- docgen/typedoc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docgen/typedoc.js b/docgen/typedoc.js index 6d04ae747..3a08d0fd2 100644 --- a/docgen/typedoc.js +++ b/docgen/typedoc.js @@ -20,7 +20,7 @@ const options = { excludeExternals: true, ignoreCompilerErrors: true, name: 'Firebase Functions SDK', - mode: 'file', + mode: 'modules', hideGenerator: true }; From 0248c8d650d921faf825375527cceb84a34017a0 Mon Sep 17 00:00:00 2001 From: Diana Tkachenko Date: Tue, 9 Jul 2019 11:09:07 -0700 Subject: [PATCH 05/18] change toc to match modules mode of typedoc --- docgen/content-sources/toc.yaml | 58 ++++++++++++++++----------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/docgen/content-sources/toc.yaml b/docgen/content-sources/toc.yaml index a8f658112..1c6ef9f2d 100644 --- a/docgen/content-sources/toc.yaml +++ b/docgen/content-sources/toc.yaml @@ -3,73 +3,73 @@ toc: path: /docs/reference/functions/functions - title: "functions.analytics" - path: /docs/reference/functions/functions.analytics + path: /docs/reference/functions/_providers_analytics_.html section: - title: "AnalyticsEvent" - path: /docs/reference/functions/AnalyticsEvent + path: /docs/reference/functions/_providers_analytics_.analyticsevent - title: "AnalyticsEventBuilder" - path: /docs/reference/functions/AnalyticsEventBuilder + path: /docs/reference/functions/_providers_analytics_.analyticseventbuilder - title: "AppInfo" - path: /docs/reference/functions/functions.analytics.AppInfo + path: /docs/reference/functions/_providers_analytics_.appinfo - title: "DeviceInfo" - path: /docs/reference/functions/functions.analytics.DeviceInfo + path: /docs/reference/functions/_providers_analytics_.deviceinfo - title: "ExportBundleInfo" - path: /docs/reference/functions/functions.analytics.ExportBundleInfo + path: /docs/reference/functions/_providers_analytics_.exportbundleinfo - title: "GeoInfo" - path: /docs/reference/functions/functions.analytics.GeoInfo + path: /docs/reference/functions/_providers_analytics_.geoinfo - title: "UserDimensions" - path: /docs/reference/functions/functions.analytics.UserDimensions + path: /docs/reference/functions/_providers_analytics_.userdimensions - title: "UserPropertyValue" - path: /docs/reference/functions/functions.analytics.UserPropertyValue + path: /docs/reference/functions/_providers_analytics_.userpropertyvalue - title: "functions.auth" - path: /docs/reference/functions/functions.auth + path: /docs/reference/functions/_providers_auth_.html section: - title: "UserBuilder" - path: /docs/reference/functions/functions.auth.UserBuilder + path: /docs/reference/functions/_providers_auth_.userbuilder - title: "UserInfo" - path: /docs/reference/functions/functions.auth.UserInfo + path: /docs/reference/functions/_providers_auth_.userinfo - title: "UserMetadata" - path: /docs/reference/functions/functions.auth.UserMetadata + path: /docs/reference/functions/_providers_auth_.usermetadata - title: "UserRecord" - path: /docs/reference/functions/functions.auth.UserRecord + path: /docs/reference/functions/_providers_auth_.userrecord - title: "functions.database" - path: /docs/reference/functions/functions.database + path: /docs/reference/functions/_providers_database_.html section: - title: "DeltaSnapshot" - path: /docs/reference/functions/functions.database.DeltaSnapshot + path: /docs/reference/functions/_providers_database_.deltasnapshot - title: "RefBuilder" - path: /docs/reference/functions/functions.database.RefBuilder + path: /docs/reference/functions/_providers_database_.refbuilder - title: "functions.https" - path: /docs/reference/functions/functions.https + path: /docs/reference/functions/_providers_https_.html - title: "functions.pubsub" - path: /docs/reference/functions/functions.pubsub + path: /docs/reference/functions/_providers_pubsub_.html section: - title: "Message" - path: /docs/reference/functions/functions.pubsub.Message + path: /docs/reference/functions/_providers_pubsub_.message - title: "TopicBuilder" - path: /docs/reference/functions/functions.pubsub.TopicBuilder + path: /docs/reference/functions/_providers_pubsub_.topicbuilder - title: "functions.storage" - path: /docs/reference/functions/functions.storage + path: /docs/reference/functions/_providers_storage_.html section: - title: "BucketBuilder" - path: /docs/reference/functions/functions.storage.BucketBuilder + path: /docs/reference/functions/_providers_storage_.bucketbuilder - title: "ObjectBuilder" - path: /docs/reference/functions/functions.storage.ObjectBuilder + path: /docs/reference/functions/_providers_storage_.objectbuilder - title: "ObjectMetadata" - path: /docs/reference/functions/functions.storage.ObjectMetadata + path: /docs/reference/functions/_providers_storage_.objectmetadata - title: "CloudFunction" - path: /docs/reference/functions/functions.CloudFunction + path: /docs/reference/functions/_cloud_functions_.html - title: "Config" - path: /docs/reference/functions/functions.config.Config + path: /docs/reference/functions/_config_config - title: "Event" - path: /docs/reference/functions/functions.Event + path: /docs/reference/functions/_cloud_functions_.event - title: "functions.config" - path: /docs/reference/functions/functions.config + path: /docs/reference/functions/_config_.html - title: "HttpsFunction" path: /docs/reference/functions/functions.HttpsFunction \ No newline at end of file From ed0f30a750c17b88d584c0da0a845ef7860eb4f1 Mon Sep 17 00:00:00 2001 From: Diana Tkachenko Date: Tue, 9 Jul 2019 12:24:12 -0700 Subject: [PATCH 06/18] add UserInfo to be generated, modify toc.yaml to correct links --- docgen/content-sources/toc.yaml | 48 ++++++++++++++++----------------- docgen/generate-docs.js | 2 +- docgen/typedoc.js | 2 +- src/providers/auth.ts | 5 ++++ 4 files changed, 31 insertions(+), 26 deletions(-) diff --git a/docgen/content-sources/toc.yaml b/docgen/content-sources/toc.yaml index 1c6ef9f2d..2fcb85dbd 100644 --- a/docgen/content-sources/toc.yaml +++ b/docgen/content-sources/toc.yaml @@ -1,46 +1,46 @@ toc: - title: "functions" - path: /docs/reference/functions/functions + path: /docs/reference/functions/globals.html - title: "functions.analytics" path: /docs/reference/functions/_providers_analytics_.html section: - title: "AnalyticsEvent" - path: /docs/reference/functions/_providers_analytics_.analyticsevent + path: /docs/reference/functions/_providers_analytics_.analyticsevent.html - title: "AnalyticsEventBuilder" - path: /docs/reference/functions/_providers_analytics_.analyticseventbuilder + path: /docs/reference/functions/_providers_analytics_.analyticseventbuilder.html - title: "AppInfo" - path: /docs/reference/functions/_providers_analytics_.appinfo + path: /docs/reference/functions/_providers_analytics_.appinfo.html - title: "DeviceInfo" - path: /docs/reference/functions/_providers_analytics_.deviceinfo + path: /docs/reference/functions/_providers_analytics_.deviceinfo.html - title: "ExportBundleInfo" - path: /docs/reference/functions/_providers_analytics_.exportbundleinfo + path: /docs/reference/functions/_providers_analytics_.exportbundleinfo.html - title: "GeoInfo" - path: /docs/reference/functions/_providers_analytics_.geoinfo + path: /docs/reference/functions/_providers_analytics_.geoinfo.html - title: "UserDimensions" - path: /docs/reference/functions/_providers_analytics_.userdimensions + path: /docs/reference/functions/_providers_analytics_.userdimensions.html - title: "UserPropertyValue" - path: /docs/reference/functions/_providers_analytics_.userpropertyvalue + path: /docs/reference/functions/_providers_analytics_.userpropertyvalue.html - title: "functions.auth" path: /docs/reference/functions/_providers_auth_.html section: - title: "UserBuilder" - path: /docs/reference/functions/_providers_auth_.userbuilder + path: /docs/reference/functions/_providers_auth_.userbuilder.html - title: "UserInfo" - path: /docs/reference/functions/_providers_auth_.userinfo - - title: "UserMetadata" - path: /docs/reference/functions/_providers_auth_.usermetadata + path: /docs/reference/functions/_providers_auth_.html#userinfo + - title: "UserRecordMetadata" + path: /docs/reference/functions/_providers_auth_.userrecordmetadata.html - title: "UserRecord" - path: /docs/reference/functions/_providers_auth_.userrecord + path: /docs/reference/functions/_providers_auth_.html#userrecord - title: "functions.database" path: /docs/reference/functions/_providers_database_.html section: - title: "DeltaSnapshot" - path: /docs/reference/functions/_providers_database_.deltasnapshot + path: /docs/reference/functions/_providers_database_.deltasnapshot.html - title: "RefBuilder" - path: /docs/reference/functions/_providers_database_.refbuilder + path: /docs/reference/functions/_providers_database_.refbuilder.html - title: "functions.https" path: /docs/reference/functions/_providers_https_.html @@ -49,27 +49,27 @@ toc: path: /docs/reference/functions/_providers_pubsub_.html section: - title: "Message" - path: /docs/reference/functions/_providers_pubsub_.message + path: /docs/reference/functions/_providers_pubsub_.message.html - title: "TopicBuilder" - path: /docs/reference/functions/_providers_pubsub_.topicbuilder + path: /docs/reference/functions/_providers_pubsub_.topicbuilder.html - title: "functions.storage" path: /docs/reference/functions/_providers_storage_.html section: - title: "BucketBuilder" - path: /docs/reference/functions/_providers_storage_.bucketbuilder + path: /docs/reference/functions/_providers_storage_.bucketbuilder.html - title: "ObjectBuilder" - path: /docs/reference/functions/_providers_storage_.objectbuilder + path: /docs/reference/functions/_providers_storage_.objectbuilder.html - title: "ObjectMetadata" - path: /docs/reference/functions/_providers_storage_.objectmetadata + path: /docs/reference/functions/_providers_storage_.objectmetadata.html - title: "CloudFunction" path: /docs/reference/functions/_cloud_functions_.html - title: "Config" - path: /docs/reference/functions/_config_config + path: /docs/reference/functions/_config_config.html - title: "Event" - path: /docs/reference/functions/_cloud_functions_.event + path: /docs/reference/functions/_cloud_functions_.event.html - title: "functions.config" path: /docs/reference/functions/_config_.html - title: "HttpsFunction" - path: /docs/reference/functions/functions.HttpsFunction \ No newline at end of file + path: /docs/reference/functions/functions.HttpsFunction.html \ No newline at end of file diff --git a/docgen/generate-docs.js b/docgen/generate-docs.js index 655ba2c81..e9fff11b4 100644 --- a/docgen/generate-docs.js +++ b/docgen/generate-docs.js @@ -110,7 +110,7 @@ function generateTempHomeMdFile(tocRaw, homeRaw) { tocPageLines.push(`\n## [${group.title}](${stripPath(group.path)})`); const section = group.section || []; section.forEach(item => { - tocPageLines.push(`- [${item.title}](${stripPath(item.path)}.html)`); + tocPageLines.push(`- [${item.title}](${stripPath(item.path)})`); }); }); return fs.writeFile(tempHomePath, tocPageLines.join('\n')); diff --git a/docgen/typedoc.js b/docgen/typedoc.js index 3a08d0fd2..58156ff59 100644 --- a/docgen/typedoc.js +++ b/docgen/typedoc.js @@ -16,7 +16,7 @@ */ const options = { - includeDeclarations: true, + // includeDeclarations: true, excludeExternals: true, ignoreCompilerErrors: true, name: 'Firebase Functions SDK', diff --git a/src/providers/auth.ts b/src/providers/auth.ts index 95747ede5..706e5f140 100644 --- a/src/providers/auth.ts +++ b/src/providers/auth.ts @@ -116,6 +116,11 @@ export class UserBuilder { */ export type UserRecord = firebase.auth.UserRecord; +/** + * UserInfo that is part of the UserRecord object. + */ +export type UserInfo = firebase.auth.UserInfo; + export function userRecordConstructor( wireData: Object ): firebase.auth.UserRecord { From 8547a7ea03752a80cdd76707365cf82a44a8607b Mon Sep 17 00:00:00 2001 From: Diana Tkachenko Date: Tue, 9 Jul 2019 14:25:15 -0700 Subject: [PATCH 07/18] add missing sections to toc.yaml --- docgen/content-sources/toc.yaml | 72 ++++++++++++++++++++++++++------- docgen/generate-docs.js | 1 - src/providers/auth.ts | 2 +- 3 files changed, 58 insertions(+), 17 deletions(-) diff --git a/docgen/content-sources/toc.yaml b/docgen/content-sources/toc.yaml index 2fcb85dbd..14d362e6f 100644 --- a/docgen/content-sources/toc.yaml +++ b/docgen/content-sources/toc.yaml @@ -1,6 +1,26 @@ toc: - title: "functions" - path: /docs/reference/functions/globals.html + path: /docs/reference/functions/_cloud_functions_.html + section: + - title: "CloudFunction" + path: /docs/reference/functions/_cloud_functions_.html#cloudfunction + - title: "HttpsFunction" + path: /docs/reference/functions/_cloud_functions_.html#httpsfunction + - title: "Event" + path: /docs/reference/functions/_cloud_functions_.event.html + - title: "EventContext" + path: /docs/reference/functions/_cloud_functions_.eventcontext.html + - title: "FunctionBuilder" + path: /docs/reference/functions/_function_builder_.functionbuilder.html + - title: "Change" + path: /docs/reference/functions/_cloud_functions_.change.html + + +- title: "functions.config" + path: /docs/reference/functions/_config_.html + section: + - title: "Config" + path: /docs/reference/functions/_config_.config.html - title: "functions.analytics" path: /docs/reference/functions/_providers_analytics_.html @@ -34,16 +54,41 @@ toc: - title: "UserRecord" path: /docs/reference/functions/_providers_auth_.html#userrecord +- title: "functions.crashlytics" + path: /docs/reference/functions/_providers_crashlytics_.html + section: + - title: "Issue" + path: /docs/reference/functions/_providers_crashlytics_.issue.html + - title: "IssueBuilder" + path: /docs/reference/functions/_providers_crashlytics_.issuebuilder.html + - title: "AppInfo" + path: /docs/reference/functions/_providers_crashlytics_.appinfo.html + - title: "VelocityAlert" + path: /docs/reference/functions/_providers_crashlytics_.velocityalert.html + +- title: "functions.firestore" + path: /docs/reference/functions/_providers_firestore_.html + section: + - title: "DocumentBuilder" + path: /docs/reference/functions/_providers_firestore_.documentbuilder.html + - title: "DocumentSnapshot" + path: /docs/reference/functions/_providers_firestore_.html#documentsnapshot + - title: "functions.database" path: /docs/reference/functions/_providers_database_.html section: - - title: "DeltaSnapshot" - path: /docs/reference/functions/_providers_database_.deltasnapshot.html + - title: "DataSnapshot" + path: /docs/reference/functions/_providers_database_.datasnapshot.html - title: "RefBuilder" path: /docs/reference/functions/_providers_database_.refbuilder.html + - title: "InstanceBuilder" + path: /docs/reference/functions/_providers_database_.instancebuilder.html - title: "functions.https" path: /docs/reference/functions/_providers_https_.html + section: + - title: "HttpsError" + path: /docs/reference/functions/_providers_https_.httpserror.html - title: "functions.pubsub" path: /docs/reference/functions/_providers_pubsub_.html @@ -53,6 +98,14 @@ toc: - title: "TopicBuilder" path: /docs/reference/functions/_providers_pubsub_.topicbuilder.html +- title: "functions.remoteconfig" + path: /docs/reference/functions/_providers_remoteconfig_.html + section: + - title: "RemoteConfigUser" + path: /docs/reference/functions/_providers_remoteconfig_.remoteconfiguser.html + - title: "TemplateVersion" + path: /docs/reference/functions/_providers_remoteconfig_.templateversion.html + - title: "functions.storage" path: /docs/reference/functions/_providers_storage_.html section: @@ -61,15 +114,4 @@ toc: - title: "ObjectBuilder" path: /docs/reference/functions/_providers_storage_.objectbuilder.html - title: "ObjectMetadata" - path: /docs/reference/functions/_providers_storage_.objectmetadata.html - -- title: "CloudFunction" - path: /docs/reference/functions/_cloud_functions_.html -- title: "Config" - path: /docs/reference/functions/_config_config.html -- title: "Event" - path: /docs/reference/functions/_cloud_functions_.event.html -- title: "functions.config" - path: /docs/reference/functions/_config_.html -- title: "HttpsFunction" - path: /docs/reference/functions/functions.HttpsFunction.html \ No newline at end of file + path: /docs/reference/functions/_providers_storage_.objectmetadata.html \ No newline at end of file diff --git a/docgen/generate-docs.js b/docgen/generate-docs.js index e9fff11b4..5070e035c 100644 --- a/docgen/generate-docs.js +++ b/docgen/generate-docs.js @@ -106,7 +106,6 @@ function generateTempHomeMdFile(tocRaw, homeRaw) { const { toc } = yaml.safeLoad(tocRaw); let tocPageLines = [homeRaw, '# API Reference']; toc.forEach(group => { - console.log(group); tocPageLines.push(`\n## [${group.title}](${stripPath(group.path)})`); const section = group.section || []; section.forEach(item => { diff --git a/src/providers/auth.ts b/src/providers/auth.ts index 706e5f140..32f965e62 100644 --- a/src/providers/auth.ts +++ b/src/providers/auth.ts @@ -117,7 +117,7 @@ export class UserBuilder { export type UserRecord = firebase.auth.UserRecord; /** - * UserInfo that is part of the UserRecord object. + * UserInfo that is part of the UserRecord */ export type UserInfo = firebase.auth.UserInfo; From faf5c67caf4b299c5f45bc1eca167dd0d9d3cd47 Mon Sep 17 00:00:00 2001 From: Diana Tkachenko Date: Tue, 9 Jul 2019 15:03:52 -0700 Subject: [PATCH 08/18] fix merge conflict --- package.json | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 09b6caa0b..f3aa49eea 100644 --- a/package.json +++ b/package.json @@ -24,19 +24,13 @@ "build:pack": "rm -rf lib && npm install && tsc -p tsconfig.release.json && npm pack", "build:release": "npm install --production && npm install typescript firebase-admin && tsc -p tsconfig.release.json", "build": "tsc -p tsconfig.release.json", -<<<<<<< HEAD - "format": "prettier --write '**/*.ts'", - "lint": "tslint --project tsconfig.json --config tslint.json", - "posttest": "npm run format", - "test": "mocha -r ts-node/register ./spec/index.spec.ts", - "apidocs": "node docgen/generate-docs.js" -======= "format": "prettier --check '**/*.ts'", "format:fix": "prettier --write '**/*.ts'", "lint": "tslint --config tslint.json --project tsconfig.json ", "lint:fix": "tslint --config tslint.json --fix --project tsconfig.json", - "test": "mocha -r ts-node/register ./spec/index.spec.ts" ->>>>>>> master + "test": "mocha -r ts-node/register ./spec/index.spec.ts", + "apidocs": "node docgen/generate-docs.js" + }, "dependencies": { "@types/cors": "^2.8.5", From 97658499aa34ae7f9b857246aefec26c3c4ef36f Mon Sep 17 00:00:00 2001 From: Diana Tkachenko Date: Tue, 9 Jul 2019 15:53:21 -0700 Subject: [PATCH 09/18] fix erroneous warnings about missing and unlisted files --- docgen/generate-docs.js | 21 ++++++++++----------- package.json | 1 - 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/docgen/generate-docs.js b/docgen/generate-docs.js index 5070e035c..adc285306 100644 --- a/docgen/generate-docs.js +++ b/docgen/generate-docs.js @@ -132,24 +132,24 @@ function checkForMissingFilesAndFixFilenameCase() { .filter(line => line.includes('path:')) .map(line => line.split(devsitePath)[1]); // Logs warning to console if a file from TOC is not found. - console.log(filenames); + // console.log(filenames); const fileCheckPromises = filenames.map(filename => { // Warns if file does not exist, fixes filename case if it does. // Preferred filename for devsite should be capitalized and taken from // toc.yaml. - const tocFilePath = `${docPath}/${filename}.html`; + const tocFilePath = `${docPath}/${filename}`; // Generated filename from Typedoc will be lowercase. - const generatedFilePath = `${docPath}/${filename.toLowerCase()}.html`; + const generatedFilePath = `${docPath}/${filename.toLowerCase()}`; return fs.exists(generatedFilePath).then(exists => { if (exists) { // Store in a lookup table for link fixing. lowerToUpperLookup[ - `${filename.toLowerCase()}.html` - ] = `${filename}.html`; + `${filename.toLowerCase()}` + ] = `${filename}`; return fs.rename(generatedFilePath, tocFilePath); } else { console.warn( - `Missing file: ${filename}.html requested ` + + `Missing file: ${filename} requested ` + `in toc.yaml but not found in ${docPath}` ); } @@ -169,8 +169,7 @@ function checkForMissingFilesAndFixFilenameCase() { function checkForUnlistedFiles(filenamesFromToc, shouldRemove) { return fs.readdir(docPath).then(files => { const htmlFiles = files - .filter(filename => filename.slice(-4) === 'html') - .map(filename => filename.slice(0, -5)); + .filter(filename => filename.slice(-4) === 'html'); const removePromises = []; htmlFiles.forEach(filename => { if ( @@ -180,9 +179,9 @@ function checkForUnlistedFiles(filenamesFromToc, shouldRemove) { ) { if (shouldRemove) { console.log( - `REMOVING ${docPath}/${filename}.html - not listed in toc.yaml.` + `REMOVING ${docPath}/${filename} - not listed in toc.yaml.` ); - removePromises.push(fs.unlink(`${docPath}/${filename}.html`)); + removePromises.push(fs.unlink(`${docPath}/${filename}`)); } else { // This is just a warning, it doesn't need to finish before // the process continues. @@ -232,7 +231,7 @@ function fixAllLinks(htmlFiles) { const writePromises = []; htmlFiles.forEach(file => { // Update links in each html file to match flattened file structure. - writePromises.push(fixLinks(`${docPath}/${file}.html`)); + writePromises.push(fixLinks(`${docPath}/${file}`)); }); return Promise.all(writePromises); } diff --git a/package.json b/package.json index f3aa49eea..b400a03ae 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,6 @@ "lint:fix": "tslint --config tslint.json --fix --project tsconfig.json", "test": "mocha -r ts-node/register ./spec/index.spec.ts", "apidocs": "node docgen/generate-docs.js" - }, "dependencies": { "@types/cors": "^2.8.5", From e61e4ab93991e33ed8b831ed106156dc90a4432b Mon Sep 17 00:00:00 2001 From: Diana Tkachenko Date: Tue, 9 Jul 2019 23:05:33 -0700 Subject: [PATCH 10/18] remove underscores --- docgen/generate-docs.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/docgen/generate-docs.js b/docgen/generate-docs.js index adc285306..bd18ac4fc 100644 --- a/docgen/generate-docs.js +++ b/docgen/generate-docs.js @@ -20,6 +20,7 @@ const fs = require('mz/fs'); const path = require('path'); const yargs = require('yargs'); const yaml = require('js-yaml'); +const _ = require('lodash'); const repoPath = path.resolve(`${__dirname}/..`); @@ -75,11 +76,42 @@ function moveFilesToRoot(subdir) { .catch(e => console.error(e)); } +function removeUnderscores(htmlFiles) { + // console.log(htmlFiles); + let newHtmlFiles = []; + htmlFiles.forEach(file => { + // const fullFile = `${docPath}/${file}`; + // console.log(fullFile); + // const fileBits = fullFile.split("/"); + // const path = _.dropRight(fileBits).join("/"); + // const originalFile = _.last(fileBits); + let newFileName = file; + if (_.startsWith(file, "_")) { + newFileName = _.trimStart(file, "_"); + } + fs.rename(`${docPath}/${file}`, `${docPath}/${newFileName}`, (err) => { + if (err) console.log(err) + }); + newHtmlFiles.push(newFileName); + }) + return newHtmlFiles; +} + /** * Reformat links to match flat structure. * @param {string} file File to fix links in. */ function fixLinks(file) { + // const fileBits = file.split("/"); + // const path = _.dropRight(fileBits).join("/"); + // const originalFile = _.last(fileBits); + // let newFileName = originalFile; + // if (_.startsWith(originalFile, "_")) { + // newFileName = path + "/" + _.trimStart(originalFile, "_"); + // } + // fs.rename(file, newFileName, (err) => { + // if (err) console.log(err) + // }); return fs.readFile(file, 'utf8').then(data => { const flattenedLinks = data .replace(/\.\.\//g, '') @@ -293,6 +325,7 @@ Promise.all([ .then(htmlFiles => writeGeneratedFileList(htmlFiles)) // Correct the links in all the generated html files now that files have // all been moved to top level. + .then(removeUnderscores) .then(fixAllLinks) .then(() => { fs.readFile(`${docPath}/index.html`, 'utf8').then(data => { From 0b4dd34f01982e0f7a96ee55ad4ad2da32b67ffb Mon Sep 17 00:00:00 2001 From: Diana Tkachenko Date: Tue, 9 Jul 2019 23:08:19 -0700 Subject: [PATCH 11/18] edit toc.yaml to fix the links --- docgen/content-sources/toc.yaml | 94 ++++++++++++++++----------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/docgen/content-sources/toc.yaml b/docgen/content-sources/toc.yaml index 14d362e6f..eb95cdc54 100644 --- a/docgen/content-sources/toc.yaml +++ b/docgen/content-sources/toc.yaml @@ -1,117 +1,117 @@ toc: - title: "functions" - path: /docs/reference/functions/_cloud_functions_.html + path: /docs/reference/functions/cloud_functions_.html section: - title: "CloudFunction" - path: /docs/reference/functions/_cloud_functions_.html#cloudfunction + path: /docs/reference/functions/cloud_functions_.html#cloudfunction - title: "HttpsFunction" - path: /docs/reference/functions/_cloud_functions_.html#httpsfunction + path: /docs/reference/functions/cloud_functions_.html#httpsfunction - title: "Event" - path: /docs/reference/functions/_cloud_functions_.event.html + path: /docs/reference/functions/cloud_functions_.event.html - title: "EventContext" - path: /docs/reference/functions/_cloud_functions_.eventcontext.html + path: /docs/reference/functions/cloud_functions_.eventcontext.html - title: "FunctionBuilder" - path: /docs/reference/functions/_function_builder_.functionbuilder.html + path: /docs/reference/functions/function_builder_.functionbuilder.html - title: "Change" - path: /docs/reference/functions/_cloud_functions_.change.html + path: /docs/reference/functions/cloud_functions_.change.html - title: "functions.config" - path: /docs/reference/functions/_config_.html + path: /docs/reference/functions/config_.html section: - title: "Config" - path: /docs/reference/functions/_config_.config.html + path: /docs/reference/functions/config_.config.html - title: "functions.analytics" - path: /docs/reference/functions/_providers_analytics_.html + path: /docs/reference/functions/providers_analytics_.html section: - title: "AnalyticsEvent" - path: /docs/reference/functions/_providers_analytics_.analyticsevent.html + path: /docs/reference/functions/providers_analytics_.analyticsevent.html - title: "AnalyticsEventBuilder" - path: /docs/reference/functions/_providers_analytics_.analyticseventbuilder.html + path: /docs/reference/functions/providers_analytics_.analyticseventbuilder.html - title: "AppInfo" - path: /docs/reference/functions/_providers_analytics_.appinfo.html + path: /docs/reference/functions/providers_analytics_.appinfo.html - title: "DeviceInfo" - path: /docs/reference/functions/_providers_analytics_.deviceinfo.html + path: /docs/reference/functions/providers_analytics_.deviceinfo.html - title: "ExportBundleInfo" - path: /docs/reference/functions/_providers_analytics_.exportbundleinfo.html + path: /docs/reference/functions/providers_analytics_.exportbundleinfo.html - title: "GeoInfo" - path: /docs/reference/functions/_providers_analytics_.geoinfo.html + path: /docs/reference/functions/providers_analytics_.geoinfo.html - title: "UserDimensions" - path: /docs/reference/functions/_providers_analytics_.userdimensions.html + path: /docs/reference/functions/providers_analytics_.userdimensions.html - title: "UserPropertyValue" - path: /docs/reference/functions/_providers_analytics_.userpropertyvalue.html + path: /docs/reference/functions/providers_analytics_.userpropertyvalue.html - title: "functions.auth" - path: /docs/reference/functions/_providers_auth_.html + path: /docs/reference/functions/providers_auth_.html section: - title: "UserBuilder" - path: /docs/reference/functions/_providers_auth_.userbuilder.html + path: /docs/reference/functions/providers_auth_.userbuilder.html - title: "UserInfo" - path: /docs/reference/functions/_providers_auth_.html#userinfo + path: /docs/reference/functions/providers_auth_.html#userinfo - title: "UserRecordMetadata" - path: /docs/reference/functions/_providers_auth_.userrecordmetadata.html + path: /docs/reference/functions/providers_auth_.userrecordmetadata.html - title: "UserRecord" - path: /docs/reference/functions/_providers_auth_.html#userrecord + path: /docs/reference/functions/providers_auth_.html#userrecord - title: "functions.crashlytics" - path: /docs/reference/functions/_providers_crashlytics_.html + path: /docs/reference/functions/providers_crashlytics_.html section: - title: "Issue" - path: /docs/reference/functions/_providers_crashlytics_.issue.html + path: /docs/reference/functions/providers_crashlytics_.issue.html - title: "IssueBuilder" - path: /docs/reference/functions/_providers_crashlytics_.issuebuilder.html + path: /docs/reference/functions/providers_crashlytics_.issuebuilder.html - title: "AppInfo" - path: /docs/reference/functions/_providers_crashlytics_.appinfo.html + path: /docs/reference/functions/providers_crashlytics_.appinfo.html - title: "VelocityAlert" - path: /docs/reference/functions/_providers_crashlytics_.velocityalert.html + path: /docs/reference/functions/providers_crashlytics_.velocityalert.html - title: "functions.firestore" - path: /docs/reference/functions/_providers_firestore_.html + path: /docs/reference/functions/providers_firestore_.html section: - title: "DocumentBuilder" - path: /docs/reference/functions/_providers_firestore_.documentbuilder.html + path: /docs/reference/functions/providers_firestore_.documentbuilder.html - title: "DocumentSnapshot" - path: /docs/reference/functions/_providers_firestore_.html#documentsnapshot + path: /docs/reference/functions/providers_firestore_.html#documentsnapshot - title: "functions.database" - path: /docs/reference/functions/_providers_database_.html + path: /docs/reference/functions/providers_database_.html section: - title: "DataSnapshot" - path: /docs/reference/functions/_providers_database_.datasnapshot.html + path: /docs/reference/functions/providers_database_.datasnapshot.html - title: "RefBuilder" - path: /docs/reference/functions/_providers_database_.refbuilder.html + path: /docs/reference/functions/providers_database_.refbuilder.html - title: "InstanceBuilder" - path: /docs/reference/functions/_providers_database_.instancebuilder.html + path: /docs/reference/functions/providers_database_.instancebuilder.html - title: "functions.https" - path: /docs/reference/functions/_providers_https_.html + path: /docs/reference/functions/providers_https_.html section: - title: "HttpsError" - path: /docs/reference/functions/_providers_https_.httpserror.html + path: /docs/reference/functions/providers_https_.httpserror.html - title: "functions.pubsub" - path: /docs/reference/functions/_providers_pubsub_.html + path: /docs/reference/functions/providers_pubsub_.html section: - title: "Message" - path: /docs/reference/functions/_providers_pubsub_.message.html + path: /docs/reference/functions/providers_pubsub_.message.html - title: "TopicBuilder" - path: /docs/reference/functions/_providers_pubsub_.topicbuilder.html + path: /docs/reference/functions/providers_pubsub_.topicbuilder.html - title: "functions.remoteconfig" - path: /docs/reference/functions/_providers_remoteconfig_.html + path: /docs/reference/functions/providers_remoteconfig_.html section: - title: "RemoteConfigUser" - path: /docs/reference/functions/_providers_remoteconfig_.remoteconfiguser.html + path: /docs/reference/functions/providers_remoteconfig_.remoteconfiguser.html - title: "TemplateVersion" - path: /docs/reference/functions/_providers_remoteconfig_.templateversion.html + path: /docs/reference/functions/providers_remoteconfig_.templateversion.html - title: "functions.storage" - path: /docs/reference/functions/_providers_storage_.html + path: /docs/reference/functions/providers_storage_.html section: - title: "BucketBuilder" - path: /docs/reference/functions/_providers_storage_.bucketbuilder.html + path: /docs/reference/functions/providers_storage_.bucketbuilder.html - title: "ObjectBuilder" - path: /docs/reference/functions/_providers_storage_.objectbuilder.html + path: /docs/reference/functions/providers_storage_.objectbuilder.html - title: "ObjectMetadata" - path: /docs/reference/functions/_providers_storage_.objectmetadata.html \ No newline at end of file + path: /docs/reference/functions/providers_storage_.objectmetadata.html \ No newline at end of file From 311f0ec36f8092c9abef7d3193a812576eaa211d Mon Sep 17 00:00:00 2001 From: Diana Tkachenko Date: Wed, 10 Jul 2019 13:28:54 -0700 Subject: [PATCH 12/18] remove underscores in links inside the html files --- docgen/generate-docs.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docgen/generate-docs.js b/docgen/generate-docs.js index bd18ac4fc..e37764a0e 100644 --- a/docgen/generate-docs.js +++ b/docgen/generate-docs.js @@ -115,7 +115,8 @@ function fixLinks(file) { return fs.readFile(file, 'utf8').then(data => { const flattenedLinks = data .replace(/\.\.\//g, '') - .replace(/(modules|interfaces|classes)\//g, ''); + .replace(/(modules|interfaces|classes)\//g, '') + .replace(/\"_/g, '"'); let caseFixedLinks = flattenedLinks; for (const lower in lowerToUpperLookup) { const re = new RegExp(lower, 'g'); From eec23ddf4e4ee01c69854c585355f8b71707a66f Mon Sep 17 00:00:00 2001 From: Diana Tkachenko Date: Wed, 10 Jul 2019 13:44:38 -0700 Subject: [PATCH 13/18] unhide Event --- src/cloud-functions.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/cloud-functions.ts b/src/cloud-functions.ts index 686e9e31e..05d385929 100644 --- a/src/cloud-functions.ts +++ b/src/cloud-functions.ts @@ -29,7 +29,6 @@ const WILDCARD_REGEX = new RegExp('{[^/{}]*}', 'g'); /** * Wire format for an event. - * @hidden */ export interface Event { context: { From b62db9ec043f1397952f17b952a4f97e767d848e Mon Sep 17 00:00:00 2001 From: Diana Tkachenko Date: Wed, 10 Jul 2019 17:13:04 -0700 Subject: [PATCH 14/18] hide Event --- src/cloud-functions.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cloud-functions.ts b/src/cloud-functions.ts index 05d385929..686e9e31e 100644 --- a/src/cloud-functions.ts +++ b/src/cloud-functions.ts @@ -29,6 +29,7 @@ const WILDCARD_REGEX = new RegExp('{[^/{}]*}', 'g'); /** * Wire format for an event. + * @hidden */ export interface Event { context: { From d34b799307f6e5bd7282eb1f3a09f7fed1761d70 Mon Sep 17 00:00:00 2001 From: Diana Tkachenko Date: Wed, 10 Jul 2019 17:14:05 -0700 Subject: [PATCH 15/18] add docgen/html to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index d345a2f7a..ba3cdeec5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ .tmp .vscode/ coverage +docgen/html firebase-functions-*.tgz integration_test/.firebaserc integration_test/*.log From 729d469812e1fe39fc833f9845bfc0a919f27341 Mon Sep 17 00:00:00 2001 From: Diana Tkachenko Date: Wed, 10 Jul 2019 17:21:19 -0700 Subject: [PATCH 16/18] formatting --- docgen/content-sources/HOME.md | 2 +- docgen/content-sources/toc.yaml | 211 ++++++++++++++++---------------- 2 files changed, 106 insertions(+), 107 deletions(-) diff --git a/docgen/content-sources/HOME.md b/docgen/content-sources/HOME.md index f578cb507..c89df0a57 100644 --- a/docgen/content-sources/HOME.md +++ b/docgen/content-sources/HOME.md @@ -1,3 +1,3 @@ # Firebase Functions SDK Reference -Functions SDK!!! \ No newline at end of file +Functions SDK!!! diff --git a/docgen/content-sources/toc.yaml b/docgen/content-sources/toc.yaml index eb95cdc54..b6874bd40 100644 --- a/docgen/content-sources/toc.yaml +++ b/docgen/content-sources/toc.yaml @@ -1,117 +1,116 @@ toc: -- title: "functions" - path: /docs/reference/functions/cloud_functions_.html - section: - - title: "CloudFunction" - path: /docs/reference/functions/cloud_functions_.html#cloudfunction - - title: "HttpsFunction" - path: /docs/reference/functions/cloud_functions_.html#httpsfunction - - title: "Event" - path: /docs/reference/functions/cloud_functions_.event.html - - title: "EventContext" - path: /docs/reference/functions/cloud_functions_.eventcontext.html - - title: "FunctionBuilder" - path: /docs/reference/functions/function_builder_.functionbuilder.html - - title: "Change" - path: /docs/reference/functions/cloud_functions_.change.html - + - title: 'functions' + path: /docs/reference/functions/cloud_functions_.html + section: + - title: 'CloudFunction' + path: /docs/reference/functions/cloud_functions_.html#cloudfunction + - title: 'HttpsFunction' + path: /docs/reference/functions/cloud_functions_.html#httpsfunction + - title: 'Event' + path: /docs/reference/functions/cloud_functions_.event.html + - title: 'EventContext' + path: /docs/reference/functions/cloud_functions_.eventcontext.html + - title: 'FunctionBuilder' + path: /docs/reference/functions/function_builder_.functionbuilder.html + - title: 'Change' + path: /docs/reference/functions/cloud_functions_.change.html -- title: "functions.config" - path: /docs/reference/functions/config_.html - section: - - title: "Config" - path: /docs/reference/functions/config_.config.html + - title: 'functions.config' + path: /docs/reference/functions/config_.html + section: + - title: 'Config' + path: /docs/reference/functions/config_.config.html -- title: "functions.analytics" - path: /docs/reference/functions/providers_analytics_.html - section: - - title: "AnalyticsEvent" - path: /docs/reference/functions/providers_analytics_.analyticsevent.html - - title: "AnalyticsEventBuilder" - path: /docs/reference/functions/providers_analytics_.analyticseventbuilder.html - - title: "AppInfo" - path: /docs/reference/functions/providers_analytics_.appinfo.html - - title: "DeviceInfo" - path: /docs/reference/functions/providers_analytics_.deviceinfo.html - - title: "ExportBundleInfo" - path: /docs/reference/functions/providers_analytics_.exportbundleinfo.html - - title: "GeoInfo" - path: /docs/reference/functions/providers_analytics_.geoinfo.html - - title: "UserDimensions" - path: /docs/reference/functions/providers_analytics_.userdimensions.html - - title: "UserPropertyValue" - path: /docs/reference/functions/providers_analytics_.userpropertyvalue.html + - title: 'functions.analytics' + path: /docs/reference/functions/providers_analytics_.html + section: + - title: 'AnalyticsEvent' + path: /docs/reference/functions/providers_analytics_.analyticsevent.html + - title: 'AnalyticsEventBuilder' + path: /docs/reference/functions/providers_analytics_.analyticseventbuilder.html + - title: 'AppInfo' + path: /docs/reference/functions/providers_analytics_.appinfo.html + - title: 'DeviceInfo' + path: /docs/reference/functions/providers_analytics_.deviceinfo.html + - title: 'ExportBundleInfo' + path: /docs/reference/functions/providers_analytics_.exportbundleinfo.html + - title: 'GeoInfo' + path: /docs/reference/functions/providers_analytics_.geoinfo.html + - title: 'UserDimensions' + path: /docs/reference/functions/providers_analytics_.userdimensions.html + - title: 'UserPropertyValue' + path: /docs/reference/functions/providers_analytics_.userpropertyvalue.html -- title: "functions.auth" - path: /docs/reference/functions/providers_auth_.html - section: - - title: "UserBuilder" - path: /docs/reference/functions/providers_auth_.userbuilder.html - - title: "UserInfo" - path: /docs/reference/functions/providers_auth_.html#userinfo - - title: "UserRecordMetadata" - path: /docs/reference/functions/providers_auth_.userrecordmetadata.html - - title: "UserRecord" - path: /docs/reference/functions/providers_auth_.html#userrecord + - title: 'functions.auth' + path: /docs/reference/functions/providers_auth_.html + section: + - title: 'UserBuilder' + path: /docs/reference/functions/providers_auth_.userbuilder.html + - title: 'UserInfo' + path: /docs/reference/functions/providers_auth_.html#userinfo + - title: 'UserRecordMetadata' + path: /docs/reference/functions/providers_auth_.userrecordmetadata.html + - title: 'UserRecord' + path: /docs/reference/functions/providers_auth_.html#userrecord -- title: "functions.crashlytics" - path: /docs/reference/functions/providers_crashlytics_.html - section: - - title: "Issue" - path: /docs/reference/functions/providers_crashlytics_.issue.html - - title: "IssueBuilder" - path: /docs/reference/functions/providers_crashlytics_.issuebuilder.html - - title: "AppInfo" - path: /docs/reference/functions/providers_crashlytics_.appinfo.html - - title: "VelocityAlert" - path: /docs/reference/functions/providers_crashlytics_.velocityalert.html + - title: 'functions.crashlytics' + path: /docs/reference/functions/providers_crashlytics_.html + section: + - title: 'Issue' + path: /docs/reference/functions/providers_crashlytics_.issue.html + - title: 'IssueBuilder' + path: /docs/reference/functions/providers_crashlytics_.issuebuilder.html + - title: 'AppInfo' + path: /docs/reference/functions/providers_crashlytics_.appinfo.html + - title: 'VelocityAlert' + path: /docs/reference/functions/providers_crashlytics_.velocityalert.html -- title: "functions.firestore" - path: /docs/reference/functions/providers_firestore_.html - section: - - title: "DocumentBuilder" - path: /docs/reference/functions/providers_firestore_.documentbuilder.html - - title: "DocumentSnapshot" - path: /docs/reference/functions/providers_firestore_.html#documentsnapshot + - title: 'functions.firestore' + path: /docs/reference/functions/providers_firestore_.html + section: + - title: 'DocumentBuilder' + path: /docs/reference/functions/providers_firestore_.documentbuilder.html + - title: 'DocumentSnapshot' + path: /docs/reference/functions/providers_firestore_.html#documentsnapshot -- title: "functions.database" - path: /docs/reference/functions/providers_database_.html - section: - - title: "DataSnapshot" - path: /docs/reference/functions/providers_database_.datasnapshot.html - - title: "RefBuilder" - path: /docs/reference/functions/providers_database_.refbuilder.html - - title: "InstanceBuilder" - path: /docs/reference/functions/providers_database_.instancebuilder.html + - title: 'functions.database' + path: /docs/reference/functions/providers_database_.html + section: + - title: 'DataSnapshot' + path: /docs/reference/functions/providers_database_.datasnapshot.html + - title: 'RefBuilder' + path: /docs/reference/functions/providers_database_.refbuilder.html + - title: 'InstanceBuilder' + path: /docs/reference/functions/providers_database_.instancebuilder.html -- title: "functions.https" - path: /docs/reference/functions/providers_https_.html - section: - - title: "HttpsError" - path: /docs/reference/functions/providers_https_.httpserror.html + - title: 'functions.https' + path: /docs/reference/functions/providers_https_.html + section: + - title: 'HttpsError' + path: /docs/reference/functions/providers_https_.httpserror.html -- title: "functions.pubsub" - path: /docs/reference/functions/providers_pubsub_.html - section: - - title: "Message" - path: /docs/reference/functions/providers_pubsub_.message.html - - title: "TopicBuilder" - path: /docs/reference/functions/providers_pubsub_.topicbuilder.html + - title: 'functions.pubsub' + path: /docs/reference/functions/providers_pubsub_.html + section: + - title: 'Message' + path: /docs/reference/functions/providers_pubsub_.message.html + - title: 'TopicBuilder' + path: /docs/reference/functions/providers_pubsub_.topicbuilder.html -- title: "functions.remoteconfig" - path: /docs/reference/functions/providers_remoteconfig_.html - section: - - title: "RemoteConfigUser" - path: /docs/reference/functions/providers_remoteconfig_.remoteconfiguser.html - - title: "TemplateVersion" - path: /docs/reference/functions/providers_remoteconfig_.templateversion.html + - title: 'functions.remoteconfig' + path: /docs/reference/functions/providers_remoteconfig_.html + section: + - title: 'RemoteConfigUser' + path: /docs/reference/functions/providers_remoteconfig_.remoteconfiguser.html + - title: 'TemplateVersion' + path: /docs/reference/functions/providers_remoteconfig_.templateversion.html -- title: "functions.storage" - path: /docs/reference/functions/providers_storage_.html - section: - - title: "BucketBuilder" - path: /docs/reference/functions/providers_storage_.bucketbuilder.html - - title: "ObjectBuilder" - path: /docs/reference/functions/providers_storage_.objectbuilder.html - - title: "ObjectMetadata" - path: /docs/reference/functions/providers_storage_.objectmetadata.html \ No newline at end of file + - title: 'functions.storage' + path: /docs/reference/functions/providers_storage_.html + section: + - title: 'BucketBuilder' + path: /docs/reference/functions/providers_storage_.bucketbuilder.html + - title: 'ObjectBuilder' + path: /docs/reference/functions/providers_storage_.objectbuilder.html + - title: 'ObjectMetadata' + path: /docs/reference/functions/providers_storage_.objectmetadata.html From 4f9b61d4172643437bf3a3d2ae98ba1bef08ebb2 Mon Sep 17 00:00:00 2001 From: Diana Tkachenko Date: Thu, 11 Jul 2019 15:46:15 -0700 Subject: [PATCH 17/18] remove Event from toc, add proper toc file checking --- docgen/content-sources/toc.yaml | 2 -- docgen/generate-docs.js | 18 +++++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/docgen/content-sources/toc.yaml b/docgen/content-sources/toc.yaml index b6874bd40..c2766e430 100644 --- a/docgen/content-sources/toc.yaml +++ b/docgen/content-sources/toc.yaml @@ -6,8 +6,6 @@ toc: path: /docs/reference/functions/cloud_functions_.html#cloudfunction - title: 'HttpsFunction' path: /docs/reference/functions/cloud_functions_.html#httpsfunction - - title: 'Event' - path: /docs/reference/functions/cloud_functions_.event.html - title: 'EventContext' path: /docs/reference/functions/cloud_functions_.eventcontext.html - title: 'FunctionBuilder' diff --git a/docgen/generate-docs.js b/docgen/generate-docs.js index e37764a0e..b3389c12e 100644 --- a/docgen/generate-docs.js +++ b/docgen/generate-docs.js @@ -76,6 +76,21 @@ function moveFilesToRoot(subdir) { .catch(e => console.error(e)); } +function renameFiles() { + return fs.readdir(docPath).then(files => { + console.log(files); + files.forEach(file => { + let newFileName = file; + if (_.startsWith(file, "_") && _.endsWith(file, "html")) { + newFileName = _.trimStart(file, "_"); + fs.rename(`${docPath}/${file}`, `${docPath}/${newFileName}`, (err) => { + if (err) console.log(err) + }); + } + }) + }) +} + function removeUnderscores(htmlFiles) { // console.log(htmlFiles); let newHtmlFiles = []; @@ -313,6 +328,7 @@ Promise.all([ moveFilesToRoot('interfaces'), ]); }) + .then(renameFiles) // Check for files listed in TOC that are missing and warn if so. // Not blocking. .then(checkForMissingFilesAndFixFilenameCase) @@ -326,7 +342,7 @@ Promise.all([ .then(htmlFiles => writeGeneratedFileList(htmlFiles)) // Correct the links in all the generated html files now that files have // all been moved to top level. - .then(removeUnderscores) + // .then(removeUnderscores) .then(fixAllLinks) .then(() => { fs.readFile(`${docPath}/index.html`, 'utf8').then(data => { From 81464eeb817370ea340ea13723c77d50b7f8e9ea Mon Sep 17 00:00:00 2001 From: Diana Tkachenko Date: Thu, 11 Jul 2019 16:02:21 -0700 Subject: [PATCH 18/18] clean up docgen script --- docgen/generate-docs.js | 38 +++++++------------------------------- 1 file changed, 7 insertions(+), 31 deletions(-) diff --git a/docgen/generate-docs.js b/docgen/generate-docs.js index b3389c12e..299250e64 100644 --- a/docgen/generate-docs.js +++ b/docgen/generate-docs.js @@ -76,6 +76,12 @@ function moveFilesToRoot(subdir) { .catch(e => console.error(e)); } +/** + * Renames files to remove the leading underscores. + * We need to do this because devsite hides these files. + * Example: + * _cloud_functions_.resource.html => cloud_functions_.resource.html + */ function renameFiles() { return fs.readdir(docPath).then(files => { console.log(files); @@ -91,42 +97,11 @@ function renameFiles() { }) } -function removeUnderscores(htmlFiles) { - // console.log(htmlFiles); - let newHtmlFiles = []; - htmlFiles.forEach(file => { - // const fullFile = `${docPath}/${file}`; - // console.log(fullFile); - // const fileBits = fullFile.split("/"); - // const path = _.dropRight(fileBits).join("/"); - // const originalFile = _.last(fileBits); - let newFileName = file; - if (_.startsWith(file, "_")) { - newFileName = _.trimStart(file, "_"); - } - fs.rename(`${docPath}/${file}`, `${docPath}/${newFileName}`, (err) => { - if (err) console.log(err) - }); - newHtmlFiles.push(newFileName); - }) - return newHtmlFiles; -} - /** * Reformat links to match flat structure. * @param {string} file File to fix links in. */ function fixLinks(file) { - // const fileBits = file.split("/"); - // const path = _.dropRight(fileBits).join("/"); - // const originalFile = _.last(fileBits); - // let newFileName = originalFile; - // if (_.startsWith(originalFile, "_")) { - // newFileName = path + "/" + _.trimStart(originalFile, "_"); - // } - // fs.rename(file, newFileName, (err) => { - // if (err) console.log(err) - // }); return fs.readFile(file, 'utf8').then(data => { const flattenedLinks = data .replace(/\.\.\//g, '') @@ -328,6 +303,7 @@ Promise.all([ moveFilesToRoot('interfaces'), ]); }) + // Rename files to remove the underscores since devsite hides those. .then(renameFiles) // Check for files listed in TOC that are missing and warn if so. // Not blocking.