Simulator first commit

This commit is contained in:
2019-09-18 11:11:16 +03:00
commit 6e1686be67
5028 changed files with 985331 additions and 0 deletions

6
node_modules/protobufjs/.travis.yml generated vendored Normal file
View File

@ -0,0 +1,6 @@
language: node_js
node_js:
- 0.12
- 4
- 6
sudo: false

202
node_modules/protobufjs/LICENSE generated vendored Normal file
View File

@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
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.

184
node_modules/protobufjs/README.md generated vendored Normal file
View File

@ -0,0 +1,184 @@
protobuf.js 5 [![Build Status](https://travis-ci.org/dcodeIO/protobuf.js.svg?branch=ProtoBuf5)](https://travis-ci.org/dcodeIO/protobuf.js) [![Donate](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=dcode%40dcode.io&item_name=%3C3%20protobuf.js)
=====================================
**Protocol Buffers** are a language-neutral, platform-neutral, extensible way of serializing structured data for use
in communications protocols, data storage, and more, originally designed at Google ([see](https://developers.google.com/protocol-buffers/docs/overview)).
**protobuf.js** is a pure JavaScript implementation on top of [bytebuffer.js](https://github.com/dcodeIO/bytebuffer.js)
including a .proto parser, message class building and simple encoding and decoding. There is no compilation step
required, it's super easy to use and it works out of the box on .proto files!
Getting started
---------------
* **Step 1:** Become familar with [Google's Protocol Buffers (protobuf)](https://developers.google.com/protocol-buffers/docs/overview)
* **Step 2:** Read on or head straight to [our wiki](https://github.com/dcodeIO/protobuf.js/wiki) for additional information
* **Step 3:** Build something cool! :-)
Features
--------
* [RequireJS](http://requirejs.org/)/AMD compatible
* [node.js](http://nodejs.org)/CommonJS compatible, also available via [npm](https://npmjs.org/package/protobufjs)
* Browser compatible
* [Closure Compiler](https://developers.google.com/closure/compiler/) compatible (fully annotated, [externs](https://github.com/dcodeIO/protobuf.js/tree/master/externs))
* Fully documented using [jsdoc3](https://github.com/jsdoc3/jsdoc)
* Well tested through [test.js](https://github.com/dcodeIO/test.js)
* [bytebuffer.js](https://github.com/dcodeIO/bytebuffer.js) is the only production dependency
* Fully compatible to the official implementation including advanced features
* proto2js command line utility
Installation
------------
### node.js / CommonJS
```
$> npm install protobufjs
```
```js
var ProtoBuf = require("protobufjs");
...
```
### RequireJS / AMD
Requires [bytebuffer.js](http://github.com/dcodeIO/bytebuffer.js). Optionally depends on [long.js](https://github.com/dcodeIO/long.js) for long (int64) support. If you do not require long support, you can skip the Long.js config. RequireJS example:
```js
require(["protobuf"], function(ProtoBuf) {
...
});
```
Or as a module dependency:
```js
define("MyModule", ["protobuf"], function(ProtoBuf) {
...
});
```
### Browser
Requires [bytebuffer.js](http://github.com/dcodeIO/bytebuffer.js). Optionally depends on [long.js](https://github.com/dcodeIO/long.js) for long (int64) support. If you do not require long support, you can skip the Long.js include.
```html
<!-- Order is important -->
<script src="long.min.js"></script>
<script src="bytebuffer.min.js"></script>
<script src="protobuf.min.js"></script>
```
```js
var ProtoBuf = dcodeIO.ProtoBuf;
...
```
Getting started
---------------
*Note:* You'll need the full build to load .proto data. light builds are able to load JSON only.
### Loading .proto files
To load a .proto file, use:
**API:** `ProtoBuf.loadProtoFile(source[, callback[, builder]]):Builder|undefined`
```js
// Synchronously
var builder = ProtoBuf.loadProtoFile("path/to/file.proto");
// Asynchronously
ProtoBuf.loadProtoFile("path/to/file.proto", function(err, builder) {
...
});
```
`ProtoBuf.loadProtoFile` also accepts an object specifying the import root directory and the file to load as its first parameter: `{root: string, file: string}`. Additionally, an already created and then reused builder can be specified as the last argument, which is useful if all the definitions shall reside in a single namespace.
### Loading .proto strings
**API:** `ProtoBuf.loadProto(source[, builder][, filename]):Builder`
```js
var builder = ProtoBuf.loadProto(...protoString..., "myproto.proto");
```
### Loading JSON files and strings
To load the (raw) JSON counterpart generated through pbjs, use `ProtoBuf.loadJsonFile` respectively `ProtoBuf.loadJson`. It's the same API.
If you generated classes or modules with it, loading is done just by including respectively requiring the resulting file. Loading is handled transparently in this case.
When using JSON only, you can use protobuf-light.js or protobuf-light.min.js instead, which do NOT include the ProtoBuf.DotProto package for parsing and are therefore smaller.
Command line
------------
Since ProtoBuf.js 4.0.0 the library ships with the `pbjs` command line utility. With it it's possible to convert between .proto and JSON descriptors and even to generate the code required to access runtime structures as pure JS (classes), an AMD module or a CommonJS module.
```
_ |_ . _
|_)|_)|_) ProtoBuf.js v4.0.0-b3 https://github.com/dcodeIO/ProtoBuf.js
| '
CLI utility to convert between .proto and JSON syntax / to generate classes.
Usage: pbjs <filename> [options] [> outFile]
Options:
--help, -h Show help [boolean]
--version, -v Show version number [boolean]
--source, -s Specifies the source format. Valid formats are:
json Plain JSON descriptor
proto Plain .proto descriptor
--target, -t Specifies the target format. Valid formats are:
amd Runtime structures as AMD module
commonjs Runtime structures as CommonJS module
js Runtime structures
json Plain JSON descriptor
proto Plain .proto descriptor
--using, -u Specifies an option to apply to the volatile builder
loading the source, e.g. convertFieldsToCamelCase.
--min, -m Minifies the output. [default: false]
--path, -p Adds a directory to the include path.
--legacy, -l Includes legacy descriptors from google/protobuf/ if
explicitly referenced. [default: false]
--quiet, -q Suppresses any informatory output to stderr. [default: false]
--use, -i Specifies an option to apply to the emitted builder
utilized by your program, e.g. populateAccessors.
--exports, -e Specifies the namespace to export. Defaults to export
the root namespace.
--dependency, -d Library dependency to use when generating classes.
Defaults to 'protobufjs' for CommonJS, 'ProtoBuf' for
AMD modules and 'dcodeIO.ProtoBuf' for classes.
```
Documentation
-------------
* [Read the official protobuf guide](https://developers.google.com/protocol-buffers/docs/overview)
* [Read the API docs](http://htmlpreview.github.io/?https://raw.githubusercontent.com/dcodeIO/protobuf.js/ProtoBuf5/docs/ProtoBuf.html)
* [Check out the examples](https://github.com/dcodeIO/protobuf.js/tree/ProtoBuf5/examples)
Tests
-----
* [View source](https://github.com/dcodeIO/protobuf.js/blob/ProtoBuf5/tests/suite.js)
Downloads
---------
* [Distributions](https://github.com/dcodeIO/protobuf.js/tree/ProtoBuf5/dist)
* [ZIP-Archive](https://github.com/dcodeIO/protobuf.js/archive/ProtoBuf5.zip)
* [Tarball](https://github.com/dcodeIO/protobuf.js/tarball/ProtoBuf5)
CDN usage
---------
```html
<script src="//cdn.rawgit.com/dcodeIO/protobuf.js/5.0.1/dist/protobuf.min.js"></script>
```
With the version pointing to the exact [release](https://github.com/dcodeIO/protobuf.js/releases) your project depends upon.
**License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html)

2
node_modules/protobufjs/bin/pbjs generated vendored Executable file
View File

@ -0,0 +1,2 @@
#!/usr/bin/env node
process.exit(require(__dirname+"/../cli/pbjs.js").main(process.argv));

19
node_modules/protobufjs/bower.json generated vendored Normal file
View File

@ -0,0 +1,19 @@
{
"name": "protobuf",
"description": "Protocol Buffers for JavaScript. Finally.",
"version": "5.0.3",
"main": "dist/protobuf.js",
"license": "Apache-2.0",
"homepage": "http://dcode.io/",
"dependencies": {
"bytebuffer": "~5"
},
"keywords": ["net", "buffer", "protobuf", "serialization", "bytebuffer", "websocket", "webrtc"],
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
]
}

281
node_modules/protobufjs/cli/pbjs.js generated vendored Normal file
View File

@ -0,0 +1,281 @@
/*
Copyright 2013 Daniel Wirtz <dcode@dcode.io>
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.
*/
var ProtoBuf = require(__dirname+"/../index.js"),
fs = require("fs"),
path = require("path"),
cli = require("ascli")("pbjs"),
yargs = require("yargs"),
util = require("./pbjs/util.js"),
glob = require("glob"),
pkg = require("../package.json");
/**
* pbjs namespace.
* @exports pbjs
* @namespace
*/
var pbjs = module.exports = {};
/**
* @alias pbjs/util
*/
pbjs.util = util;
/**
* Source formats.
* @type {!Object.<string,!function(string,!Object.<string,*>)>}
*/
pbjs.sources = {};
fs.readdirSync(__dirname+"/pbjs/sources").forEach(function(source) {
if (/\.js$/.test(source)) {
var src = require(__dirname + "/pbjs/sources/" + source);
if (!src.exclude)
pbjs.sources[source.substring(0, source.lastIndexOf("."))] = src;
}
});
/**
* Target formats.
* @type {!Object.<string,!function(!ProtoBuf.Builder,!Object.<string,*>)>}
*/
pbjs.targets = {};
fs.readdirSync(__dirname+"/pbjs/targets").forEach(function(target) {
if (/\.js$/.test(target))
pbjs.targets[target.substring(0, target.lastIndexOf("."))] = require(__dirname + "/pbjs/targets/" + target);
});
/**
* Status code: Operation successful
* @type {number}
*/
pbjs.STATUS_OK = 0;
/**
* Status code: Displaying usage information
* @type {number}
*/
pbjs.STATUS_USAGE = 1;
/**
* Status code: No such include directory
* @type {number}
*/
pbjs.STATUS_ERR_INCLUDE_DIR = 2;
/**
* Status code: No such source format
* @type {number}
*/
pbjs.STATUS_ERR_SOURCE_FORMAT = 3;
/**
* Status code: No such target format
* @type {number}
*/
pbjs.STATUS_ERR_TARGET_FORMAT = 4;
/**
* Status code: No such namespace
* @type {number}
*/
pbjs.STATUS_ERR_NAMESPACE = 5;
/**
* Status code: Illegal dependency
* @type {number}
*/
pbjs.STATUS_ERR_DEPENDENCY = 6;
/**
* Status code: No matching source files
* @type {number}
*/
pbjs.STATUS_ERR_NOSOURCE = 7;
// Makes a table of available source or target formats
function mkOptions(obj) {
var str = '';
Object.keys(obj).forEach(function(key) {
str += "\n "+util.pad(key, 10)+" "+obj[key].description;
});
return str;
}
/**
* Executes the program.
* @param {!Array.<string>} argv Command line arguments
* @returns {number} Status code
*/
pbjs.main = function(argv) {
var options = yargs
.usage(cli("pb".white.bold+"js".green.bold, util.pad("ProtoBuf.js v"+pkg['version'], 31, true)+" "+pkg['homepage'].grey) + "\n" +
"CLI utility to convert between .proto and JSON syntax / to generate classes.\n\n" +
"Usage: ".white.bold+path.basename(argv[1]).green.bold+" <source files...> [options] [> outFile]")
.help("help")
.version(pkg["version"])
.wrap(null)
.options({
source: {
alias: "s",
describe: "Specifies the source format. Valid formats are:\n" + mkOptions(pbjs.sources)+"\n"
},
target: {
alias: "t",
describe: "Specifies the target format. Valid formats are:\n" + mkOptions(pbjs.targets)+"\n"
},
using: {
alias: "u",
describe: "Specifies an option to apply to the volatile builder\nloading the source, e.g. convertFieldsToCamelCase.",
type: "array"
},
min: {
alias: "m",
describe: "Minifies the output.",
default: false
},
path: {
alias: "p",
describe: "Adds a directory to the include path."
},
legacy: {
alias: "l",
describe: "Includes legacy descriptors from google/protobuf/ if\nexplicitly referenced.",
default: false
},
quiet: {
alias: "q",
describe: "Suppresses any informatory output to stderr.",
default: false
},
out: {
alias: "o",
describe: "Send output to file instead of stdout.",
},
use: {
alias: "i",
describe: "Specifies an option to apply to the emitted builder\nutilized by your program, e.g. populateAccessors.",
type: "array"
},
exports: {
alias: "e",
describe: "Specifies the namespace to export. Defaults to export\nthe root namespace."
},
dependency: {
alias: "d",
describe: "Library dependency to use when generating classes.\nDefaults to 'protobufjs' for CommonJS, 'protobuf' for\nAMD modules and 'dcodeIO.ProtoBuf' for classes."
}
})
.alias("help", "h")
.alias("version", "v")
.check(function (args) {
if (args.source && typeof pbjs.sources[args.source] !== "function") {
return "Unrecognized source format: '" + args.source + "'";
}
if (args.target && typeof pbjs.targets[args.target] !== "function") {
return "Unrecognized target format: '" + args.target + "'";
}
if (args._.length < 3) {
return "The filename to parse is required.";
}
return true;
})
.parse(argv);
var start = Date.now(),
sourceFiles = options._.slice(2);
// Expand glob expressions
var sourceFilesExpand = [];
for (var i=0; i<sourceFiles.length; ++i) {
var filename = sourceFiles[i],
files = glob.sync(filename);
if (files.length === 0) {
cli.fail("No matching source files: "+filename);
return pbjs.STATUS_ERR_NOSOURCE;
}
files.forEach(function(filename) {
if (sourceFilesExpand.indexOf(filename) === -1)
sourceFilesExpand.push(filename);
});
}
sourceFiles = sourceFilesExpand;
if (!options.target)
options.target = "json";
// Set up include paths
var includePath = Array.isArray(options['path']) ? options['path'] : (typeof options['path'] === 'string' ? [options['path']] : []);
sourceFiles.forEach(function (sourceFile) {
var dir = path.dirname(sourceFile);
if (includePath.indexOf(dir) === -1) {
includePath.push(dir);
}
});
includePath.forEach(function(path) { // Verify that include paths actually exist
if (!fs.existsSync(path)) {
if (!options.quiet)
cli.fail("No such include directory: "+path);
return pbjs.STATUS_ERR_INCLUDE_DIR;
}
});
options.path = includePath;
// Detect source format if not specified, then verify
if (typeof options.source !== 'string') {
var source = fs.readFileSync(sourceFiles[0]).toString("utf8").trim();
if (source.substring(0,1) === "{")
options.source = "json";
else
options.source = "proto";
}
// Load the source files to a common builder
var builder = pbjs.sources[options.source](sourceFiles, options);
// Validate exports and dependency if set
if (typeof options.exports !== 'undefined') {
if (!(builder.lookup(options.exports) instanceof ProtoBuf.Reflect.Namespace)) {
if (!options.quiet)
cli.fail("No such export namespace: "+options.exports);
return pbjs.STATUS_ERR_NAMESPACE;
}
if (options.exports.charAt(0) === '.')
options.exports = options.exports.substring(1);
}
if (typeof options.dependency !== 'undefined')
if (typeof options.dependency !== 'string' || !options.dependency) {
if (!options.quiet)
cli.fail("Illegal dependency: "+options.dependency);
return pbjs.STATUS_ERR_DEPENDENCY;
}
// Perform target conversion
if (!options.quiet)
cli.error("\nProcessing: "+sourceFiles.join(", ")+" ...\n");
var res = pbjs.targets[options.target](builder, options);
if (options.out){
fs.writeFileSync(options.out, res);
}else
process.stdout.write(res);
if (!options.quiet)
cli.error(""),
cli.ok("Converted "+sourceFiles.length+" source files to "+options.target+" ("+res.length+" bytes, "+(Date.now()-start)+" ms)");
return pbjs.STATUS_OK;
};

130
node_modules/protobufjs/cli/pbjs/sources/binary.js generated vendored Normal file
View File

@ -0,0 +1,130 @@
/*
Copyright 2013 Daniel Wirtz <dcode@dcode.io>
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.
*/
var description = "Binary descriptor set";
var ProtoBuf = require(__dirname+"/../../../index.js"),
util = require(__dirname+"/../util.js"),
node_path = require("path"),
fs = require("fs");
/**
* pbjs source: Binary descriptor
* @exports pbjs/sources/binary
* @function
* @param {!Array.<string>} filenames Source files
* @param {!Object.<string,*>=} options Options
* @returns {!ProtoBuf.Builder}
*/
var binary = module.exports = function(filenames, options) {
options = options || [];
var builder = ProtoBuf.newBuilder(util.getBuilderOptions(options, "using")),
loaded = [];
filenames.forEach(function(filename) {
var data = binary.load(filename, options, loaded);
builder["import"](data, filename);
});
builder.resolveAll();
return builder;
};
/**
* Module description.
* @type {string}
*/
binary.description = description;
binary.exclude = true; // Unfinished
/**
* Loads a binary descriptor.
* @param {string} filename Source file
* @param {!Object.<string,*>} options Options
* @param {!Array.<string>=} loaded An array of already loaded filenames
* @returns {*} JSON descriptor
*/
binary.load = function(filename, options, loaded) {
filename = node_path.resolve(filename);
loaded = loaded || [];
if (loaded.indexOf(filename) >= 0)
return {};
var data = fs.readFileSync(filename);
loaded.push(filename);
var builder = ProtoBuf.loadProtoFile(node_path.join("..", "..", "..", "src", "google", "protobuf", "descriptor.proto")),
FileDescriptorSet = builder.build("google.protobuf.FileDescriptorSet");
var fds = FileDescriptorSet.decode(data),
imports = [];
var json = {
"package": null,
"imports": imports
};
fds.file.forEach(function(fdp) {
imports.push(buildFileDescriptorProto(fdp));
});
return json;
};
function buildFileDescriptorProto(fdp) {
var pkg = fdp.package,
messages = [],
enums = [],
services = [],
extensions = [],
options = {},
imports = [];
fdp.message_type.forEach(function(dp) {
messages.push(buildMessageDescriptorProto(dp));
});
fdp.enum_type.forEach(function(edp) {
enums.push(buildEnumDescriptorProto(edp));
});
fdp.service.forEach(function(sdp) {
enums.push(buildServiceDescriptorProto(sdp));
});
fdp.extension.forEach(function(fdp) {
extensions.push(buildFieldDescriptorProtoAsExtension(fdp));
});
fdp.options.forEach(function(fo) {
// TODO
});
fdp.dependency.forEach(function(filename) {
// TODO
});
return {
"package": pkg,
"messages": messages,
"enums": enums,
"services": services,
"extensions": extensions,
"options": options,
"imports": imports
};
}
function buildMessageDescriptorProto(mdp) {
}
function buildEnumDescriptorProto(edp) {
}
function buildServiceDescriptorProto(sdp) {
}
function buildFieldDescriptorProtoAsExtension(fdp) {
}

84
node_modules/protobufjs/cli/pbjs/sources/json.js generated vendored Normal file
View File

@ -0,0 +1,84 @@
/*
Copyright 2013 Daniel Wirtz <dcode@dcode.io>
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.
*/
var description = "Plain JSON descriptor";
var ProtoBuf = require(__dirname+"/../../../index.js"),
util = require(__dirname+"/../util.js"),
node_path = require("path"),
fs = require("fs");
/**
* pbjs source: Plain JSON descriptor
* @exports pbjs/sources/json
* @function
* @param {!Array.<string>} filenames Source files
* @param {!Object.<string,*>=} options Options
* @returns {!ProtoBuf.Builder}
*/
var json = module.exports = function(filenames, options) {
options = options || [];
var builder = ProtoBuf.newBuilder(util.getBuilderOptions(options, "using")),
loaded = [];
filenames.forEach(function(filename) {
var data = json.load(filename, options, loaded);
builder["import"](data, filename);
});
builder.resolveAll();
return builder;
};
/**
* Module description.
* @type {string}
*/
json.description = description;
/**
* Loads a JSON descriptor including imports.
* @param {string} filename Source file
* @param {!Object.<string,*>} options Options
* @param {!Array.<string>=} loaded An array of already loaded filenames
* @returns {*} JSON descriptor
*/
json.load = function(filename, options, loaded) {
filename = node_path.resolve(filename);
loaded = loaded || [];
if (loaded.indexOf(filename) >= 0)
return {};
var data = JSON.parse(fs.readFileSync(filename).toString("utf8")),
imports = data['imports'];
loaded.push(filename);
if (Array.isArray(imports)) {
for (var i=0; i<imports.length; ++i) {
// Skip pulled imports and legacy descriptors
if (typeof imports[i] !== 'string' || (util.isDescriptor(imports[i]) && !options.legacy))
continue;
// Merge imports, try include paths
(function() {
var path = options.path || [];
for (var j=0; j<path.length; ++j) {
var import_filename = node_path.resolve(path[j] + "/", imports[i]);
if (!fs.existsSync(import_filename))
continue;
imports[i] = json.load(import_filename, options, loaded);
return;
}
throw Error("File not found: "+imports[i]);
})();
}
}
return data;
};

84
node_modules/protobufjs/cli/pbjs/sources/proto.js generated vendored Normal file
View File

@ -0,0 +1,84 @@
/*
Copyright 2013 Daniel Wirtz <dcode@dcode.io>
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.
*/
var description = "Plain .proto descriptor";
var ProtoBuf = require(__dirname+"/../../../index.js"),
util = require(__dirname+"/../util.js"),
fs = require("fs"),
node_path = require("path");
/**
* pbjs source: Plain .proto descriptor
* @exports pbjs/sources/proto
* @function
* @param {!Array.<string>} filenames Source files
* @param {!Object.<string,*>=} options Options
* @returns {!ProtoBuf.Builder}
*/
var proto = module.exports = function(filenames, options) {
options = options || [];
var builder = ProtoBuf.newBuilder(util.getBuilderOptions(options, "using")),
loaded = [];
filenames.forEach(function(filename) {
var data = proto.load(filename, options, loaded);
builder["import"](data, filename);
});
builder.resolveAll();
return builder;
};
/**
* Module description.
* @type {string}
*/
proto.description = description;
/**
* Loads a .proto descriptor including imports.
* @param {string} filename Source file
* @param {!Object.<string,*>} options Options
* @param {!Array.<string>=} loaded An array of already loaded filenames
* @returns {*} JSON descriptor
*/
proto.load = function(filename, options, loaded) {
filename = node_path.resolve(filename);
loaded = loaded || [];
if (loaded.indexOf(filename) >= 0)
return {};
var data = ProtoBuf.DotProto.Parser.parse(fs.readFileSync(filename).toString("utf8"));
loaded.push(filename);
if (Array.isArray(data['imports'])) {
var imports = data['imports'];
for (var i=0; i<imports.length; i++) {
// Skip pulled imports and legacy descriptors
if (typeof imports[i] !== 'string' || (util.isDescriptor(imports[i]) && !options.legacy))
continue;
// Merge imports, try include paths
(function() {
var path = options.path || [];
for (var j=0; j<path.length; ++j) {
var import_filename = node_path.resolve(path[j] + "/", imports[i]);
if (!fs.existsSync(import_filename))
continue;
imports[i] = proto.load(import_filename, options, loaded);
return;
}
throw Error("File not found: "+imports[i]);
})();
}
}
return data;
};

45
node_modules/protobufjs/cli/pbjs/targets/amd.js generated vendored Normal file
View File

@ -0,0 +1,45 @@
/*
Copyright 2013 Daniel Wirtz <dcode@dcode.io>
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.
*/
var description = "Runtime structures as AMD module";
var ProtoBuf = require("../../../index.js"),
util = require("../util.js"),
js = require("./js.js");
/**
* pbjs target: Runtime structures as an AMD module
* @exports pbjs/targets/amd
* @function
* @param {!ProtoBuf.Builder} builder Builder
* @param {!Object.<string,*>=} options Options
* @returns {string}
*/
var amd = module.exports = function(builder, options) {
options = options || {};
return [
"define([", JSON.stringify(options.dependency || "protobuf"), "]", options.min ? "," : ", ",
"function(ProtoBuf)", options.min ? "{" : " {\n ",
"return ProtoBuf",
util.indent(js.build(builder, options), options.min ? "" : " "), options.min ? "" : "\n",
"});"
].join('');
};
/**
* Module description.
* @type {string}
*/
amd.description = description;

42
node_modules/protobufjs/cli/pbjs/targets/commonjs.js generated vendored Normal file
View File

@ -0,0 +1,42 @@
/*
Copyright 2013 Daniel Wirtz <dcode@dcode.io>
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.
*/
var description = "Runtime structures as CommonJS module";
var util = require("../util.js"),
js = require("./js.js");
/**
* pbjs target: Runtime structures as a CommonJS module
* @exports pbjs/targets/commonjs
* @function
* @param {!ProtoBuf.Builder} builder Builder
* @param {!Object.<string,*>=} options Options
* @returns {string}
*/
var commonjs = module.exports = function(builder, options) {
options = options || {};
return [
"module.exports", options.min ? "=" : " = ",
"require(", JSON.stringify(options.dependency || "protobufjs"), ")",
js.build(builder, options)
].join('');
};
/**
* Module description.
* @type {string}
*/
commonjs.description = description;

63
node_modules/protobufjs/cli/pbjs/targets/js.js generated vendored Normal file
View File

@ -0,0 +1,63 @@
/*
Copyright 2013 Daniel Wirtz <dcode@dcode.io>
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.
*/
var description = "Runtime structures";
var util = require("../util.js"),
json = require("./json.js");
/**
* pbjs target: Runtime structures
* @exports pbjs/targets/js
* @function
* @param {!ProtoBuf.Builder} builder Builder
* @param {!Object.<string,*>=} options Options
* @returns {string}
*/
var js = module.exports = function(builder, options) {
options = options || {};
var varName = "_root";
if (options.exports)
varName = options.exports.substring(options.exports.lastIndexOf(".")+1);
return [
"var ", varName, options.min ? "=" : " = ", options.dependency || "dcodeIO.ProtoBuf",
js.build(builder, options)
].join('');
};
/**
* Builds the core js target.
* @param {!ProtoBuf.Builder} builder Builder
* @param {!Object.<string,*>=} options Options
* @returns {string}
*/
js.build = function(builder, options) {
options = options || {};
return [
".newBuilder(",
JSON.stringify(util.getBuilderOptions(options, "use"), null, options.min ? 0 : 4),
")['import'](",
json(builder, options),
").build(",
typeof options.exports === 'string' ? JSON.stringify(options.exports.split(".")) : "",
");"
].join('');
};
/**
* Module description.
* @type {string}
*/
js.description = description;

260
node_modules/protobufjs/cli/pbjs/targets/json.js generated vendored Normal file
View File

@ -0,0 +1,260 @@
/*
Copyright 2013 Daniel Wirtz <dcode@dcode.io>
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.
*/
var description = "Plain JSON descriptor";
var ProtoBuf = require(__dirname+"/../../../index.js"),
util = require("../util.js");
/**
* pbjs target: Plain JSON descriptor
* @exports pbjs/targets/json
* @function
* @param {!ProtoBuf.Builder} builder Builder
* @param {!Object.<string,*>=} options Options
* @returns {string}
*/
var json = module.exports = function(builder, options) {
options = options || {};
builder.resolveAll();
// Set the pointer to the lowest common namespace (with options)
var ptr = builder.ns;
while (ptr.children.length === 1 && Object.keys(ptr.options).length === 0 && ptr.children[0].className === "Namespace")
ptr = ptr.children[0];
// Start by building the package namespace
var pkg = ptr.fqn().substring(1),
out = {
"package": pkg !== "" ? pkg : null
};
buildNamespace(ptr, out);
return JSON.stringify(out, null, options.min ? 0 : 4);
};
/**
* Module description.
* @type {string}
*/
json.description = description;
/**
* Builds all structures in a namespace.
* @param {!ProtoBuf.Reflect.Namespace} ns Namespace to build
* @param {!Object.<string,*>} out Extended output object
*/
function buildNamespace(ns, out) {
var messages, enums, services;
util.extend(out, {
"syntax" : ns.syntax || 'proto2',
"options" : out.options || {},
"messages" : messages = [],
"enums" : enums = [],
"services" : services = []
});
if (!(ns instanceof ProtoBuf.Reflect.Message))
out['isNamespace'] = true;
util.extend(out["options"], buildOptions(ns.options));
ns.getChildren(ProtoBuf.Reflect.Enum).forEach(function(enm) {
enums.push(buildEnum(enm));
});
if (enums.length === 0)
delete out["enums"];
ns.getChildren(ProtoBuf.Reflect.Message).forEach(function(msg) {
messages.push(buildMessage(msg));
});
ns.getChildren(ProtoBuf.Reflect.Service).forEach(function(svc) {
services.push(buildService(svc));
});
if (services.length === 0)
delete out["services"];
Array.prototype.push.apply(messages, buildExtensions(ns));
ns.getChildren(ProtoBuf.Reflect.Namespace).forEach(function(innerNs) {
if (innerNs.className !== "Namespace")
return;
var emptyMessage = {
"name": innerNs.name,
"fields": []
};
buildNamespace(innerNs, emptyMessage);
messages.push(emptyMessage);
});
if (messages.length === 0)
delete out["messages"];
if (Object.keys(out["options"]).length === 0)
delete out["options"];
}
/**
* Builds extensions declared in the specified namespace.
* @param {!ProtoBuf.Reflect.Namespace} ns Namespace
* @returns {!Array.<!*>}
*/
function buildExtensions(ns) {
var exts = util.groupExtensions(ns);
if (exts === null)
return [];
var messages = [];
Object.keys(exts).forEach(function(extFqn) {
var extMsg = ns.resolve(extFqn),
extFields = exts[extFqn];
var fields, ext = {
"ref" : ns.qn(extMsg),
"fields" : fields = []
};
extFields.forEach(function(extField) {
fields.push(buildMessageField(extField));
});
messages.push(ext);
});
return messages;
}
/**
* Builds block-level options.
* @param {!Object.<string,*>} options Options
* @returns {!Object.<string,*>}
*/
function buildOptions(options) {
Object.keys(options = options || {}).forEach(function(key) {
var val = options[key];
switch (typeof val) {
case 'string':
case 'number':
case 'boolean':
case 'object':
break;
default:
throw Error("Illegal option type: "+typeof(val));
}
});
return options;
}
/**
* Builds a message.
* @param {!ProtoBuf.Reflect.Message} msg Message
* @returns {!*}
*/
function buildMessage(msg) {
var fields, oneofs;
var out = {
"name" : msg.name,
"syntax" : msg.syntax || 'proto2',
"options" : {},
"fields" : fields = [],
"oneofs" : oneofs = {}
};
msg.getChildren(ProtoBuf.Reflect.Message.Field).forEach(function(fld) {
if (fld instanceof ProtoBuf.Reflect.Message.ExtensionField)
return;
fields.push(buildMessageField(fld));
});
msg.getChildren(ProtoBuf.Reflect.Message.OneOf).forEach(function(oneof) {
oneofs[oneof.name] = buildMessageOneof(oneof);
});
if (msg.extensions)
out["extensions"] = msg.extensions;
if (Object.keys(oneofs).length === 0)
delete out["oneofs"];
buildNamespace(msg, out);
return out;
}
/**
* Builds a message field.
* @param {!ProtoBuf.Reflect.Message.Field} fld Message field
* @returns {!*}
*/
function buildMessageField(fld) {
return {
"rule" : fld.map ? "map" : (fld.repeated ? "repeated" : (fld.required ? "required" : "optional")),
"type" : fld.resolvedType ? fld.parent.qn(fld.resolvedType) : fld.type['name'],
"keytype" : (typeof(fld.keyType) === 'string') ? fld.keyType : (fld.keyType !== null ? fld.keyType.name : undefined),
"name" : fld instanceof ProtoBuf.Reflect.Message.ExtensionField ? fld.name.substring(fld.name.lastIndexOf(".")+1): fld.name,
"id" : fld.id,
"options" : Object.keys(fld.options).length > 0 ? buildOptions(fld.options) : undefined,
"oneof" : fld.oneof ? fld.oneof.name : undefined
};
}
/**
* Builds a message oneof.
* @param {!ProtoBuf.Reflect.message.OneOf} oneof Message oneof
* @returns {!Array.<!*>}
*/
function buildMessageOneof(oneof) {
var out = [];
oneof.fields.forEach(function(fld) {
out.push(fld.id);
});
return out;
}
/**
* Builds an enum.
* @param {!ProtoBuf.Reflect.Enum} enm Enum
* @returns {!*}
*/
function buildEnum(enm) {
var values;
var out = {
"name" : enm.name,
"syntax" : enm.syntax || 'proto2',
"values" : values = []
};
enm.getChildren(ProtoBuf.Reflect.Enum.Value).forEach(function(val) {
values.push(buildEnumValue(val));
});
if (Object.keys(enm.options).length > 0)
out["options"] = buildOptions(enm.options);
return out;
}
/**
* Builds an enum value.
* @param {!ProtoBuf.Reflect.Enum.Value} val Enum value
* @returns {!*}
*/
function buildEnumValue(val) {
return {
"name" : val.name,
"id" : val.id
};
}
/**
* Builds a service.
* @param {!ProtoBuf.Reflect.Service} svc Service
* @returns {!*}
*/
function buildService(svc) {
var rpc;
var out = {
"name": svc.name,
"options": buildOptions(svc.options),
"rpc": rpc = {}
};
svc.getChildren(ProtoBuf.Reflect.Service.RPCMethod).forEach(function(mtd) {
rpc[mtd.name] = {
"request": svc.qn(mtd.resolvedRequestType),
"request_stream": mtd.requestStream,
"response": svc.qn(mtd.resolvedResponseType),
"response_stream": mtd.responseStream,
"options": buildOptions(mtd.options)
};
});
return out;
}

267
node_modules/protobufjs/cli/pbjs/targets/proto.js generated vendored Normal file
View File

@ -0,0 +1,267 @@
/*
Copyright 2013 Daniel Wirtz <dcode@dcode.io>
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.
*/
var description = "Plain .proto descriptor";
var ProtoBuf = require(__dirname+"/../../../index.js"),
util = require("../util.js");
/**
* pbjs target: Plain .proto descriptor
* @exports pbjs/targets/proto
* @function
* @param {!ProtoBuf.Builder} builder Builder
* @param {!Object.<string,*>=} options Options
* @returns {string}
*/
var proto = module.exports = function(builder, options) {
options = options || {};
builder.resolveAll();
// Set the pointer to the lowest common namespace (with options)
var ptr = builder.ns;
while (ptr.children.length === 1 && Object.keys(ptr.options).length === 0 && ptr.children[0].className === "Namespace")
ptr = ptr.children[0];
var out = [];
function trim() {
out[out.length-1] = out[out.length-1].replace(/\n{2,}$/, "\n");
}
// Builds a set of top level options
function buildOptions(opt, indent) {
var keys;
if ((keys = Object.keys(opt)).length === 0)
return;
keys.forEach(function(key) {
if (!options.min)
out.push(indent);
out.push("option ", key, options.min ? "=" : " = ", value(opt[key]), options.min ? ";" : ";\n");
});
if (!options.min)
out[out.length-1] += "\n";
}
// Builds everything within a namespace
function buildNamespace(ns, indent) {
ns.getChildren(ProtoBuf.Reflect.Enum).forEach(function(enm) {
buildEnum(enm, indent);
});
ns.getChildren(ProtoBuf.Reflect.Message).forEach(function(msg) {
if (!msg.isGroup) // legacy groups are build within the respective field
buildMessage(msg, indent);
});
var exts = util.groupExtensions(ns);
if (exts !== null) {
Object.keys(exts).forEach(function(extFqn) {
var extMsg = ns.resolve(extFqn),
extFields = exts[extFqn];
if (!options.min)
out.push(indent);
out.push("extend ", ns.qn(extMsg), options.min ? "{" : " {\n");
extFields.forEach(function(extField) {
buildMessageField(ns, extField, indent+" ", false);
});
if (!options.min)
out.push(indent);
out.push(options.min ? "}" : "}\n\n");
});
}
ns.getChildren(ProtoBuf.Reflect.Service).forEach(function(svc) {
buildService(svc, indent);
});
ns.getChildren(ProtoBuf.Reflect.Namespace).forEach(function(innerNs) {
if (innerNs.className !== "Namespace")
return;
if (!options.min)
out.push(indent);
out.push("message ", innerNs.name, options.min ? "{" : " {\n");
buildNamespace(innerNs, indent+" ");
if (!options.min)
out.push(indent);
out.push(options.min ? "}" : "}\n");
});
trim();
}
// Builds a message
function buildMessage(msg, indent) {
if (!msg.isGroup) {
if (!options.min)
out.push(indent);
out.push("message ", msg.name);
}
out.push(options.min ? "{" : " {\n");
buildOptions(msg.options, indent+" ");
var n = 0, oneofFields = [];
msg.getChildren(ProtoBuf.Reflect.Message.OneOf).forEach(function(oneof) {
if (!options.min)
out.push(indent, " ");
out.push("oneof ", oneof.name, options.min ? "{" : " {\n");
oneof.fields.forEach(function(fld) {
buildMessageField(msg, fld, indent+" ", true);
oneofFields.push(fld);
});
if (!options.min)
out.push(indent, " ");
out.push(options.min ? "}" : "}\n");
});
msg.getChildren(ProtoBuf.Reflect.Message.Field).forEach(function(fld) {
if (fld instanceof ProtoBuf.Reflect.Message.ExtensionField)
return;
if (oneofFields.indexOf(fld) >= 0)
return;
buildMessageField(msg, fld, indent+" ", false);
n++;
});
if (n > 0 && !options.min)
out[out.length-1] += "\n";
if (msg.extensions) { // array of ranges
if (!options.min)
out.push(indent, " ");
out.push("extensions ");
msg.extensions.forEach(function(range, index) {
if (index > 0)
out.push(options.min ? "," : ", ");
out.push(value(range[0]));
if (range[1] !== range[0])
out.push(" to ", range[1] === ProtoBuf.ID_MAX ? "max" : value(range[1]));
});
out.push(options.min ? ";" : ";\n\n");
}
buildNamespace(msg, indent+" ");
if (!options.min)
out.push(indent);
out.push(options.min ? "}" : "}\n\n");
}
// Builds a message field
function buildMessageField(msg, fld, indent, isOneOf) {
var isGroup = false;
if (!options.min)
out.push(indent);
if (!isOneOf)
out.push(fld.required ? "required " : (fld.repeated ? "repeated " : "optional "));
if (fld.resolvedType !== null) {
if (fld.resolvedType instanceof ProtoBuf.Reflect.Message && fld.resolvedType.isGroup) {
// inline legacy groups
out.push("group ");
isGroup = true;
}
out.push(msg.qn(fld.resolvedType));
} else
out.push(fld.type['name']);
if (!isGroup)
out.push(" ", fld instanceof ProtoBuf.Reflect.Message.ExtensionField ? fld.name.substring(fld.name.lastIndexOf(".")+1) : fld.name);
out.push(options.min ? "=" : " = ", fld.id);
if (isGroup) // inline
buildMessage(fld.resolvedType, indent);
else {
var keys = Object.keys(fld.options);
if (keys.length > 0) {
out.push(options.min ? "[" : " [");
var n = 0;
keys.forEach(function (key) {
if (n > 0)
out.push(options.min ? "," : ", ");
out.push(key, options.min ? "=" : " = ",
// BEWARE: Monkey patch for string enum defaults
key === "default" && fld.type === ProtoBuf.TYPES["enum"] && typeof fld.options[key] === 'string' ? fld.options[key] : value(fld.options[key])
);
n++;
});
out.push("]");
}
out.push(options.min ? ";" : ";\n");
}
}
// Builds an enum
function buildEnum(enm, indent) {
if (!options.min)
out.push(indent);
out.push("enum ", enm.name, options.min ? "{" : " {\n");
buildOptions(enm.options, indent+" ");
enm.getChildren(ProtoBuf.Reflect.Enum.Value).forEach(function(val) {
if (!options.min)
out.push(indent, " ");
out.push(val.name, options.min ? "=" : " = ", val.id, options.min? ";" : ";\n");
});
if (!options.min)
out.push(indent);
out.push(options.min ? "}" : "}\n\n");
}
// Builds a service
function buildService(svc, indent) {
if (!options.min)
out.push(indent);
out.push("service ", svc.name, options.min ? "{" : " {\n");
buildOptions(svc.options, indent+" ");
svc.getChildren(ProtoBuf.Reflect.Service.RPCMethod).forEach(function(rpc) {
if (!options.min)
out.push(indent+" ");
out.push("rpc ", rpc.name, "(", svc.qn(rpc.resolvedRequestType), ") returns(", svc.qn(rpc.resolvedResponseType), ")");
var keys = Object.keys(rpc.options);
if (keys.length === 0) {
out.push(options.min ? ";" : ";\n")
} else {
out.push(options.min ? "{" : " {\n");
buildOptions(rpc.options, indent+" ");
trim();
if (!options.min)
out.push(indent+" ");
out.push(options.min ? "}" : "}\n");
}
if (!options.min)
out[out.length-1] += "\n";
});
trim();
out.push(options.min ? "}" : "}\n");
}
// Start by building the package namespace
var pkg = ptr.fqn().substring(1);
if (pkg !== "")
out.push("package ", pkg, options.min ? ";" : ";\n\n");
buildOptions(ptr.options, "");
buildNamespace(ptr, "");
return out.join('');
};
/**
* Module description.
* @type {string}
*/
proto.description = description;
/**
* Converts a JavaScript value to a .proto value.
* @param {*} v Value
* @returns {string} Dot proto value
*/
function value(v) {
switch (typeof v) {
case 'boolean':
return v ? 'true' : 'false';
case 'number':
return v.toString();
case 'string':
return '"'+v.replace(/"/g, '\\"')+'"';
default:
throw new Error("illegal value type: "+typeof(v));
}
}

128
node_modules/protobufjs/cli/pbjs/util.js generated vendored Normal file
View File

@ -0,0 +1,128 @@
/*
Copyright 2013 Daniel Wirtz <dcode@dcode.io>
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.
*/
var ProtoBuf = require("../../index.js");
/**
* Utility namespace.
* @exports pbjs/util
* @namespace
*/
var util = module.exports = {};
/**
* Extracts builder options with the specified prefix from a set of CLI options.
* @param {!Object.<string,*>} options CLI options
* @param {string} prefix Prefix
* @returns {!Object.<string,*>}
*/
util.getBuilderOptions = function(options, prefix) {
if (!options[prefix])
return {};
var builderOptions = {};
options[prefix].forEach(function(kv) {
var key, val;
var p = kv.indexOf("=");
if (p < 0) {
key = kv;
val = true;
} else {
key = kv.substring(0, p);
val = kv.substring(p+1);
if (val === "true")
val = true;
else if (val === "false")
val = false;
else {
var intval = parseInt(val, 10);
if (intval == val)
val = intval;
}
}
builderOptions[key] = val;
});
return builderOptions;
};
/**
* Pads a string to the specified length.
* @param {string} str String to pad
* @param {number} len Pad length
* @param {boolean=} left Whether to pad to the left, defaults to `false`
* @returns {string}
*/
util.pad = function(str, len, left) {
while (str.length < len)
left ? str = " "+str : str += " ";
return str;
};
/**
* Indents a string by the specified whitespace.
* @param {string} str String to indent
* @param {string|number} ws Whitespace string or number of whitespaces
* @returns {string}
*/
util.indent = function(str, ws) {
if (ws === 0 || ws === "")
return str;
var lines = str.split(/\r?\n/);
if (typeof ws === 'number') {
var n = ws; ws = "";
while (ws.length < n) ws += " ";
}
for (var i=1; i<lines.length; ++i)
lines[i] = ws+lines[i];
return lines.join("\n");
};
/**
* Extends an object with additional properties.
* @param {!Object.<string,*>} subject Subject to extend
* @param {!Object.<string,*>} extension Extensions to apply
*/
util.extend = function(subject, extension) {
Object.keys(extension).forEach(function(key) {
subject[key] = extension[key];
});
};
/**
* Groups extensions by extended message.
* @param {!ProtoBuf.Reflect.Namespace} ns Namespace
* @returns {?Object.<string,!Array.<!ProtoBuf.Reflect.Message.ExtensionField>>}
*/
util.groupExtensions = function(ns) {
var exts = {},
n = 0;
ns.getChildren(ProtoBuf.Reflect.Extension).forEach(function(ext) {
var msg = ext.field.parent,
fqn = msg.fqn();
if (!exts[fqn])
exts[fqn] = [];
exts[fqn].push(ext.field);
n++;
});
return n > 0 ? exts : null;
};
/**
* Tests if the specified import name is referencing an internal descriptor.
* @param {string} name Import name
* @returns {boolean}
*/
util.isDescriptor = function(name) {
return /^google\/protobuf\/descriptor/.test(name);
};

35
node_modules/protobufjs/dist/README.md generated vendored Normal file
View File

@ -0,0 +1,35 @@
Distributions
=============
ProtoBuf.js is available either with or without the .proto parser included.
### Full build including .proto parser (.proto and JSON)
* **[protobuf.js](https://raw.githubusercontent.com/dcodeIO/ProtoBuf.js/master/dist/protobuf.js)**
contains the commented source code.
* **[protobuf.min.js](https://raw.githubusercontent.com/dcodeIO/ProtoBuf.js/master/dist/protobuf.min.js)**
has been compiled with Closure Compiler.
* **[protobuf.min.js.gz](https://raw.githubusercontent.com/dcodeIO/ProtoBuf.js/master/dist/protobuf.min.js.gz)**
has also been gzipped using `-9`.
* **[protobuf.min.map](https://raw.githubusercontent.com/dcodeIO/ProtoBuf.js/master/dist/protobuf.min.map)**
is the source map generated by Closure Compiler.
### Light build excluding .proto parser (JSON only) for use with [pbjs](https://github.com/dcodeIO/Protobuf.js/wiki/pbjs)
* **[protobuf-light.js](https://raw.githubusercontent.com/dcodeIO/ProtoBuf.js/master/dist/protobuf-light.js)**
contains the commented source code.
* **[protobuf-light.min.js](https://raw.githubusercontent.com/dcodeIO/ProtoBuf.js/master/dist/protobuf-light.min.js)**
has been compiled with Closure Compiler.
* **[protobuf-light.min.js.gz](https://raw.githubusercontent.com/dcodeIO/ProtoBuf.js/master/dist/protobuf-light.min.js.gz)**
has also been gzipped using `-9`.
* **[protobuf-light.min.map](https://raw.githubusercontent.com/dcodeIO/ProtoBuf.js/master/dist/protobuf-light.min.map)**
is the source map generated by Closure Compiler.
When sending pull requests, please note that these files have been automatically generated from the sources located in
[src/](https://github.com/dcodeIO/protobuf.js/tree/master/src).

4275
node_modules/protobufjs/dist/protobuf-light.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

94
node_modules/protobufjs/dist/protobuf-light.min.js generated vendored Normal file
View File

@ -0,0 +1,94 @@
/*
protobuf.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
Released under the Apache License, Version 2.0
see: https://github.com/dcodeIO/protobuf.js for details
*/
var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(e,p,d){if(d.get||d.set)throw new TypeError("ES3 does not support getters and setters.");e!=Array.prototype&&e!=Object.prototype&&(e[p]=d.value)};$jscomp.getGlobal=function(e){return"undefined"!=typeof window&&window===e?e:"undefined"!=typeof global&&null!=global?global:e};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_";
$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(e){return $jscomp.SYMBOL_PREFIX+(e||"")+$jscomp.symbolCounter_++};
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var e=$jscomp.global.Symbol.iterator;e||(e=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[e]&&$jscomp.defineProperty(Array.prototype,e,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(e){var p=0;return $jscomp.iteratorPrototype(function(){return p<e.length?{done:!1,value:e[p++]}:{done:!0}})};
$jscomp.iteratorPrototype=function(e){$jscomp.initSymbolIterator();e={next:e};e[$jscomp.global.Symbol.iterator]=function(){return this};return e};$jscomp.array=$jscomp.array||{};$jscomp.iteratorFromArray=function(e,p){$jscomp.initSymbolIterator();e instanceof String&&(e+="");var d=0,c={next:function(){if(d<e.length){var t=d++;return{value:p(t,e[t]),done:!1}}c.next=function(){return{done:!0,value:void 0}};return c.next()}};c[Symbol.iterator]=function(){return c};return c};
$jscomp.polyfill=function(e,p,d,c){if(p){d=$jscomp.global;e=e.split(".");for(c=0;c<e.length-1;c++){var t=e[c];t in d||(d[t]={});d=d[t]}e=e[e.length-1];c=d[e];p=p(c);p!=c&&null!=p&&$jscomp.defineProperty(d,e,{configurable:!0,writable:!0,value:p})}};$jscomp.polyfill("Array.prototype.keys",function(e){return e?e:function(){return $jscomp.iteratorFromArray(this,function(e){return e})}},"es6-impl","es3");
$jscomp.polyfill("Array.prototype.entries",function(e){return e?e:function(){return $jscomp.iteratorFromArray(this,function(e,d){return[e,d]})}},"es6-impl","es3");$jscomp.polyfill("Array.prototype.values",function(e){return e?e:function(){return $jscomp.iteratorFromArray(this,function(e,d){return d})}},"es6","es3");
(function(e,p){"function"===typeof define&&define.amd?define(["bytebuffer"],p):"function"===typeof require&&"object"===typeof module&&module&&module.exports?module.exports=p(require("bytebuffer"),!0):(e.dcodeIO=e.dcodeIO||{}).ProtoBuf=p(e.dcodeIO.ByteBuffer)})(this,function(e,p){var d={};d.ByteBuffer=e;d.Long=e.Long||null;d.VERSION="5.0.3";d.WIRE_TYPES={};d.WIRE_TYPES.VARINT=0;d.WIRE_TYPES.BITS64=1;d.WIRE_TYPES.LDELIM=2;d.WIRE_TYPES.STARTGROUP=3;d.WIRE_TYPES.ENDGROUP=4;d.WIRE_TYPES.BITS32=5;d.PACKABLE_WIRE_TYPES=
[d.WIRE_TYPES.VARINT,d.WIRE_TYPES.BITS64,d.WIRE_TYPES.BITS32];d.TYPES={int32:{name:"int32",wireType:d.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:"uint32",wireType:d.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:"sint32",wireType:d.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:"int64",wireType:d.WIRE_TYPES.VARINT,defaultValue:d.Long?d.Long.ZERO:void 0},uint64:{name:"uint64",wireType:d.WIRE_TYPES.VARINT,defaultValue:d.Long?d.Long.UZERO:void 0},sint64:{name:"sint64",wireType:d.WIRE_TYPES.VARINT,
defaultValue:d.Long?d.Long.ZERO:void 0},bool:{name:"bool",wireType:d.WIRE_TYPES.VARINT,defaultValue:!1},"double":{name:"double",wireType:d.WIRE_TYPES.BITS64,defaultValue:0},string:{name:"string",wireType:d.WIRE_TYPES.LDELIM,defaultValue:""},bytes:{name:"bytes",wireType:d.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:"fixed32",wireType:d.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:"sfixed32",wireType:d.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:"fixed64",wireType:d.WIRE_TYPES.BITS64,
defaultValue:d.Long?d.Long.UZERO:void 0},sfixed64:{name:"sfixed64",wireType:d.WIRE_TYPES.BITS64,defaultValue:d.Long?d.Long.ZERO:void 0},"float":{name:"float",wireType:d.WIRE_TYPES.BITS32,defaultValue:0},"enum":{name:"enum",wireType:d.WIRE_TYPES.VARINT,defaultValue:0},message:{name:"message",wireType:d.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:"group",wireType:d.WIRE_TYPES.STARTGROUP,defaultValue:null}};d.MAP_KEY_TYPES=[d.TYPES.int32,d.TYPES.sint32,d.TYPES.sfixed32,d.TYPES.uint32,d.TYPES.fixed32,
d.TYPES.int64,d.TYPES.sint64,d.TYPES.sfixed64,d.TYPES.uint64,d.TYPES.fixed64,d.TYPES.bool,d.TYPES.string,d.TYPES.bytes];d.ID_MIN=1;d.ID_MAX=536870911;d.convertFieldsToCamelCase=!1;d.populateAccessors=!0;d.populateDefaults=!0;d.Util=function(){var c={};c.IS_NODE=!("object"!==typeof process||"[object process]"!==process+""||process.browser);c.XHR=function(){for(var c=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},
function(){return new ActiveXObject("Microsoft.XMLHTTP")}],d=null,e=0;e<c.length;e++){try{d=c[e]()}catch(k){continue}break}if(!d)throw Error("XMLHttpRequest is not supported");return d};c.fetch=function(d,e){e&&"function"!=typeof e&&(e=null);if(c.IS_NODE){var t=require("fs");if(e)t.readFile(d,function(c,b){c?e(null):e(""+b)});else try{return t.readFileSync(d)}catch(l){return null}}else{var k=c.XHR();k.open("GET",d,e?!0:!1);k.setRequestHeader("Accept","text/plain");"function"===typeof k.overrideMimeType&&
k.overrideMimeType("text/plain");if(e)k.onreadystatechange=function(){4==k.readyState&&(200==k.status||0==k.status&&"string"===typeof k.responseText?e(k.responseText):e(null))},4!=k.readyState&&k.send(null);else return k.send(null),200==k.status||0==k.status&&"string"===typeof k.responseText?k.responseText:null}};c.toCamelCase=function(c){return c.replace(/_([a-zA-Z])/g,function(c,e){return e.toUpperCase()})};return c}();d.Lang={DELIM:/[\s\{\}=;:\[\],'"\(\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,
TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,FQTYPEREF:/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\s/,STRING:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,STRING_DQ:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,STRING_SQ:/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g};d.Reflect=function(c){function d(a,g){if(a&&"number"===typeof a.low&&"number"===typeof a.high&&"boolean"===typeof a.unsigned&&a.low===a.low&&a.high===a.high)return new c.Long(a.low,a.high,"undefined"===
typeof g?a.unsigned:g);if("string"===typeof a)return c.Long.fromString(a,g||!1,10);if("number"===typeof a)return c.Long.fromNumber(a,g||!1);throw Error("not convertible to Long");}function z(a,g){var h=g.readVarint32(),b=h&7,h=h>>>3;switch(b){case c.WIRE_TYPES.VARINT:do h=g.readUint8();while(128===(h&128));break;case c.WIRE_TYPES.BITS64:g.offset+=8;break;case c.WIRE_TYPES.LDELIM:h=g.readVarint32();g.offset+=h;break;case c.WIRE_TYPES.STARTGROUP:z(h,g);break;case c.WIRE_TYPES.ENDGROUP:if(h===a)return!1;
throw Error("Illegal GROUPEND after unknown group: "+h+" ("+a+" expected)");case c.WIRE_TYPES.BITS32:g.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+a+": "+b);}return!0}var r={},k=function(a,g,c){this.builder=a;this.parent=g;this.name=c},l=k.prototype;l.fqn=function(){var a=this.name,g=this;do{g=g.parent;if(null==g)break;a=g.name+"."+a}while(1);return a};l.toString=function(a){return(a?this.className+" ":"")+this.fqn()};l.build=function(){throw Error(this.toString(!0)+
" cannot be built directly");};r.T=k;var b=function(a,g,c,b,e){k.call(this,a,g,c);this.className="Namespace";this.children=[];this.options=b||{};this.syntax=e||"proto2"},l=b.prototype=Object.create(k.prototype);l.getChildren=function(a){a=a||null;if(null==a)return this.children.slice();for(var g=[],c=0,b=this.children.length;c<b;++c)this.children[c]instanceof a&&g.push(this.children[c]);return g};l.addChild=function(a){var c;if(c=this.getChild(a.name))if(c instanceof u.Field&&c.name!==c.originalName&&
null===this.getChild(c.originalName))c.name=c.originalName;else if(a instanceof u.Field&&a.name!==a.originalName&&null===this.getChild(a.originalName))a.name=a.originalName;else throw Error("Duplicate name in namespace "+this.toString(!0)+": "+a.name);this.children.push(a)};l.getChild=function(a){for(var c="number"===typeof a?"id":"name",h=0,b=this.children.length;h<b;++h)if(this.children[h][c]===a)return this.children[h];return null};l.resolve=function(a,c){var g="string"===typeof a?a.split("."):
a,b=this,e=0;if(""===g[e]){for(;null!==b.parent;)b=b.parent;e++}do{do{if(!(b instanceof r.Namespace)){b=null;break}b=b.getChild(g[e]);if(!(b&&b instanceof r.T)||c&&!(b instanceof r.Namespace)){b=null;break}e++}while(e<g.length);if(null!=b)break;if(null!==this.parent)return this.parent.resolve(a,c)}while(null!=b);return b};l.qn=function(a){var c=[],b=a;do c.unshift(b.name),b=b.parent;while(null!==b);for(b=1;b<=c.length;b++){var e=c.slice(c.length-b);if(a===this.resolve(e,a instanceof r.Namespace))return e.join(".")}return a.fqn()};
l.build=function(){for(var a={},c=this.children,h=0,e=c.length,d;h<e;++h)d=c[h],d instanceof b&&(a[d.name]=d.build());Object.defineProperty&&Object.defineProperty(a,"$options",{value:this.buildOpt()});return a};l.buildOpt=function(){for(var a={},c=Object.keys(this.options),b=0,e=c.length;b<e;++b)a[c[b]]=this.options[c[b]];return a};l.getOption=function(a){return"undefined"===typeof a?this.options:"undefined"!==typeof this.options[a]?this.options[a]:null};r.Namespace=b;var m=function(a,g,b,e,d){this.type=
a;this.resolvedType=g;this.isMapKey=b;this.syntax=e;this.name=d;if(b&&0>c.MAP_KEY_TYPES.indexOf(a))throw Error("Invalid map key type: "+a.name);},f=m.prototype;m.defaultFieldValue=function(a){"string"===typeof a&&(a=c.TYPES[a]);if("undefined"===typeof a.defaultValue)throw Error("default value for type "+a.name+" is not supported");return a==c.TYPES.bytes?new e(0):a.defaultValue};f.toString=function(){return(this.name||"")+(this.isMapKey?"map":"value")+" element"};f.verifyValue=function(a){function g(a,
c){throw Error("Illegal value for "+b.toString(!0)+" of type "+b.type.name+": "+a+" ("+c+")");}var b=this;switch(this.type){case c.TYPES.int32:case c.TYPES.sint32:case c.TYPES.sfixed32:return("number"!==typeof a||a===a&&0!==a%1)&&g(typeof a,"not an integer"),4294967295<a?a|0:a;case c.TYPES.uint32:case c.TYPES.fixed32:return("number"!==typeof a||a===a&&0!==a%1)&&g(typeof a,"not an integer"),0>a?a>>>0:a;case c.TYPES.int64:case c.TYPES.sint64:case c.TYPES.sfixed64:if(c.Long)try{return d(a,!1)}catch(w){g(typeof a,
w.message)}else g(typeof a,"requires Long.js");case c.TYPES.uint64:case c.TYPES.fixed64:if(c.Long)try{return d(a,!0)}catch(w){g(typeof a,w.message)}else g(typeof a,"requires Long.js");case c.TYPES.bool:return"boolean"!==typeof a&&g(typeof a,"not a boolean"),a;case c.TYPES["float"]:case c.TYPES["double"]:return"number"!==typeof a&&g(typeof a,"not a number"),a;case c.TYPES.string:return"string"===typeof a||a&&a instanceof String||g(typeof a,"not a string"),""+a;case c.TYPES.bytes:return e.isByteBuffer(a)?
a:e.wrap(a,"base64");case c.TYPES["enum"]:for(var v=this.resolvedType.getChildren(c.Reflect.Enum.Value),q=0;q<v.length;q++)if(v[q].name==a||v[q].id==a)return v[q].id;if("proto3"===this.syntax)return("number"!==typeof a||a===a&&0!==a%1)&&g(typeof a,"not an integer"),(4294967295<a||0>a)&&g(typeof a,"not in range for uint32"),a;g(a,"not a valid enum value");case c.TYPES.group:case c.TYPES.message:a&&"object"===typeof a||g(typeof a,"object expected");if(a instanceof this.resolvedType.clazz)return a;if(a instanceof
c.Builder.Message){var v={},q;for(q in a)a.hasOwnProperty(q)&&(v[q]=a[q]);a=v}return new this.resolvedType.clazz(a)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+a+" (undefined type "+this.type+")");};f.calculateLength=function(a,g){if(null===g)return 0;var b;switch(this.type){case c.TYPES.int32:return 0>g?e.calculateVarint64(g):e.calculateVarint32(g);case c.TYPES.uint32:return e.calculateVarint32(g);case c.TYPES.sint32:return e.calculateVarint32(e.zigZagEncode32(g));case c.TYPES.fixed32:case c.TYPES.sfixed32:case c.TYPES["float"]:return 4;
case c.TYPES.int64:case c.TYPES.uint64:return e.calculateVarint64(g);case c.TYPES.sint64:return e.calculateVarint64(e.zigZagEncode64(g));case c.TYPES.fixed64:case c.TYPES.sfixed64:return 8;case c.TYPES.bool:return 1;case c.TYPES["enum"]:return e.calculateVarint32(g);case c.TYPES["double"]:return 8;case c.TYPES.string:return b=e.calculateUTF8Bytes(g),e.calculateVarint32(b)+b;case c.TYPES.bytes:if(0>g.remaining())throw Error("Illegal value for "+this.toString(!0)+": "+g.remaining()+" bytes remaining");
return e.calculateVarint32(g.remaining())+g.remaining();case c.TYPES.message:return b=this.resolvedType.calculate(g),e.calculateVarint32(b)+b;case c.TYPES.group:return b=this.resolvedType.calculate(g),b+e.calculateVarint32(a<<3|c.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+g+" (unknown type)");};f.encodeValue=function(a,g,b){if(null===g)return b;switch(this.type){case c.TYPES.int32:0>g?b.writeVarint64(g):b.writeVarint32(g);break;case c.TYPES.uint32:b.writeVarint32(g);
break;case c.TYPES.sint32:b.writeVarint32ZigZag(g);break;case c.TYPES.fixed32:b.writeUint32(g);break;case c.TYPES.sfixed32:b.writeInt32(g);break;case c.TYPES.int64:case c.TYPES.uint64:b.writeVarint64(g);break;case c.TYPES.sint64:b.writeVarint64ZigZag(g);break;case c.TYPES.fixed64:b.writeUint64(g);break;case c.TYPES.sfixed64:b.writeInt64(g);break;case c.TYPES.bool:"string"===typeof g?b.writeVarint32("false"===g.toLowerCase()?0:!!g):b.writeVarint32(g?1:0);break;case c.TYPES["enum"]:b.writeVarint32(g);
break;case c.TYPES["float"]:b.writeFloat32(g);break;case c.TYPES["double"]:b.writeFloat64(g);break;case c.TYPES.string:b.writeVString(g);break;case c.TYPES.bytes:if(0>g.remaining())throw Error("Illegal value for "+this.toString(!0)+": "+g.remaining()+" bytes remaining");a=g.offset;b.writeVarint32(g.remaining());b.append(g);g.offset=a;break;case c.TYPES.message:a=(new e).LE();this.resolvedType.encode(g,a);b.writeVarint32(a.offset);b.append(a.flip());break;case c.TYPES.group:this.resolvedType.encode(g,
b);b.writeVarint32(a<<3|c.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+g+" (unknown type)");}return b};f.decode=function(a,b,e){if(b!=this.type.wireType)throw Error("Unexpected wire type for element");switch(this.type){case c.TYPES.int32:return a.readVarint32()|0;case c.TYPES.uint32:return a.readVarint32()>>>0;case c.TYPES.sint32:return a.readVarint32ZigZag()|0;case c.TYPES.fixed32:return a.readUint32()>>>0;case c.TYPES.sfixed32:return a.readInt32()|
0;case c.TYPES.int64:return a.readVarint64();case c.TYPES.uint64:return a.readVarint64().toUnsigned();case c.TYPES.sint64:return a.readVarint64ZigZag();case c.TYPES.fixed64:return a.readUint64();case c.TYPES.sfixed64:return a.readInt64();case c.TYPES.bool:return!!a.readVarint32();case c.TYPES["enum"]:return a.readVarint32();case c.TYPES["float"]:return a.readFloat();case c.TYPES["double"]:return a.readDouble();case c.TYPES.string:return a.readVString();case c.TYPES.bytes:e=a.readVarint32();if(a.remaining()<
e)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+e+" required but got only "+a.remaining());b=a.clone();b.limit=b.offset+e;a.offset+=e;return b;case c.TYPES.message:return e=a.readVarint32(),this.resolvedType.decode(a,e);case c.TYPES.group:return this.resolvedType.decode(a,-1,e)}throw Error("[INTERNAL] Illegal decode type");};f.valueFromString=function(a){if(!this.isMapKey)throw Error("valueFromString() called on non-map-key element");switch(this.type){case c.TYPES.int32:case c.TYPES.sint32:case c.TYPES.sfixed32:case c.TYPES.uint32:case c.TYPES.fixed32:return this.verifyValue(parseInt(a));
case c.TYPES.int64:case c.TYPES.sint64:case c.TYPES.sfixed64:case c.TYPES.uint64:case c.TYPES.fixed64:return this.verifyValue(a);case c.TYPES.bool:return"true"===a;case c.TYPES.string:return this.verifyValue(a);case c.TYPES.bytes:return e.fromBinary(a)}};f.valueToString=function(a){if(!this.isMapKey)throw Error("valueToString() called on non-map-key element");return this.type===c.TYPES.bytes?a.toString("binary"):a.toString()};r.Element=m;var u=function(a,c,e,d,q,f){b.call(this,a,c,e,d,f);this.className=
"Message";this.extensions=void 0;this.clazz=null;this.isGroup=!!q;this._fieldsByName=this._fieldsById=this._fields=null},f=u.prototype=Object.create(b.prototype);f.build=function(a){if(this.clazz&&!a)return this.clazz;a=function(a,c){function b(c,g,f,d){if(null===c||"object"!==typeof c){if(d&&d instanceof a.Reflect.Enum){var h=a.Reflect.Enum.getName(d.object,c);if(null!==h)return h}return c}if(e.isByteBuffer(c))return g?c.toBase64():c.toBuffer();if(a.Long.isLong(c))return f?c.toString():a.Long.fromValue(c);
var n;if(Array.isArray(c))return n=[],c.forEach(function(a,c){n[c]=b(a,g,f,d)}),n;n={};if(c instanceof a.Map){for(var h=c.entries(),m=h.next();!m.done;m=h.next())n[c.keyElem.valueToString(m.value[0])]=b(m.value[1],g,f,c.valueElem.resolvedType);return n}var h=c.$type,m=void 0,q;for(q in c)c.hasOwnProperty(q)&&(h&&(m=h.getChild(q))?n[q]=b(c[q],g,f,m.resolvedType):n[q]=b(c[q],g,f));return n}var g=c.getChildren(a.Reflect.Message.Field),d=c.getChildren(a.Reflect.Message.OneOf),f=function(b,h){a.Builder.Message.call(this);
for(var n=0,m=d.length;n<m;++n)this[d[n].name]=null;n=0;for(m=g.length;n<m;++n){var q=g[n];this[q.name]=q.repeated?[]:q.map?new a.Map(q):null;!q.required&&"proto3"!==c.syntax||null===q.defaultValue||(this[q.name]=q.defaultValue)}if(0<arguments.length)if(1!==arguments.length||null===b||"object"!==typeof b||!("function"!==typeof b.encode||b instanceof f)||Array.isArray(b)||b instanceof a.Map||e.isByteBuffer(b)||b instanceof ArrayBuffer||a.Long&&b instanceof a.Long)for(n=0,m=arguments.length;n<m;++n)"undefined"!==
typeof(q=arguments[n])&&this.$set(g[n].name,q);else this.$set(b)},h=f.prototype=Object.create(a.Builder.Message.prototype);h.add=function(b,g,e){var f=c._fieldsByName[b];if(!e){if(!f)throw Error(this+"#"+b+" is undefined");if(!(f instanceof a.Reflect.Message.Field))throw Error(this+"#"+b+" is not a field: "+f.toString(!0));if(!f.repeated)throw Error(this+"#"+b+" is not a repeated field");g=f.verifyValue(g,!0)}null===this[b]&&(this[b]=[]);this[b].push(g);return this};h.$add=h.add;h.set=function(b,
g,e){if(b&&"object"===typeof b){e=g;for(var f in b)b.hasOwnProperty(f)&&"undefined"!==typeof(g=b[f])&&void 0===c._oneofsByName[f]&&this.$set(f,g,e);return this}f=c._fieldsByName[b];if(e)this[b]=g;else{if(!f)throw Error(this+"#"+b+" is not a field: undefined");if(!(f instanceof a.Reflect.Message.Field))throw Error(this+"#"+b+" is not a field: "+f.toString(!0));this[f.name]=g=f.verifyValue(g)}f&&f.oneof&&(e=this[f.oneof.name],null!==g?(null!==e&&e!==f.name&&(this[e]=null),this[f.oneof.name]=f.name):
e===b&&(this[f.oneof.name]=null));return this};h.$set=h.set;h.get=function(b,g){if(g)return this[b];var f=c._fieldsByName[b];if(!(f&&f instanceof a.Reflect.Message.Field))throw Error(this+"#"+b+" is not a field: undefined");if(!(f instanceof a.Reflect.Message.Field))throw Error(this+"#"+b+" is not a field: "+f.toString(!0));return this[f.name]};h.$get=h.get;for(var m=0;m<g.length;m++){var q=g[m];q instanceof a.Reflect.Message.ExtensionField||c.builder.options.populateAccessors&&function(a){var b=
a.originalName.replace(/(_[a-zA-Z])/g,function(a){return a.toUpperCase().replace("_","")}),b=b.substring(0,1).toUpperCase()+b.substring(1),g=a.originalName.replace(/([A-Z])/g,function(a){return"_"+a}),f=function(c,b){this[a.name]=b?c:a.verifyValue(c);return this},e=function(){return this[a.name]};null===c.getChild("set"+b)&&(h["set"+b]=f);null===c.getChild("set_"+g)&&(h["set_"+g]=f);null===c.getChild("get"+b)&&(h["get"+b]=e);null===c.getChild("get_"+g)&&(h["get_"+g]=e)}(q)}h.encode=function(a,b){"boolean"===
typeof a&&(b=a,a=void 0);var g=!1;a||(a=new e,g=!0);var f=a.littleEndian;try{return c.encode(this,a.LE(),b),(g?a.flip():a).LE(f)}catch(C){throw a.LE(f),C;}};f.encode=function(a,c,b){return(new f(a)).encode(c,b)};h.calculate=function(){return c.calculate(this)};h.encodeDelimited=function(a,b){var g=!1;a||(a=new e,g=!0);var f=(new e).LE();c.encode(this,f,b).flip();a.writeVarint32(f.remaining());a.append(f);return g?a.flip():a};h.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(n){throw n.encoded&&
(n.encoded=n.encoded.toArrayBuffer()),n;}};h.toArrayBuffer=h.encodeAB;h.encodeNB=function(){try{return this.encode().toBuffer()}catch(n){throw n.encoded&&(n.encoded=n.encoded.toBuffer()),n;}};h.toBuffer=h.encodeNB;h.encode64=function(){try{return this.encode().toBase64()}catch(n){throw n.encoded&&(n.encoded=n.encoded.toBase64()),n;}};h.toBase64=h.encode64;h.encodeHex=function(){try{return this.encode().toHex()}catch(n){throw n.encoded&&(n.encoded=n.encoded.toHex()),n;}};h.toHex=h.encodeHex;h.toRaw=
function(a,c){return b(this,!!a,!!c,this.$type)};h.encodeJSON=function(){return JSON.stringify(b(this,!0,!0,this.$type))};f.decode=function(a,b,g){"string"===typeof b&&(g=b,b=-1);"string"===typeof a?a=e.wrap(a,g?g:"base64"):e.isByteBuffer(a)||(a=e.wrap(a));g=a.littleEndian;try{var f=c.decode(a.LE(),b);a.LE(g);return f}catch(C){throw a.LE(g),C;}};f.decodeDelimited=function(a,b){"string"===typeof a?a=e.wrap(a,b?b:"base64"):e.isByteBuffer(a)||(a=e.wrap(a));if(1>a.remaining())return null;var g=a.offset,
f=a.readVarint32();if(a.remaining()<f)return a.offset=g,null;try{var h=c.decode(a.slice(a.offset,a.offset+f).LE());a.offset+=f;return h}catch(E){throw a.offset+=f,E;}};f.decode64=function(a){return f.decode(a,"base64")};f.decodeHex=function(a){return f.decode(a,"hex")};f.decodeJSON=function(a){return new f(JSON.parse(a))};h.toString=function(){return c.toString()};Object.defineProperty&&(Object.defineProperty(f,"$options",{value:c.buildOpt()}),Object.defineProperty(h,"$options",{value:f.$options}),
Object.defineProperty(f,"$type",{value:c}),Object.defineProperty(h,"$type",{value:c}));return f}(c,this);this._fields=[];this._fieldsById={};this._fieldsByName={};this._oneofsByName={};for(var b=0,d=this.children.length,f;b<d;b++)if(f=this.children[b],f instanceof x||f instanceof u||f instanceof D){if(a.hasOwnProperty(f.name))throw Error("Illegal reflect child of "+this.toString(!0)+": "+f.toString(!0)+" cannot override static property '"+f.name+"'");a[f.name]=f.build()}else if(f instanceof u.Field)f.build(),
this._fields.push(f),this._fieldsById[f.id]=f,this._fieldsByName[f.name]=f;else if(f instanceof u.OneOf)this._oneofsByName[f.name]=f;else if(!(f instanceof u.OneOf||f instanceof y))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[b].toString(!0));return this.clazz=a};f.encode=function(a,c,b){for(var g=null,f,e=0,h=this._fields.length,d;e<h;++e)f=this._fields[e],d=a[f.name],f.required&&null===d?null===g&&(g=f):f.encode(b?d:f.verifyValue(d),c,a);if(null!==g)throw a=Error("Missing at least one required field for "+
this.toString(!0)+": "+g),a.encoded=c,a;return c};f.calculate=function(a){for(var c=0,b=0,f=this._fields.length,e,d;b<f;++b){e=this._fields[b];d=a[e.name];if(e.required&&null===d)throw Error("Missing at least one required field for "+this.toString(!0)+": "+e);c+=e.calculate(d,a)}return c};f.decode=function(a,b,f){"number"!==typeof b&&(b=-1);for(var g=a.offset,e=new this.clazz,d,h,m;a.offset<g+b||-1===b&&0<a.remaining();){d=a.readVarint32();h=d&7;m=d>>>3;if(h===c.WIRE_TYPES.ENDGROUP){if(m!==f)throw Error("Illegal group end indicator for "+
this.toString(!0)+": "+m+" ("+(f?f+" expected":"not a group")+")");break}if(d=this._fieldsById[m])d.repeated&&!d.options.packed?e[d.name].push(d.decode(h,a)):d.map?(h=d.decode(h,a),e[d.name].set(h[0],h[1])):(e[d.name]=d.decode(h,a),d.oneof&&(h=e[d.oneof.name],null!==h&&h!==d.name&&(e[h]=null),e[d.oneof.name]=d.name));else switch(h){case c.WIRE_TYPES.VARINT:a.readVarint32();break;case c.WIRE_TYPES.BITS32:a.offset+=4;break;case c.WIRE_TYPES.BITS64:a.offset+=8;break;case c.WIRE_TYPES.LDELIM:d=a.readVarint32();
a.offset+=d;break;case c.WIRE_TYPES.STARTGROUP:for(;z(m,a););break;default:throw Error("Illegal wire type for unknown field "+m+" in "+this.toString(!0)+"#decode: "+h);}}a=0;for(b=this._fields.length;a<b;++a)if(d=this._fields[a],null===e[d.name])if("proto3"===this.syntax)e[d.name]=d.defaultValue;else{if(d.required)throw a=Error("Missing at least one required field for "+this.toString(!0)+": "+d.name),a.decoded=e,a;c.populateDefaults&&null!==d.defaultValue&&(e[d.name]=d.defaultValue)}return e};r.Message=
u;var p=function(a,b,f,e,d,m,l,y,t,z){k.call(this,a,b,m);this.className="Message.Field";this.required="required"===f;this.repeated="repeated"===f;this.map="map"===f;this.keyType=e||null;this.type=d;this.resolvedType=null;this.id=l;this.options=y||{};this.defaultValue=null;this.oneof=t||null;this.syntax=z||"proto2";this.originalName=this.name;this.keyElement=this.element=null;!this.builder.options.convertFieldsToCamelCase||this instanceof u.ExtensionField||(this.name=c.Util.toCamelCase(this.name))},
f=p.prototype=Object.create(k.prototype);f.build=function(){this.element=new m(this.type,this.resolvedType,!1,this.syntax,this.name);this.map&&(this.keyElement=new m(this.keyType,void 0,!0,this.syntax,this.name));"proto3"!==this.syntax||this.repeated||this.map?"undefined"!==typeof this.options["default"]&&(this.defaultValue=this.verifyValue(this.options["default"])):this.defaultValue=m.defaultFieldValue(this.type)};f.verifyValue=function(a,b){function g(a,c){throw Error("Illegal value for "+f.toString(!0)+
" of type "+f.type.name+": "+a+" ("+c+")");}b=b||!1;var f=this;if(null===a)return this.required&&g(typeof a,"required"),"proto3"===this.syntax&&this.type!==c.TYPES.message&&g(typeof a,"proto3 field without field presence cannot be null"),null;var e;if(this.repeated&&!b){Array.isArray(a)||(a=[a]);var d=[];for(e=0;e<a.length;e++)d.push(this.element.verifyValue(a[e]));return d}if(this.map&&!b){if(a instanceof c.Map)return a;a instanceof Object||g(typeof a,"expected ProtoBuf.Map or raw object for map field");
return new c.Map(this,a)}!this.repeated&&Array.isArray(a)&&g(typeof a,"no array expected");return this.element.verifyValue(a)};f.hasWirePresence=function(a,b){if("proto3"!==this.syntax)return null!==a;if(this.oneof&&b[this.oneof.name]===this.name)return!0;switch(this.type){case c.TYPES.int32:case c.TYPES.sint32:case c.TYPES.sfixed32:case c.TYPES.uint32:case c.TYPES.fixed32:return 0!==a;case c.TYPES.int64:case c.TYPES.sint64:case c.TYPES.sfixed64:case c.TYPES.uint64:case c.TYPES.fixed64:return 0!==
a.low||0!==a.high;case c.TYPES.bool:return a;case c.TYPES["float"]:case c.TYPES["double"]:return 0!==a;case c.TYPES.string:return 0<a.length;case c.TYPES.bytes:return 0<a.remaining();case c.TYPES["enum"]:return 0!==a;case c.TYPES.message:return null!==a;default:return!0}};f.encode=function(a,b,f){if(null===this.type||"object"!==typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===a||this.repeated&&0==a.length)return b;try{if(this.repeated){var g;
if(this.options.packed&&0<=c.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)){b.writeVarint32(this.id<<3|c.WIRE_TYPES.LDELIM);b.ensureCapacity(b.offset+=1);var d=b.offset;for(g=0;g<a.length;g++)this.element.encodeValue(this.id,a[g],b);var h=b.offset-d,m=e.calculateVarint32(h);if(1<m){var l=b.slice(d,b.offset),d=d+(m-1);b.offset=d;b.append(l)}b.writeVarint32(h,d-m)}else for(g=0;g<a.length;g++)b.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,a[g],b)}else this.map?a.forEach(function(a,
g,f){f=e.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,g)+e.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,a);b.writeVarint32(this.id<<3|c.WIRE_TYPES.LDELIM);b.writeVarint32(f);b.writeVarint32(8|this.keyType.wireType);this.keyElement.encodeValue(1,g,b);b.writeVarint32(16|this.type.wireType);this.element.encodeValue(2,a,b)},this):this.hasWirePresence(a,f)&&(b.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,a,b))}catch(F){throw Error("Illegal value for "+
this.toString(!0)+": "+a+" ("+F+")");}return b};f.calculate=function(a,b){a=this.verifyValue(a);if(null===this.type||"object"!==typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===a||this.repeated&&0==a.length)return 0;var g=0;try{if(this.repeated){var f,d;if(this.options.packed&&0<=c.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)){g+=e.calculateVarint32(this.id<<3|c.WIRE_TYPES.LDELIM);for(f=d=0;f<a.length;f++)d+=this.element.calculateLength(this.id,
a[f]);g+=e.calculateVarint32(d);g+=d}else for(f=0;f<a.length;f++)g+=e.calculateVarint32(this.id<<3|this.type.wireType),g+=this.element.calculateLength(this.id,a[f])}else this.map?a.forEach(function(a,b,f){a=e.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,b)+e.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,a);g+=e.calculateVarint32(this.id<<3|c.WIRE_TYPES.LDELIM);g+=e.calculateVarint32(a);g+=a},this):this.hasWirePresence(a,b)&&(g+=e.calculateVarint32(this.id<<
3|this.type.wireType),g+=this.element.calculateLength(this.id,a))}catch(w){throw Error("Illegal value for "+this.toString(!0)+": "+a+" ("+w+")");}return g};f.decode=function(a,b,f){if(!(!this.map&&a==this.type.wireType||!f&&this.repeated&&this.options.packed&&a==c.WIRE_TYPES.LDELIM||this.map&&a==c.WIRE_TYPES.LDELIM))throw Error("Illegal wire type for field "+this.toString(!0)+": "+a+" ("+this.type.wireType+" expected)");if(a==c.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&0<=c.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)&&
!f){a=b.readVarint32();a=b.offset+a;for(f=[];b.offset<a;)f.push(this.decode(this.type.wireType,b,!0));return f}if(this.map){var g=m.defaultFieldValue(this.keyType);f=m.defaultFieldValue(this.type);a=b.readVarint32();if(b.remaining()<a)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+a+" required but got only "+b.remaining());var d=b.clone();d.limit=d.offset+a;for(b.offset+=a;0<d.remaining();)if(b=d.readVarint32(),a=b&7,b>>>=3,1===b)g=this.keyElement.decode(d,a,b);else if(2===b)f=
this.element.decode(d,a,b);else throw Error("Unexpected tag in map field key/value submessage");return[g,f]}return this.element.decode(b,a,this.id)};r.Message.Field=p;f=function(a,b,c,f,d,e,m){p.call(this,a,b,c,null,f,d,e,m)};f.prototype=Object.create(p.prototype);r.Message.ExtensionField=f;r.Message.OneOf=function(a,b,c){k.call(this,a,b,c);this.fields=[]};var x=function(a,c,f,d,e){b.call(this,a,c,f,d,e);this.className="Enum";this.object=null};x.getName=function(a,b){for(var c=Object.keys(a),f=0,
g;f<c.length;++f)if(a[g=c[f]]===b)return g;return null};(x.prototype=Object.create(b.prototype)).build=function(a){if(this.object&&!a)return this.object;a=new c.Builder.Enum;for(var b=this.getChildren(x.Value),f=0,d=b.length;f<d;++f)a[b[f].name]=b[f].id;Object.defineProperty&&Object.defineProperty(a,"$options",{value:this.buildOpt(),enumerable:!1});return this.object=a};r.Enum=x;f=function(a,b,c,f){k.call(this,a,b,c);this.className="Enum.Value";this.id=f};f.prototype=Object.create(k.prototype);r.Enum.Value=
f;var y=function(a,b,c,f){k.call(this,a,b,c);this.field=f};y.prototype=Object.create(k.prototype);r.Extension=y;var D=function(a,c,f,d){b.call(this,a,c,f,d);this.className="Service";this.clazz=null};(D.prototype=Object.create(b.prototype)).build=function(a){return this.clazz&&!a?this.clazz:this.clazz=function(a,b){for(var c=function(b){a.Builder.Service.call(this);this.rpcImpl=b||function(a,b,c){setTimeout(c.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),
0)}},f=c.prototype=Object.create(a.Builder.Service.prototype),d=b.getChildren(a.Reflect.Service.RPCMethod),g=0;g<d.length;g++)(function(a){f[a.name]=function(c,f){try{try{c=a.resolvedRequestType.clazz.decode(e.wrap(c))}catch(A){if(!(A instanceof TypeError))throw A;}if(null===c||"object"!==typeof c)throw Error("Illegal arguments");c instanceof a.resolvedRequestType.clazz||(c=new a.resolvedRequestType.clazz(c));this.rpcImpl(a.fqn(),c,function(c,d){if(c)f(c);else{null===d&&(d="");try{d=a.resolvedResponseType.clazz.decode(d)}catch(G){}d&&
d instanceof a.resolvedResponseType.clazz?f(null,d):f(Error("Illegal response type received in service method "+b.name+"#"+a.name))}})}catch(A){setTimeout(f.bind(this,A),0)}};c[a.name]=function(b,f,d){(new c(b))[a.name](f,d)};Object.defineProperty&&(Object.defineProperty(c[a.name],"$options",{value:a.buildOpt()}),Object.defineProperty(f[a.name],"$options",{value:c[a.name].$options}))})(d[g]);Object.defineProperty&&(Object.defineProperty(c,"$options",{value:b.buildOpt()}),Object.defineProperty(f,"$options",
{value:c.$options}),Object.defineProperty(c,"$type",{value:b}),Object.defineProperty(f,"$type",{value:b}));return c}(c,this)};r.Service=D;var B=function(a,b,c,f){k.call(this,a,b,c);this.className="Service.Method";this.options=f||{}};(B.prototype=Object.create(k.prototype)).buildOpt=l.buildOpt;r.Service.Method=B;l=function(a,b,c,f,d,e,m,l){B.call(this,a,b,c,l);this.className="Service.RPCMethod";this.requestName=f;this.responseName=d;this.requestStream=e;this.responseStream=m;this.resolvedResponseType=
this.resolvedRequestType=null};l.prototype=Object.create(B.prototype);r.Service.RPCMethod=l;return r}(d);d.Builder=function(c,d,e){function t(b){b.messages&&b.messages.forEach(function(c){c.syntax=b.syntax;t(c)});b.enums&&b.enums.forEach(function(c){c.syntax=b.syntax})}var k=function(b){this.ptr=this.ns=new e.Namespace(this,null,"");this.resolved=!1;this.result=null;this.files={};this.importRoot=null;this.options=b||{}},l=k.prototype;k.isMessage=function(b){return"string"!==typeof b.name||"undefined"!==
typeof b.values||"undefined"!==typeof b.rpc?!1:!0};k.isMessageField=function(b){return"string"!==typeof b.rule||"string"!==typeof b.name||"string"!==typeof b.type||"undefined"===typeof b.id?!1:!0};k.isEnum=function(b){return"string"===typeof b.name&&"undefined"!==typeof b.values&&Array.isArray(b.values)&&0!==b.values.length?!0:!1};k.isService=function(b){return"string"===typeof b.name&&"object"===typeof b.rpc&&b.rpc?!0:!1};k.isExtend=function(b){return"string"!==typeof b.ref?!1:!0};l.reset=function(){this.ptr=
this.ns;return this};l.define=function(b){if("string"!==typeof b||!d.TYPEREF.test(b))throw Error("illegal namespace: "+b);b.split(".").forEach(function(b){var c=this.ptr.getChild(b);null===c&&this.ptr.addChild(c=new e.Namespace(this,this.ptr,b));this.ptr=c},this);return this};l.create=function(b){if(!b)return this;if(Array.isArray(b)){if(0===b.length)return this;b=b.slice()}else b=[b];for(var d=[b];0<d.length;){b=d.pop();if(!Array.isArray(b))throw Error("not a valid namespace: "+JSON.stringify(b));
for(;0<b.length;){var f=b.shift();if(k.isMessage(f)){var l=new e.Message(this,this.ptr,f.name,f.options,f.isGroup,f.syntax),t={};f.oneofs&&Object.keys(f.oneofs).forEach(function(b){l.addChild(t[b]=new e.Message.OneOf(this,l,b))},this);f.fields&&f.fields.forEach(function(b){if(null!==l.getChild(b.id|0))throw Error("duplicate or invalid field id in "+l.name+": "+b.id);if(b.options&&"object"!==typeof b.options)throw Error("illegal field options in "+l.name+"#"+b.name);var c=null;if("string"===typeof b.oneof&&
!(c=t[b.oneof]))throw Error("illegal oneof in "+l.name+"#"+b.name+": "+b.oneof);b=new e.Message.Field(this,l,b.rule,b.keytype,b.type,b.name,b.id,b.options,c,f.syntax);c&&c.fields.push(b);l.addChild(b)},this);var r=[];f.enums&&f.enums.forEach(function(b){r.push(b)});f.messages&&f.messages.forEach(function(b){r.push(b)});f.services&&f.services.forEach(function(b){r.push(b)});f.extensions&&(l.extensions="number"===typeof f.extensions[0]?[f.extensions]:f.extensions);this.ptr.addChild(l);if(0<r.length){d.push(b);
b=r;r=null;this.ptr=l;l=null;continue}r=null}else if(k.isEnum(f))l=new e.Enum(this,this.ptr,f.name,f.options,f.syntax),f.values.forEach(function(b){l.addChild(new e.Enum.Value(this,l,b.name,b.id))},this),this.ptr.addChild(l);else if(k.isService(f))l=new e.Service(this,this.ptr,f.name,f.options),Object.keys(f.rpc).forEach(function(b){var c=f.rpc[b];l.addChild(new e.Service.RPCMethod(this,l,b,c.request,c.response,!!c.request_stream,!!c.response_stream,c.options))},this),this.ptr.addChild(l);else if(k.isExtend(f))if(l=
this.ptr.resolve(f.ref,!0))f.fields.forEach(function(b){if(null!==l.getChild(b.id|0))throw Error("duplicate extended field id in "+l.name+": "+b.id);if(l.extensions){var f=!1;l.extensions.forEach(function(a){b.id>=a[0]&&b.id<=a[1]&&(f=!0)});if(!f)throw Error("illegal extended field id in "+l.name+": "+b.id+" (not within valid ranges)");}var d=b.name;this.options.convertFieldsToCamelCase&&(d=c.Util.toCamelCase(d));var d=new e.Message.ExtensionField(this,l,b.rule,b.type,this.ptr.fqn()+"."+d,b.id,b.options),
a=new e.Extension(this,this.ptr,b.name,d);d.extension=a;this.ptr.addChild(a);l.addChild(d)},this);else{if(!/\.?google\.protobuf\./.test(f.ref))throw Error("extended message "+f.ref+" is not defined");}else throw Error("not a valid definition: "+JSON.stringify(f));l=f=null}b=null;this.ptr=this.ptr.parent}this.resolved=!1;this.result=null;return this};l["import"]=function(b,d){var f="/";if("string"===typeof d){c.Util.IS_NODE&&(d=require("path").resolve(d));if(!0===this.files[d])return this.reset();
this.files[d]=!0}else if("object"===typeof d){var e=d.root;c.Util.IS_NODE&&(e=require("path").resolve(e));if(0<=e.indexOf("\\")||0<=d.file.indexOf("\\"))f="\\";e=c.Util.IS_NODE?require("path").join(e,d.file):e+f+d.file;if(!0===this.files[e])return this.reset();this.files[e]=!0}if(b.imports&&0<b.imports.length){var l=!1;if("object"===typeof d){if(this.importRoot=d.root,l=!0,e=this.importRoot,d=d.file,0<=e.indexOf("\\")||0<=d.indexOf("\\"))f="\\"}else"string"===typeof d?this.importRoot?e=this.importRoot:
0<=d.indexOf("/")?(e=d.replace(/\/[^\/]*$/,""),""===e&&(e="/")):0<=d.indexOf("\\")?(e=d.replace(/\\[^\\]*$/,""),f="\\"):e=".":e=null;for(var m=0;m<b.imports.length;m++)if("string"===typeof b.imports[m]){if(!e)throw Error("cannot determine import root");var k=b.imports[m];if("google/protobuf/descriptor.proto"!==k&&(k=c.Util.IS_NODE?require("path").join(e,k):e+f+k,!0!==this.files[k])){/\.proto$/i.test(k)&&!c.DotProto&&(k=k.replace(/\.proto$/,".json"));var r=c.Util.fetch(k);if(null===r)throw Error("failed to import '"+
k+"' in '"+d+"': file not found");if(/\.json$/i.test(k))this["import"](JSON.parse(r+""),k);else this["import"](c.DotProto.Parser.parse(r),k)}}else if(d)if(/\.(\w+)$/.test(d))this["import"](b.imports[m],d.replace(/^(.+)\.(\w+)$/,function(a,b,c){return b+"_import"+m+"."+c}));else this["import"](b.imports[m],d+"_import"+m);else this["import"](b.imports[m]);l&&(this.importRoot=null)}b["package"]&&this.define(b["package"]);b.syntax&&t(b);var p=this.ptr;b.options&&Object.keys(b.options).forEach(function(a){p.options[a]=
b.options[a]});b.messages&&(this.create(b.messages),this.ptr=p);b.enums&&(this.create(b.enums),this.ptr=p);b.services&&(this.create(b.services),this.ptr=p);b["extends"]&&this.create(b["extends"]);return this.reset()};l.resolveAll=function(){var b;if(null==this.ptr||"object"===typeof this.ptr.type)return this;if(this.ptr instanceof e.Namespace)this.ptr.children.forEach(function(b){this.ptr=b;this.resolveAll()},this);else if(this.ptr instanceof e.Message.Field){if(d.TYPE.test(this.ptr.type))this.ptr.type=
c.TYPES[this.ptr.type];else{if(!d.TYPEREF.test(this.ptr.type))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);b=(this.ptr instanceof e.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0);if(!b)throw Error("unresolvable type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.resolvedType=b;if(b instanceof e.Enum){if(this.ptr.type=c.TYPES["enum"],"proto3"===this.ptr.syntax&&"proto3"!==b.syntax)throw Error("proto3 message cannot reference proto2 enum");
}else if(b instanceof e.Message)this.ptr.type=b.isGroup?c.TYPES.group:c.TYPES.message;else throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);}if(this.ptr.map){if(!d.TYPE.test(this.ptr.keyType))throw Error("illegal key type for map field in "+this.ptr.toString(!0)+": "+this.ptr.keyType);this.ptr.keyType=c.TYPES[this.ptr.keyType]}"proto3"===this.ptr.syntax&&this.ptr.repeated&&void 0===this.ptr.options.packed&&-1!==c.PACKABLE_WIRE_TYPES.indexOf(this.ptr.type.wireType)&&
(this.ptr.options.packed=!0)}else if(this.ptr instanceof c.Reflect.Service.Method)if(this.ptr instanceof c.Reflect.Service.RPCMethod){b=this.ptr.parent.resolve(this.ptr.requestName,!0);if(!(b&&b instanceof c.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);this.ptr.resolvedRequestType=b;b=this.ptr.parent.resolve(this.ptr.responseName,!0);if(!(b&&b instanceof c.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+
": "+this.ptr.responseName);this.ptr.resolvedResponseType=b}else throw Error("illegal service type in "+this.ptr.toString(!0));else if(!(this.ptr instanceof c.Reflect.Message.OneOf||this.ptr instanceof c.Reflect.Extension||this.ptr instanceof c.Reflect.Enum.Value))throw Error("illegal object in namespace: "+typeof this.ptr+": "+this.ptr);return this.reset()};l.build=function(b){this.reset();this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null);null===this.result&&(this.result=this.ns.build());
if(!b)return this.result;b="string"===typeof b?b.split("."):b;for(var c=this.result,f=0;f<b.length;f++)if(c[b[f]])c=c[b[f]];else{c=null;break}return c};l.lookup=function(b,c){return b?this.ns.resolve(b,c):this.ns};l.toString=function(){return"Builder"};k.Message=function(){};k.Enum=function(){};k.Service=function(){};return k}(d,d.Lang,d.Reflect);d.Map=function(c,d){function e(c){var b=0;return{next:function(){return b<c.length?{done:!1,value:c[b++]}:{done:!0}}}}var t=function(c,b){if(!c.map)throw Error("field is not a map");
this.field=c;this.keyElem=new d.Element(c.keyType,null,!0,c.syntax);this.valueElem=new d.Element(c.type,c.resolvedType,!1,c.syntax);this.map={};Object.defineProperty(this,"size",{get:function(){return Object.keys(this.map).length}});if(b)for(var e=Object.keys(b),f=0;f<e.length;f++){var l=this.keyElem.valueFromString(e[f]),k=this.valueElem.verifyValue(b[e[f]]);this.map[this.keyElem.valueToString(l)]={key:l,value:k}}},k=t.prototype;k.clear=function(){this.map={}};k["delete"]=function(c){c=this.keyElem.valueToString(this.keyElem.verifyValue(c));
var b=c in this.map;delete this.map[c];return b};k.entries=function(){for(var c=[],b=Object.keys(this.map),d=0,f;d<b.length;d++)c.push([(f=this.map[b[d]]).key,f.value]);return e(c)};k.keys=function(){for(var c=[],b=Object.keys(this.map),d=0;d<b.length;d++)c.push(this.map[b[d]].key);return e(c)};k.values=function(){for(var c=[],b=Object.keys(this.map),d=0;d<b.length;d++)c.push(this.map[b[d]].value);return e(c)};k.forEach=function(c,b){for(var d=Object.keys(this.map),f=0,e;f<d.length;f++)c.call(b,(e=
this.map[d[f]]).value,e.key,this)};k.set=function(c,b){var d=this.keyElem.verifyValue(c),f=this.valueElem.verifyValue(b);this.map[this.keyElem.valueToString(d)]={key:d,value:f};return this};k.get=function(c){c=this.keyElem.valueToString(this.keyElem.verifyValue(c));if(c in this.map)return this.map[c].value};k.has=function(c){return this.keyElem.valueToString(this.keyElem.verifyValue(c))in this.map};return t}(d,d.Reflect);d.newBuilder=function(c){c=c||{};"undefined"===typeof c.convertFieldsToCamelCase&&
(c.convertFieldsToCamelCase=d.convertFieldsToCamelCase);"undefined"===typeof c.populateAccessors&&(c.populateAccessors=d.populateAccessors);return new d.Builder(c)};d.loadJson=function(c,e,p){if("string"===typeof e||e&&"string"===typeof e.file&&"string"===typeof e.root)p=e,e=null;e&&"object"===typeof e||(e=d.newBuilder());"string"===typeof c&&(c=JSON.parse(c));e["import"](c,p);e.resolveAll();return e};d.loadJsonFile=function(c,e,p){e&&"object"===typeof e?(p=e,e=null):e&&"function"===typeof e||(e=
null);if(e)return d.Util.fetch("string"===typeof c?c:c.root+"/"+c.file,function(k){if(null===k)e(Error("Failed to fetch file"));else try{e(null,d.loadJson(JSON.parse(k),p,c))}catch(l){e(l)}});var r=d.Util.fetch("object"===typeof c?c.root+"/"+c.file:c);return null===r?null:d.loadJson(JSON.parse(r),p,c)};return d});

BIN
node_modules/protobufjs/dist/protobuf-light.min.js.gz generated vendored Normal file

Binary file not shown.

8
node_modules/protobufjs/dist/protobuf-light.min.map generated vendored Normal file

File diff suppressed because one or more lines are too long

5265
node_modules/protobufjs/dist/protobuf.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

116
node_modules/protobufjs/dist/protobuf.min.js generated vendored Normal file
View File

@ -0,0 +1,116 @@
/*
protobuf.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
Released under the Apache License, Version 2.0
see: https://github.com/dcodeIO/protobuf.js for details
*/
var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(e,p,d){if(d.get||d.set)throw new TypeError("ES3 does not support getters and setters.");e!=Array.prototype&&e!=Object.prototype&&(e[p]=d.value)};$jscomp.getGlobal=function(e){return"undefined"!=typeof window&&window===e?e:"undefined"!=typeof global&&null!=global?global:e};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_";
$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(e){return $jscomp.SYMBOL_PREFIX+(e||"")+$jscomp.symbolCounter_++};
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var e=$jscomp.global.Symbol.iterator;e||(e=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[e]&&$jscomp.defineProperty(Array.prototype,e,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(e){var p=0;return $jscomp.iteratorPrototype(function(){return p<e.length?{done:!1,value:e[p++]}:{done:!0}})};
$jscomp.iteratorPrototype=function(e){$jscomp.initSymbolIterator();e={next:e};e[$jscomp.global.Symbol.iterator]=function(){return this};return e};$jscomp.array=$jscomp.array||{};$jscomp.iteratorFromArray=function(e,p){$jscomp.initSymbolIterator();e instanceof String&&(e+="");var d=0,b={next:function(){if(d<e.length){var t=d++;return{value:p(t,e[t]),done:!1}}b.next=function(){return{done:!0,value:void 0}};return b.next()}};b[Symbol.iterator]=function(){return b};return b};
$jscomp.polyfill=function(e,p,d,b){if(p){d=$jscomp.global;e=e.split(".");for(b=0;b<e.length-1;b++){var t=e[b];t in d||(d[t]={});d=d[t]}e=e[e.length-1];b=d[e];p=p(b);p!=b&&null!=p&&$jscomp.defineProperty(d,e,{configurable:!0,writable:!0,value:p})}};$jscomp.polyfill("Array.prototype.keys",function(e){return e?e:function(){return $jscomp.iteratorFromArray(this,function(e){return e})}},"es6-impl","es3");
$jscomp.polyfill("Array.prototype.entries",function(e){return e?e:function(){return $jscomp.iteratorFromArray(this,function(e,d){return[e,d]})}},"es6-impl","es3");$jscomp.polyfill("Array.prototype.values",function(e){return e?e:function(){return $jscomp.iteratorFromArray(this,function(e,d){return d})}},"es6","es3");
(function(e,p){"function"===typeof define&&define.amd?define(["bytebuffer"],p):"function"===typeof require&&"object"===typeof module&&module&&module.exports?module.exports=p(require("bytebuffer"),!0):(e.dcodeIO=e.dcodeIO||{}).ProtoBuf=p(e.dcodeIO.ByteBuffer)})(this,function(e,p){var d={};d.ByteBuffer=e;d.Long=e.Long||null;d.VERSION="5.0.3";d.WIRE_TYPES={};d.WIRE_TYPES.VARINT=0;d.WIRE_TYPES.BITS64=1;d.WIRE_TYPES.LDELIM=2;d.WIRE_TYPES.STARTGROUP=3;d.WIRE_TYPES.ENDGROUP=4;d.WIRE_TYPES.BITS32=5;d.PACKABLE_WIRE_TYPES=
[d.WIRE_TYPES.VARINT,d.WIRE_TYPES.BITS64,d.WIRE_TYPES.BITS32];d.TYPES={int32:{name:"int32",wireType:d.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:"uint32",wireType:d.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:"sint32",wireType:d.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:"int64",wireType:d.WIRE_TYPES.VARINT,defaultValue:d.Long?d.Long.ZERO:void 0},uint64:{name:"uint64",wireType:d.WIRE_TYPES.VARINT,defaultValue:d.Long?d.Long.UZERO:void 0},sint64:{name:"sint64",wireType:d.WIRE_TYPES.VARINT,
defaultValue:d.Long?d.Long.ZERO:void 0},bool:{name:"bool",wireType:d.WIRE_TYPES.VARINT,defaultValue:!1},"double":{name:"double",wireType:d.WIRE_TYPES.BITS64,defaultValue:0},string:{name:"string",wireType:d.WIRE_TYPES.LDELIM,defaultValue:""},bytes:{name:"bytes",wireType:d.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:"fixed32",wireType:d.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:"sfixed32",wireType:d.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:"fixed64",wireType:d.WIRE_TYPES.BITS64,
defaultValue:d.Long?d.Long.UZERO:void 0},sfixed64:{name:"sfixed64",wireType:d.WIRE_TYPES.BITS64,defaultValue:d.Long?d.Long.ZERO:void 0},"float":{name:"float",wireType:d.WIRE_TYPES.BITS32,defaultValue:0},"enum":{name:"enum",wireType:d.WIRE_TYPES.VARINT,defaultValue:0},message:{name:"message",wireType:d.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:"group",wireType:d.WIRE_TYPES.STARTGROUP,defaultValue:null}};d.MAP_KEY_TYPES=[d.TYPES.int32,d.TYPES.sint32,d.TYPES.sfixed32,d.TYPES.uint32,d.TYPES.fixed32,
d.TYPES.int64,d.TYPES.sint64,d.TYPES.sfixed64,d.TYPES.uint64,d.TYPES.fixed64,d.TYPES.bool,d.TYPES.string,d.TYPES.bytes];d.ID_MIN=1;d.ID_MAX=536870911;d.convertFieldsToCamelCase=!1;d.populateAccessors=!0;d.populateDefaults=!0;d.Util=function(){var b={};b.IS_NODE=!("object"!==typeof process||"[object process]"!==process+""||process.browser);b.XHR=function(){for(var b=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},
function(){return new ActiveXObject("Microsoft.XMLHTTP")}],d=null,e=0;e<b.length;e++){try{d=b[e]()}catch(m){continue}break}if(!d)throw Error("XMLHttpRequest is not supported");return d};b.fetch=function(d,e){e&&"function"!=typeof e&&(e=null);if(b.IS_NODE){var t=require("fs");if(e)t.readFile(d,function(b,a){b?e(null):e(""+a)});else try{return t.readFileSync(d)}catch(n){return null}}else{var m=b.XHR();m.open("GET",d,e?!0:!1);m.setRequestHeader("Accept","text/plain");"function"===typeof m.overrideMimeType&&
m.overrideMimeType("text/plain");if(e)m.onreadystatechange=function(){4==m.readyState&&(200==m.status||0==m.status&&"string"===typeof m.responseText?e(m.responseText):e(null))},4!=m.readyState&&m.send(null);else return m.send(null),200==m.status||0==m.status&&"string"===typeof m.responseText?m.responseText:null}};b.toCamelCase=function(b){return b.replace(/_([a-zA-Z])/g,function(b,d){return d.toUpperCase()})};return b}();d.Lang={DELIM:/[\s\{\}=;:\[\],'"\(\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,
TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,FQTYPEREF:/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\s/,STRING:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,STRING_DQ:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,STRING_SQ:/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g};d.DotProto=function(b,d){function e(b,c){var l,a=1;"-"==b.charAt(0)&&(a=-1,b=b.substring(1));if(d.NUMBER_DEC.test(b))l=parseInt(b);else if(d.NUMBER_HEX.test(b))l=parseInt(b.substring(2),16);else if(d.NUMBER_OCT.test(b))l=
parseInt(b.substring(1),8);else throw Error("illegal id value: "+(0>a?"-":"")+b);l=a*l|0;if(!c&&0>l)throw Error("illegal id value: "+(0>a?"-":"")+b);return l}function t(b){var c=1;"-"==b.charAt(0)&&(c=-1,b=b.substring(1));if(d.NUMBER_DEC.test(b))return c*parseInt(b,10);if(d.NUMBER_HEX.test(b))return c*parseInt(b.substring(2),16);if(d.NUMBER_OCT.test(b))return c*parseInt(b.substring(1),8);if("inf"===b)return Infinity*c;if("nan"===b)return NaN;if(d.NUMBER_FLT.test(b))return c*parseFloat(b);throw Error("illegal number value: "+
(0>c?"-":"")+b);}function m(b,c,d){"undefined"===typeof b[c]?b[c]=d:(Array.isArray(b[c])||(b[c]=[b[c]]),b[c].push(d))}var n={},a=function(b){this.source=b+"";this.index=0;this.line=1;this.stack=[];this._stringOpen=null},g=a.prototype;g._readString=function(){var b='"'===this._stringOpen?d.STRING_DQ:d.STRING_SQ;b.lastIndex=this.index-1;var c=b.exec(this.source);if(!c)throw Error("unterminated string");this.index=b.lastIndex;this.stack.push(this._stringOpen);this._stringOpen=null;return c[1]};g.next=
function(){if(0<this.stack.length)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();var b,c;do{for(b=!1;d.WHITESPACE.test(c=this.source.charAt(this.index));)if("\n"===c&&++this.line,++this.index===this.source.length)return null;if("/"===this.source.charAt(this.index))if(++this.index,"/"===this.source.charAt(this.index)){for(;"\n"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index;
++this.line;b=!0}else if("*"===(c=this.source.charAt(this.index))){do{"\n"===c&&++this.line;if(++this.index===this.source.length)return null;b=c;c=this.source.charAt(this.index)}while("*"!==b||"/"!==c);++this.index;b=!0}else return"/"}while(b);if(this.index===this.source.length)return null;c=this.index;d.DELIM.lastIndex=0;if(!d.DELIM.test(this.source.charAt(c++)))for(;c<this.source.length&&!d.DELIM.test(this.source.charAt(c));)++c;c=this.source.substring(this.index,this.index=c);if('"'===c||"'"===
c)this._stringOpen=c;return c};g.peek=function(){if(0===this.stack.length){var b=this.next();if(null===b)return null;this.stack.push(b)}return this.stack[0]};g.skip=function(b){var c=this.next();if(c!==b)throw Error("illegal '"+c+"', '"+b+"' expected");};g.omit=function(b){return this.peek()===b?(this.next(),!0):!1};g.toString=function(){return"Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")"};n.Tokenizer=a;var h=function(b){this.tn=new a(b);this.proto3=!1},g=h.prototype;g.parse=
function(){var b={name:"[ROOT]","package":null,messages:[],enums:[],imports:[],options:{},services:[]},c,a=!0,e;try{for(;c=this.tn.next();)switch(c){case "package":if(!a||null!==b["package"])throw Error("unexpected 'package'");c=this.tn.next();if(!d.TYPEREF.test(c))throw Error("illegal package name: "+c);this.tn.skip(";");b["package"]=c;break;case "import":if(!a)throw Error("unexpected 'import'");c=this.tn.peek();("public"===c||(e="weak"===c))&&this.tn.next();c=this._readString();this.tn.skip(";");
e||b.imports.push(c);break;case "syntax":if(!a)throw Error("unexpected 'syntax'");this.tn.skip("=");"proto3"===(b.syntax=this._readString())&&(this.proto3=!0);this.tn.skip(";");break;case "message":this._parseMessage(b,null);a=!1;break;case "enum":this._parseEnum(b);a=!1;break;case "option":this._parseOption(b);break;case "service":this._parseService(b);break;case "extend":this._parseExtend(b);break;default:throw Error("unexpected '"+c+"'");}}catch(u){throw u.message="Parse error at line "+this.tn.line+
": "+u.message,u;}delete b.name;return b};h.parse=function(b){return(new h(b)).parse()};g._readString=function(){var b="",c;do{c=this.tn.next();if("'"!==c&&'"'!==c)throw Error("illegal string delimiter: "+c);b+=this.tn.next();this.tn.skip(c);c=this.tn.peek()}while('"'===c||'"'===c);return b};g._readValue=function(b){var c=this.tn.peek();if('"'===c||"'"===c)return this._readString();this.tn.next();if(d.NUMBER.test(c))return t(c);if(d.BOOL.test(c))return"true"===c.toLowerCase();if(b&&d.TYPEREF.test(c))return c;
throw Error("illegal value: "+c);};g._parseOption=function(b,c){var a=this.tn.next(),e=!1;"("===a&&(e=!0,a=this.tn.next());if(!d.TYPEREF.test(a))throw Error("illegal option name: "+a);var g=a;e&&(this.tn.skip(")"),g="("+g+")",a=this.tn.peek(),d.FQTYPEREF.test(a)&&(g+=a,this.tn.next()));this.tn.skip("=");this._parseOptionValue(b,g);c||this.tn.skip(";")};g._parseOptionValue=function(b,c){var a=this.tn.peek();if("{"!==a)m(b.options,c,this._readValue(!0));else for(this.tn.skip("{");"}"!==(a=this.tn.next());){if(!d.NAME.test(a))throw Error("illegal option name: "+
c+"."+a);this.tn.omit(":")?m(b.options,c+"."+a,this._readValue(!0)):this._parseOptionValue(b,c+"."+a)}};g._parseService=function(b){var c=this.tn.next();if(!d.NAME.test(c))throw Error("illegal service name at line "+this.tn.line+": "+c);var a={name:c,rpc:{},options:{}};for(this.tn.skip("{");"}"!==(c=this.tn.next());)if("option"===c)this._parseOption(a);else if("rpc"===c)this._parseServiceRPC(a);else throw Error("illegal service token: "+c);this.tn.omit(";");b.services.push(a)};g._parseServiceRPC=
function(b){var c=this.tn.next();if(!d.NAME.test(c))throw Error("illegal rpc service method name: "+c);var a=c,e={request:null,response:null,request_stream:!1,response_stream:!1,options:{}};this.tn.skip("(");c=this.tn.next();"stream"===c.toLowerCase()&&(e.request_stream=!0,c=this.tn.next());if(!d.TYPEREF.test(c))throw Error("illegal rpc service request type: "+c);e.request=c;this.tn.skip(")");c=this.tn.next();if("returns"!==c.toLowerCase())throw Error("illegal rpc service request type delimiter: "+
c);this.tn.skip("(");c=this.tn.next();"stream"===c.toLowerCase()&&(e.response_stream=!0,c=this.tn.next());e.response=c;this.tn.skip(")");c=this.tn.peek();if("{"===c){for(this.tn.next();"}"!==(c=this.tn.next());)if("option"===c)this._parseOption(e);else throw Error("illegal rpc service token: "+c);this.tn.omit(";")}else this.tn.skip(";");"undefined"===typeof b.rpc&&(b.rpc={});b.rpc[a]=e};g._parseMessage=function(b,c){var a=!!c,g=this.tn.next(),h={name:"",fields:[],enums:[],messages:[],options:{},services:[],
oneofs:{}};if(!d.NAME.test(g))throw Error("illegal "+(a?"group":"message")+" name: "+g);h.name=g;a&&(this.tn.skip("="),c.id=e(this.tn.next()),h.isGroup=!0);g=this.tn.peek();"["===g&&c&&this._parseFieldOptions(c);for(this.tn.skip("{");"}"!==(g=this.tn.next());)if(d.RULE.test(g))this._parseMessageField(h,g);else if("oneof"===g)this._parseMessageOneOf(h);else if("enum"===g)this._parseEnum(h);else if("message"===g)this._parseMessage(h);else if("option"===g)this._parseOption(h);else if("service"===g)this._parseService(h);
else if("extensions"===g)h.hasOwnProperty("extensions")?h.extensions=h.extensions.concat(this._parseExtensionRanges()):h.extensions=this._parseExtensionRanges();else if("reserved"===g)this._parseIgnored();else if("extend"===g)this._parseExtend(h);else if(d.TYPEREF.test(g)){if(!this.proto3)throw Error("illegal field rule: "+g);this._parseMessageField(h,"optional",g)}else throw Error("illegal message token: "+g);this.tn.omit(";");b.messages.push(h);return h};g._parseIgnored=function(){for(;";"!==this.tn.peek();)this.tn.next();
this.tn.skip(";")};g._parseMessageField=function(b,c,a){if(!d.RULE.test(c))throw Error("illegal message field rule: "+c);var g={rule:c,type:"",name:"",options:{},id:0};if("map"===c){if(a)throw Error("illegal type: "+a);this.tn.skip("<");c=this.tn.next();if(!d.TYPE.test(c)&&!d.TYPEREF.test(c))throw Error("illegal message field type: "+c);g.keytype=c;this.tn.skip(",");c=this.tn.next();if(!d.TYPE.test(c)&&!d.TYPEREF.test(c))throw Error("illegal message field: "+c);g.type=c;this.tn.skip(">");c=this.tn.next();
if(!d.NAME.test(c))throw Error("illegal message field name: "+c);g.name=c;this.tn.skip("=");g.id=e(this.tn.next());c=this.tn.peek();"["===c&&this._parseFieldOptions(g);this.tn.skip(";")}else if(a="undefined"!==typeof a?a:this.tn.next(),"group"===a){c=this._parseMessage(b,g);if(!/^[A-Z]/.test(c.name))throw Error("illegal group name: "+c.name);g.type=c.name;g.name=c.name.toLowerCase();this.tn.omit(";")}else{if(!d.TYPE.test(a)&&!d.TYPEREF.test(a))throw Error("illegal message field type: "+a);g.type=
a;c=this.tn.next();if(!d.NAME.test(c))throw Error("illegal message field name: "+c);g.name=c;this.tn.skip("=");g.id=e(this.tn.next());c=this.tn.peek();"["===c&&this._parseFieldOptions(g);this.tn.skip(";")}b.fields.push(g);return g};g._parseMessageOneOf=function(b){var c=this.tn.next();if(!d.NAME.test(c))throw Error("illegal oneof name: "+c);var a=c,g=[];for(this.tn.skip("{");"}"!==(c=this.tn.next());)c=this._parseMessageField(b,"optional",c),c.oneof=a,g.push(c.id);this.tn.omit(";");b.oneofs[a]=g};
g._parseFieldOptions=function(b){this.tn.skip("[");for(var c=!0;"]"!==this.tn.peek();)c||this.tn.skip(","),this._parseOption(b,!0),c=!1;this.tn.next()};g._parseEnum=function(b){var c={name:"",values:[],options:{}},a=this.tn.next();if(!d.NAME.test(a))throw Error("illegal name: "+a);c.name=a;for(this.tn.skip("{");"}"!==(a=this.tn.next());)if("option"===a)this._parseOption(c);else{if(!d.NAME.test(a))throw Error("illegal name: "+a);this.tn.skip("=");var g={name:a,id:e(this.tn.next(),!0)},a=this.tn.peek();
"["===a&&this._parseFieldOptions({options:{}});this.tn.skip(";");c.values.push(g)}this.tn.omit(";");b.enums.push(c)};g._parseExtensionRanges=function(){var a=[],c,d;do{for(d=[];;){c=this.tn.next();switch(c){case "min":c=b.ID_MIN;break;case "max":c=b.ID_MAX;break;default:c=t(c)}d.push(c);if(2===d.length)break;if("to"!==this.tn.peek()){d.push(c);break}this.tn.next()}a.push(d)}while(this.tn.omit(","));this.tn.skip(";");return a};g._parseExtend=function(b){var a=this.tn.next();if(!d.TYPEREF.test(a))throw Error("illegal extend reference: "+
a);var g={ref:a,fields:[]};for(this.tn.skip("{");"}"!==(a=this.tn.next());)if(d.RULE.test(a))this._parseMessageField(g,a);else if(d.TYPEREF.test(a)){if(!this.proto3)throw Error("illegal field rule: "+a);this._parseMessageField(g,"optional",a)}else throw Error("illegal extend token: "+a);this.tn.omit(";");b.messages.push(g);return g};g.toString=function(){return"Parser at line "+this.tn.line};n.Parser=h;return n}(d,d.Lang);d.Reflect=function(b){function d(f,k){if(f&&"number"===typeof f.low&&"number"===
typeof f.high&&"boolean"===typeof f.unsigned&&f.low===f.low&&f.high===f.high)return new b.Long(f.low,f.high,"undefined"===typeof k?f.unsigned:k);if("string"===typeof f)return b.Long.fromString(f,k||!1,10);if("number"===typeof f)return b.Long.fromNumber(f,k||!1);throw Error("not convertible to Long");}function y(f,k){var a=k.readVarint32(),c=a&7,a=a>>>3;switch(c){case b.WIRE_TYPES.VARINT:do a=k.readUint8();while(128===(a&128));break;case b.WIRE_TYPES.BITS64:k.offset+=8;break;case b.WIRE_TYPES.LDELIM:a=
k.readVarint32();k.offset+=a;break;case b.WIRE_TYPES.STARTGROUP:y(a,k);break;case b.WIRE_TYPES.ENDGROUP:if(a===f)return!1;throw Error("Illegal GROUPEND after unknown group: "+a+" ("+f+" expected)");case b.WIRE_TYPES.BITS32:k.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+f+": "+c);}return!0}var r={},m=function(b,k,a){this.builder=b;this.parent=k;this.name=a},n=m.prototype;n.fqn=function(){var b=this.name,k=this;do{k=k.parent;if(null==k)break;b=k.name+"."+b}while(1);return b};
n.toString=function(b){return(b?this.className+" ":"")+this.fqn()};n.build=function(){throw Error(this.toString(!0)+" cannot be built directly");};r.T=m;var a=function(b,k,a,c,d){m.call(this,b,k,a);this.className="Namespace";this.children=[];this.options=c||{};this.syntax=d||"proto2"},n=a.prototype=Object.create(m.prototype);n.getChildren=function(b){b=b||null;if(null==b)return this.children.slice();for(var f=[],a=0,c=this.children.length;a<c;++a)this.children[a]instanceof b&&f.push(this.children[a]);
return f};n.addChild=function(b){var f;if(f=this.getChild(b.name))if(f instanceof l.Field&&f.name!==f.originalName&&null===this.getChild(f.originalName))f.name=f.originalName;else if(b instanceof l.Field&&b.name!==b.originalName&&null===this.getChild(b.originalName))b.name=b.originalName;else throw Error("Duplicate name in namespace "+this.toString(!0)+": "+b.name);this.children.push(b)};n.getChild=function(b){for(var f="number"===typeof b?"id":"name",a=0,c=this.children.length;a<c;++a)if(this.children[a][f]===
b)return this.children[a];return null};n.resolve=function(b,a){var f="string"===typeof b?b.split("."):b,k=this,c=0;if(""===f[c]){for(;null!==k.parent;)k=k.parent;c++}do{do{if(!(k instanceof r.Namespace)){k=null;break}k=k.getChild(f[c]);if(!(k&&k instanceof r.T)||a&&!(k instanceof r.Namespace)){k=null;break}c++}while(c<f.length);if(null!=k)break;if(null!==this.parent)return this.parent.resolve(b,a)}while(null!=k);return k};n.qn=function(b){var f=[],a=b;do f.unshift(a.name),a=a.parent;while(null!==
a);for(a=1;a<=f.length;a++){var c=f.slice(f.length-a);if(b===this.resolve(c,b instanceof r.Namespace))return c.join(".")}return b.fqn()};n.build=function(){for(var b={},k=this.children,c=0,d=k.length,g;c<d;++c)g=k[c],g instanceof a&&(b[g.name]=g.build());Object.defineProperty&&Object.defineProperty(b,"$options",{value:this.buildOpt()});return b};n.buildOpt=function(){for(var b={},a=Object.keys(this.options),c=0,d=a.length;c<d;++c)b[a[c]]=this.options[a[c]];return b};n.getOption=function(b){return"undefined"===
typeof b?this.options:"undefined"!==typeof this.options[b]?this.options[b]:null};r.Namespace=a;var g=function(f,a,c,d,g){this.type=f;this.resolvedType=a;this.isMapKey=c;this.syntax=d;this.name=g;if(c&&0>b.MAP_KEY_TYPES.indexOf(f))throw Error("Invalid map key type: "+f.name);},h=g.prototype;g.defaultFieldValue=function(f){"string"===typeof f&&(f=b.TYPES[f]);if("undefined"===typeof f.defaultValue)throw Error("default value for type "+f.name+" is not supported");return f==b.TYPES.bytes?new e(0):f.defaultValue};
h.toString=function(){return(this.name||"")+(this.isMapKey?"map":"value")+" element"};h.verifyValue=function(f){function a(b,f){throw Error("Illegal value for "+c.toString(!0)+" of type "+c.type.name+": "+b+" ("+f+")");}var c=this;switch(this.type){case b.TYPES.int32:case b.TYPES.sint32:case b.TYPES.sfixed32:return("number"!==typeof f||f===f&&0!==f%1)&&a(typeof f,"not an integer"),4294967295<f?f|0:f;case b.TYPES.uint32:case b.TYPES.fixed32:return("number"!==typeof f||f===f&&0!==f%1)&&a(typeof f,"not an integer"),
0>f?f>>>0:f;case b.TYPES.int64:case b.TYPES.sint64:case b.TYPES.sfixed64:if(b.Long)try{return d(f,!1)}catch(x){a(typeof f,x.message)}else a(typeof f,"requires Long.js");case b.TYPES.uint64:case b.TYPES.fixed64:if(b.Long)try{return d(f,!0)}catch(x){a(typeof f,x.message)}else a(typeof f,"requires Long.js");case b.TYPES.bool:return"boolean"!==typeof f&&a(typeof f,"not a boolean"),f;case b.TYPES["float"]:case b.TYPES["double"]:return"number"!==typeof f&&a(typeof f,"not a number"),f;case b.TYPES.string:return"string"===
typeof f||f&&f instanceof String||a(typeof f,"not a string"),""+f;case b.TYPES.bytes:return e.isByteBuffer(f)?f:e.wrap(f,"base64");case b.TYPES["enum"]:for(var g=this.resolvedType.getChildren(b.Reflect.Enum.Value),h=0;h<g.length;h++)if(g[h].name==f||g[h].id==f)return g[h].id;if("proto3"===this.syntax)return("number"!==typeof f||f===f&&0!==f%1)&&a(typeof f,"not an integer"),(4294967295<f||0>f)&&a(typeof f,"not in range for uint32"),f;a(f,"not a valid enum value");case b.TYPES.group:case b.TYPES.message:f&&
"object"===typeof f||a(typeof f,"object expected");if(f instanceof this.resolvedType.clazz)return f;if(f instanceof b.Builder.Message){var g={},h;for(h in f)f.hasOwnProperty(h)&&(g[h]=f[h]);f=g}return new this.resolvedType.clazz(f)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+f+" (undefined type "+this.type+")");};h.calculateLength=function(f,a){if(null===a)return 0;var c;switch(this.type){case b.TYPES.int32:return 0>a?e.calculateVarint64(a):e.calculateVarint32(a);case b.TYPES.uint32:return e.calculateVarint32(a);
case b.TYPES.sint32:return e.calculateVarint32(e.zigZagEncode32(a));case b.TYPES.fixed32:case b.TYPES.sfixed32:case b.TYPES["float"]:return 4;case b.TYPES.int64:case b.TYPES.uint64:return e.calculateVarint64(a);case b.TYPES.sint64:return e.calculateVarint64(e.zigZagEncode64(a));case b.TYPES.fixed64:case b.TYPES.sfixed64:return 8;case b.TYPES.bool:return 1;case b.TYPES["enum"]:return e.calculateVarint32(a);case b.TYPES["double"]:return 8;case b.TYPES.string:return c=e.calculateUTF8Bytes(a),e.calculateVarint32(c)+
c;case b.TYPES.bytes:if(0>a.remaining())throw Error("Illegal value for "+this.toString(!0)+": "+a.remaining()+" bytes remaining");return e.calculateVarint32(a.remaining())+a.remaining();case b.TYPES.message:return c=this.resolvedType.calculate(a),e.calculateVarint32(c)+c;case b.TYPES.group:return c=this.resolvedType.calculate(a),c+e.calculateVarint32(f<<3|b.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+a+" (unknown type)");};h.encodeValue=function(f,
a,c){if(null===a)return c;switch(this.type){case b.TYPES.int32:0>a?c.writeVarint64(a):c.writeVarint32(a);break;case b.TYPES.uint32:c.writeVarint32(a);break;case b.TYPES.sint32:c.writeVarint32ZigZag(a);break;case b.TYPES.fixed32:c.writeUint32(a);break;case b.TYPES.sfixed32:c.writeInt32(a);break;case b.TYPES.int64:case b.TYPES.uint64:c.writeVarint64(a);break;case b.TYPES.sint64:c.writeVarint64ZigZag(a);break;case b.TYPES.fixed64:c.writeUint64(a);break;case b.TYPES.sfixed64:c.writeInt64(a);break;case b.TYPES.bool:"string"===
typeof a?c.writeVarint32("false"===a.toLowerCase()?0:!!a):c.writeVarint32(a?1:0);break;case b.TYPES["enum"]:c.writeVarint32(a);break;case b.TYPES["float"]:c.writeFloat32(a);break;case b.TYPES["double"]:c.writeFloat64(a);break;case b.TYPES.string:c.writeVString(a);break;case b.TYPES.bytes:if(0>a.remaining())throw Error("Illegal value for "+this.toString(!0)+": "+a.remaining()+" bytes remaining");f=a.offset;c.writeVarint32(a.remaining());c.append(a);a.offset=f;break;case b.TYPES.message:f=(new e).LE();
this.resolvedType.encode(a,f);c.writeVarint32(f.offset);c.append(f.flip());break;case b.TYPES.group:this.resolvedType.encode(a,c);c.writeVarint32(f<<3|b.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+a+" (unknown type)");}return c};h.decode=function(a,c,d){if(c!=this.type.wireType)throw Error("Unexpected wire type for element");switch(this.type){case b.TYPES.int32:return a.readVarint32()|0;case b.TYPES.uint32:return a.readVarint32()>>>
0;case b.TYPES.sint32:return a.readVarint32ZigZag()|0;case b.TYPES.fixed32:return a.readUint32()>>>0;case b.TYPES.sfixed32:return a.readInt32()|0;case b.TYPES.int64:return a.readVarint64();case b.TYPES.uint64:return a.readVarint64().toUnsigned();case b.TYPES.sint64:return a.readVarint64ZigZag();case b.TYPES.fixed64:return a.readUint64();case b.TYPES.sfixed64:return a.readInt64();case b.TYPES.bool:return!!a.readVarint32();case b.TYPES["enum"]:return a.readVarint32();case b.TYPES["float"]:return a.readFloat();
case b.TYPES["double"]:return a.readDouble();case b.TYPES.string:return a.readVString();case b.TYPES.bytes:d=a.readVarint32();if(a.remaining()<d)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+d+" required but got only "+a.remaining());c=a.clone();c.limit=c.offset+d;a.offset+=d;return c;case b.TYPES.message:return d=a.readVarint32(),this.resolvedType.decode(a,d);case b.TYPES.group:return this.resolvedType.decode(a,-1,d)}throw Error("[INTERNAL] Illegal decode type");};h.valueFromString=
function(a){if(!this.isMapKey)throw Error("valueFromString() called on non-map-key element");switch(this.type){case b.TYPES.int32:case b.TYPES.sint32:case b.TYPES.sfixed32:case b.TYPES.uint32:case b.TYPES.fixed32:return this.verifyValue(parseInt(a));case b.TYPES.int64:case b.TYPES.sint64:case b.TYPES.sfixed64:case b.TYPES.uint64:case b.TYPES.fixed64:return this.verifyValue(a);case b.TYPES.bool:return"true"===a;case b.TYPES.string:return this.verifyValue(a);case b.TYPES.bytes:return e.fromBinary(a)}};
h.valueToString=function(a){if(!this.isMapKey)throw Error("valueToString() called on non-map-key element");return this.type===b.TYPES.bytes?a.toString("binary"):a.toString()};r.Element=g;var l=function(b,c,d,g,e,h){a.call(this,b,c,d,g,h);this.className="Message";this.extensions=void 0;this.clazz=null;this.isGroup=!!e;this._fieldsByName=this._fieldsById=this._fields=null},h=l.prototype=Object.create(a.prototype);h.build=function(a){if(this.clazz&&!a)return this.clazz;a=function(b,a){function f(a,c,
d,g){if(null===a||"object"!==typeof a){if(g&&g instanceof b.Reflect.Enum){var k=b.Reflect.Enum.getName(g.object,a);if(null!==k)return k}return a}if(e.isByteBuffer(a))return c?a.toBase64():a.toBuffer();if(b.Long.isLong(a))return d?a.toString():b.Long.fromValue(a);var h;if(Array.isArray(a))return h=[],a.forEach(function(b,a){h[a]=f(b,c,d,g)}),h;h={};if(a instanceof b.Map){for(var k=a.entries(),q=k.next();!q.done;q=k.next())h[a.keyElem.valueToString(q.value[0])]=f(q.value[1],c,d,a.valueElem.resolvedType);
return h}var k=a.$type,q=void 0,l;for(l in a)a.hasOwnProperty(l)&&(k&&(q=k.getChild(l))?h[l]=f(a[l],c,d,q.resolvedType):h[l]=f(a[l],c,d));return h}var c=a.getChildren(b.Reflect.Message.Field),d=a.getChildren(b.Reflect.Message.OneOf),g=function(f,k){b.Builder.Message.call(this);for(var h=0,q=d.length;h<q;++h)this[d[h].name]=null;h=0;for(q=c.length;h<q;++h){var l=c[h];this[l.name]=l.repeated?[]:l.map?new b.Map(l):null;!l.required&&"proto3"!==a.syntax||null===l.defaultValue||(this[l.name]=l.defaultValue)}if(0<
arguments.length)if(1!==arguments.length||null===f||"object"!==typeof f||!("function"!==typeof f.encode||f instanceof g)||Array.isArray(f)||f instanceof b.Map||e.isByteBuffer(f)||f instanceof ArrayBuffer||b.Long&&f instanceof b.Long)for(h=0,q=arguments.length;h<q;++h)"undefined"!==typeof(l=arguments[h])&&this.$set(c[h].name,l);else this.$set(f)},k=g.prototype=Object.create(b.Builder.Message.prototype);k.add=function(f,c,d){var g=a._fieldsByName[f];if(!d){if(!g)throw Error(this+"#"+f+" is undefined");
if(!(g instanceof b.Reflect.Message.Field))throw Error(this+"#"+f+" is not a field: "+g.toString(!0));if(!g.repeated)throw Error(this+"#"+f+" is not a repeated field");c=g.verifyValue(c,!0)}null===this[f]&&(this[f]=[]);this[f].push(c);return this};k.$add=k.add;k.set=function(f,c,d){if(f&&"object"===typeof f){d=c;for(var g in f)f.hasOwnProperty(g)&&"undefined"!==typeof(c=f[g])&&void 0===a._oneofsByName[g]&&this.$set(g,c,d);return this}g=a._fieldsByName[f];if(d)this[f]=c;else{if(!g)throw Error(this+
"#"+f+" is not a field: undefined");if(!(g instanceof b.Reflect.Message.Field))throw Error(this+"#"+f+" is not a field: "+g.toString(!0));this[g.name]=c=g.verifyValue(c)}g&&g.oneof&&(d=this[g.oneof.name],null!==c?(null!==d&&d!==g.name&&(this[d]=null),this[g.oneof.name]=g.name):d===f&&(this[g.oneof.name]=null));return this};k.$set=k.set;k.get=function(f,c){if(c)return this[f];var d=a._fieldsByName[f];if(!(d&&d instanceof b.Reflect.Message.Field))throw Error(this+"#"+f+" is not a field: undefined");
if(!(d instanceof b.Reflect.Message.Field))throw Error(this+"#"+f+" is not a field: "+d.toString(!0));return this[d.name]};k.$get=k.get;for(var h=0;h<c.length;h++){var l=c[h];l instanceof b.Reflect.Message.ExtensionField||a.builder.options.populateAccessors&&function(b){var f=b.originalName.replace(/(_[a-zA-Z])/g,function(b){return b.toUpperCase().replace("_","")}),f=f.substring(0,1).toUpperCase()+f.substring(1),c=b.originalName.replace(/([A-Z])/g,function(b){return"_"+b}),d=function(a,f){this[b.name]=
f?a:b.verifyValue(a);return this},g=function(){return this[b.name]};null===a.getChild("set"+f)&&(k["set"+f]=d);null===a.getChild("set_"+c)&&(k["set_"+c]=d);null===a.getChild("get"+f)&&(k["get"+f]=g);null===a.getChild("get_"+c)&&(k["get_"+c]=g)}(l)}k.encode=function(b,f){"boolean"===typeof b&&(f=b,b=void 0);var c=!1;b||(b=new e,c=!0);var d=b.littleEndian;try{return a.encode(this,b.LE(),f),(c?b.flip():b).LE(d)}catch(A){throw b.LE(d),A;}};g.encode=function(b,a,f){return(new g(b)).encode(a,f)};k.calculate=
function(){return a.calculate(this)};k.encodeDelimited=function(b,f){var c=!1;b||(b=new e,c=!0);var d=(new e).LE();a.encode(this,d,f).flip();b.writeVarint32(d.remaining());b.append(d);return c?b.flip():b};k.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(q){throw q.encoded&&(q.encoded=q.encoded.toArrayBuffer()),q;}};k.toArrayBuffer=k.encodeAB;k.encodeNB=function(){try{return this.encode().toBuffer()}catch(q){throw q.encoded&&(q.encoded=q.encoded.toBuffer()),q;}};k.toBuffer=k.encodeNB;
k.encode64=function(){try{return this.encode().toBase64()}catch(q){throw q.encoded&&(q.encoded=q.encoded.toBase64()),q;}};k.toBase64=k.encode64;k.encodeHex=function(){try{return this.encode().toHex()}catch(q){throw q.encoded&&(q.encoded=q.encoded.toHex()),q;}};k.toHex=k.encodeHex;k.toRaw=function(b,a){return f(this,!!b,!!a,this.$type)};k.encodeJSON=function(){return JSON.stringify(f(this,!0,!0,this.$type))};g.decode=function(b,f,c){"string"===typeof f&&(c=f,f=-1);"string"===typeof b?b=e.wrap(b,c?
c:"base64"):e.isByteBuffer(b)||(b=e.wrap(b));c=b.littleEndian;try{var d=a.decode(b.LE(),f);b.LE(c);return d}catch(A){throw b.LE(c),A;}};g.decodeDelimited=function(b,f){"string"===typeof b?b=e.wrap(b,f?f:"base64"):e.isByteBuffer(b)||(b=e.wrap(b));if(1>b.remaining())return null;var c=b.offset,d=b.readVarint32();if(b.remaining()<d)return b.offset=c,null;try{var g=a.decode(b.slice(b.offset,b.offset+d).LE());b.offset+=d;return g}catch(B){throw b.offset+=d,B;}};g.decode64=function(b){return g.decode(b,
"base64")};g.decodeHex=function(b){return g.decode(b,"hex")};g.decodeJSON=function(b){return new g(JSON.parse(b))};k.toString=function(){return a.toString()};Object.defineProperty&&(Object.defineProperty(g,"$options",{value:a.buildOpt()}),Object.defineProperty(k,"$options",{value:g.$options}),Object.defineProperty(g,"$type",{value:a}),Object.defineProperty(k,"$type",{value:a}));return g}(b,this);this._fields=[];this._fieldsById={};this._fieldsByName={};this._oneofsByName={};for(var f=0,c=this.children.length,
d;f<c;f++)if(d=this.children[f],d instanceof v||d instanceof l||d instanceof u){if(a.hasOwnProperty(d.name))throw Error("Illegal reflect child of "+this.toString(!0)+": "+d.toString(!0)+" cannot override static property '"+d.name+"'");a[d.name]=d.build()}else if(d instanceof l.Field)d.build(),this._fields.push(d),this._fieldsById[d.id]=d,this._fieldsByName[d.name]=d;else if(d instanceof l.OneOf)this._oneofsByName[d.name]=d;else if(!(d instanceof l.OneOf||d instanceof w))throw Error("Illegal reflect child of "+
this.toString(!0)+": "+this.children[f].toString(!0));return this.clazz=a};h.encode=function(b,a,c){for(var f=null,d,g=0,k=this._fields.length,h;g<k;++g)d=this._fields[g],h=b[d.name],d.required&&null===h?null===f&&(f=d):d.encode(c?h:d.verifyValue(h),a,b);if(null!==f)throw b=Error("Missing at least one required field for "+this.toString(!0)+": "+f),b.encoded=a,b;return a};h.calculate=function(b){for(var a=0,f=0,c=this._fields.length,d,g;f<c;++f){d=this._fields[f];g=b[d.name];if(d.required&&null===
g)throw Error("Missing at least one required field for "+this.toString(!0)+": "+d);a+=d.calculate(g,b)}return a};h.decode=function(a,c,d){"number"!==typeof c&&(c=-1);for(var f=a.offset,g=new this.clazz,k,h,e;a.offset<f+c||-1===c&&0<a.remaining();){k=a.readVarint32();h=k&7;e=k>>>3;if(h===b.WIRE_TYPES.ENDGROUP){if(e!==d)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+e+" ("+(d?d+" expected":"not a group")+")");break}if(k=this._fieldsById[e])k.repeated&&!k.options.packed?g[k.name].push(k.decode(h,
a)):k.map?(h=k.decode(h,a),g[k.name].set(h[0],h[1])):(g[k.name]=k.decode(h,a),k.oneof&&(h=g[k.oneof.name],null!==h&&h!==k.name&&(g[h]=null),g[k.oneof.name]=k.name));else switch(h){case b.WIRE_TYPES.VARINT:a.readVarint32();break;case b.WIRE_TYPES.BITS32:a.offset+=4;break;case b.WIRE_TYPES.BITS64:a.offset+=8;break;case b.WIRE_TYPES.LDELIM:k=a.readVarint32();a.offset+=k;break;case b.WIRE_TYPES.STARTGROUP:for(;y(e,a););break;default:throw Error("Illegal wire type for unknown field "+e+" in "+this.toString(!0)+
"#decode: "+h);}}a=0;for(c=this._fields.length;a<c;++a)if(k=this._fields[a],null===g[k.name])if("proto3"===this.syntax)g[k.name]=k.defaultValue;else{if(k.required)throw a=Error("Missing at least one required field for "+this.toString(!0)+": "+k.name),a.decoded=g,a;b.populateDefaults&&null!==k.defaultValue&&(g[k.name]=k.defaultValue)}return g};r.Message=l;var c=function(a,c,d,g,h,e,n,t,w,y){m.call(this,a,c,e);this.className="Message.Field";this.required="required"===d;this.repeated="repeated"===d;
this.map="map"===d;this.keyType=g||null;this.type=h;this.resolvedType=null;this.id=n;this.options=t||{};this.defaultValue=null;this.oneof=w||null;this.syntax=y||"proto2";this.originalName=this.name;this.keyElement=this.element=null;!this.builder.options.convertFieldsToCamelCase||this instanceof l.ExtensionField||(this.name=b.Util.toCamelCase(this.name))},h=c.prototype=Object.create(m.prototype);h.build=function(){this.element=new g(this.type,this.resolvedType,!1,this.syntax,this.name);this.map&&(this.keyElement=
new g(this.keyType,void 0,!0,this.syntax,this.name));"proto3"!==this.syntax||this.repeated||this.map?"undefined"!==typeof this.options["default"]&&(this.defaultValue=this.verifyValue(this.options["default"])):this.defaultValue=g.defaultFieldValue(this.type)};h.verifyValue=function(a,c){function f(b,a){throw Error("Illegal value for "+d.toString(!0)+" of type "+d.type.name+": "+b+" ("+a+")");}c=c||!1;var d=this;if(null===a)return this.required&&f(typeof a,"required"),"proto3"===this.syntax&&this.type!==
b.TYPES.message&&f(typeof a,"proto3 field without field presence cannot be null"),null;var g;if(this.repeated&&!c){Array.isArray(a)||(a=[a]);var k=[];for(g=0;g<a.length;g++)k.push(this.element.verifyValue(a[g]));return k}if(this.map&&!c){if(a instanceof b.Map)return a;a instanceof Object||f(typeof a,"expected ProtoBuf.Map or raw object for map field");return new b.Map(this,a)}!this.repeated&&Array.isArray(a)&&f(typeof a,"no array expected");return this.element.verifyValue(a)};h.hasWirePresence=function(a,
c){if("proto3"!==this.syntax)return null!==a;if(this.oneof&&c[this.oneof.name]===this.name)return!0;switch(this.type){case b.TYPES.int32:case b.TYPES.sint32:case b.TYPES.sfixed32:case b.TYPES.uint32:case b.TYPES.fixed32:return 0!==a;case b.TYPES.int64:case b.TYPES.sint64:case b.TYPES.sfixed64:case b.TYPES.uint64:case b.TYPES.fixed64:return 0!==a.low||0!==a.high;case b.TYPES.bool:return a;case b.TYPES["float"]:case b.TYPES["double"]:return 0!==a;case b.TYPES.string:return 0<a.length;case b.TYPES.bytes:return 0<
a.remaining();case b.TYPES["enum"]:return 0!==a;case b.TYPES.message:return null!==a;default:return!0}};h.encode=function(a,c,d){if(null===this.type||"object"!==typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===a||this.repeated&&0==a.length)return c;try{if(this.repeated){var f;if(this.options.packed&&0<=b.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)){c.writeVarint32(this.id<<3|b.WIRE_TYPES.LDELIM);c.ensureCapacity(c.offset+=1);var g=c.offset;
for(f=0;f<a.length;f++)this.element.encodeValue(this.id,a[f],c);var h=c.offset-g,k=e.calculateVarint32(h);if(1<k){var l=c.slice(g,c.offset),g=g+(k-1);c.offset=g;c.append(l)}c.writeVarint32(h,g-k)}else for(f=0;f<a.length;f++)c.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,a[f],c)}else this.map?a.forEach(function(a,d,f){f=e.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,d)+e.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,
a);c.writeVarint32(this.id<<3|b.WIRE_TYPES.LDELIM);c.writeVarint32(f);c.writeVarint32(8|this.keyType.wireType);this.keyElement.encodeValue(1,d,c);c.writeVarint32(16|this.type.wireType);this.element.encodeValue(2,a,c)},this):this.hasWirePresence(a,d)&&(c.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,a,c))}catch(C){throw Error("Illegal value for "+this.toString(!0)+": "+a+" ("+C+")");}return c};h.calculate=function(a,c){a=this.verifyValue(a);if(null===this.type||"object"!==
typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===a||this.repeated&&0==a.length)return 0;var d=0;try{if(this.repeated){var f,g;if(this.options.packed&&0<=b.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)){d+=e.calculateVarint32(this.id<<3|b.WIRE_TYPES.LDELIM);for(f=g=0;f<a.length;f++)g+=this.element.calculateLength(this.id,a[f]);d+=e.calculateVarint32(g);d+=g}else for(f=0;f<a.length;f++)d+=e.calculateVarint32(this.id<<3|this.type.wireType),d+=
this.element.calculateLength(this.id,a[f])}else this.map?a.forEach(function(a,c,f){a=e.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,c)+e.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,a);d+=e.calculateVarint32(this.id<<3|b.WIRE_TYPES.LDELIM);d+=e.calculateVarint32(a);d+=a},this):this.hasWirePresence(a,c)&&(d+=e.calculateVarint32(this.id<<3|this.type.wireType),d+=this.element.calculateLength(this.id,a))}catch(x){throw Error("Illegal value for "+
this.toString(!0)+": "+a+" ("+x+")");}return d};h.decode=function(a,c,d){if(!(!this.map&&a==this.type.wireType||!d&&this.repeated&&this.options.packed&&a==b.WIRE_TYPES.LDELIM||this.map&&a==b.WIRE_TYPES.LDELIM))throw Error("Illegal wire type for field "+this.toString(!0)+": "+a+" ("+this.type.wireType+" expected)");if(a==b.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&0<=b.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)&&!d){a=c.readVarint32();a=c.offset+a;for(d=[];c.offset<a;)d.push(this.decode(this.type.wireType,
c,!0));return d}if(this.map){var f=g.defaultFieldValue(this.keyType);d=g.defaultFieldValue(this.type);a=c.readVarint32();if(c.remaining()<a)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+a+" required but got only "+c.remaining());var h=c.clone();h.limit=h.offset+a;for(c.offset+=a;0<h.remaining();)if(c=h.readVarint32(),a=c&7,c>>>=3,1===c)f=this.keyElement.decode(h,a,c);else if(2===c)d=this.element.decode(h,a,c);else throw Error("Unexpected tag in map field key/value submessage");
return[f,d]}return this.element.decode(c,a,this.id)};r.Message.Field=c;h=function(a,b,d,g,h,e,l){c.call(this,a,b,d,null,g,h,e,l)};h.prototype=Object.create(c.prototype);r.Message.ExtensionField=h;r.Message.OneOf=function(a,b,c){m.call(this,a,b,c);this.fields=[]};var v=function(b,c,d,g,h){a.call(this,b,c,d,g,h);this.className="Enum";this.object=null};v.getName=function(a,b){for(var c=Object.keys(a),d=0,g;d<c.length;++d)if(a[g=c[d]]===b)return g;return null};(v.prototype=Object.create(a.prototype)).build=
function(a){if(this.object&&!a)return this.object;a=new b.Builder.Enum;for(var c=this.getChildren(v.Value),d=0,g=c.length;d<g;++d)a[c[d].name]=c[d].id;Object.defineProperty&&Object.defineProperty(a,"$options",{value:this.buildOpt(),enumerable:!1});return this.object=a};r.Enum=v;h=function(a,b,c,d){m.call(this,a,b,c);this.className="Enum.Value";this.id=d};h.prototype=Object.create(m.prototype);r.Enum.Value=h;var w=function(a,b,c,d){m.call(this,a,b,c);this.field=d};w.prototype=Object.create(m.prototype);
r.Extension=w;var u=function(b,c,d,g){a.call(this,b,c,d,g);this.className="Service";this.clazz=null};(u.prototype=Object.create(a.prototype)).build=function(a){return this.clazz&&!a?this.clazz:this.clazz=function(a,b){for(var c=function(b){a.Builder.Service.call(this);this.rpcImpl=b||function(a,b,c){setTimeout(c.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}},d=c.prototype=Object.create(a.Builder.Service.prototype),g=b.getChildren(a.Reflect.Service.RPCMethod),
f=0;f<g.length;f++)(function(a){d[a.name]=function(c,d){try{try{c=a.resolvedRequestType.clazz.decode(e.wrap(c))}catch(z){if(!(z instanceof TypeError))throw z;}if(null===c||"object"!==typeof c)throw Error("Illegal arguments");c instanceof a.resolvedRequestType.clazz||(c=new a.resolvedRequestType.clazz(c));this.rpcImpl(a.fqn(),c,function(c,g){if(c)d(c);else{null===g&&(g="");try{g=a.resolvedResponseType.clazz.decode(g)}catch(D){}g&&g instanceof a.resolvedResponseType.clazz?d(null,g):d(Error("Illegal response type received in service method "+
b.name+"#"+a.name))}})}catch(z){setTimeout(d.bind(this,z),0)}};c[a.name]=function(b,d,g){(new c(b))[a.name](d,g)};Object.defineProperty&&(Object.defineProperty(c[a.name],"$options",{value:a.buildOpt()}),Object.defineProperty(d[a.name],"$options",{value:c[a.name].$options}))})(g[f]);Object.defineProperty&&(Object.defineProperty(c,"$options",{value:b.buildOpt()}),Object.defineProperty(d,"$options",{value:c.$options}),Object.defineProperty(c,"$type",{value:b}),Object.defineProperty(d,"$type",{value:b}));
return c}(b,this)};r.Service=u;var p=function(a,b,c,d){m.call(this,a,b,c);this.className="Service.Method";this.options=d||{}};(p.prototype=Object.create(m.prototype)).buildOpt=n.buildOpt;r.Service.Method=p;n=function(a,b,c,d,g,h,e,l){p.call(this,a,b,c,l);this.className="Service.RPCMethod";this.requestName=d;this.responseName=g;this.requestStream=h;this.responseStream=e;this.resolvedResponseType=this.resolvedRequestType=null};n.prototype=Object.create(p.prototype);r.Service.RPCMethod=n;return r}(d);
d.Builder=function(b,d,e){function t(a){a.messages&&a.messages.forEach(function(b){b.syntax=a.syntax;t(b)});a.enums&&a.enums.forEach(function(b){b.syntax=a.syntax})}var m=function(a){this.ptr=this.ns=new e.Namespace(this,null,"");this.resolved=!1;this.result=null;this.files={};this.importRoot=null;this.options=a||{}},n=m.prototype;m.isMessage=function(a){return"string"!==typeof a.name||"undefined"!==typeof a.values||"undefined"!==typeof a.rpc?!1:!0};m.isMessageField=function(a){return"string"!==typeof a.rule||
"string"!==typeof a.name||"string"!==typeof a.type||"undefined"===typeof a.id?!1:!0};m.isEnum=function(a){return"string"===typeof a.name&&"undefined"!==typeof a.values&&Array.isArray(a.values)&&0!==a.values.length?!0:!1};m.isService=function(a){return"string"===typeof a.name&&"object"===typeof a.rpc&&a.rpc?!0:!1};m.isExtend=function(a){return"string"!==typeof a.ref?!1:!0};n.reset=function(){this.ptr=this.ns;return this};n.define=function(a){if("string"!==typeof a||!d.TYPEREF.test(a))throw Error("illegal namespace: "+
a);a.split(".").forEach(function(a){var b=this.ptr.getChild(a);null===b&&this.ptr.addChild(b=new e.Namespace(this,this.ptr,a));this.ptr=b},this);return this};n.create=function(a){if(!a)return this;if(Array.isArray(a)){if(0===a.length)return this;a=a.slice()}else a=[a];for(var d=[a];0<d.length;){a=d.pop();if(!Array.isArray(a))throw Error("not a valid namespace: "+JSON.stringify(a));for(;0<a.length;){var h=a.shift();if(m.isMessage(h)){var l=new e.Message(this,this.ptr,h.name,h.options,h.isGroup,h.syntax),
c={};h.oneofs&&Object.keys(h.oneofs).forEach(function(a){l.addChild(c[a]=new e.Message.OneOf(this,l,a))},this);h.fields&&h.fields.forEach(function(a){if(null!==l.getChild(a.id|0))throw Error("duplicate or invalid field id in "+l.name+": "+a.id);if(a.options&&"object"!==typeof a.options)throw Error("illegal field options in "+l.name+"#"+a.name);var b=null;if("string"===typeof a.oneof&&!(b=c[a.oneof]))throw Error("illegal oneof in "+l.name+"#"+a.name+": "+a.oneof);a=new e.Message.Field(this,l,a.rule,
a.keytype,a.type,a.name,a.id,a.options,b,h.syntax);b&&b.fields.push(a);l.addChild(a)},this);var n=[];h.enums&&h.enums.forEach(function(a){n.push(a)});h.messages&&h.messages.forEach(function(a){n.push(a)});h.services&&h.services.forEach(function(a){n.push(a)});h.extensions&&(l.extensions="number"===typeof h.extensions[0]?[h.extensions]:h.extensions);this.ptr.addChild(l);if(0<n.length){d.push(a);a=n;n=null;this.ptr=l;l=null;continue}n=null}else if(m.isEnum(h))l=new e.Enum(this,this.ptr,h.name,h.options,
h.syntax),h.values.forEach(function(a){l.addChild(new e.Enum.Value(this,l,a.name,a.id))},this),this.ptr.addChild(l);else if(m.isService(h))l=new e.Service(this,this.ptr,h.name,h.options),Object.keys(h.rpc).forEach(function(a){var b=h.rpc[a];l.addChild(new e.Service.RPCMethod(this,l,a,b.request,b.response,!!b.request_stream,!!b.response_stream,b.options))},this),this.ptr.addChild(l);else if(m.isExtend(h))if(l=this.ptr.resolve(h.ref,!0))h.fields.forEach(function(a){if(null!==l.getChild(a.id|0))throw Error("duplicate extended field id in "+
l.name+": "+a.id);if(l.extensions){var c=!1;l.extensions.forEach(function(b){a.id>=b[0]&&a.id<=b[1]&&(c=!0)});if(!c)throw Error("illegal extended field id in "+l.name+": "+a.id+" (not within valid ranges)");}var d=a.name;this.options.convertFieldsToCamelCase&&(d=b.Util.toCamelCase(d));var d=new e.Message.ExtensionField(this,l,a.rule,a.type,this.ptr.fqn()+"."+d,a.id,a.options),g=new e.Extension(this,this.ptr,a.name,d);d.extension=g;this.ptr.addChild(g);l.addChild(d)},this);else{if(!/\.?google\.protobuf\./.test(h.ref))throw Error("extended message "+
h.ref+" is not defined");}else throw Error("not a valid definition: "+JSON.stringify(h));l=h=null}a=null;this.ptr=this.ptr.parent}this.resolved=!1;this.result=null;return this};n["import"]=function(a,d){var g="/";if("string"===typeof d){b.Util.IS_NODE&&(d=require("path").resolve(d));if(!0===this.files[d])return this.reset();this.files[d]=!0}else if("object"===typeof d){var e=d.root;b.Util.IS_NODE&&(e=require("path").resolve(e));if(0<=e.indexOf("\\")||0<=d.file.indexOf("\\"))g="\\";e=b.Util.IS_NODE?
require("path").join(e,d.file):e+g+d.file;if(!0===this.files[e])return this.reset();this.files[e]=!0}if(a.imports&&0<a.imports.length){var c=!1;if("object"===typeof d){if(this.importRoot=d.root,c=!0,e=this.importRoot,d=d.file,0<=e.indexOf("\\")||0<=d.indexOf("\\"))g="\\"}else"string"===typeof d?this.importRoot?e=this.importRoot:0<=d.indexOf("/")?(e=d.replace(/\/[^\/]*$/,""),""===e&&(e="/")):0<=d.indexOf("\\")?(e=d.replace(/\\[^\\]*$/,""),g="\\"):e=".":e=null;for(var n=0;n<a.imports.length;n++)if("string"===
typeof a.imports[n]){if(!e)throw Error("cannot determine import root");var m=a.imports[n];if("google/protobuf/descriptor.proto"!==m&&(m=b.Util.IS_NODE?require("path").join(e,m):e+g+m,!0!==this.files[m])){/\.proto$/i.test(m)&&!b.DotProto&&(m=m.replace(/\.proto$/,".json"));var r=b.Util.fetch(m);if(null===r)throw Error("failed to import '"+m+"' in '"+d+"': file not found");if(/\.json$/i.test(m))this["import"](JSON.parse(r+""),m);else this["import"](b.DotProto.Parser.parse(r),m)}}else if(d)if(/\.(\w+)$/.test(d))this["import"](a.imports[n],
d.replace(/^(.+)\.(\w+)$/,function(a,b,c){return b+"_import"+n+"."+c}));else this["import"](a.imports[n],d+"_import"+n);else this["import"](a.imports[n]);c&&(this.importRoot=null)}a["package"]&&this.define(a["package"]);a.syntax&&t(a);var p=this.ptr;a.options&&Object.keys(a.options).forEach(function(b){p.options[b]=a.options[b]});a.messages&&(this.create(a.messages),this.ptr=p);a.enums&&(this.create(a.enums),this.ptr=p);a.services&&(this.create(a.services),this.ptr=p);a["extends"]&&this.create(a["extends"]);
return this.reset()};n.resolveAll=function(){var a;if(null==this.ptr||"object"===typeof this.ptr.type)return this;if(this.ptr instanceof e.Namespace)this.ptr.children.forEach(function(a){this.ptr=a;this.resolveAll()},this);else if(this.ptr instanceof e.Message.Field){if(d.TYPE.test(this.ptr.type))this.ptr.type=b.TYPES[this.ptr.type];else{if(!d.TYPEREF.test(this.ptr.type))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);a=(this.ptr instanceof e.Message.ExtensionField?
this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0);if(!a)throw Error("unresolvable type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.resolvedType=a;if(a instanceof e.Enum){if(this.ptr.type=b.TYPES["enum"],"proto3"===this.ptr.syntax&&"proto3"!==a.syntax)throw Error("proto3 message cannot reference proto2 enum");}else if(a instanceof e.Message)this.ptr.type=a.isGroup?b.TYPES.group:b.TYPES.message;else throw Error("illegal type reference in "+this.ptr.toString(!0)+
": "+this.ptr.type);}if(this.ptr.map){if(!d.TYPE.test(this.ptr.keyType))throw Error("illegal key type for map field in "+this.ptr.toString(!0)+": "+this.ptr.keyType);this.ptr.keyType=b.TYPES[this.ptr.keyType]}"proto3"===this.ptr.syntax&&this.ptr.repeated&&void 0===this.ptr.options.packed&&-1!==b.PACKABLE_WIRE_TYPES.indexOf(this.ptr.type.wireType)&&(this.ptr.options.packed=!0)}else if(this.ptr instanceof b.Reflect.Service.Method)if(this.ptr instanceof b.Reflect.Service.RPCMethod){a=this.ptr.parent.resolve(this.ptr.requestName,
!0);if(!(a&&a instanceof b.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);this.ptr.resolvedRequestType=a;a=this.ptr.parent.resolve(this.ptr.responseName,!0);if(!(a&&a instanceof b.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=a}else throw Error("illegal service type in "+this.ptr.toString(!0));else if(!(this.ptr instanceof b.Reflect.Message.OneOf||
this.ptr instanceof b.Reflect.Extension||this.ptr instanceof b.Reflect.Enum.Value))throw Error("illegal object in namespace: "+typeof this.ptr+": "+this.ptr);return this.reset()};n.build=function(a){this.reset();this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null);null===this.result&&(this.result=this.ns.build());if(!a)return this.result;a="string"===typeof a?a.split("."):a;for(var b=this.result,d=0;d<a.length;d++)if(b[a[d]])b=b[a[d]];else{b=null;break}return b};n.lookup=function(a,
b){return a?this.ns.resolve(a,b):this.ns};n.toString=function(){return"Builder"};m.Message=function(){};m.Enum=function(){};m.Service=function(){};return m}(d,d.Lang,d.Reflect);d.Map=function(b,d){function e(b){var a=0;return{next:function(){return a<b.length?{done:!1,value:b[a++]}:{done:!0}}}}var t=function(b,a){if(!b.map)throw Error("field is not a map");this.field=b;this.keyElem=new d.Element(b.keyType,null,!0,b.syntax);this.valueElem=new d.Element(b.type,b.resolvedType,!1,b.syntax);this.map={};
Object.defineProperty(this,"size",{get:function(){return Object.keys(this.map).length}});if(a)for(var g=Object.keys(a),e=0;e<g.length;e++){var l=this.keyElem.valueFromString(g[e]),c=this.valueElem.verifyValue(a[g[e]]);this.map[this.keyElem.valueToString(l)]={key:l,value:c}}},m=t.prototype;m.clear=function(){this.map={}};m["delete"]=function(b){b=this.keyElem.valueToString(this.keyElem.verifyValue(b));var a=b in this.map;delete this.map[b];return a};m.entries=function(){for(var b=[],a=Object.keys(this.map),
d=0,h;d<a.length;d++)b.push([(h=this.map[a[d]]).key,h.value]);return e(b)};m.keys=function(){for(var b=[],a=Object.keys(this.map),d=0;d<a.length;d++)b.push(this.map[a[d]].key);return e(b)};m.values=function(){for(var b=[],a=Object.keys(this.map),d=0;d<a.length;d++)b.push(this.map[a[d]].value);return e(b)};m.forEach=function(b,a){for(var d=Object.keys(this.map),e=0,l;e<d.length;e++)b.call(a,(l=this.map[d[e]]).value,l.key,this)};m.set=function(b,a){var d=this.keyElem.verifyValue(b),e=this.valueElem.verifyValue(a);
this.map[this.keyElem.valueToString(d)]={key:d,value:e};return this};m.get=function(b){b=this.keyElem.valueToString(this.keyElem.verifyValue(b));if(b in this.map)return this.map[b].value};m.has=function(b){return this.keyElem.valueToString(this.keyElem.verifyValue(b))in this.map};return t}(d,d.Reflect);d.loadProto=function(b,e,p){if("string"===typeof e||e&&"string"===typeof e.file&&"string"===typeof e.root)p=e,e=void 0;return d.loadJson(d.DotProto.Parser.parse(b),e,p)};d.protoFromString=d.loadProto;
d.loadProtoFile=function(b,e,p){e&&"object"===typeof e?(p=e,e=null):e&&"function"===typeof e||(e=null);if(e)return d.Util.fetch("string"===typeof b?b:b.root+"/"+b.file,function(m){if(null===m)e(Error("Failed to fetch file"));else try{e(null,d.loadProto(m,p,b))}catch(n){e(n)}});var t=d.Util.fetch("object"===typeof b?b.root+"/"+b.file:b);return null===t?null:d.loadProto(t,p,b)};d.protoFromFile=d.loadProtoFile;d.newBuilder=function(b){b=b||{};"undefined"===typeof b.convertFieldsToCamelCase&&(b.convertFieldsToCamelCase=
d.convertFieldsToCamelCase);"undefined"===typeof b.populateAccessors&&(b.populateAccessors=d.populateAccessors);return new d.Builder(b)};d.loadJson=function(b,e,p){if("string"===typeof e||e&&"string"===typeof e.file&&"string"===typeof e.root)p=e,e=null;e&&"object"===typeof e||(e=d.newBuilder());"string"===typeof b&&(b=JSON.parse(b));e["import"](b,p);e.resolveAll();return e};d.loadJsonFile=function(b,e,p){e&&"object"===typeof e?(p=e,e=null):e&&"function"===typeof e||(e=null);if(e)return d.Util.fetch("string"===
typeof b?b:b.root+"/"+b.file,function(m){if(null===m)e(Error("Failed to fetch file"));else try{e(null,d.loadJson(JSON.parse(m),p,b))}catch(n){e(n)}});var r=d.Util.fetch("object"===typeof b?b.root+"/"+b.file:b);return null===r?null:d.loadJson(JSON.parse(r),p,b)};return d});

BIN
node_modules/protobufjs/dist/protobuf.min.js.gz generated vendored Normal file

Binary file not shown.

8
node_modules/protobufjs/dist/protobuf.min.map generated vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,961 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: Service</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: Service</h1>
<section>
<header>
<h2>
<span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Builder.html">.Builder</a>.</span>
Service
</h2>
<div class="class-description"><p>Barebone of all runtime services.</p></div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="Service"><span class="type-signature"></span>new Service<span class="signature">(rpcImpl<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Constructs a new runtime Service.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>rpcImpl</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>RPC implementation receiving the method name and the message</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4005">line 4005</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<dl>
<dt>
<div class="param-desc">
<p>If the service cannot be created</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Error</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id=".$options"><span class="type-signature">(static) </span>$options<span class="type-signature"> :Object.&lt;string, *></span></h4>
<div class="description">
<p>Service options.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object.&lt;string, *></span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4108">line 4108</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".$type"><span class="type-signature">(static, non-null) </span>$type<span class="type-signature"> :<a href="ProtoBuf.Reflect.Service.html">ProtoBuf.Reflect.Service</a></span></h4>
<div class="description">
<p>Reflection type.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type"><a href="ProtoBuf.Reflect.Service.html">ProtoBuf.Reflect.Service</a></span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4124">line 4124</a>
</li></ul></dd>
</dl>
<h4 class="name" id="$options"><span class="type-signature"></span>$options<span class="type-signature"> :Object.&lt;string, *></span></h4>
<div class="description">
<p>Service options.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object.&lt;string, *></span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4116">line 4116</a>
</li></ul></dd>
</dl>
<h4 class="name" id="$type"><span class="type-signature">(non-null) </span>$type<span class="type-signature"> :<a href="ProtoBuf.Reflect.Service.html">ProtoBuf.Reflect.Service</a></span></h4>
<div class="description">
<p>Reflection type.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type"><a href="ProtoBuf.Reflect.Service.html">ProtoBuf.Reflect.Service</a></span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4132">line 4132</a>
</li></ul></dd>
</dl>
<h4 class="name" id="rpcImpl"><span class="type-signature">(non-null) </span>rpcImpl<span class="type-signature"> :function</span></h4>
<div class="description">
<p>Service implementation.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">function</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4016">line 4016</a>
</li></ul></dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".%5BMethod%5D"><span class="type-signature">(abstract, static) </span>[Method]<span class="signature">(rpcImpl<span class="signature-attributes">non-null</span>, req, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Asynchronously performs an RPC call using the given RPC implementation.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>rpcImpl</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"><p>RPC implementation</p></td>
</tr>
<tr>
<td class="name"><code>req</code></td>
<td class="type">
<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
</td>
<td class="description last"><p>Request</p></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"><p>Callback receiving
the error if any and the response either as a pre-parsed message or as its raw bytes</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4036">line 4036</a>
</li></ul></dd>
</dl>
<h4 class="name" id="%5BMethod%5D"><span class="type-signature">(abstract) </span>[Method]<span class="signature">(req, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Asynchronously performs an RPC call using the instance's RPC implementation.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>req</code></td>
<td class="type">
<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
</td>
<td class="description last"><p>Request</p></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"><p>Callback receiving
the error if any and the response either as a pre-parsed message or as its raw bytes</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4047">line 4047</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

2800
node_modules/protobufjs/docs/ProtoBuf.Builder.html generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,729 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: Parser</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: Parser</h1>
<section>
<header>
<h2>
<span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.DotProto.html">.DotProto</a>.</span>
Parser
</h2>
<div class="class-description"><p>prototype parser</p></div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="Parser"><span class="type-signature"></span>new Parser<span class="signature">(source)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Constructs a new Parser.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>source</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Source</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line688">line 688</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id="proto3"><span class="type-signature"></span>proto3<span class="type-signature"> :boolean</span></h4>
<div class="description">
<p>Whether parsing proto3 or not.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">boolean</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line701">line 701</a>
</li></ul></dd>
</dl>
<h4 class="name" id="tn"><span class="type-signature">(non-null) </span>tn<span class="type-signature"> :<a href="ProtoBuf.DotProto.Tokenizer.html">ProtoBuf.DotProto.Tokenizer</a></span></h4>
<div class="description">
<p>Tokenizer.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type"><a href="ProtoBuf.DotProto.Tokenizer.html">ProtoBuf.DotProto.Tokenizer</a></span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line695">line 695</a>
</li></ul></dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".parse"><span class="type-signature">(static) </span>parse<span class="signature">()</span><span class="type-signature"> &rarr; (non-null) {Object}</span></h4>
<div class="description">
<p>Parses the specified source.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line796">line 796</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<dl>
<dt>
<div class="param-desc">
<p>If the source cannot be parsed</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Error</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
<h4 class="name" id="parse"><span class="type-signature"></span>parse<span class="signature">()</span><span class="type-signature"> &rarr; (non-null) {Object}</span></h4>
<div class="description">
<p>Parses the source.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line716">line 716</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<dl>
<dt>
<div class="param-desc">
<p>If the source cannot be parsed</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Error</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
<h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
<div class="description">
<p>Returns a string representation of this parser.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1373">line 1373</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

File diff suppressed because it is too large Load Diff

144
node_modules/protobufjs/docs/ProtoBuf.DotProto.html generated vendored Normal file
View File

@ -0,0 +1,144 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Namespace: DotProto</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Namespace: DotProto</h1>
<section>
<header>
<h2>
<span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a>.</span>
DotProto
</h2>
</header>
<article>
<div class="container-overview">
<div class="description"><p>Utilities to parse .proto files.</p></div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line486">line 486</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Classes</h3>
<dl>
<dt><a href="ProtoBuf.DotProto.Parser.html">Parser</a></dt>
<dd></dd>
<dt><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></dt>
<dd></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

555
node_modules/protobufjs/docs/ProtoBuf.Element.html generated vendored Normal file
View File

@ -0,0 +1,555 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: Element</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: Element</h1>
<section>
<header>
<h2>
<span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a>.</span>
Element
</h2>
</header>
<article>
<div class="container-overview">
<dt>
<h4 class="name" id="Element"><span class="type-signature"></span>new Element<span class="signature">(type, resolvedType, isMapKey, syntax)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Constructs a new Element implementation that checks and converts values for a
particular field type, as appropriate.</p>
<p>An Element represents a single value: either the value of a singular field,
or a value contained in one entry of a repeated field or map field. This
class does not implement these higher-level concepts; it only encapsulates
the low-level typechecking and conversion.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type"><a href="Object.html">Object</a></span>
</td>
<td class="description last"><p>Resolved data type</p></td>
</tr>
<tr>
<td class="name"><code>resolvedType</code></td>
<td class="type">
<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
|
<span class="param-type">null</span>
</td>
<td class="description last"><p>Resolved type, if relevant
(e.g. submessage field).</p></td>
</tr>
<tr>
<td class="name"><code>isMapKey</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>Is this element a Map key? The value will be
converted to string form if so.</p></td>
</tr>
<tr>
<td class="name"><code>syntax</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Syntax level of defining message type, e.g.,
proto2 or proto3.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ProtoBuf.js.html">ProtoBuf.js</a>, <a href="ProtoBuf.js.html#line3754">line 3754</a>
</li></ul></dd>
</dl>
</dd>
</div>
<h3 class="subsection-title">Members</h3>
<dl>
<dt>
<h4 class="name" id="isMapKey"><span class="type-signature"></span>isMapKey<span class="type-signature"> :boolean</span></h4>
</dt>
<dd>
<div class="description">
<p>Element is a map key.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">boolean</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ProtoBuf.js.html">ProtoBuf.js</a>, <a href="ProtoBuf.js.html#line3771">line 3771</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="resolvedType"><span class="type-signature"></span>resolvedType<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>|null</span></h4>
</dt>
<dd>
<div class="description">
<p>Element type reference to submessage or enum definition, if needed.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
|
<span class="param-type">null</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ProtoBuf.js.html">ProtoBuf.js</a>, <a href="ProtoBuf.js.html#line3765">line 3765</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="syntax"><span class="type-signature"></span>syntax<span class="type-signature"> :string</span></h4>
</dt>
<dd>
<div class="description">
<p>Syntax level of defining message type, e.g., proto2 or proto3.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ProtoBuf.js.html">ProtoBuf.js</a>, <a href="ProtoBuf.js.html#line3777">line 3777</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="type"><span class="type-signature"></span>type<span class="type-signature"> :<a href="Object.html">Object</a></span></h4>
</dt>
<dd>
<div class="description">
<p>Element type, as a string (e.g., int32).</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type"><a href="Object.html">Object</a></span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ProtoBuf.js.html">ProtoBuf.js</a>, <a href="ProtoBuf.js.html#line3759">line 3759</a>
</li></ul></dd>
</dl>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Element.html">Element</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
</nav>
<br clear="both">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a> on Mon Jun 01 2015 01:15:14 GMT+0200 (Mitteleuropäische Sommerzeit)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

561
node_modules/protobufjs/docs/ProtoBuf.Map.html generated vendored Normal file
View File

@ -0,0 +1,561 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: Map</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: Map</h1>
<section>
<header>
<h2>
<span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a>.</span>
Map
</h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="Map"><span class="type-signature"></span>new Map<span class="signature">(field<span class="signature-attributes">non-null</span>, contents<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Constructs a new Map. A Map is a container that is used to implement map
fields on message objects. It closely follows the ES6 Map API; however,
it is distinct because we do not want to depend on external polyfills or
on ES6 itself.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>field</code></td>
<td class="type">
<span class="param-type">ProtoBuf.Reflect.Field</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Map field</p></td>
</tr>
<tr>
<td class="name"><code>contents</code></td>
<td class="type">
<span class="param-type">Object.&lt;string, *></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Initial contents</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4934">line 4934</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id="field"><span class="type-signature">(non-null) </span>field<span class="type-signature"> :ProtoBuf.Reflect.Field</span></h4>
<div class="description">
<p>The field corresponding to this map.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">ProtoBuf.Reflect.Field</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4942">line 4942</a>
</li></ul></dd>
</dl>
<h4 class="name" id="keyElem"><span class="type-signature">(non-null) </span>keyElem<span class="type-signature"> :<a href="ProtoBuf.Reflect.Element.html">ProtoBuf.Reflect.Element</a></span></h4>
<div class="description">
<p>Element instance corresponding to key type.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type"><a href="ProtoBuf.Reflect.Element.html">ProtoBuf.Reflect.Element</a></span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4948">line 4948</a>
</li></ul></dd>
</dl>
<h4 class="name" id="map"><span class="type-signature">(non-null) </span>map<span class="type-signature"> :Object.&lt;string, {key: *, value: *}></span></h4>
<div class="description">
<p>Internal map: stores mapping of (string form of key) -&gt; (key, value)
pair.</p>
<p>We provide map semantics for arbitrary key types, but we build on top
of an Object, which has only string keys. In order to avoid the need
to convert a string key back to its native type in many situations,
we store the native key value alongside the value. Thus, we only need
a one-way mapping from a key type to its string form that guarantees
uniqueness and equality (i.e., str(K1) === str(K2) if and only if K1
=== K2).</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object.&lt;string, {key: *, value: *}></span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4970">line 4970</a>
</li></ul></dd>
</dl>
<h4 class="name" id="valueElem"><span class="type-signature">(non-null) </span>valueElem<span class="type-signature"> :<a href="ProtoBuf.Reflect.Element.html">ProtoBuf.Reflect.Element</a></span></h4>
<div class="description">
<p>Element instance corresponding to value type.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type"><a href="ProtoBuf.Reflect.Element.html">ProtoBuf.Reflect.Element</a></span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4954">line 4954</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

View File

@ -0,0 +1,846 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: Element</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: Element</h1>
<section>
<header>
<h2>
<span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a>.</span>
Element
</h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="Element"><span class="type-signature"></span>new Element<span class="signature">(type, resolvedType, isMapKey, syntax, name)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Constructs a new Element implementation that checks and converts values for a
particular field type, as appropriate.</p>
<p>An Element represents a single value: either the value of a singular field,
or a value contained in one entry of a repeated field or map field. This
class does not implement these higher-level concepts; it only encapsulates
the low-level typechecking and conversion.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>Resolved data type</p></td>
</tr>
<tr>
<td class="name"><code>resolvedType</code></td>
<td class="type">
<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
|
<span class="param-type">null</span>
</td>
<td class="description last"><p>Resolved type, if relevant
(e.g. submessage field).</p></td>
</tr>
<tr>
<td class="name"><code>isMapKey</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>Is this element a Map key? The value will be
converted to string form if so.</p></td>
</tr>
<tr>
<td class="name"><code>syntax</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Syntax level of defining message type, e.g.,
proto2 or proto3.</p></td>
</tr>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Name of the field containing this element (for error
messages)</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1720">line 1720</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id="isMapKey"><span class="type-signature"></span>isMapKey<span class="type-signature"> :boolean</span></h4>
<div class="description">
<p>Element is a map key.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">boolean</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1738">line 1738</a>
</li></ul></dd>
</dl>
<h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4>
<div class="description">
<p>Name of the field containing this element (for error messages)</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1750">line 1750</a>
</li></ul></dd>
</dl>
<h4 class="name" id="resolvedType"><span class="type-signature"></span>resolvedType<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>|null</span></h4>
<div class="description">
<p>Element type reference to submessage or enum definition, if needed.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
|
<span class="param-type">null</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1732">line 1732</a>
</li></ul></dd>
</dl>
<h4 class="name" id="syntax"><span class="type-signature"></span>syntax<span class="type-signature"> :string</span></h4>
<div class="description">
<p>Syntax level of defining message type, e.g., proto2 or proto3.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1744">line 1744</a>
</li></ul></dd>
</dl>
<h4 class="name" id="type"><span class="type-signature"></span>type<span class="type-signature"> :Object</span></h4>
<div class="description">
<p>Element type, as a string (e.g., int32).</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1726">line 1726</a>
</li></ul></dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".defaultFieldValue"><span class="type-signature">(static) </span>defaultFieldValue<span class="signature">(type)</span><span class="type-signature"> &rarr; {*}</span></h4>
<div class="description">
<p>Returns the default value for this field in proto3.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">string</span>
|
<span class="param-type">Object</span>
</td>
<td class="description last"><p>the field type</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1780">line 1780</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Default value</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">*</span>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

File diff suppressed because it is too large Load Diff

2722
node_modules/protobufjs/docs/ProtoBuf.Reflect.Enum.html generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,360 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: Extension</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: Extension</h1>
<section>
<header>
<h2>
<span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a>.</span>
Extension
</h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="Extension"><span class="type-signature"></span>new Extension<span class="signature">(builder<span class="signature-attributes">non-null</span>, parent<span class="signature-attributes">non-null</span>, name, field<span class="signature-attributes">non-null</span>)</span><span class="type-signature"></span></h4>
<div class="description">
<p>An extension (field).</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>builder</code></td>
<td class="type">
<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
</td>
<td class="description last"><p>Builder reference</p></td>
</tr>
<tr>
<td class="name"><code>parent</code></td>
<td class="type">
<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
</td>
<td class="description last"><p>Parent object</p></td>
</tr>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Object name</p></td>
</tr>
<tr>
<td class="name"><code>field</code></td>
<td class="type">
<span class="param-type"><a href="ProtoBuf.Reflect.Message.Field.html">ProtoBuf.Reflect.Message.Field</a></span>
</td>
<td class="description last"><p>Extension field</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3939">line 3939</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id="field"><span class="type-signature">(non-null) </span>field<span class="type-signature"> :<a href="ProtoBuf.Reflect.Message.Field.html">ProtoBuf.Reflect.Message.Field</a></span></h4>
<div class="description">
<p>Extended message field.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type"><a href="ProtoBuf.Reflect.Message.Field.html">ProtoBuf.Reflect.Message.Field</a></span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3947">line 3947</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

953
node_modules/protobufjs/docs/ProtoBuf.Reflect.T.html generated vendored Normal file
View File

@ -0,0 +1,953 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: T</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: T</h1>
<section>
<header>
<h2>
<span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a>.</span>
T
</h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="T"><span class="type-signature">(abstract) </span>new T<span class="signature">(builder<span class="signature-attributes">non-null</span>, parent<span class="signature-attributes">nullable</span>, name)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Constructs a Reflect base class.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>builder</code></td>
<td class="type">
<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Builder reference</p></td>
</tr>
<tr>
<td class="name"><code>parent</code></td>
<td class="type">
<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>Parent object</p></td>
</tr>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Object name</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1410">line 1410</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id="builder"><span class="type-signature">(non-null) </span>builder<span class="type-signature"> :<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span></h4>
<div class="description">
<p>Builder reference.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1417">line 1417</a>
</li></ul></dd>
</dl>
<h4 class="name" id="className"><span class="type-signature"></span>className<span class="type-signature"> :string</span></h4>
<div class="description">
<p>Fully qualified class name</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1438">line 1438</a>
</li></ul></dd>
</dl>
<h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4>
<div class="description">
<p>Object name in namespace.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1431">line 1431</a>
</li></ul></dd>
</dl>
<h4 class="name" id="parent"><span class="type-signature">(nullable) </span>parent<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span></h4>
<div class="description">
<p>Parent object.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1424">line 1424</a>
</li></ul></dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="build"><span class="type-signature"></span>build<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Builds this type.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1479">line 1479</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<dl>
<dt>
<div class="param-desc">
<p>If this type cannot be built directly</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Error</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
<h4 class="name" id="fqn"><span class="type-signature"></span>fqn<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
<div class="description">
<p>Returns the fully qualified name of this object.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1452">line 1452</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Fully qualified name as of &quot;.PATH.TO.THIS&quot;</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
<h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">(includeClass<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Returns a string representation of this Reflect object (its fully qualified name).</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>includeClass</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Set to true to include the class name. Defaults to false.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1470">line 1470</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>String representation</p>
</div>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

159
node_modules/protobufjs/docs/ProtoBuf.Reflect.html generated vendored Normal file
View File

@ -0,0 +1,159 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Namespace: Reflect</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Namespace: Reflect</h1>
<section>
<header>
<h2>
<span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a>.</span>
Reflect
</h2>
</header>
<article>
<div class="container-overview">
<div class="description"><p>Reflection types.</p></div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1399">line 1399</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Classes</h3>
<dl>
<dt><a href="ProtoBuf.Reflect.Element.html">Element</a></dt>
<dd></dd>
<dt><a href="ProtoBuf.Reflect.Enum.html">Enum</a></dt>
<dd></dd>
<dt><a href="ProtoBuf.Reflect.Extension.html">Extension</a></dt>
<dd></dd>
<dt><a href="ProtoBuf.Reflect.Message.html">Message</a></dt>
<dd></dd>
<dt><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></dt>
<dd></dd>
<dt><a href="ProtoBuf.Reflect.Service.html">Service</a></dt>
<dd></dd>
<dt><a href="ProtoBuf.Reflect.T.html">T</a></dt>
<dd></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

692
node_modules/protobufjs/docs/ProtoBuf.Util.html generated vendored Normal file
View File

@ -0,0 +1,692 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Namespace: Util</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Namespace: Util</h1>
<section>
<header>
<h2>
<span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a>.</span>
Util
</h2>
</header>
<article>
<div class="container-overview">
<div class="description"><p>ProtoBuf utilities.</p></div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line304">line 304</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id=".IS_NODE"><span class="type-signature">(static, constant) </span>IS_NODE<span class="type-signature"> :boolean</span></h4>
<div class="description">
<p>Flag if running in node or not.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">boolean</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line312">line 312</a>
</li></ul></dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".fetch"><span class="type-signature">(static) </span>fetch<span class="signature">(path, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {string|undefined}</span></h4>
<div class="description">
<p>Fetches a resource.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>path</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Resource path</p></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Callback receiving the resource's contents. If omitted the resource will
be fetched synchronously. If the request failed, contents will be null.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line350">line 350</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Resource contents if callback is omitted (null if the request failed), else undefined.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
|
<span class="param-type">undefined</span>
</dd>
</dl>
<h4 class="name" id=".toCamelCase"><span class="type-signature">(static) </span>toCamelCase<span class="signature">(str)</span><span class="type-signature"> &rarr; {string}</span></h4>
<div class="description">
<p>Converts a string to camel case.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>str</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line400">line 400</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
<h4 class="name" id=".XHR"><span class="type-signature">(static) </span>XHR<span class="signature">()</span><span class="type-signature"> &rarr; {XMLHttpRequest}</span></h4>
<div class="description">
<p>Constructs a XMLHttpRequest object.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line322">line 322</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<dl>
<dt>
<div class="param-desc">
<p>If XMLHttpRequest is not supported</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Error</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">XMLHttpRequest</span>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

3209
node_modules/protobufjs/docs/ProtoBuf.html generated vendored Normal file

File diff suppressed because it is too large Load Diff

5316
node_modules/protobufjs/docs/ProtoBuf.js.html generated vendored Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

65
node_modules/protobufjs/docs/index.html generated vendored Normal file
View File

@ -0,0 +1,65 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Home</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Home</h1>
<h3> </h3>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

25
node_modules/protobufjs/docs/scripts/linenumber.js generated vendored Normal file
View File

@ -0,0 +1,25 @@
/*global document */
(function() {
var source = document.getElementsByClassName('prettyprint source linenums');
var i = 0;
var lineNumber = 0;
var lineId;
var lines;
var totalLines;
var anchorHash;
if (source && source[0]) {
anchorHash = document.location.hash.substring(1);
lines = source[0].getElementsByTagName('li');
totalLines = lines.length;
for (; i < totalLines; i++) {
lineNumber++;
lineId = 'line' + lineNumber;
lines[i].id = lineId;
if (lineId === anchorHash) {
lines[i].className += ' selected';
}
}
}
})();

View File

@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
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.

View File

@ -0,0 +1,2 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com",
/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]);

View File

@ -0,0 +1,28 @@
var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c<i;++c){var j=f[c];if(/\\[bdsw]/i.test(j))a.push(j);else{var j=m(j),d;c+2<i&&"-"===f[c+1]?(d=m(f[c+2]),c+=2):d=j;b.push([j,d]);d<65||j>122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c<b.length;++c)i=b[c],i[0]<=j[1]+1?j[1]=Math.max(j[1],i[1]):f.push(j=i);b=["["];o&&b.push("^");b.push.apply(b,a);for(c=0;c<
f.length;++c)i=f[c],b.push(e(i[0])),i[1]>i[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c<b;++c){var j=f[c];j==="("?++i:"\\"===j.charAt(0)&&(j=+j.substring(1))&&j<=i&&(d[j]=-1)}for(c=1;c<d.length;++c)-1===d[c]&&(d[c]=++t);for(i=c=0;c<b;++c)j=f[c],j==="("?(++i,d[i]===void 0&&(f[c]="(?:")):"\\"===j.charAt(0)&&
(j=+j.substring(1))&&j<=i&&(f[c]="\\"+d[i]);for(i=c=0;c<b;++c)"^"===f[c]&&"^"!==f[c+1]&&(f[c]="");if(a.ignoreCase&&s)for(c=0;c<b;++c)j=f[c],a=j.charAt(0),j.length>=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p<d;++p){var g=a[p];if(g.ignoreCase)l=!0;else if(/[a-z]/i.test(g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){s=!0;l=!1;break}}for(var r=
{b:8,t:9,n:10,v:11,f:12,r:13},n=[],p=0,d=a.length;p<d;++p){g=a[p];if(g.global||g.multiline)throw Error(""+g);n.push("(?:"+y(g)+")")}return RegExp(n.join("|"),l?"gi":"g")}function M(a){function m(a){switch(a.nodeType){case 1:if(e.test(a.className))break;for(var g=a.firstChild;g;g=g.nextSibling)m(g);g=a.nodeName;if("BR"===g||"LI"===g)h[s]="\n",t[s<<1]=y++,t[s++<<1|1]=a;break;case 3:case 4:g=a.nodeValue,g.length&&(g=p?g.replace(/\r\n?/g,"\n"):g.replace(/[\t\n\r ]+/g," "),h[s]=g,t[s<<1]=y,y+=g.length,
t[s++<<1|1]=a)}}var e=/(?:^|\s)nocode(?:\s|$)/,h=[],y=0,t=[],s=0,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=document.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);m(a);return{a:h.join("").replace(/\n$/,""),c:t}}function B(a,m,e,h){m&&(a={a:m,d:a},e(a),h.push.apply(h,a.e))}function x(a,m){function e(a){for(var l=a.d,p=[l,"pln"],d=0,g=a.a.match(y)||[],r={},n=0,z=g.length;n<z;++n){var f=g[n],b=r[f],o=void 0,c;if(typeof b===
"string")c=!1;else{var i=h[f.charAt(0)];if(i)o=f.match(i[1]),b=i[0];else{for(c=0;c<t;++c)if(i=m[c],o=f.match(i[1])){b=i[0];break}o||(b="pln")}if((c=b.length>=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
l=[],p={},d=0,g=e.length;d<g;++d){var r=e[d],n=r[3];if(n)for(var k=n.length;--k>=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g<d.length;++g)e(d[g]);m===(m|0)&&d[0].setAttribute("value",
m);var r=s.createElement("OL");r.className="linenums";for(var n=Math.max(0,m-1|0)||0,g=0,z=d.length;g<z;++g)l=d[g],l.className="L"+(g+n)%10,l.firstChild||l.appendChild(s.createTextNode("\xa0")),r.appendChild(l);a.appendChild(r)}function k(a,m){for(var e=m.length;--e>=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*</.test(m)?"default-markup":"default-code";return A[a]}function E(a){var m=
a.g;try{var e=M(a.h),h=e.a;a.a=h;a.c=e.c;a.d=0;C(m,h)(a);var k=/\bMSIE\b/.test(navigator.userAgent),m=/\n/g,t=a.a,s=t.length,e=0,l=a.c,p=l.length,h=0,d=a.e,g=d.length,a=0;d[g]=s;var r,n;for(n=r=0;n<g;)d[n]!==d[n+2]?(d[r++]=d[n++],d[r++]=d[n++]):n+=2;g=r;for(n=r=0;n<g;){for(var z=d[n],f=d[n+1],b=n+2;b+2<=g&&d[b+1]===f;)b+=2;d[r++]=z;d[r++]=f;n=b}for(d.length=r;h<p;){var o=l[h+2]||s,c=d[a+2]||s,b=Math.min(o,c),i=l[h+1],j;if(i.nodeType!==1&&(j=t.substring(e,b))){k&&(j=j.replace(m,"\r"));i.nodeValue=
j;var u=i.ownerDocument,v=u.createElement("SPAN");v.className=d[a+1];var x=i.parentNode;x.replaceChild(v,i);v.appendChild(i);e<o&&(l[h+1]=i=u.createTextNode(t.substring(b,o)),x.insertBefore(i,v.nextSibling))}e=b;e>=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),
["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",
/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),
["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",
hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p<h.length&&l.now()<e;p++){var n=h[p],k=n.className;if(k.indexOf("prettyprint")>=0){var k=k.match(g),f,b;if(b=
!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p<h.length?setTimeout(m,
250):a&&a()}for(var e=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],h=[],k=0;k<e.length;++k)for(var t=0,s=e[k].length;t<s;++t)h.push(e[k][t]);var e=q,l=Date;l.now||(l={now:function(){return+new Date}});var p=0,d,g=/\blang(?:uage)?-([\w.]+)(?!\S)/;m()};window.PR={createSimpleLexer:x,registerLangHandler:k,sourceDecorator:u,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",
PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}})();

353
node_modules/protobufjs/docs/styles/jsdoc-default.css generated vendored Normal file
View File

@ -0,0 +1,353 @@
@font-face {
font-family: 'Open Sans';
font-weight: normal;
font-style: normal;
src: url('../fonts/OpenSans-Regular-webfont.eot');
src:
local('Open Sans'),
local('OpenSans'),
url('../fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/OpenSans-Regular-webfont.woff') format('woff'),
url('../fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg');
}
@font-face {
font-family: 'Open Sans Light';
font-weight: normal;
font-style: normal;
src: url('../fonts/OpenSans-Light-webfont.eot');
src:
local('Open Sans Light'),
local('OpenSans Light'),
url('../fonts/OpenSans-Light-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/OpenSans-Light-webfont.woff') format('woff'),
url('../fonts/OpenSans-Light-webfont.svg#open_sanslight') format('svg');
}
html
{
overflow: auto;
background-color: #fff;
font-size: 14px;
}
body
{
font-family: 'Open Sans', sans-serif;
line-height: 1.5;
color: #4d4e53;
background-color: white;
}
a, a:visited, a:active {
color: #0095dd;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
header
{
display: block;
padding: 0px 4px;
}
tt, code, kbd, samp {
font-family: Consolas, Monaco, 'Andale Mono', monospace;
}
.class-description {
font-size: 130%;
line-height: 140%;
margin-bottom: 1em;
margin-top: 1em;
}
.class-description:empty {
margin: 0;
}
#main {
float: left;
width: 70%;
}
article dl {
margin-bottom: 40px;
}
section
{
display: block;
background-color: #fff;
padding: 12px 24px;
border-bottom: 1px solid #ccc;
margin-right: 30px;
}
.variation {
display: none;
}
.signature-attributes {
font-size: 60%;
color: #aaa;
font-style: italic;
font-weight: lighter;
}
nav
{
display: block;
float: right;
margin-top: 28px;
width: 30%;
box-sizing: border-box;
border-left: 1px solid #ccc;
padding-left: 16px;
}
nav ul {
font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif;
font-size: 100%;
line-height: 17px;
padding: 0;
margin: 0;
list-style-type: none;
}
nav ul a, nav ul a:visited, nav ul a:active {
font-family: Consolas, Monaco, 'Andale Mono', monospace;
line-height: 18px;
color: #4D4E53;
}
nav h3 {
margin-top: 12px;
}
nav li {
margin-top: 6px;
}
footer {
display: block;
padding: 6px;
margin-top: 12px;
font-style: italic;
font-size: 90%;
}
h1, h2, h3, h4 {
font-weight: 200;
margin: 0;
}
h1
{
font-family: 'Open Sans Light', sans-serif;
font-size: 48px;
letter-spacing: -2px;
margin: 12px 24px 20px;
}
h2, h3
{
font-size: 30px;
font-weight: 700;
letter-spacing: -1px;
margin-bottom: 12px;
}
h4
{
font-size: 18px;
letter-spacing: -0.33px;
margin-bottom: 12px;
color: #4d4e53;
}
h5, .container-overview .subsection-title
{
font-size: 120%;
font-weight: bold;
letter-spacing: -0.01em;
margin: 8px 0 3px 0;
}
h6
{
font-size: 100%;
letter-spacing: -0.01em;
margin: 6px 0 3px 0;
font-style: italic;
}
.ancestors { color: #999; }
.ancestors a
{
color: #999 !important;
text-decoration: none;
}
.clear
{
clear: both;
}
.important
{
font-weight: bold;
color: #950B02;
}
.yes-def {
text-indent: -1000px;
}
.type-signature {
color: #aaa;
}
.name, .signature {
font-family: Consolas, Monaco, 'Andale Mono', monospace;
}
.details { margin-top: 14px; border-left: 2px solid #DDD; }
.details dt { width: 120px; float: left; padding-left: 10px; padding-top: 6px; }
.details dd { margin-left: 70px; }
.details ul { margin: 0; }
.details ul { list-style-type: none; }
.details li { margin-left: 30px; padding-top: 6px; }
.details pre.prettyprint { margin: 0 }
.details .object-value { padding-top: 0; }
.description {
margin-bottom: 1em;
margin-top: 1em;
}
.code-caption
{
font-style: italic;
font-size: 107%;
margin: 0;
}
.prettyprint
{
border: 1px solid #ddd;
width: 80%;
overflow: auto;
}
.prettyprint.source {
width: inherit;
}
.prettyprint code
{
font-size: 100%;
line-height: 18px;
display: block;
padding: 4px 12px;
margin: 0;
background-color: #fff;
color: #4D4E53;
}
.prettyprint code span.line
{
display: inline-block;
}
.prettyprint.linenums
{
padding-left: 70px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.prettyprint.linenums ol
{
padding-left: 0;
}
.prettyprint.linenums li
{
border-left: 3px #ddd solid;
}
.prettyprint.linenums li.selected,
.prettyprint.linenums li.selected *
{
background-color: lightyellow;
}
.prettyprint.linenums li *
{
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
}
.params, .props
{
border-spacing: 0;
border: 0;
border-collapse: collapse;
}
.params .name, .props .name, .name code {
color: #4D4E53;
font-family: Consolas, Monaco, 'Andale Mono', monospace;
font-size: 100%;
}
.params td, .params th, .props td, .props th
{
border: 1px solid #ddd;
margin: 0px;
text-align: left;
vertical-align: top;
padding: 4px 6px;
display: table-cell;
}
.params thead tr, .props thead tr
{
background-color: #ddd;
font-weight: bold;
}
.params .params thead tr, .props .props thead tr
{
background-color: #fff;
font-weight: bold;
}
.params th, .props th { border-right: 1px solid #aaa; }
.params thead .last, .props thead .last { border-right: 1px solid #ddd; }
.params td.description > p:first-child,
.props td.description > p:first-child
{
margin-top: 0;
padding-top: 0;
}
.params td.description > p:last-child,
.props td.description > p:last-child
{
margin-bottom: 0;
padding-bottom: 0;
}
.disabled {
color: #454545;
}

111
node_modules/protobufjs/docs/styles/prettify-jsdoc.css generated vendored Normal file
View File

@ -0,0 +1,111 @@
/* JSDoc prettify.js theme */
/* plain text */
.pln {
color: #000000;
font-weight: normal;
font-style: normal;
}
/* string content */
.str {
color: #006400;
font-weight: normal;
font-style: normal;
}
/* a keyword */
.kwd {
color: #000000;
font-weight: bold;
font-style: normal;
}
/* a comment */
.com {
font-weight: normal;
font-style: italic;
}
/* a type name */
.typ {
color: #000000;
font-weight: normal;
font-style: normal;
}
/* a literal value */
.lit {
color: #006400;
font-weight: normal;
font-style: normal;
}
/* punctuation */
.pun {
color: #000000;
font-weight: bold;
font-style: normal;
}
/* lisp open bracket */
.opn {
color: #000000;
font-weight: bold;
font-style: normal;
}
/* lisp close bracket */
.clo {
color: #000000;
font-weight: bold;
font-style: normal;
}
/* a markup tag name */
.tag {
color: #006400;
font-weight: normal;
font-style: normal;
}
/* a markup attribute name */
.atn {
color: #006400;
font-weight: normal;
font-style: normal;
}
/* a markup attribute value */
.atv {
color: #006400;
font-weight: normal;
font-style: normal;
}
/* a declaration */
.dec {
color: #000000;
font-weight: bold;
font-style: normal;
}
/* a variable name */
.var {
color: #000000;
font-weight: normal;
font-style: normal;
}
/* a function name */
.fun {
color: #000000;
font-weight: bold;
font-style: normal;
}
/* Specify class=linenums on a pre to get line numbering */
ol.linenums {
margin-top: 0;
margin-bottom: 0;
}

View File

@ -0,0 +1,132 @@
/* Tomorrow Theme */
/* Original theme - https://github.com/chriskempson/tomorrow-theme */
/* Pretty printing styles. Used with prettify.js. */
/* SPAN elements with the classes below are added by prettyprint. */
/* plain text */
.pln {
color: #4d4d4c; }
@media screen {
/* string content */
.str {
color: #718c00; }
/* a keyword */
.kwd {
color: #8959a8; }
/* a comment */
.com {
color: #8e908c; }
/* a type name */
.typ {
color: #4271ae; }
/* a literal value */
.lit {
color: #f5871f; }
/* punctuation */
.pun {
color: #4d4d4c; }
/* lisp open bracket */
.opn {
color: #4d4d4c; }
/* lisp close bracket */
.clo {
color: #4d4d4c; }
/* a markup tag name */
.tag {
color: #c82829; }
/* a markup attribute name */
.atn {
color: #f5871f; }
/* a markup attribute value */
.atv {
color: #3e999f; }
/* a declaration */
.dec {
color: #f5871f; }
/* a variable name */
.var {
color: #c82829; }
/* a function name */
.fun {
color: #4271ae; } }
/* Use higher contrast and text-weight for printable form. */
@media print, projection {
.str {
color: #060; }
.kwd {
color: #006;
font-weight: bold; }
.com {
color: #600;
font-style: italic; }
.typ {
color: #404;
font-weight: bold; }
.lit {
color: #044; }
.pun, .opn, .clo {
color: #440; }
.tag {
color: #006;
font-weight: bold; }
.atn {
color: #404; }
.atv {
color: #060; } }
/* Style */
/*
pre.prettyprint {
background: white;
font-family: Consolas, Monaco, 'Andale Mono', monospace;
font-size: 12px;
line-height: 1.5;
border: 1px solid #ccc;
padding: 10px; }
*/
/* Specify class=linenums on a pre to get line numbering */
ol.linenums {
margin-top: 0;
margin-bottom: 0; }
/* IE indents via margin-left */
li.L0,
li.L1,
li.L2,
li.L3,
li.L4,
li.L5,
li.L6,
li.L7,
li.L8,
li.L9 {
/* */ }
/* Alternate shading for lines */
li.L1,
li.L3,
li.L5,
li.L7,
li.L9 {
/* */ }

BIN
node_modules/protobufjs/donate.png generated vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

28
node_modules/protobufjs/examples/protoify/README.md generated vendored Normal file
View File

@ -0,0 +1,28 @@
ProtoBuf.js protoify example
============================
This example shows the general usage of ProtoBuf.js by converting JSON structures to protocol buffers and vice versa
using a definition describing JSON itself. While this works as an example, it does not provide any real world benefits
(well, this is if you are not building a protobuf-backed database for JSON data, using inter-field substitution to
minimize redundancy - nevermind, forget that).
Instructions
------------
1. Set up dependencies: `npm install`
2. Run: `npm test`
Now you know no more and no less than that it works and you might want to inspect the following files to get the 'how':
* **[index.js](https://github.com/dcodeIO/ProtoBuf.js/blob/master/examples/protoify/index.js)**
contains the sample's source code
* **[json.proto](https://github.com/dcodeIO/ProtoBuf.js/blob/master/examples/protoify/json.proto)**
contains the protobuf definition used
* **[json.json](https://github.com/dcodeIO/ProtoBuf.js/blob/master/examples/protoify/json.json)**
contains the protobuf definition converted through `proto2js json.proto > json.json`
* **[json.js](https://github.com/dcodeIO/ProtoBuf.js/blob/master/examples/protoify/json.js)**
contains the protobuf definition converted through `proto2js json.proto -commonjs=js > json.js`
* **[test.js](https://github.com/dcodeIO/ProtoBuf.js/blob/master/examples/protoify/test.js)**
contains our simple test suite

147
node_modules/protobufjs/examples/protoify/index.js generated vendored Normal file
View File

@ -0,0 +1,147 @@
var ProtoBuf = require("protobufjs"),
ByteBuffer = ProtoBuf.ByteBuffer, // ProtoBuf.js uses and also exposes ByteBuffer.js
Long = ProtoBuf.Long; // as well as Long.js (not used in this example)
// Option 1: Loading the .proto file directly
var builder = ProtoBuf.loadProtoFile("./json.proto"), // Creates the Builder
JS = builder.build("js"); // Returns just the 'js' namespace if that's all we need
// Option 2: Loading the .json file generated through 'proto2js json.proto > json.json'
var root = ProtoBuf.loadJsonFile("./json.json").build(), // Here we make the Builder return the root namespace
JS = root.js; // then we reference 'js' inside. Both is possible.
// Option 3: Loading the module generated through 'proto2js json.proto -commonjs=js > json.js'
var JS = require("./json.js"); // Returns what is specified with -commonjs[=XX] (omitted=root)
// `JS` now contains the js namespace from json.proto: Value, Array and Object
// This is how we use these classes:
/**
* Converts a JSON-like structure to JS-Namespace values.
* @param {*} val JSON
* @returns {!JS.Value} JS-Namespace value
* @inner
*/
function _protoify(val) {
switch (typeof val) {
case 'number':
if (val%1 === 0 && val >= (0x80000000|0) && val <= (0x7fffffff|0))
return new JS.Value(val); // sets the first field declared in .js.Value
else
return new JS.Value(null, val); // sets the second field
case 'string':
return new JS.Value({ 'string': val }); // uses object notation instead
case 'boolean':
return new JS.Value({ 'boolean': val });
case 'object':
if (val === null)
return new JS.Value({ 'null': true });
if (Object.prototype.toString.call(val) === "[object Array]") {
var arr = new JS.Array();
for (var i=0; i<val.length; ++i)
arr['values'][i] = _protoify(val[i]);
return new JS.Value({ 'array': arr });
}
var obj = new JS.Object();
for (var key in val)
if (val.hasOwnProperty(key))
obj['keys'].push(_protoify(key)),
obj['values'].push(_protoify(val[key]));
return new JS.Value({ 'object': obj });
case 'undefined':
return new JS.Value(); // undefined
default:
throw Error("Unsupported type: "+(typeof val)); // symbol, function
}
}
/**
* Converts JS-Namespace values to JSON.
* @param {!JS.Value} value JS value
* @returns {*} JSON
* @inner
*/
function _jsonify(value) {
if (value.type === null)
return undefined;
switch (value.type) {
case 'null':
return null;
case 'array':
return (function() {
var values = value['array']['values'],
i = 0,
k = values.length,
arr = new Array(k);
for (; i<k; ++i)
arr[i] = _jsonify(values[i]);
return arr;
})();
case 'object':
return (function() {
var keys = value['object']['keys'],
values = value['object']['values'],
i = 0,
k = keys.length,
obj = {};
for (; i<k; ++i)
obj[keys[i]['string'] /* is a JS.Value, here always a string */] = _jsonify(values[i]);
return obj;
})();
default:
return value[value.type];
}
}
// And this is how we actually encode and decode them:
/**
* A temporary Buffer to speed up encoding.
* @type {!ByteBuffer}
* @inner
*/
var tempBuffer = ByteBuffer.allocate(1024);
/**
* Converts a JSON structure to a Buffer.
* @param {*} json JSON
* @returns {!Buffer|!ArrayBuffer}
* @expose
*/
module.exports = function(json) {
return _protoify(json) // Returns the root JS.Value
.encode(tempBuffer).flip() // Encodes it to a ByteBuffer, here: reusing tempBuffer forever
// The non-tempBuffer alternative is just doing .encode()
.toBuffer(); // Converts it to a Buffer. In the browser, this returns an ArrayBuffer. To return an
// ArrayBuffer explicitly both under node.js and in the browser, use .toArrayBuffer().
// Performance note: This just returns a slice on the ByteBuffer's backing .buffer
};
/**
* Converts a Buffer to a JSON structure.
* @param {!Buffer|!ArrayBuffer} proto Buffer
* @returns {*} JSON
* @expose
*/
module.exports.parse = function(proto) {
return _jsonify( // Processes JS-namespace objects
JS.Value.decode(proto) // Decodes the JS.Value from a ByteBuffer, a Buffer, an ArrayBuffer, an Uint8Array, ...
);
};
/**
* Performs maintenance.
* @expose
*/
module.exports.performMaintenance = function() {
if (tempBuffer.capacity() > 2048)
tempBuffer = ByteBuffer.allocate(1024);
// In case this module is running inside of a daemon, we'd just call this
// method every now and then to discard the tempBuffer if it becomes too
// large. This is just an example on how to reuse ByteBuffers effectively.
// You may consider something like this for the performance benefit, which
// is decreasing the memory allocation footprint of your app.
};
// Have a nice day!

123
node_modules/protobufjs/examples/protoify/json.js generated vendored Normal file
View File

@ -0,0 +1,123 @@
module.exports = require("protobufjs").newBuilder({})["import"]({
"package": "js",
"messages": [
{
"name": "Value",
"fields": [
{
"rule": "optional",
"options": {},
"type": "sint32",
"name": "integer",
"id": 1,
"oneof": "type"
},
{
"rule": "optional",
"options": {},
"type": "double",
"name": "double",
"id": 2,
"oneof": "type"
},
{
"rule": "optional",
"options": {},
"type": "string",
"name": "string",
"id": 3,
"oneof": "type"
},
{
"rule": "optional",
"options": {},
"type": "bool",
"name": "boolean",
"id": 4,
"oneof": "type"
},
{
"rule": "optional",
"options": {},
"type": "bool",
"name": "null",
"id": 5,
"oneof": "type"
},
{
"rule": "optional",
"options": {},
"type": "Array",
"name": "array",
"id": 6,
"oneof": "type"
},
{
"rule": "optional",
"options": {},
"type": "Object",
"name": "object",
"id": 7,
"oneof": "type"
}
],
"enums": [],
"messages": [],
"options": {},
"oneofs": {
"type": [
1,
2,
3,
4,
5,
6,
7
]
}
},
{
"name": "Array",
"fields": [
{
"rule": "repeated",
"options": {},
"type": "Value",
"name": "values",
"id": 1
}
],
"enums": [],
"messages": [],
"options": {},
"oneofs": {}
},
{
"name": "Object",
"fields": [
{
"rule": "repeated",
"options": {},
"type": "Value",
"name": "keys",
"id": 1
},
{
"rule": "repeated",
"options": {},
"type": "Value",
"name": "values",
"id": 2
}
],
"enums": [],
"messages": [],
"options": {},
"oneofs": {}
}
],
"enums": [],
"imports": [],
"options": {},
"services": []
}).build("js");

123
node_modules/protobufjs/examples/protoify/json.json generated vendored Normal file
View File

@ -0,0 +1,123 @@
{
"package": "js",
"messages": [
{
"name": "Value",
"fields": [
{
"rule": "optional",
"options": {},
"type": "sint32",
"name": "integer",
"id": 1,
"oneof": "type"
},
{
"rule": "optional",
"options": {},
"type": "double",
"name": "double",
"id": 2,
"oneof": "type"
},
{
"rule": "optional",
"options": {},
"type": "string",
"name": "string",
"id": 3,
"oneof": "type"
},
{
"rule": "optional",
"options": {},
"type": "bool",
"name": "boolean",
"id": 4,
"oneof": "type"
},
{
"rule": "optional",
"options": {},
"type": "bool",
"name": "null",
"id": 5,
"oneof": "type"
},
{
"rule": "optional",
"options": {},
"type": "Array",
"name": "array",
"id": 6,
"oneof": "type"
},
{
"rule": "optional",
"options": {},
"type": "Object",
"name": "object",
"id": 7,
"oneof": "type"
}
],
"enums": [],
"messages": [],
"options": {},
"oneofs": {
"type": [
1,
2,
3,
4,
5,
6,
7
]
}
},
{
"name": "Array",
"fields": [
{
"rule": "repeated",
"options": {},
"type": "Value",
"name": "values",
"id": 1
}
],
"enums": [],
"messages": [],
"options": {},
"oneofs": {}
},
{
"name": "Object",
"fields": [
{
"rule": "repeated",
"options": {},
"type": "Value",
"name": "keys",
"id": 1
},
{
"rule": "repeated",
"options": {},
"type": "Value",
"name": "values",
"id": 2
}
],
"enums": [],
"messages": [],
"options": {},
"oneofs": {}
}
],
"enums": [],
"imports": [],
"options": {},
"services": []
}

30
node_modules/protobufjs/examples/protoify/json.proto generated vendored Normal file
View File

@ -0,0 +1,30 @@
// Everything below is located in the js-namespace
package js;
// Represents a JavaScript value.
// Contains exactly one or zero fields.
message Value {
oneof type {
sint32 integer = 1;
double double = 2;
string string = 3;
bool boolean = 4;
bool null = 5;
Array array = 6;
Object object = 7;
// if none is set: undefined
}
}
// Represents a JavaScript array.
// Contains zero to N values.
message Array {
repeated Value values = 1;
}
// Represents a JavaScript object.
// Contains zero to N keys with associated values.
message Object {
repeated Value keys = 1;
repeated Value values = 2;
}

15
node_modules/protobufjs/examples/protoify/package.json generated vendored Normal file
View File

@ -0,0 +1,15 @@
{
"name": "protobufjs-protoify-example",
"version": "1.0.0",
"main": "index.js",
"dependencies": {
"protobufjs": "~3.7"
},
"engines": {
"node": ">=0.8"
},
"scripts": {
"test": "node test.js"
},
"private": true
}

56
node_modules/protobufjs/examples/protoify/test.js generated vendored Normal file
View File

@ -0,0 +1,56 @@
var protoify = require("./index.js"),
ByteBuffer = require("protobufjs").ByteBuffer,
assert = require("assert");
// Array of samples to test
var samples = [
1, -1, 0x80000000|0, 0x7fffffff|0, // Integers
0.1, 0.2, 1.234, // Doubles
"John", // String
true, false, // Booleans
null, // null
[], // Array
{}, // Object
undefined, // undefined
[ // Array holding each data type
1,
0.1,
"John",
true,
false,
null,
[],
{},
undefined
],
{ // Object holding each data type
1: 1,
0.1: 0.1,
"John": "John",
true: true,
false: false,
null: null,
array: [],
object: {},
undefined: undefined
}
];
samples.forEach(function(sample) {
// Encode each sample to a Buffer
var buf = protoify(sample);
// Print some nice debugging information
console.log(JSON.stringify(sample));
console.log("-------------------------------------------------------------------");
console.log(ByteBuffer.wrap(buf).toDebug(true));
// Decode the Buffer back to JSON
var decodedSample = protoify.parse(buf);
// And assert that it's actually equal
assert.deepEqual(decodedSample, sample);
});
// If no assertion errors are thrown, print
console.log("OK");

9
node_modules/protobufjs/examples/websocket/README.md generated vendored Normal file
View File

@ -0,0 +1,9 @@
ProtoBuf.js WebSocket example
=============================
This example shows how to use binary websockets to transfer protocol buffers.
Instructions
------------
1. Set up dependencies: `npm install`
2. Run: `node server.js`
3. Open [http://localhost:8080/](http://localhost:8080/) in a recent browser

View File

@ -0,0 +1,16 @@
{
"name": "protobufjs-websocket-example",
"version": "1.1.0",
"dependencies": {
"protobufjs": "~3",
"ws": "~0.4",
"open": "0.0.3"
},
"engines": {
"node": ">=0.8"
},
"scripts": {
"run": "node server.js"
},
"private": true
}

97
node_modules/protobufjs/examples/websocket/server.js generated vendored Normal file
View File

@ -0,0 +1,97 @@
// Set up: npm install
var http = require("http"),
fs = require("fs"),
path = require("path"),
ws = require("ws"),
open = require("open"),
ProtoBuf = require("protobufjs");
// Copy dependencies to "www/" (example specific, you usually don't have to care
var deps = [
["Long.min.js", "./node_modules/long/dist/Long.min.js"],
["ByteBufferAB.min.js", "./node_modules/bytebuffer/dist/ByteBufferAB.min.js"],
["ProtoBuf.min.js", "./node_modules/protobufjs/dist/ProtoBuf.min.js"]
];
for (var i=0, dep, data; i<deps.length; i++) {
dep = deps[i];
if (!fs.existsSync(path.join(__dirname, "www", dep[0]))) {
console.log("Copying "+dep[0]+" from "+dep[1]);
try {
fs.writeFileSync(path.join(__dirname, "www", dep[0]), fs.readFileSync(path.join(__dirname, dep[1])));
} catch (err) {
console.log("Copying failed: "+err.message);
console.log("\nDid you run `npm install` ?");
process.exit(1);
}
}
}
// Initialize from .proto file
var builder = ProtoBuf.loadProtoFile(path.join(__dirname, "www", "example.proto")),
Message = builder.build("Message");
// HTTP server
var server = http.createServer(function(req, res) {
var file = null,
type = "text/html";
if (req.url == "/") {
file = "index.html";
} else if (/^\/(\w+(?:\.min)?\.(?:js|html|proto))$/.test(req.url)) {
file = req.url.substring(1);
if (/\.js$/.test(file)) {
type = "text/javascript";
}
}
if (file) {
fs.readFile(path.join(__dirname, "www", file), function(err, data) {
if (err) {
res.writeHead(500, {"Content-Type": type});
res.end("Internal Server Error: "+err);
} else {
res.writeHead(200, {"Content-Type": type});
res.write(data);
res.end();
console.log("Served www/"+file);
}
});
} else {
res.writeHead(404, {"Content-Type": "text/html"});
res.end("Not Found");
}
});
server.listen(8080);
server.on("listening", function() {
console.log("Server started");
open("http://localhost:8080/");
});
server.on("error", function(err) {
console.log("Failed to start server:", err);
process.exit(1);
});
// WebSocket adapter
var wss = new ws.Server({server: server});
wss.on("connection", function(socket) {
console.log("New WebSocket connection");
socket.on("close", function() {
console.log("WebSocket disconnected");
});
socket.on("message", function(data, flags) {
if (flags.binary) {
try {
// Decode the Message
var msg = Message.decode(data);
console.log("Received: "+msg.text);
// Transform the text to upper case
msg.text = msg.text.toUpperCase();
// Re-encode it and send it back
socket.send(msg.toBuffer());
console.log("Sent: "+msg.text);
} catch (err) {
console.log("Processing failed:", err);
}
} else {
console.log("Not binary data");
}
});
});

View File

@ -0,0 +1,3 @@
message Message {
required string text = 1;
}

View File

@ -0,0 +1,59 @@
<!DOCTYPE html>
<html>
<head> <!-- Please copy the following files into here: -->
<script src="./Long.min.js"></script> <!-- https://raw.github.com/dcodeIO/Long.js/master/dist/Long.min.js -->
<script src="./ByteBufferAB.min.js"></script> <!-- https://raw.github.com/dcodeIO/ByteBuffer.js/master/dist/ByteBufferAB.min.js -->
<script src="./ProtoBuf.min.js"></script> <!-- https://raw.github.com/dcodeIO/ProtoBuf.js/master/dist/ProtoBuf.min.js -->
<script>
if (typeof dcodeIO === 'undefined' || !dcodeIO.ProtoBuf) {
throw(new Error("ProtoBuf.js is not present. Please see www/index.html for manual setup instructions."));
}
// Initialize ProtoBuf.js
var ProtoBuf = dcodeIO.ProtoBuf;
var Message = ProtoBuf.loadProtoFile("./example.proto").build("Message");
</script>
</head>
<body>
<textarea id="log" style="width: 100%; height: 200px"></textarea><br />
<input type="text" id="text" value="hello world!" /> <button onclick="send()">Send</button>
<script>
var log = document.getElementById("log");
var text = document.getElementById("text");
// Connect to our server: node server.js
var socket = new WebSocket("ws://localhost:8080/ws");
socket.binaryType = "arraybuffer"; // We are talking binary
function send() {
if (socket.readyState == WebSocket.OPEN) {
var msg = new Message(text.value);
socket.send(msg.toArrayBuffer());
log.value += "Sent: "+msg.text+"\n";
} else {
log.value += "Not connected\n";
}
}
socket.onopen = function() {
log.value += "Connected\n";
};
socket.onclose = function() {
log.value += "Disconnected\n";
};
socket.onmessage = function(evt) {
try {
// Decode the Message
var msg = Message.decode(evt.data);
log.value += "Received: "+msg.text+"\n";
} catch (err) {
log.value += "Error: "+err+"\n";
}
};
log.value = ""; // Clear log on reload
</script>
</body>
</html>

644
node_modules/protobufjs/externs/fs.js generated vendored Normal file
View File

@ -0,0 +1,644 @@
/*
* Copyright 2012 The Closure Compiler Authors.
*
* 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.
*/
/**
* @fileoverview Definitions for node's "fs" module.
* @see http://nodejs.org/api/fs.html
* @externs
* @author Daniel Wirtz <dcode@dcode.io>
*/
/**
BEGIN_NODE_INCLUDE
var fs = require('fs');
END_NODE_INCLUDE
*/
var fs = {};
/**
* @param {string} oldPath
* @param {string} newPath
* @param {function(...)=} callback
*/
fs.rename = function(oldPath, newPath, callback) {};
/**
* @param {string} oldPath
* @param {string} newPath
*/
fs.renameSync = function(oldPath, newPath) {};
/**
* @param {*} fd
* @param {number} len
* @param {function(...)=} callback
*/
fs.truncate = function(fd, len, callback) {};
/**
* @param {*} fd
* @param {number} len
*/
fs.truncateSync = function(fd, len) {};
/**
* @param {string} path
* @param {number} uid
* @param {number} gid
* @param {function(...)=} callback
*/
fs.chown = function(path, uid, gid, callback) {};
/**
* @param {string} path
* @param {number} uid
* @param {number} gid
*/
fs.chownSync = function(path, uid, gid) {};
/**
* @param {*} fd
* @param {number} uid
* @param {number} gid
* @param {function(...)=} callback
*/
fs.fchown = function(fd, uid, gid, callback) {};
/**
* @param {*} fd
* @param {number} uid
* @param {number} gid
*/
fs.fchownSync = function(fd, uid, gid) {};
/**
* @param {string} path
* @param {number} uid
* @param {number} gid
* @param {function(...)=} callback
*/
fs.lchown = function(path, uid, gid, callback) {};
/**
* @param {string} path
* @param {number} uid
* @param {number} gid
*/
fs.lchownSync = function(path, uid, gid) {};
/**
* @param {string} path
* @param {number} mode
* @param {function(...)=} callback
*/
fs.chmod = function(path, mode, callback) {};
/**
* @param {string} path
* @param {number} mode
*/
fs.chmodSync = function(path, mode) {};
/**
* @param {*} fd
* @param {number} mode
* @param {function(...)=} callback
*/
fs.fchmod = function(fd, mode, callback) {};
/**
* @param {*} fd
* @param {number} mode
*/
fs.fchmodSync = function(fd, mode) {};
/**
* @param {string} path
* @param {number} mode
* @param {function(...)=} callback
*/
fs.lchmod = function(path, mode, callback) {};
/**
* @param {string} path
* @param {number} mode
*/
fs.lchmodSync = function(path, mode) {};
/**
* @param {string} path
* @param {function(string, fs.Stats)=} callback
* @nosideeffects
*/
fs.stat = function(path, callback) {};
/**
* @param {string} path
* @return {fs.Stats}
* @nosideeffects
*/
fs.statSync = function(path) {}
/**
* @param {*} fd
* @param {function(string, fs.Stats)=} callback
* @nosideeffects
*/
fs.fstat = function(fd, callback) {};
/**
* @param {*} fd
* @return {fs.Stats}
* @nosideeffects
*/
fs.fstatSync = function(fd) {}
/**
* @param {string} path
* @param {function(string, fs.Stats)=} callback
* @nosideeffects
*/
fs.lstat = function(path, callback) {};
/**
* @param {string} path
* @return {fs.Stats}
* @nosideeffects
*/
fs.lstatSync = function(path) {}
/**
* @param {string} srcpath
* @param {string} dstpath
* @param {function(...)=} callback
*/
fs.link = function(srcpath, dstpath, callback) {};
/**
* @param {string} srcpath
* @param {string} dstpath
*/
fs.linkSync = function(srcpath, dstpath) {};
/**
* @param {string} srcpath
* @param {string} dstpath
* @param {string=} type
* @param {function(...)=} callback
*/
fs.symlink = function(srcpath, dstpath, type, callback) {};
/**
* @param {string} srcpath
* @param {string} dstpath
* @param {string=} type
*/
fs.symlinkSync = function(srcpath, dstpath, type) {};
/**
* @param {string} path
* @param {function(string, string)=} callback
* @nosideeffects
*/
fs.readlink = function(path, callback) {};
/**
* @param {string} path
* @return {string}
* @nosideeffects
*/
fs.readlinkSync = function(path) {};
/**
* @param {string} path
* @param {object.<string,string>=|function(string, string)=} cache
* @param {function(string, string)=} callback
* @nosideeffects
*/
fs.realpath = function(path, cache, callback) {};
/**
* @param {string} path
* @param {object.<string,string>=} cache
* @return {string}
* @nosideeffects
*/
fs.realpathSync = function(path, cache) {};
/**
* @param {string} path
* @param {function(...)=} callback
*/
fs.unlink = function(path, callback) {};
/**
* @param {string} path
*/
fs.unlinkSync = function(path) {};
/**
* @param {string} path
* @param {function(...)=} callback
*/
fs.rmdir = function(path, callback) {};
/**
* @param {string} path
*/
fs.rmdirSync = function(path) {};
/**
* @param {string} path
* @param {number=} mode
* @param {function(...)=} callback
*/
fs.mkdir = function(path, mode, callback) {};
/**
* @param {string} path
* @param {number=} mode
*/
fs.mkdirSync = function(path, mode) {};
/**
* @param {string} path
* @param {function(string,array.<string>)=} callback
* @nosideeffects
*/
fs.readdir = function(path, callback) {};
/**
* @param {string} path
* @return {array.<string>}
* @nosideeffects
*/
fs.readdirSync = function(path) {};
/**
* @param {*} fd
* @param {function(...)=} callback
*/
fs.close = function(fd, callback) {};
/**
* @param {*} fd
*/
fs.closeSync = function(fd) {};
/**
* @param {string} path
* @param {string} flags
* @param {number=} mode
* @param {function(string, *)=} callback
* @nosideeffects
*/
fs.open = function(path, flags, mode, callback) {};
/**
* @param {string} path
* @param {string} flags
* @param {number=} mode
* @return {*}
* @nosideeffects
*/
fs.openSync = function(path, flags, mode) {};
/**
* @param {string} path
* @param {number} atime
* @param {number} mtime
* @param {function(...)=} callback
* @nosideeffects
*/
fs.utimes = function(path, atime, mtime, callback) {};
/**
* @param {string} path
* @param {number} atime
* @param {number} mtime
* @nosideeffects
*/
fs.utimesSync = function(path, atime, mtime) {};
/**
* @param {*} fd
* @param {number} atime
* @param {number} mtime
* @param {function(...)=} callback
* @nosideeffects
*/
fs.futimes = function(fd, atime, mtime, callback) {};
/**
* @param {*} fd
* @param {number} atime
* @param {number} mtime
* @nosideeffects
*/
fs.futimesSync = function(fd, atime, mtime) {};
/**
* @param {*} fd
* @param {function(...)=} callback
*/
fs.fsync = function(fd, callback) {};
/**
* @param {*} fd
*/
fs.fsyncSync = function(fd) {};
/**
* @param {*} fd
* @param {*} buffer
* @param {number} offset
* @param {number} length
* @param {number} position
* @param {function(string, number, *)=} callback
*/
fs.write = function(fd, buffer, offset, length, position, callback) {};
/**
* @param {*} fd
* @param {*} buffer
* @param {number} offset
* @param {number} length
* @param {number} position
* @return {number}
*/
fs.writeSync = function(fd, buffer, offset, length, position) {};
/**
* @param {*} fd
* @param {*} buffer
* @param {number} offset
* @param {number} length
* @param {number} position
* @param {function(string, number, *)=} callback
* @nosideeffects
*/
fs.read = function(fd, buffer, offset, length, position, callback) {};
/**
* @param {*} fd
* @param {*} buffer
* @param {number} offset
* @param {number} length
* @param {number} position
* @return {number}
* @nosideeffects
*/
fs.readSync = function(fd, buffer, offset, length, position) {};
/**
* @param {string} filename
* @param {string=|function(string, *)=}encoding
* @param {function(string, *)=} callback
* @nosideeffects
*/
fs.readFile = function(filename, encoding, callback) {};
/**
* @param {string} filename
* @param {string=} encoding
* @nosideeffects
*/
fs.readFileSync = function(filename, encoding) {};
/**
* @param {string} filename
* @param {*} data
* @param {string=|function(string)=} encoding
* @param {function(string)=} callback
*/
fs.writeFile = function(filename, data, encoding, callback) {};
/**
* @param {string} filename
* @param {*} data
* @param {string=} encoding
*/
fs.writeFileSync = function(filename, data, encoding) {};
/**
* @param {string} filename
* @param {*} data
* @param {string=|function(string)=} encoding
* @param {function(string)=} callback
*/
fs.appendFile = function(filename, data, encoding, callback) {};
/**
* @param {string} filename
* @param {*} data
* @param {string=|function(string)=} encoding
*/
fs.appendFileSync = function(filename, data, encoding) {};
/**
* @param {string} filename
* @param {{persistent: boolean, interval: number}=|function(*,*)} options
* @param {function(*,*)=} listener
*/
fs.watchFile = function(filename, options, listener) {};
/**
* @param {string} filename
* @param {function=} listener
*/
fs.unwatchFile = function(filename, listener) {};
/**
*
* @param {string} filename
* @param {{persistent: boolean}=|function(string, string)} options
* @param {function(string, string)=} listener
* @return {fs.FSWatcher}
*/
fs.watch = function(filename, options, listener) {};
/**
* @param {string} path
* @param {function(boolean)} callback
* @nosideeffects
*/
fs.exists = function(path, callback) {};
/**
* @param {string} path
* @nosideeffects
*/
fs.existsSync = function(path) {};
/**
* @constructor
*/
fs.Stats = function() {};
/**
* @return {boolean}
* @nosideeffects
*/
fs.Stats.prototype.isFile = function() {};
/**
* @return {boolean}
* @nosideeffects
*/
fs.Stats.prototype.isDirectory = function() {};
/**
* @return {boolean}
* @nosideeffects
*/
fs.Stats.prototype.isBlockDevice = function() {};
/**
* @return {boolean}
* @nosideeffects
*/
fs.Stats.prototype.isCharacterDevice = function() {};
/**
* @return {boolean}
* @nosideeffects
*/
fs.Stats.prototype.isSymbolicLink = function() {};
/**
* @return {boolean}
* @nosideeffects
*/
fs.Stats.prototype.isFIFO = function() {};
/**
* @return {boolean}
* @nosideeffects
*/
fs.Stats.prototype.isSocket = function() {};
/**
* @type {number}
*/
fs.Stats.prototype.dev = 0;
/**
* @type {number}
*/
fs.Stats.prototype.ino = 0;
/**
* @type {number}
*/
fs.Stats.prototype.mode = 0;
/**
* @type {number}
*/
fs.Stats.prototype.nlink = 0;
/**
* @type {number}
*/
fs.Stats.prototype.uid = 0;
/**
* @type {number}
*/
fs.Stats.prototype.gid = 0;
/**
* @type {number}
*/
fs.Stats.prototype.rdev = 0;
/**
* @type {number}
*/
fs.Stats.prototype.size = 0;
/**
* @type {number}
*/
fs.Stats.prototype.blkSize = 0;
/**
* @type {number}
*/
fs.Stats.prototype.blocks = 0;
/**
* @type {Date}
*/
fs.Stats.prototype.atime = 0;
/**
* @type {Date}
*/
fs.Stats.prototype.mtime = 0;
/**
* @type {Date}
*/
fs.Stats.prototype.ctime = 0;
/**
* @param {string} path
* @param {{flags: string, encoding: ?string, fd: *, mode: number, bufferSize: number}=} options
* @nosideeffects
*/
fs.createReadStream = function(path, options) {};
/**
* @constructor
* @extends {stream.ReadableStream}
*/
fs.ReadStream = function() {};
/**
* @param {string} path
* @param {{flags: string, encoding: ?string, mode: number}=} options
* @nosideeffects
*/
fs.createWriteStream = function(path, options) {};
/**
* @constructor
* @extends {stream.WritableStream}
*/
fs.WriteStream = function() {};
/**
* @param {string} event
* @param {function(...)} callback
*/
fs.WriteStream.prototype.on = function(event, callback) {};
/**
* @constructor
*/
fs.FSWatcher = function() {};
/**
*/
fs.FSWatcher.prototype.close = function() {};
/**
* @param {string} event
* @param {function(...)} callback
*/
fs.FSWatcher.prototype.on = function(event, callback) {};

933
node_modules/protobufjs/externs/protobuf.js generated vendored Normal file
View File

@ -0,0 +1,933 @@
/*
* Copyright 2012 The Closure Compiler Authors.
*
* 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.
*/
/**
* @fileoverview Externs for ProtoBuf.js.
* @see https://github.com/dcodeIO/ProtoBuf.js
* @externs
*/
/**
BEGIN_NODE_INCLUDE
var ProtoBuf = require('protobufjs');
END_NODE_INCLUDE
*/
/**
* @typedef {Array}
*/
var Buffer;
/**
* @typedef {Object}
*/
var dcodeIO;
/**
* {@type Object.<string.*>}
*/
var ProtoBuf = {};
/**
* @type {string}
* @const
*/
ProtoBuf.VERSION;
/**
* @type {!Object.<string,number>}
* @const
*/
ProtoBuf.WIRE_TYPES = {};
/**
* @type {number}
* @const
*/
ProtoBuf.WIRE_TYPES.VARINT;
/**
* @type {number}
* @const
*/
ProtoBuf.WIRE_TYPES.BITS64;
/**
* @type {number}
* @const
*/
ProtoBuf.WIRE_TYPES.LDELIM;
/**
* @type {number}
* @const
*/
ProtoBuf.WIRE_TYPES.STARTGROUP;
/**
* @type {number}
* @const
*/
ProtoBuf.WIRE_TYPES.ENDGROUP;
/**
* @type {number}
* @const
*/
ProtoBuf.WIRE_TYPES.BITS32;
/**
* @type {!Array.<number>}
* @const
*/
ProtoBuf.PACKABLE_WIRE_TYPES;
/**
* @type {boolean}
*/
ProtoBuf.convertFieldsToCamelCase;
/**
* @type {boolean}
*/
ProtoBuf.populateAccessors;
/**
* @dict
* @type {!Object<string,{name: string, wireType: number}>}
* @const
*/
ProtoBuf.TYPES;
/**
* @type {number}
*/
ProtoBuf.ID_MIN;
/**
* @type {number}
*/
ProtoBuf.ID_MAX;
/**
* @type {!function(new: ByteBuffer, ...*)}
*/
ProtoBuf.ByteBuffer;
/**
* @type {?function(new: Long, ...*)}
*/
ProtoBuf.Long;
/**
* @type {!Object<string,string|RegExp>}
*/
ProtoBuf.Lang;
/**
* @type {Object<string, function(*)>}
*/
ProtoBuf.DotProto;
/**
* @param {string} proto
* @constructor
*/
ProtoBuf.DotProto.Tokenizer = function(proto) {};
/**
* @type {string}
*/
ProtoBuf.DotProto.Tokenizer.prototype.source;
/**
* @type {number}
*/
ProtoBuf.DotProto.Tokenizer.prototype.index;
/**
* @type {number}
*/
ProtoBuf.DotProto.Tokenizer.prototype.line;
/**
* @type {Array.<string>}
*/
ProtoBuf.DotProto.Tokenizer.prototype.stack;
/**
* @type {boolean}
*/
ProtoBuf.DotProto.Tokenizer.prototype.readingString;
/**
* @return {?string}
* @throws {Error}
*/
ProtoBuf.DotProto.Tokenizer.prototype.next = function() {};
/**
* @return {?string}
* @throws {Error}
*/
ProtoBuf.DotProto.Tokenizer.prototype.peek = function() {};
/**
* @return {string}
* @nosideeffects
*/
ProtoBuf.DotProto.Tokenizer.prototype.toString = function() {};
/**
* @param {string} proto
* @constructor
*/
ProtoBuf.DotProto.Parser = function(proto) {};
/**
* @type {!ProtoBuf.DotProto.Tokenizer}
*/
ProtoBuf.DotProto.Parser.prototype.tn;
/**
* @return {{package: (string|null), messages: Array.<Object>, enums: Array.<Object>, imports: Array.<string>, options: Object<string,*>}}
* @throws {Error}
*/
ProtoBuf.DotProto.Parser.prototype.parse = function() {};
/**
* @return {string}
* @nosideeffects
*/
ProtoBuf.DotProto.Parser.prototype.toString = function() {};
/**
* @type {Object<string, function(*)>}
*/
ProtoBuf.Reflect.Reflect = {};
/**
* @constructor
* @param {ProtoBuf.Reflect.T} parent
* @param {string} name Object name
*/
ProtoBuf.Reflect.T = function(parent, name) {};
/**
* @type {?ProtoBuf.Reflect.T}
*/
ProtoBuf.Reflect.T.prototype.parent;
/**
* @type {string}
*/
ProtoBuf.Reflect.T.prototype.name;
/**
* @returns {string}
* @nosideeffects
*/
ProtoBuf.Reflect.T.prototype.fqn = function() {};
/**
* @param {boolean=} includeClass
* @returns {string}
* @nosideeffects
*/
ProtoBuf.Reflect.T.prototype.toString = function(includeClass) {};
/**
* @throws {Error}
*/
ProtoBuf.Reflect.T.prototype.build = function() {};
/**
* @param {?ProtoBuf.Reflect.Namespace} parent
* @param {string} name
* @constructor
* @extends ProtoBuf.Reflect.T
*/
ProtoBuf.Reflect.Namespace = function(parent, name) {};
/**
* @type {Array.<ProtoBuf.Reflect.T>}
*/
ProtoBuf.Reflect.Namespace.prototype.children;
/**
* @param {ProtoBuf.Reflect.T=} type
* @return {Array.<ProtoBuf.Reflect.T>}
* @nosideeffects
*/
ProtoBuf.Reflect.Namespace.prototype.getChildren = function(type) {};
/**
* @param {ProtoBuf.Reflect.T} child
* @throws {Error}
*/
ProtoBuf.Reflect.Namespace.prototype.addChild = function(child) {};
/**
* @param {string|number} nameOrId
* @returns {boolean}
* @nosideeffects
*/
ProtoBuf.Reflect.Namespace.prototype.hasChild = function(nameOrId) {};
/**
* @param {string|number} nameOrId
* @return {?ProtoBuf.Reflect.T}
* @nosideeffects
*/
ProtoBuf.Reflect.Namespace.prototype.getChild = function(nameOrId) {};
/**
* @param {string} qn
* @param {boolean=} excludeFields
* @return {?ProtoBuf.Reflect.Namespace}
* @nosideeffects
*/
ProtoBuf.Reflect.Namespace.prototype.resolve = function(qn, excludeFields) {};
/**
* @return {Object.<string,Function|Object>}
*/
ProtoBuf.Reflect.Namespace.prototype.build = function() {};
/**
* @param {!ProtoBuf.Reflect.Namespace} parent
* @param {string} name
* @constructor
* @extends ProtoBuf.Reflect.Namespace
*/
ProtoBuf.Reflect.Message = function(parent, name) {};
/**
* @type {?Array.<number>}
*/
ProtoBuf.Reflect.Message.prototype.extensions;
/**
* @type {?ProtoBuf.Builder.Message}
*/
ProtoBuf.Reflect.Message.prototype.clazz;
/**
* @return {!ProtoBuf.Builder.Message}
* @throws {Error}
*/
ProtoBuf.Reflect.Message.prototype.build = function() {};
/**
* @param {!ProtoBuf.Builder.Message} message
* @param {!ByteBuffer} buffer
* @return {!ByteBuffer}
* @throws {Error}
*/
ProtoBuf.Reflect.Message.prototype.encode = function(message, buffer) {};
/**
* @param {!ProtoBuf.Builder.Message} message
* @return {number}
* @throws {Error}
*/
ProtoBuf.Reflect.Message.prototype.calculate = function(message) {};
/**
* @param {!ProtoBuf.Builder.Message} message
* @param {!ByteBuffer} buffer
* @param {boolean} noVerify
* @return {!ByteBuffer}
* @throws {Error}
*/
ProtoBuf.Reflect.Message.prototype.encodeDelimited = function(message, buffer, noVerify) {};
/**
* @param {!ByteBuffer} buffer
* @param {number=} length
* @return {!ProtoBuf.Builder.Message}
* @throws {Error}
*/
ProtoBuf.Reflect.Message.prototype.decode = function(buffer, length) {};
/**
* @param {!ByteBuffer} buffer
* @param {number=} length
* @return {!ProtoBuf.Builder.Message}
* @throws {Error}
*/
ProtoBuf.Reflect.Message.prototype.decodeDelimited = function(buffer, length) {};
/**
* @param {!ProtoBuf.Reflect.Message} message
* @param {string} rule
* @param {string} type
* @param {string} name
* @param {number} id
* @param {Object<string>=} options
* @constructor
* @extends ProtoBuf.Reflect.T
*/
ProtoBuf.Reflect.Message.Field = function(message, rule, type, name, id, options) {};
/**
* @type {boolean}
*/
ProtoBuf.Reflect.Message.Field.prototype.required;
/**
* @type {boolean}
*/
ProtoBuf.Reflect.Message.Field.prototype.repeated;
/**
* @type {string|{name: string, wireType: number}}
*/
ProtoBuf.Reflect.Message.Field.prototype.type;
/**
* @type {number}
*/
ProtoBuf.Reflect.Message.Field.prototype.id;
/**
* @type {!Object.<string,*>}
*/
ProtoBuf.Reflect.Message.Field.prototype.options;
/**
* @type {?ProtoBuf.Reflect.T}
*/
ProtoBuf.Reflect.Message.Field.prototype.resolvedType;
/**
* @type {string}
*/
ProtoBuf.Reflect.Message.Field.prototype.originalName;
/**
* @param {*} value
* @param {boolean=} skipRepeated
* @return {*}
* @throws {Error}
* @nosideeffects
*/
ProtoBuf.Reflect.Message.Field.prototype.verifyValue = function(value, skipRepeated) {};
/**
* @param {*} value
* @param {!ByteBuffer} buffer
* @return {!ByteBuffer}
* @throws {Error}
*/
ProtoBuf.Reflect.Message.Field.prototype.encode = function(value, buffer) {};
/**
* @param {*} value
* @return {number}
* @throws {Error}
* @nosideeffects
*/
ProtoBuf.Reflect.Message.Field.prototype.calculate = function(value) {};
/**
* @param {number} wireType
* @param {!ByteBuffer} buffer
* @return {*}
* @throws {Error}
*/
ProtoBuf.Reflect.Message.Field.prototype.decode = function(wireType, buffer) {};
/**
* @param {*} value
* @param {!ByteBuffer} buffer
* @return {!ByteBuffer}
* @throws {Error}
*/
ProtoBuf.Reflect.Message.Field.prototype.encodeValue = function(value, buffer) {};
/**
* @param {!ProtoBuf.Reflect.T} parent
* @param {string} name
* @constructor
* @extends ProtoBuf.Reflect.Namespace
*/
ProtoBuf.Reflect.Enum = function(parent, name) {};
/**
* @return {Object<string,*>}
*/
ProtoBuf.Reflect.Enum.prototype.build = function() {};
/**
* @type {?Object.<string,number>}
*/
ProtoBuf.Reflect.Enum.prototype.object;
/**
* @param {!ProtoBuf.Reflect.Enum} enm
* @param {string} name
* @param {number} id
* @constructor
* @extends ProtoBuf.Reflect.T
*/
ProtoBuf.Reflect.Enum.Value = function(enm, name, id) {};
/**
* @type {number}
*/
ProtoBuf.Reflect.Enum.Value.prototype.id;
/**
* @param {!ProtoBuf.Reflect.Namespace} root
* @param {string} name Service name
* @param {Object.<string,*>=} options
* @constructor
* @extends ProtoBuf.Reflect.Namespace
*/
ProtoBuf.Reflect.Service = function(root, name, options) {};
/**
* @type {ProtoBuf.Builder.Service}
*/
ProtoBuf.Reflect.Service.prototype.clazz;
/**
* @return {!ProtoBuf.Builder.Service}
* @throws {Error}
*/
ProtoBuf.Reflect.Service.prototype.build = function() {};
/**
* @param {!ProtoBuf.Reflect.Service} svc
* @param {string} name
* @param {Object.<string,*>=} options
* @constructor
* @extends ProtoBuf.Reflect.T
*/
ProtoBuf.Reflect.Service.Method = function(svc, name, options) {};
/**
* @return {Object.<string,*>}
*/
ProtoBuf.Reflect.Service.Method.prototype.buildOpt = function() {};
/**
* @param {!ProtoBuf.Reflect.Service} svc
* @param {string} name
* @param {string} request
* @param {string} response
* @param {Object.<string,*>=} options
* @constructor
* @extends ProtoBuf.Reflect.Service.Method
*/
ProtoBuf.Reflect.Service.RPCMethod = function(svc, name, request, response, options) {};
/**
* @type {string}
*/
ProtoBuf.Reflect.Service.RPCMethod.prototype.requestName;
/**
* @type {string}
*/
ProtoBuf.Reflect.Service.RPCMethod.prototype.responseName;
/**
* @type {ProtoBuf.Reflect.Message}
*/
ProtoBuf.Reflect.Service.RPCMethod.prototype.resolvedRequestType;
/**
* @type {ProtoBuf.Reflect.Message}
*/
ProtoBuf.Reflect.Service.RPCMethod.prototype.resolvedResponseType;
/**
* @constructor
*/
ProtoBuf.Builder = function() {};
/**
* @type {!ProtoBuf.Reflect.Namespace}
*/
ProtoBuf.Builder.prototype.ns;
/**
* @type {?ProtoBuf.Reflect.T}
*/
ProtoBuf.Builder.prototype.ptr;
/**
* @type {boolean}
*/
ProtoBuf.Builder.prototype.resolved;
/**
* @type {Object.<string,ProtoBuf.Builder.Message|Object>|null}
*/
ProtoBuf.Builder.prototype.result;
/**
* @type {Array.<string>}
*/
ProtoBuf.Builder.prototype.files;
/**
* @type {?string}
*/
ProtoBuf.Builder.prototype.importRoot;
/**
*/
ProtoBuf.Builder.prototype.reset = function() {};
/**
* @param {string} pkg
* @return {!ProtoBuf.Builder}
* @throws {Error}
*/
ProtoBuf.Builder.prototype.define = function(pkg) {};
/**
* @param {Object.<string,*>} def
* @return {boolean}
* @nosideeffects
*/
ProtoBuf.Builder.isValidMessage = function(def) {};
/**
* @param {Object.<string,*>} def
* @return {boolean}
* @nosideeffects
*/
ProtoBuf.Builder.isValidMessageField = function(def) {};
/**
* @param {Object.<string,*>} def
* @return {boolean}
*/
ProtoBuf.Builder.isValidEnum = function(def) {};
/**
* @param {Object.<string,*>} def
* @return {boolean}
*/
ProtoBuf.Builder.isValidService = function(def) {};
/**
* @param {Object.<string,*>} def
* @return {boolean}
*/
ProtoBuf.Builder.isValidExtend = function(def) {};
/**
* @param {Array.<Object.<string,*>>} messages
* @return {ProtoBuf.Builder}
* @throws {Error}
*/
ProtoBuf.Builder.prototype.create = function(messages) {};
/**
* @name ProtoBuf.Builder.prototype.import
* @function
* @param {ProtoBuf.Builder} builder
* @param {(string|{root: string, file: string})=} filename
* @return {!ProtoBuf.Builder}
* @throws {Error}
*/
ProtoBuf.Builder.prototype["import"] = function(builder, filename) {};
/**
* @throws {Error}
*/
ProtoBuf.Builder.prototype.resolveAll = function() {};
/**
* @param {string=} path
* @return {ProtoBuf.Builder.Message|Object.<string,*>}
* @throws {Error}
*/
ProtoBuf.Builder.prototype.build = function(path) {};
/**
* @param {string=} path
* @return {?ProtoBuf.Reflect.T}
*/
ProtoBuf.Builder.prototype.lookup = function(path) {};
/**
* @return {string}
* @nosideeffects
*/
ProtoBuf.Builder.prototype.toString = function() {};
/**
* @param {Object.<string,*>} values
* @constructor
* @throws {Error}
*/
ProtoBuf.Builder.Message = function(values) {};
/**
* @param {string} key
* @param {*} value
* @param {boolean=} noAssert
* @throws {Error}
*/
ProtoBuf.Builder.Message.prototype.add = function(key, value, noAssert) {};
/**
* @param {string} key
* @param {*} value
* @param {boolean=} noAssert
* @throws {Error}
*/
ProtoBuf.Builder.Message.prototype.$add = function(key, value, noAssert) {};
/**
* @param {string} key
* @param {*} value
* @param {boolean=} noAssert
* @throws {Error}
*/
ProtoBuf.Builder.Message.prototype.set = function(key, value, noAssert) {};
/**
* @param {string} key
* @param {*} value
* @param {boolean=} noAssert
* @throws {Error}
*/
ProtoBuf.Builder.Message.prototype.$set = function(key, value, noAssert) {};
/**
* @param {string} key
* @return {*}
* @throws {Error}
* @nosideeffects
*/
ProtoBuf.Builder.Message.prototype.get = function(key) {};
/**
* @param {string} key
* @return {*}
* @throws {Error}
* @nosideeffects
*/
ProtoBuf.Builder.Message.prototype.$get = function(key) {};
/**
* @param {ByteBuffer=} buffer
* @return {!ByteBuffer}
* @throws {Error}
*/
ProtoBuf.Builder.Message.prototype.encode = function(buffer) {};
/**
* @return {number}
* @throws {Error}
* @nosideeffects
*/
ProtoBuf.Builder.Message.prototype.calculate = function() {};
/**
* @return {!ArrayBuffer}
* @throws {Error}
*/
ProtoBuf.Builder.Message.prototype.encodeAB = function() {};
/**
* @return {!ArrayBuffer}
* @throws {Error}
* @nosideeffects
*/
ProtoBuf.Builder.Message.prototype.toArrayBuffer = function() {};
/**
* @return {!Buffer}
* @throws {Error}
*/
ProtoBuf.Builder.Message.prototype.encodeNB = function() {};
/**
* @return {!Buffer}
* @throws {Error}
* @nosideeffects
*/
ProtoBuf.Builder.Message.prototype.toBuffer = function() {};
/**
* @return {string}
* @throws {Error}
* @nosideeffects
*/
ProtoBuf.Builder.Message.prototype.encode64 = function() {};
/**
* @return {string}
* @throws {Error}
* @nosideeffects
*/
ProtoBuf.Builder.Message.prototype.toBase64 = function() {};
/**
* @return {string}
* @throws {Error}
* @nosideeffects
*/
ProtoBuf.Builder.Message.prototype.encodeHex = function() {};
/**
* @return {string}
* @throws {Error}
* @nosideeffects
*/
ProtoBuf.Builder.Message.prototype.toHex = function() {};
/**
* @param {boolean=} includeBuffers
* @return {Object.<string,*>}
* @nosideeffects
*/
ProtoBuf.Builder.Message.prototype.toRaw = function(includeBuffers) {};
/**
* @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer
* @param {string=} enc
* @return {!ProtoBuf.Builder.Message}
* @throws {Error}
* @nosideeffects
*/
ProtoBuf.Builder.Message.decode = function(buffer, enc) {};
/**
* @param {string} str
* @return {!ProtoBuf.Builder.Message}
* @throws {Error}
* @nosideeffects
*/
ProtoBuf.Builder.Message.decode64 = function(str) {};
/**
* @param {string} str
* @return {!ProtoBuf.Builder.Message}
* @throws {Error}
* @nosideeffects
*/
ProtoBuf.Builder.Message.decodeHex = function(str) {};
/**
* @return {string}
* @nosideeffects
*/
ProtoBuf.Builder.Message.prototype.toString = function() {};
/**
* @param {function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))} rpcImpl
* @constructor
*/
ProtoBuf.Builder.Service = function(rpcImpl) {};
/**
* @type {function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))}
*/
ProtoBuf.Builder.prototype.rpcImpl;
/**
* @param {string} proto
* @param {(ProtoBuf.Builder|string)=} builder
* @param {(string|{root: string, file: string})=} filename
* @return {!ProtoBuf.Builder}
* @throws {Error}
*/
ProtoBuf.loadProto = function(proto, builder, filename) {};
/**
* @param {string} proto
* @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder
* @param {(string|{root: string, file: string})=} filename
* @return {!ProtoBuf.Builder}
* @throws {Error}
*/
ProtoBuf.protoFromString = function(proto, builder, filename) {};
/**
* @param {string|{root: string, file: string}} filename
* @param {(function(ProtoBuf.Builder)|ProtoBuf.Builder)=} callback
* @param {ProtoBuf.Builder=} builder
* @return {ProtoBuf.Builder|undefined}
* @throws {Error}
*/
ProtoBuf.loadProtoFile = function(filename, callback, builder) {};
/**
* @param {string|{root: string, file: string}} filename
* @param {(function(ProtoBuf.Builder)|ProtoBuf.Builder)=} callback
* @param {ProtoBuf.Builder=} builder
* @return {ProtoBuf.Builder|undefined}
* @throws {Error}
*/
ProtoBuf.protoFromFile = function(filename, callback, builder) {};
/**
* @param {!*|string} json
* @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder
* @param {(string|{root: string, file: string})=} filename
* @return {!ProtoBuf.Builder}
* @throws {Error}
*/
ProtoBuf.loadJson = function(json, builder, filename) {};
/**
* @param {string|{root: string, file: string}} filename
* @param {(function(ProtoBuf.Builder)|ProtoBuf.Builder)=} callback
* @param {ProtoBuf.Builder=} builder
* @return {ProtoBuf.Builder|undefined}
* @throws {Error}
*/
ProtoBuf.loadJsonFile = function(filename, callback, builder) {};
/**
* @param {string=} pkg
* @return {!ProtoBuf.Builder}
*/
ProtoBuf.newBuilder = function(pkg) {};
ProtoBuf.Util = {};
/**
* @type {boolean}
*/
ProtoBuf.Util.IS_NODE;
/**
* @return {XMLHttpRequest}
*/
ProtoBuf.Util.XHR = function() {};
/**
* @param {string} path
* @param {function(?string)=} callback
* @return {?string|undefined}
*/
ProtoBuf.Util.fetch = function(path, callback) {};
/**
* @param {*} obj
* @return {boolean}
*/
ProtoBuf.Util.isArray = function(obj) {};

1
node_modules/protobufjs/index.js generated vendored Normal file
View File

@ -0,0 +1 @@
module.exports = require("./dist/protobuf.js");

12
node_modules/protobufjs/jsdoc.json generated vendored Normal file
View File

@ -0,0 +1,12 @@
{
"tags": {
"allowUnknownTags": true
},
"source": {
"include": ["dist/protobuf.js"]
},
"opts": {
"destination": "docs"
},
"plugins": ["plugins/markdown"]
}

96
node_modules/protobufjs/package.json generated vendored Normal file
View File

@ -0,0 +1,96 @@
{
"_from": "protobufjs@^5.0.1",
"_id": "protobufjs@5.0.3",
"_inBundle": false,
"_integrity": "sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA==",
"_location": "/protobufjs",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "protobufjs@^5.0.1",
"name": "protobufjs",
"escapedName": "protobufjs",
"rawSpec": "^5.0.1",
"saveSpec": null,
"fetchSpec": "^5.0.1"
},
"_requiredBy": [
"/mumble-streams"
],
"_resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-5.0.3.tgz",
"_shasum": "e4dfe9fb67c90b2630d15868249bcc4961467a17",
"_spec": "protobufjs@^5.0.1",
"_where": "/home/sergiu/linx-audio-simulator/node_modules/mumble-streams",
"author": {
"name": "Daniel Wirtz",
"email": "dcode@dcode.io"
},
"bin": {
"pbjs": "./bin/pbjs"
},
"browser": {
"fs": false,
"path": false
},
"bugs": {
"url": "https://github.com/dcodeIO/protobuf.js/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Frank Xu",
"email": "yyfrankyy@gmail.com"
}
],
"dependencies": {
"ascli": "~1",
"bytebuffer": "~5",
"glob": "^7.0.5",
"yargs": "^3.10.0"
},
"deprecated": false,
"description": "Protocol Buffers for JavaScript. Finally.",
"devDependencies": {
"closurecompiler": "~1",
"fixture-stdout": "^0.2.1",
"jsdoc": "~3.3.0-alpha10",
"metascript": ">=0.18 <1",
"testjs": "~1 >=1.0.4"
},
"engines": {
"node": ">=0.8"
},
"homepage": "https://github.com/dcodeIO/protobuf.js",
"keywords": [
"net",
"buffer",
"protobuf",
"serialization",
"bytebuffer",
"websocket",
"webrtc"
],
"license": "Apache-2.0",
"main": "./dist/protobuf.js",
"name": "protobufjs",
"repository": {
"type": "git",
"url": "git+https://github.com/dcodeIO/protobuf.js.git"
},
"scripts": {
"build": "node scripts/build.js",
"compile": "npm run-script compile-full && npm run-script compile-light",
"compile-full": "ccjs dist/protobuf.js --create_source_map=dist/protobuf.min.map --compilation_level=SIMPLE_OPTIMIZATIONS > dist/protobuf.min.js",
"compile-light": "ccjs dist/protobuf-light.js --create_source_map=dist/protobuf-light.min.map --compilation_level=SIMPLE_OPTIMIZATIONS > dist/protobuf-light.min.js",
"compress": "npm run-script compress-full && npm run-script compress-light",
"compress-full": "gzip -c -9 dist/protobuf.min.js > dist/protobuf.min.js.gz",
"compress-light": "gzip -c -9 dist/protobuf-light.min.js > dist/protobuf-light.min.js.gz",
"descriptor2json": "node bin/pbjs src/google/protobuf/descriptor.proto --target=json > src/google/protobuf/descriptor.json",
"jsdoc": "node node_modules/jsdoc/jsdoc.js -c jsdoc.json",
"make": "npm run-script build && npm run-script compile && npm run-script descriptor2json && npm run-script compress && npm test && npm run-script jsdoc",
"prepublish": "npm test",
"test": "node bin/pbjs tests/complex.proto --target=json > tests/complex.json && node node_modules/testjs/bin/testjs tests/suite.js"
},
"version": "5.0.3"
}

BIN
node_modules/protobufjs/protobuf.png generated vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

53
node_modules/protobufjs/scripts/build.js generated vendored Normal file
View File

@ -0,0 +1,53 @@
/*
Copyright 2013 Daniel Wirtz <dcode@dcode.io>
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.
*/
var MetaScript = require("metascript"),
path = require("path"),
fs = require("fs");
var rootDir = path.join(__dirname, ".."),
srcDir = path.join(rootDir, "src"),
distDir = path.join(rootDir, "dist"),
pkg = require(path.join(rootDir, "package.json")),
filename;
var scope = {
VERSION: pkg.version, // Version
DOTPROTO: true // Whether to include the ProtoBuf.DotProto package for .proto syntax support
};
// Make full build
console.log("Building protobuf.js with scope", JSON.stringify(scope, null, 2));
fs.writeFileSync(
path.join(distDir, "protobuf.js"),
MetaScript.transform(fs.readFileSync(filename = path.join(srcDir, "wrap.js")), filename, scope, srcDir)
);
// Make light build
scope.DOTPROTO = false;
console.log("Building protobuf-light.js with scope", JSON.stringify(scope, null, 2));
fs.writeFileSync(
path.join(distDir, "protobuf-light.js"),
MetaScript.transform(fs.readFileSync(filename = path.join(srcDir, "wrap.js")), filename, scope, srcDir)
);
// Update bower.json
scope = { VERSION: pkg.version };
console.log("Updating bower.json with scope", JSON.stringify(scope, null, 2));
fs.writeFileSync(
path.join(rootDir, "bower.json"),
MetaScript.transform(fs.readFileSync(filename = path.join(srcDir, "bower.json.in")), filename, scope, srcDir)
);

634
node_modules/protobufjs/src/ProtoBuf/Builder.js generated vendored Normal file
View File

@ -0,0 +1,634 @@
/**
* @alias ProtoBuf.Builder
* @expose
*/
ProtoBuf.Builder = (function(ProtoBuf, Lang, Reflect) {
"use strict";
/**
* Constructs a new Builder.
* @exports ProtoBuf.Builder
* @class Provides the functionality to build protocol messages.
* @param {Object.<string,*>=} options Options
* @constructor
*/
var Builder = function(options) {
/**
* Namespace.
* @type {ProtoBuf.Reflect.Namespace}
* @expose
*/
this.ns = new Reflect.Namespace(this, null, ""); // Global namespace
/**
* Namespace pointer.
* @type {ProtoBuf.Reflect.T}
* @expose
*/
this.ptr = this.ns;
/**
* Resolved flag.
* @type {boolean}
* @expose
*/
this.resolved = false;
/**
* The current building result.
* @type {Object.<string,ProtoBuf.Builder.Message|Object>|null}
* @expose
*/
this.result = null;
/**
* Imported files.
* @type {Array.<string>}
* @expose
*/
this.files = {};
/**
* Import root override.
* @type {?string}
* @expose
*/
this.importRoot = null;
/**
* Options.
* @type {!Object.<string, *>}
* @expose
*/
this.options = options || {};
};
/**
* @alias ProtoBuf.Builder.prototype
* @inner
*/
var BuilderPrototype = Builder.prototype;
// ----- Definition tests -----
/**
* Tests if a definition most likely describes a message.
* @param {!Object} def
* @returns {boolean}
* @expose
*/
Builder.isMessage = function(def) {
// Messages require a string name
if (typeof def["name"] !== 'string')
return false;
// Messages do not contain values (enum) or rpc methods (service)
if (typeof def["values"] !== 'undefined' || typeof def["rpc"] !== 'undefined')
return false;
return true;
};
/**
* Tests if a definition most likely describes a message field.
* @param {!Object} def
* @returns {boolean}
* @expose
*/
Builder.isMessageField = function(def) {
// Message fields require a string rule, name and type and an id
if (typeof def["rule"] !== 'string' || typeof def["name"] !== 'string' || typeof def["type"] !== 'string' || typeof def["id"] === 'undefined')
return false;
return true;
};
/**
* Tests if a definition most likely describes an enum.
* @param {!Object} def
* @returns {boolean}
* @expose
*/
Builder.isEnum = function(def) {
// Enums require a string name
if (typeof def["name"] !== 'string')
return false;
// Enums require at least one value
if (typeof def["values"] === 'undefined' || !Array.isArray(def["values"]) || def["values"].length === 0)
return false;
return true;
};
/**
* Tests if a definition most likely describes a service.
* @param {!Object} def
* @returns {boolean}
* @expose
*/
Builder.isService = function(def) {
// Services require a string name and an rpc object
if (typeof def["name"] !== 'string' || typeof def["rpc"] !== 'object' || !def["rpc"])
return false;
return true;
};
/**
* Tests if a definition most likely describes an extended message
* @param {!Object} def
* @returns {boolean}
* @expose
*/
Builder.isExtend = function(def) {
// Extends rquire a string ref
if (typeof def["ref"] !== 'string')
return false;
return true;
};
// ----- Building -----
/**
* Resets the pointer to the root namespace.
* @returns {!ProtoBuf.Builder} this
* @expose
*/
BuilderPrototype.reset = function() {
this.ptr = this.ns;
return this;
};
/**
* Defines a namespace on top of the current pointer position and places the pointer on it.
* @param {string} namespace
* @return {!ProtoBuf.Builder} this
* @expose
*/
BuilderPrototype.define = function(namespace) {
if (typeof namespace !== 'string' || !Lang.TYPEREF.test(namespace))
throw Error("illegal namespace: "+namespace);
namespace.split(".").forEach(function(part) {
var ns = this.ptr.getChild(part);
if (ns === null) // Keep existing
this.ptr.addChild(ns = new Reflect.Namespace(this, this.ptr, part));
this.ptr = ns;
}, this);
return this;
};
/**
* Creates the specified definitions at the current pointer position.
* @param {!Array.<!Object>} defs Messages, enums or services to create
* @returns {!ProtoBuf.Builder} this
* @throws {Error} If a message definition is invalid
* @expose
*/
BuilderPrototype.create = function(defs) {
if (!defs)
return this; // Nothing to create
if (!Array.isArray(defs))
defs = [defs];
else {
if (defs.length === 0)
return this;
defs = defs.slice();
}
// It's quite hard to keep track of scopes and memory here, so let's do this iteratively.
var stack = [defs];
while (stack.length > 0) {
defs = stack.pop();
if (!Array.isArray(defs)) // Stack always contains entire namespaces
throw Error("not a valid namespace: "+JSON.stringify(defs));
while (defs.length > 0) {
var def = defs.shift(); // Namespaces always contain an array of messages, enums and services
if (Builder.isMessage(def)) {
var obj = new Reflect.Message(this, this.ptr, def["name"], def["options"], def["isGroup"], def["syntax"]);
// Create OneOfs
var oneofs = {};
if (def["oneofs"])
Object.keys(def["oneofs"]).forEach(function(name) {
obj.addChild(oneofs[name] = new Reflect.Message.OneOf(this, obj, name));
}, this);
// Create fields
if (def["fields"])
def["fields"].forEach(function(fld) {
if (obj.getChild(fld["id"]|0) !== null)
throw Error("duplicate or invalid field id in "+obj.name+": "+fld['id']);
if (fld["options"] && typeof fld["options"] !== 'object')
throw Error("illegal field options in "+obj.name+"#"+fld["name"]);
var oneof = null;
if (typeof fld["oneof"] === 'string' && !(oneof = oneofs[fld["oneof"]]))
throw Error("illegal oneof in "+obj.name+"#"+fld["name"]+": "+fld["oneof"]);
fld = new Reflect.Message.Field(this, obj, fld["rule"], fld["keytype"], fld["type"], fld["name"], fld["id"], fld["options"], oneof, def["syntax"]);
if (oneof)
oneof.fields.push(fld);
obj.addChild(fld);
}, this);
// Push children to stack
var subObj = [];
if (def["enums"])
def["enums"].forEach(function(enm) {
subObj.push(enm);
});
if (def["messages"])
def["messages"].forEach(function(msg) {
subObj.push(msg);
});
if (def["services"])
def["services"].forEach(function(svc) {
subObj.push(svc);
});
// Set extension ranges
if (def["extensions"]) {
if (typeof def["extensions"][0] === 'number') // pre 5.0.1
obj.extensions = [ def["extensions"] ];
else
obj.extensions = def["extensions"];
}
// Create on top of current namespace
this.ptr.addChild(obj);
if (subObj.length > 0) {
stack.push(defs); // Push the current level back
defs = subObj; // Continue processing sub level
subObj = null;
this.ptr = obj; // And move the pointer to this namespace
obj = null;
continue;
}
subObj = null;
} else if (Builder.isEnum(def)) {
obj = new Reflect.Enum(this, this.ptr, def["name"], def["options"], def["syntax"]);
def["values"].forEach(function(val) {
obj.addChild(new Reflect.Enum.Value(this, obj, val["name"], val["id"]));
}, this);
this.ptr.addChild(obj);
} else if (Builder.isService(def)) {
obj = new Reflect.Service(this, this.ptr, def["name"], def["options"]);
Object.keys(def["rpc"]).forEach(function(name) {
var mtd = def["rpc"][name];
obj.addChild(new Reflect.Service.RPCMethod(this, obj, name, mtd["request"], mtd["response"], !!mtd["request_stream"], !!mtd["response_stream"], mtd["options"]));
}, this);
this.ptr.addChild(obj);
} else if (Builder.isExtend(def)) {
obj = this.ptr.resolve(def["ref"], true);
if (obj) {
def["fields"].forEach(function(fld) {
if (obj.getChild(fld['id']|0) !== null)
throw Error("duplicate extended field id in "+obj.name+": "+fld['id']);
// Check if field id is allowed to be extended
if (obj.extensions) {
var valid = false;
obj.extensions.forEach(function(range) {
if (fld["id"] >= range[0] && fld["id"] <= range[1])
valid = true;
});
if (!valid)
throw Error("illegal extended field id in "+obj.name+": "+fld['id']+" (not within valid ranges)");
}
// Convert extension field names to camel case notation if the override is set
var name = fld["name"];
if (this.options['convertFieldsToCamelCase'])
name = ProtoBuf.Util.toCamelCase(name);
// see #161: Extensions use their fully qualified name as their runtime key and...
var field = new Reflect.Message.ExtensionField(this, obj, fld["rule"], fld["type"], this.ptr.fqn()+'.'+name, fld["id"], fld["options"]);
// ...are added on top of the current namespace as an extension which is used for
// resolving their type later on (the extension always keeps the original name to
// prevent naming collisions)
var ext = new Reflect.Extension(this, this.ptr, fld["name"], field);
field.extension = ext;
this.ptr.addChild(ext);
obj.addChild(field);
}, this);
} else if (!/\.?google\.protobuf\./.test(def["ref"])) // Silently skip internal extensions
throw Error("extended message "+def["ref"]+" is not defined");
} else
throw Error("not a valid definition: "+JSON.stringify(def));
def = null;
obj = null;
}
// Break goes here
defs = null;
this.ptr = this.ptr.parent; // Namespace done, continue at parent
}
this.resolved = false; // Require re-resolve
this.result = null; // Require re-build
return this;
};
/**
* Propagates syntax to all children.
* @param {!Object} parent
* @inner
*/
function propagateSyntax(parent) {
if (parent['messages']) {
parent['messages'].forEach(function(child) {
child["syntax"] = parent["syntax"];
propagateSyntax(child);
});
}
if (parent['enums']) {
parent['enums'].forEach(function(child) {
child["syntax"] = parent["syntax"];
});
}
}
/**
* Imports another definition into this builder.
* @param {Object.<string,*>} json Parsed import
* @param {(string|{root: string, file: string})=} filename Imported file name
* @returns {!ProtoBuf.Builder} this
* @throws {Error} If the definition or file cannot be imported
* @expose
*/
BuilderPrototype["import"] = function(json, filename) {
var delim = '/';
// Make sure to skip duplicate imports
if (typeof filename === 'string') {
if (ProtoBuf.Util.IS_NODE)
filename = require("path")['resolve'](filename);
if (this.files[filename] === true)
return this.reset();
this.files[filename] = true;
} else if (typeof filename === 'object') { // Object with root, file.
var root = filename.root;
if (ProtoBuf.Util.IS_NODE)
root = require("path")['resolve'](root);
if (root.indexOf("\\") >= 0 || filename.file.indexOf("\\") >= 0)
delim = '\\';
var fname;
if (ProtoBuf.Util.IS_NODE)
fname = require("path")['join'](root, filename.file);
else
fname = root + delim + filename.file;
if (this.files[fname] === true)
return this.reset();
this.files[fname] = true;
}
// Import imports
if (json['imports'] && json['imports'].length > 0) {
var importRoot,
resetRoot = false;
if (typeof filename === 'object') { // If an import root is specified, override
this.importRoot = filename["root"]; resetRoot = true; // ... and reset afterwards
importRoot = this.importRoot;
filename = filename["file"];
if (importRoot.indexOf("\\") >= 0 || filename.indexOf("\\") >= 0)
delim = '\\';
} else if (typeof filename === 'string') {
if (this.importRoot) // If import root is overridden, use it
importRoot = this.importRoot;
else { // Otherwise compute from filename
if (filename.indexOf("/") >= 0) { // Unix
importRoot = filename.replace(/\/[^\/]*$/, "");
if (/* /file.proto */ importRoot === "")
importRoot = "/";
} else if (filename.indexOf("\\") >= 0) { // Windows
importRoot = filename.replace(/\\[^\\]*$/, "");
delim = '\\';
} else
importRoot = ".";
}
} else
importRoot = null;
for (var i=0; i<json['imports'].length; i++) {
if (typeof json['imports'][i] === 'string') { // Import file
if (!importRoot)
throw Error("cannot determine import root");
var importFilename = json['imports'][i];
if (importFilename === "google/protobuf/descriptor.proto")
continue; // Not needed and therefore not used
if (ProtoBuf.Util.IS_NODE)
importFilename = require("path")['join'](importRoot, importFilename);
else
importFilename = importRoot + delim + importFilename;
if (this.files[importFilename] === true)
continue; // Already imported
if (/\.proto$/i.test(importFilename) && !ProtoBuf.DotProto) // If this is a light build
importFilename = importFilename.replace(/\.proto$/, ".json"); // always load the JSON file
var contents = ProtoBuf.Util.fetch(importFilename);
if (contents === null)
throw Error("failed to import '"+importFilename+"' in '"+filename+"': file not found");
if (/\.json$/i.test(importFilename)) // Always possible
this["import"](JSON.parse(contents+""), importFilename); // May throw
else
this["import"](ProtoBuf.DotProto.Parser.parse(contents), importFilename); // May throw
} else // Import structure
if (!filename)
this["import"](json['imports'][i]);
else if (/\.(\w+)$/.test(filename)) // With extension: Append _importN to the name portion to make it unique
this["import"](json['imports'][i], filename.replace(/^(.+)\.(\w+)$/, function($0, $1, $2) { return $1+"_import"+i+"."+$2; }));
else // Without extension: Append _importN to make it unique
this["import"](json['imports'][i], filename+"_import"+i);
}
if (resetRoot) // Reset import root override when all imports are done
this.importRoot = null;
}
// Import structures
if (json['package'])
this.define(json['package']);
if (json['syntax'])
propagateSyntax(json);
var base = this.ptr;
if (json['options'])
Object.keys(json['options']).forEach(function(key) {
base.options[key] = json['options'][key];
});
if (json['messages'])
this.create(json['messages']),
this.ptr = base;
if (json['enums'])
this.create(json['enums']),
this.ptr = base;
if (json['services'])
this.create(json['services']),
this.ptr = base;
if (json['extends'])
this.create(json['extends']);
return this.reset();
};
/**
* Resolves all namespace objects.
* @throws {Error} If a type cannot be resolved
* @returns {!ProtoBuf.Builder} this
* @expose
*/
BuilderPrototype.resolveAll = function() {
// Resolve all reflected objects
var res;
if (this.ptr == null || typeof this.ptr.type === 'object')
return this; // Done (already resolved)
if (this.ptr instanceof Reflect.Namespace) { // Resolve children
this.ptr.children.forEach(function(child) {
this.ptr = child;
this.resolveAll();
}, this);
} else if (this.ptr instanceof Reflect.Message.Field) { // Resolve type
if (!Lang.TYPE.test(this.ptr.type)) {
if (!Lang.TYPEREF.test(this.ptr.type))
throw Error("illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.type);
res = (this.ptr instanceof Reflect.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, true);
if (!res)
throw Error("unresolvable type reference in "+this.ptr.toString(true)+": "+this.ptr.type);
this.ptr.resolvedType = res;
if (res instanceof Reflect.Enum) {
this.ptr.type = ProtoBuf.TYPES["enum"];
if (this.ptr.syntax === 'proto3' && res.syntax !== 'proto3')
throw Error("proto3 message cannot reference proto2 enum");
}
else if (res instanceof Reflect.Message)
this.ptr.type = res.isGroup ? ProtoBuf.TYPES["group"] : ProtoBuf.TYPES["message"];
else
throw Error("illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.type);
} else
this.ptr.type = ProtoBuf.TYPES[this.ptr.type];
// If it's a map field, also resolve the key type. The key type can be only a numeric, string, or bool type
// (i.e., no enums or messages), so we don't need to resolve against the current namespace.
if (this.ptr.map) {
if (!Lang.TYPE.test(this.ptr.keyType))
throw Error("illegal key type for map field in "+this.ptr.toString(true)+": "+this.ptr.keyType);
this.ptr.keyType = ProtoBuf.TYPES[this.ptr.keyType];
}
// If it's a repeated and packable field then proto3 mandates it should be packed by
// default
if (
this.ptr.syntax === 'proto3' &&
this.ptr.repeated && this.ptr.options.packed === undefined &&
ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.ptr.type.wireType) !== -1
) {
this.ptr.options.packed = true;
}
} else if (this.ptr instanceof ProtoBuf.Reflect.Service.Method) {
if (this.ptr instanceof ProtoBuf.Reflect.Service.RPCMethod) {
res = this.ptr.parent.resolve(this.ptr.requestName, true);
if (!res || !(res instanceof ProtoBuf.Reflect.Message))
throw Error("Illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.requestName);
this.ptr.resolvedRequestType = res;
res = this.ptr.parent.resolve(this.ptr.responseName, true);
if (!res || !(res instanceof ProtoBuf.Reflect.Message))
throw Error("Illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.responseName);
this.ptr.resolvedResponseType = res;
} else // Should not happen as nothing else is implemented
throw Error("illegal service type in "+this.ptr.toString(true));
} else if (
!(this.ptr instanceof ProtoBuf.Reflect.Message.OneOf) && // Not built
!(this.ptr instanceof ProtoBuf.Reflect.Extension) && // Not built
!(this.ptr instanceof ProtoBuf.Reflect.Enum.Value) // Built in enum
)
throw Error("illegal object in namespace: "+typeof(this.ptr)+": "+this.ptr);
return this.reset();
};
/**
* Builds the protocol. This will first try to resolve all definitions and, if this has been successful,
* return the built package.
* @param {(string|Array.<string>)=} path Specifies what to return. If omitted, the entire namespace will be returned.
* @returns {!ProtoBuf.Builder.Message|!Object.<string,*>}
* @throws {Error} If a type could not be resolved
* @expose
*/
BuilderPrototype.build = function(path) {
this.reset();
if (!this.resolved)
this.resolveAll(),
this.resolved = true,
this.result = null; // Require re-build
if (this.result === null) // (Re-)Build
this.result = this.ns.build();
if (!path)
return this.result;
var part = typeof path === 'string' ? path.split(".") : path,
ptr = this.result; // Build namespace pointer (no hasChild etc.)
for (var i=0; i<part.length; i++)
if (ptr[part[i]])
ptr = ptr[part[i]];
else {
ptr = null;
break;
}
return ptr;
};
/**
* Similar to {@link ProtoBuf.Builder#build}, but looks up the internal reflection descriptor.
* @param {string=} path Specifies what to return. If omitted, the entire namespace wiil be returned.
* @param {boolean=} excludeNonNamespace Excludes non-namespace types like fields, defaults to `false`
* @returns {?ProtoBuf.Reflect.T} Reflection descriptor or `null` if not found
*/
BuilderPrototype.lookup = function(path, excludeNonNamespace) {
return path ? this.ns.resolve(path, excludeNonNamespace) : this.ns;
};
/**
* Returns a string representation of this object.
* @return {string} String representation as of "Builder"
* @expose
*/
BuilderPrototype.toString = function() {
return "Builder";
};
// ----- Base classes -----
// Exist for the sole purpose of being able to "... instanceof ProtoBuf.Builder.Message" etc.
/**
* @alias ProtoBuf.Builder.Message
*/
Builder.Message = function() {};
/**
* @alias ProtoBuf.Builder.Enum
*/
Builder.Enum = function() {};
/**
* @alias ProtoBuf.Builder.Message
*/
Builder.Service = function() {};
return Builder;
})(ProtoBuf, ProtoBuf.Lang, ProtoBuf.Reflect);

22
node_modules/protobufjs/src/ProtoBuf/Builder/Enum.js generated vendored Normal file
View File

@ -0,0 +1,22 @@
// This file is not included currently and exists for documentation purposes only.
/*?
// --- Scope ------------------
// T : Reflect.Enum instance
*/
/**
* Constructs a new runtime Enum.
* @name ProtoBuf.Builder.Enum
* @class Barebone of all runtime enums.
* @constructor
*/
var Enum = function() {
ProtoBuf.Builder.Enum.call(this);
};
/**
* @alias ProtoBuf.Builder.Enum.prototype
* @inner
*/
var EnumPrototype = Enum.prototype = Object.create(ProtoBuf.Builder.Enum.prototype);

721
node_modules/protobufjs/src/ProtoBuf/Builder/Message.js generated vendored Normal file
View File

@ -0,0 +1,721 @@
/*?
// --- Scope ------------------
// T : Reflect.Message instance
*/
var fields = T.getChildren(ProtoBuf.Reflect.Message.Field),
oneofs = T.getChildren(ProtoBuf.Reflect.Message.OneOf);
/**
* Constructs a new runtime Message.
* @name ProtoBuf.Builder.Message
* @class Barebone of all runtime messages.
* @param {!Object.<string,*>|string} values Preset values
* @param {...string} var_args
* @constructor
* @throws {Error} If the message cannot be created
*/
var Message = function(values, var_args) {
ProtoBuf.Builder.Message.call(this);
// Create virtual oneof properties
for (var i=0, k=oneofs.length; i<k; ++i)
this[oneofs[i].name] = null;
// Create fields and set default values
for (i=0, k=fields.length; i<k; ++i) {
var field = fields[i];
this[field.name] =
field.repeated ? [] :
(field.map ? new ProtoBuf.Map(field) : null);
if ((field.required || T.syntax === 'proto3') &&
field.defaultValue !== null)
this[field.name] = field.defaultValue;
}
if (arguments.length > 0) {
var value;
// Set field values from a values object
if (arguments.length === 1 && values !== null && typeof values === 'object' &&
/* not _another_ Message */ (typeof values.encode !== 'function' || values instanceof Message) &&
/* not a repeated field */ !Array.isArray(values) &&
/* not a Map */ !(values instanceof ProtoBuf.Map) &&
/* not a ByteBuffer */ !ByteBuffer.isByteBuffer(values) &&
/* not an ArrayBuffer */ !(values instanceof ArrayBuffer) &&
/* not a Long */ !(ProtoBuf.Long && values instanceof ProtoBuf.Long)) {
this.$set(values);
} else // Set field values from arguments, in declaration order
for (i=0, k=arguments.length; i<k; ++i)
if (typeof (value = arguments[i]) !== 'undefined')
this.$set(fields[i].name, value); // May throw
}
};
/**
* @alias ProtoBuf.Builder.Message.prototype
* @inner
*/
var MessagePrototype = Message.prototype = Object.create(ProtoBuf.Builder.Message.prototype);
/**
* Adds a value to a repeated field.
* @name ProtoBuf.Builder.Message#add
* @function
* @param {string} key Field name
* @param {*} value Value to add
* @param {boolean=} noAssert Whether to assert the value or not (asserts by default)
* @returns {!ProtoBuf.Builder.Message} this
* @throws {Error} If the value cannot be added
* @expose
*/
MessagePrototype.add = function(key, value, noAssert) {
var field = T._fieldsByName[key];
if (!noAssert) {
if (!field)
throw Error(this+"#"+key+" is undefined");
if (!(field instanceof ProtoBuf.Reflect.Message.Field))
throw Error(this+"#"+key+" is not a field: "+field.toString(true)); // May throw if it's an enum or embedded message
if (!field.repeated)
throw Error(this+"#"+key+" is not a repeated field");
value = field.verifyValue(value, true);
}
if (this[key] === null)
this[key] = [];
this[key].push(value);
return this;
};
/**
* Adds a value to a repeated field. This is an alias for {@link ProtoBuf.Builder.Message#add}.
* @name ProtoBuf.Builder.Message#$add
* @function
* @param {string} key Field name
* @param {*} value Value to add
* @param {boolean=} noAssert Whether to assert the value or not (asserts by default)
* @returns {!ProtoBuf.Builder.Message} this
* @throws {Error} If the value cannot be added
* @expose
*/
MessagePrototype.$add = MessagePrototype.add;
/**
* Sets a field's value.
* @name ProtoBuf.Builder.Message#set
* @function
* @param {string|!Object.<string,*>} keyOrObj String key or plain object holding multiple values
* @param {(*|boolean)=} value Value to set if key is a string, otherwise omitted
* @param {boolean=} noAssert Whether to not assert for an actual field / proper value type, defaults to `false`
* @returns {!ProtoBuf.Builder.Message} this
* @throws {Error} If the value cannot be set
* @expose
*/
MessagePrototype.set = function(keyOrObj, value, noAssert) {
if (keyOrObj && typeof keyOrObj === 'object') {
noAssert = value;
for (var ikey in keyOrObj) {
// Check if virtual oneof field - don't set these
if (keyOrObj.hasOwnProperty(ikey) && typeof (value = keyOrObj[ikey]) !== 'undefined' && T._oneofsByName[ikey] === undefined)
this.$set(ikey, value, noAssert);
}
return this;
}
var field = T._fieldsByName[keyOrObj];
if (!noAssert) {
if (!field)
throw Error(this+"#"+keyOrObj+" is not a field: undefined");
if (!(field instanceof ProtoBuf.Reflect.Message.Field))
throw Error(this+"#"+keyOrObj+" is not a field: "+field.toString(true));
this[field.name] = (value = field.verifyValue(value)); // May throw
} else
this[keyOrObj] = value;
if (field && field.oneof) { // Field is part of an OneOf (not a virtual OneOf field)
var currentField = this[field.oneof.name]; // Virtual field references currently set field
if (value !== null) {
if (currentField !== null && currentField !== field.name)
this[currentField] = null; // Clear currently set field
this[field.oneof.name] = field.name; // Point virtual field at this field
} else if (/* value === null && */currentField === keyOrObj)
this[field.oneof.name] = null; // Clear virtual field (current field explicitly cleared)
}
return this;
};
/**
* Sets a field's value. This is an alias for [@link ProtoBuf.Builder.Message#set}.
* @name ProtoBuf.Builder.Message#$set
* @function
* @param {string|!Object.<string,*>} keyOrObj String key or plain object holding multiple values
* @param {(*|boolean)=} value Value to set if key is a string, otherwise omitted
* @param {boolean=} noAssert Whether to not assert the value, defaults to `false`
* @throws {Error} If the value cannot be set
* @expose
*/
MessagePrototype.$set = MessagePrototype.set;
/**
* Gets a field's value.
* @name ProtoBuf.Builder.Message#get
* @function
* @param {string} key Key
* @param {boolean=} noAssert Whether to not assert for an actual field, defaults to `false`
* @return {*} Value
* @throws {Error} If there is no such field
* @expose
*/
MessagePrototype.get = function(key, noAssert) {
if (noAssert)
return this[key];
var field = T._fieldsByName[key];
if (!field || !(field instanceof ProtoBuf.Reflect.Message.Field))
throw Error(this+"#"+key+" is not a field: undefined");
if (!(field instanceof ProtoBuf.Reflect.Message.Field))
throw Error(this+"#"+key+" is not a field: "+field.toString(true));
return this[field.name];
};
/**
* Gets a field's value. This is an alias for {@link ProtoBuf.Builder.Message#$get}.
* @name ProtoBuf.Builder.Message#$get
* @function
* @param {string} key Key
* @return {*} Value
* @throws {Error} If there is no such field
* @expose
*/
MessagePrototype.$get = MessagePrototype.get;
// Getters and setters
for (var i=0; i<fields.length; i++) {
var field = fields[i];
// no setters for extension fields as these are named by their fqn
if (field instanceof ProtoBuf.Reflect.Message.ExtensionField)
continue;
if (T.builder.options['populateAccessors'])
(function(field) {
// set/get[SomeValue]
var Name = field.originalName.replace(/(_[a-zA-Z])/g, function(match) {
return match.toUpperCase().replace('_','');
});
Name = Name.substring(0,1).toUpperCase() + Name.substring(1);
// set/get_[some_value] FIXME: Do we really need these?
var name = field.originalName.replace(/([A-Z])/g, function(match) {
return "_"+match;
});
/**
* The current field's unbound setter function.
* @function
* @param {*} value
* @param {boolean=} noAssert
* @returns {!ProtoBuf.Builder.Message}
* @inner
*/
var setter = function(value, noAssert) {
this[field.name] = noAssert ? value : field.verifyValue(value);
return this;
};
/**
* The current field's unbound getter function.
* @function
* @returns {*}
* @inner
*/
var getter = function() {
return this[field.name];
};
if (T.getChild("set"+Name) === null)
/**
* Sets a value. This method is present for each field, but only if there is no name conflict with
* another field.
* @name ProtoBuf.Builder.Message#set[SomeField]
* @function
* @param {*} value Value to set
* @param {boolean=} noAssert Whether to not assert the value, defaults to `false`
* @returns {!ProtoBuf.Builder.Message} this
* @abstract
* @throws {Error} If the value cannot be set
*/
MessagePrototype["set"+Name] = setter;
if (T.getChild("set_"+name) === null)
/**
* Sets a value. This method is present for each field, but only if there is no name conflict with
* another field.
* @name ProtoBuf.Builder.Message#set_[some_field]
* @function
* @param {*} value Value to set
* @param {boolean=} noAssert Whether to not assert the value, defaults to `false`
* @returns {!ProtoBuf.Builder.Message} this
* @abstract
* @throws {Error} If the value cannot be set
*/
MessagePrototype["set_"+name] = setter;
if (T.getChild("get"+Name) === null)
/**
* Gets a value. This method is present for each field, but only if there is no name conflict with
* another field.
* @name ProtoBuf.Builder.Message#get[SomeField]
* @function
* @abstract
* @return {*} The value
*/
MessagePrototype["get"+Name] = getter;
if (T.getChild("get_"+name) === null)
/**
* Gets a value. This method is present for each field, but only if there is no name conflict with
* another field.
* @name ProtoBuf.Builder.Message#get_[some_field]
* @function
* @return {*} The value
* @abstract
*/
MessagePrototype["get_"+name] = getter;
})(field);
}
// En-/decoding
/**
* Encodes the message.
* @name ProtoBuf.Builder.Message#$encode
* @function
* @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted.
* @param {boolean=} noVerify Whether to not verify field values, defaults to `false`
* @return {!ByteBuffer} Encoded message as a ByteBuffer
* @throws {Error} If the message cannot be encoded or if required fields are missing. The later still
* returns the encoded ByteBuffer in the `encoded` property on the error.
* @expose
* @see ProtoBuf.Builder.Message#encode64
* @see ProtoBuf.Builder.Message#encodeHex
* @see ProtoBuf.Builder.Message#encodeAB
*/
MessagePrototype.encode = function(buffer, noVerify) {
if (typeof buffer === 'boolean')
noVerify = buffer,
buffer = undefined;
var isNew = false;
if (!buffer)
buffer = new ByteBuffer(),
isNew = true;
var le = buffer.littleEndian;
try {
T.encode(this, buffer.LE(), noVerify);
return (isNew ? buffer.flip() : buffer).LE(le);
} catch (e) {
buffer.LE(le);
throw(e);
}
};
/**
* Encodes a message using the specified data payload.
* @param {!Object.<string,*>} data Data payload
* @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted.
* @param {boolean=} noVerify Whether to not verify field values, defaults to `false`
* @return {!ByteBuffer} Encoded message as a ByteBuffer
* @expose
*/
Message.encode = function(data, buffer, noVerify) {
return new Message(data).encode(buffer, noVerify);
};
/**
* Calculates the byte length of the message.
* @name ProtoBuf.Builder.Message#calculate
* @function
* @returns {number} Byte length
* @throws {Error} If the message cannot be calculated or if required fields are missing.
* @expose
*/
MessagePrototype.calculate = function() {
return T.calculate(this);
};
/**
* Encodes the varint32 length-delimited message.
* @name ProtoBuf.Builder.Message#encodeDelimited
* @function
* @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted.
* @param {boolean=} noVerify Whether to not verify field values, defaults to `false`
* @return {!ByteBuffer} Encoded message as a ByteBuffer
* @throws {Error} If the message cannot be encoded or if required fields are missing. The later still
* returns the encoded ByteBuffer in the `encoded` property on the error.
* @expose
*/
MessagePrototype.encodeDelimited = function(buffer, noVerify) {
var isNew = false;
if (!buffer)
buffer = new ByteBuffer(),
isNew = true;
var enc = new ByteBuffer().LE();
T.encode(this, enc, noVerify).flip();
buffer.writeVarint32(enc.remaining());
buffer.append(enc);
return isNew ? buffer.flip() : buffer;
};
/**
* Directly encodes the message to an ArrayBuffer.
* @name ProtoBuf.Builder.Message#encodeAB
* @function
* @return {ArrayBuffer} Encoded message as ArrayBuffer
* @throws {Error} If the message cannot be encoded or if required fields are missing. The later still
* returns the encoded ArrayBuffer in the `encoded` property on the error.
* @expose
*/
MessagePrototype.encodeAB = function() {
try {
return this.encode().toArrayBuffer();
} catch (e) {
if (e["encoded"]) e["encoded"] = e["encoded"].toArrayBuffer();
throw(e);
}
};
/**
* Returns the message as an ArrayBuffer. This is an alias for {@link ProtoBuf.Builder.Message#encodeAB}.
* @name ProtoBuf.Builder.Message#toArrayBuffer
* @function
* @return {ArrayBuffer} Encoded message as ArrayBuffer
* @throws {Error} If the message cannot be encoded or if required fields are missing. The later still
* returns the encoded ArrayBuffer in the `encoded` property on the error.
* @expose
*/
MessagePrototype.toArrayBuffer = MessagePrototype.encodeAB;
/**
* Directly encodes the message to a node Buffer.
* @name ProtoBuf.Builder.Message#encodeNB
* @function
* @return {!Buffer}
* @throws {Error} If the message cannot be encoded, not running under node.js or if required fields are
* missing. The later still returns the encoded node Buffer in the `encoded` property on the error.
* @expose
*/
MessagePrototype.encodeNB = function() {
try {
return this.encode().toBuffer();
} catch (e) {
if (e["encoded"]) e["encoded"] = e["encoded"].toBuffer();
throw(e);
}
};
/**
* Returns the message as a node Buffer. This is an alias for {@link ProtoBuf.Builder.Message#encodeNB}.
* @name ProtoBuf.Builder.Message#toBuffer
* @function
* @return {!Buffer}
* @throws {Error} If the message cannot be encoded or if required fields are missing. The later still
* returns the encoded node Buffer in the `encoded` property on the error.
* @expose
*/
MessagePrototype.toBuffer = MessagePrototype.encodeNB;
/**
* Directly encodes the message to a base64 encoded string.
* @name ProtoBuf.Builder.Message#encode64
* @function
* @return {string} Base64 encoded string
* @throws {Error} If the underlying buffer cannot be encoded or if required fields are missing. The later
* still returns the encoded base64 string in the `encoded` property on the error.
* @expose
*/
MessagePrototype.encode64 = function() {
try {
return this.encode().toBase64();
} catch (e) {
if (e["encoded"]) e["encoded"] = e["encoded"].toBase64();
throw(e);
}
};
/**
* Returns the message as a base64 encoded string. This is an alias for {@link ProtoBuf.Builder.Message#encode64}.
* @name ProtoBuf.Builder.Message#toBase64
* @function
* @return {string} Base64 encoded string
* @throws {Error} If the message cannot be encoded or if required fields are missing. The later still
* returns the encoded base64 string in the `encoded` property on the error.
* @expose
*/
MessagePrototype.toBase64 = MessagePrototype.encode64;
/**
* Directly encodes the message to a hex encoded string.
* @name ProtoBuf.Builder.Message#encodeHex
* @function
* @return {string} Hex encoded string
* @throws {Error} If the underlying buffer cannot be encoded or if required fields are missing. The later
* still returns the encoded hex string in the `encoded` property on the error.
* @expose
*/
MessagePrototype.encodeHex = function() {
try {
return this.encode().toHex();
} catch (e) {
if (e["encoded"]) e["encoded"] = e["encoded"].toHex();
throw(e);
}
};
/**
* Returns the message as a hex encoded string. This is an alias for {@link ProtoBuf.Builder.Message#encodeHex}.
* @name ProtoBuf.Builder.Message#toHex
* @function
* @return {string} Hex encoded string
* @throws {Error} If the message cannot be encoded or if required fields are missing. The later still
* returns the encoded hex string in the `encoded` property on the error.
* @expose
*/
MessagePrototype.toHex = MessagePrototype.encodeHex;
/**
* Clones a message object or field value to a raw object.
* @param {*} obj Object to clone
* @param {boolean} binaryAsBase64 Whether to include binary data as base64 strings or as a buffer otherwise
* @param {boolean} longsAsStrings Whether to encode longs as strings
* @param {!ProtoBuf.Reflect.T=} resolvedType The resolved field type if a field
* @returns {*} Cloned object
* @inner
*/
function cloneRaw(obj, binaryAsBase64, longsAsStrings, resolvedType) {
if (obj === null || typeof obj !== 'object') {
// Convert enum values to their respective names
if (resolvedType && resolvedType instanceof ProtoBuf.Reflect.Enum) {
var name = ProtoBuf.Reflect.Enum.getName(resolvedType.object, obj);
if (name !== null)
return name;
}
// Pass-through string, number, boolean, null...
return obj;
}
// Convert ByteBuffers to raw buffer or strings
if (ByteBuffer.isByteBuffer(obj))
return binaryAsBase64 ? obj.toBase64() : obj.toBuffer();
// Convert Longs to proper objects or strings
if (ProtoBuf.Long.isLong(obj))
return longsAsStrings ? obj.toString() : ProtoBuf.Long.fromValue(obj);
var clone;
// Clone arrays
if (Array.isArray(obj)) {
clone = [];
obj.forEach(function(v, k) {
clone[k] = cloneRaw(v, binaryAsBase64, longsAsStrings, resolvedType);
});
return clone;
}
clone = {};
// Convert maps to objects
if (obj instanceof ProtoBuf.Map) {
var it = obj.entries();
for (var e = it.next(); !e.done; e = it.next())
clone[obj.keyElem.valueToString(e.value[0])] = cloneRaw(e.value[1], binaryAsBase64, longsAsStrings, obj.valueElem.resolvedType);
return clone;
}
// Everything else is a non-null object
var type = obj.$type,
field = undefined;
for (var i in obj)
if (obj.hasOwnProperty(i)) {
if (type && (field = type.getChild(i)))
clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings, field.resolvedType);
else
clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings);
}
return clone;
}
/**
* Returns the message's raw payload.
* @param {boolean=} binaryAsBase64 Whether to include binary data as base64 strings instead of Buffers, defaults to `false`
* @param {boolean} longsAsStrings Whether to encode longs as strings
* @returns {Object.<string,*>} Raw payload
* @expose
*/
MessagePrototype.toRaw = function(binaryAsBase64, longsAsStrings) {
return cloneRaw(this, !!binaryAsBase64, !!longsAsStrings, this.$type);
};
/**
* Encodes a message to JSON.
* @returns {string} JSON string
* @expose
*/
MessagePrototype.encodeJSON = function() {
return JSON.stringify(
cloneRaw(this,
/* binary-as-base64 */ true,
/* longs-as-strings */ true,
this.$type
)
);
};
/**
* Decodes a message from the specified buffer or string.
* @name ProtoBuf.Builder.Message.decode
* @function
* @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from
* @param {(number|string)=} length Message length. Defaults to decode all the remainig data.
* @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64
* @return {!ProtoBuf.Builder.Message} Decoded message
* @throws {Error} If the message cannot be decoded or if required fields are missing. The later still
* returns the decoded message with missing fields in the `decoded` property on the error.
* @expose
* @see ProtoBuf.Builder.Message.decode64
* @see ProtoBuf.Builder.Message.decodeHex
*/
Message.decode = function(buffer, length, enc) {
if (typeof length === 'string')
enc = length,
length = -1;
if (typeof buffer === 'string')
buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64");
else if (!ByteBuffer.isByteBuffer(buffer))
buffer = ByteBuffer.wrap(buffer); // May throw
var le = buffer.littleEndian;
try {
var msg = T.decode(buffer.LE(), length);
buffer.LE(le);
return msg;
} catch (e) {
buffer.LE(le);
throw(e);
}
};
/**
* Decodes a varint32 length-delimited message from the specified buffer or string.
* @name ProtoBuf.Builder.Message.decodeDelimited
* @function
* @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from
* @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64
* @return {ProtoBuf.Builder.Message} Decoded message or `null` if not enough bytes are available yet
* @throws {Error} If the message cannot be decoded or if required fields are missing. The later still
* returns the decoded message with missing fields in the `decoded` property on the error.
* @expose
*/
Message.decodeDelimited = function(buffer, enc) {
if (typeof buffer === 'string')
buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64");
else if (!ByteBuffer.isByteBuffer(buffer))
buffer = ByteBuffer.wrap(buffer); // May throw
if (buffer.remaining() < 1)
return null;
var off = buffer.offset,
len = buffer.readVarint32();
if (buffer.remaining() < len) {
buffer.offset = off;
return null;
}
try {
var msg = T.decode(buffer.slice(buffer.offset, buffer.offset + len).LE());
buffer.offset += len;
return msg;
} catch (err) {
buffer.offset += len;
throw err;
}
};
/**
* Decodes the message from the specified base64 encoded string.
* @name ProtoBuf.Builder.Message.decode64
* @function
* @param {string} str String to decode from
* @return {!ProtoBuf.Builder.Message} Decoded message
* @throws {Error} If the message cannot be decoded or if required fields are missing. The later still
* returns the decoded message with missing fields in the `decoded` property on the error.
* @expose
*/
Message.decode64 = function(str) {
return Message.decode(str, "base64");
};
/**
* Decodes the message from the specified hex encoded string.
* @name ProtoBuf.Builder.Message.decodeHex
* @function
* @param {string} str String to decode from
* @return {!ProtoBuf.Builder.Message} Decoded message
* @throws {Error} If the message cannot be decoded or if required fields are missing. The later still
* returns the decoded message with missing fields in the `decoded` property on the error.
* @expose
*/
Message.decodeHex = function(str) {
return Message.decode(str, "hex");
};
/**
* Decodes the message from a JSON string.
* @name ProtoBuf.Builder.Message.decodeJSON
* @function
* @param {string} str String to decode from
* @return {!ProtoBuf.Builder.Message} Decoded message
* @throws {Error} If the message cannot be decoded or if required fields are
* missing.
* @expose
*/
Message.decodeJSON = function(str) {
return new Message(JSON.parse(str));
};
// Utility
/**
* Returns a string representation of this Message.
* @name ProtoBuf.Builder.Message#toString
* @function
* @return {string} String representation as of ".Fully.Qualified.MessageName"
* @expose
*/
MessagePrototype.toString = function() {
return T.toString();
};
// Properties
/**
* Message options.
* @name ProtoBuf.Builder.Message.$options
* @type {Object.<string,*>}
* @expose
*/
var $optionsS; // cc needs this
/**
* Message options.
* @name ProtoBuf.Builder.Message#$options
* @type {Object.<string,*>}
* @expose
*/
var $options;
/**
* Reflection type.
* @name ProtoBuf.Builder.Message.$type
* @type {!ProtoBuf.Reflect.Message}
* @expose
*/
var $typeS;
/**
* Reflection type.
* @name ProtoBuf.Builder.Message#$type
* @type {!ProtoBuf.Reflect.Message}
* @expose
*/
var $type;
if (Object.defineProperty)
Object.defineProperty(Message, '$options', { "value": T.buildOpt() }),
Object.defineProperty(MessagePrototype, "$options", { "value": Message["$options"] }),
Object.defineProperty(Message, "$type", { "value": T }),
Object.defineProperty(MessagePrototype, "$type", { "value": T });

144
node_modules/protobufjs/src/ProtoBuf/Builder/Service.js generated vendored Normal file
View File

@ -0,0 +1,144 @@
/*?
// --- Scope ------------------
// T : Reflect.Service instance
*/
/**
* Constructs a new runtime Service.
* @name ProtoBuf.Builder.Service
* @param {function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))=} rpcImpl RPC implementation receiving the method name and the message
* @class Barebone of all runtime services.
* @constructor
* @throws {Error} If the service cannot be created
*/
var Service = function(rpcImpl) {
ProtoBuf.Builder.Service.call(this);
/**
* Service implementation.
* @name ProtoBuf.Builder.Service#rpcImpl
* @type {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))}
* @expose
*/
this.rpcImpl = rpcImpl || function(name, msg, callback) {
// This is what a user has to implement: A function receiving the method name, the actual message to
// send (type checked) and the callback that's either provided with the error as its first
// argument or null and the actual response message.
setTimeout(callback.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0); // Must be async!
};
};
/**
* @alias ProtoBuf.Builder.Service.prototype
* @inner
*/
var ServicePrototype = Service.prototype = Object.create(ProtoBuf.Builder.Service.prototype);
/**
* Asynchronously performs an RPC call using the given RPC implementation.
* @name ProtoBuf.Builder.Service.[Method]
* @function
* @param {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))} rpcImpl RPC implementation
* @param {ProtoBuf.Builder.Message} req Request
* @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving
* the error if any and the response either as a pre-parsed message or as its raw bytes
* @abstract
*/
/**
* Asynchronously performs an RPC call using the instance's RPC implementation.
* @name ProtoBuf.Builder.Service#[Method]
* @function
* @param {ProtoBuf.Builder.Message} req Request
* @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving
* the error if any and the response either as a pre-parsed message or as its raw bytes
* @abstract
*/
var rpc = T.getChildren(ProtoBuf.Reflect.Service.RPCMethod);
for (var i=0; i<rpc.length; i++) {
(function(method) {
// service#Method(message, callback)
ServicePrototype[method.name] = function(req, callback) {
try {
try {
// If given as a buffer, decode the request. Will throw a TypeError if not a valid buffer.
req = method.resolvedRequestType.clazz.decode(ByteBuffer.wrap(req));
} catch (err) {
if (!(err instanceof TypeError))
throw err;
}
if (req === null || typeof req !== 'object')
throw Error("Illegal arguments");
if (!(req instanceof method.resolvedRequestType.clazz))
req = new method.resolvedRequestType.clazz(req);
this.rpcImpl(method.fqn(), req, function(err, res) { // Assumes that this is properly async
if (err) {
callback(err);
return;
}
// Coalesce to empty string when service response has empty content
if (res === null)
res = ''
try { res = method.resolvedResponseType.clazz.decode(res); } catch (notABuffer) {}
if (!res || !(res instanceof method.resolvedResponseType.clazz)) {
callback(Error("Illegal response type received in service method "+ T.name+"#"+method.name));
return;
}
callback(null, res);
});
} catch (err) {
setTimeout(callback.bind(this, err), 0);
}
};
// Service.Method(rpcImpl, message, callback)
Service[method.name] = function(rpcImpl, req, callback) {
new Service(rpcImpl)[method.name](req, callback);
};
if (Object.defineProperty)
Object.defineProperty(Service[method.name], "$options", { "value": method.buildOpt() }),
Object.defineProperty(ServicePrototype[method.name], "$options", { "value": Service[method.name]["$options"] });
})(rpc[i]);
}
// Properties
/**
* Service options.
* @name ProtoBuf.Builder.Service.$options
* @type {Object.<string,*>}
* @expose
*/
var $optionsS; // cc needs this
/**
* Service options.
* @name ProtoBuf.Builder.Service#$options
* @type {Object.<string,*>}
* @expose
*/
var $options;
/**
* Reflection type.
* @name ProtoBuf.Builder.Service.$type
* @type {!ProtoBuf.Reflect.Service}
* @expose
*/
var $typeS;
/**
* Reflection type.
* @name ProtoBuf.Builder.Service#$type
* @type {!ProtoBuf.Reflect.Service}
* @expose
*/
var $type;
if (Object.defineProperty)
Object.defineProperty(Service, "$options", { "value": T.buildOpt() }),
Object.defineProperty(ServicePrototype, "$options", { "value": Service["$options"] }),
Object.defineProperty(Service, "$type", { "value": T }),
Object.defineProperty(ServicePrototype, "$type", { "value": T });

33
node_modules/protobufjs/src/ProtoBuf/DotProto.js generated vendored Normal file
View File

@ -0,0 +1,33 @@
/**
* @alias ProtoBuf.DotProto
* @expose
*/
ProtoBuf.DotProto = (function(ProtoBuf, Lang) {
"use strict";
/**
* Utilities to parse .proto files.
* @exports ProtoBuf.DotProto
* @namespace
*/
var DotProto = {};
//? include("DotProto/Tokenizer.js");
/**
* @alias ProtoBuf.DotProto.Tokenizer
* @expose
*/
DotProto.Tokenizer = Tokenizer;
//? include("DotProto/Parser.js");
/**
* @alias ProtoBuf.DotProto.Parser
* @expose
*/
DotProto.Parser = Parser;
return DotProto;
})(ProtoBuf, ProtoBuf.Lang);

Some files were not shown because too many files have changed in this diff Show More