stage-browser 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +92 -45
- package/build/icon.icns +0 -0
- package/build/icon.png +0 -0
- package/dist/bin/stage.js +111 -0
- package/dist/main/cli-args.js +28 -0
- package/dist/main/context-menu.js +68 -0
- package/dist/main/context.js +2 -0
- package/dist/main/extensions.js +78 -0
- package/dist/main/ipc.js +73 -0
- package/dist/main/main.js +282 -0
- package/dist/main/menu.js +140 -0
- package/dist/main/reveal.js +170 -0
- package/dist/main/selftest.js +570 -0
- package/dist/main/store.js +85 -0
- package/dist/main/suggest.js +43 -0
- package/dist/main/tabs.js +324 -0
- package/dist/main/ui-window.js +133 -0
- package/dist/main/url.js +38 -0
- package/dist/main/window.js +133 -0
- package/dist/preload/extension-compat.js +163 -0
- package/dist/preload/ui-preload.js +34 -0
- package/dist/shared/contract.js +6 -0
- package/dist/ui/app.js +692 -0
- package/{src → dist}/ui/index.html +15 -5
- package/dist/ui/mock.js +500 -0
- package/{src → dist}/ui/styles.css +55 -14
- package/node_modules/@types/chrome/LICENSE +21 -0
- package/node_modules/@types/chrome/README.md +15 -0
- package/node_modules/@types/chrome/chrome-cast/index.d.ts +1156 -0
- package/node_modules/@types/chrome/har-format/index.d.ts +6 -0
- package/node_modules/@types/chrome/index.d.ts +13786 -0
- package/node_modules/@types/chrome/package.json +99 -0
- package/node_modules/@types/filesystem/LICENSE +21 -0
- package/node_modules/@types/filesystem/README.md +15 -0
- package/node_modules/@types/filesystem/index.d.ts +564 -0
- package/node_modules/@types/filesystem/package.json +26 -0
- package/node_modules/@types/filewriter/LICENSE +21 -0
- package/node_modules/@types/filewriter/README.md +15 -0
- package/node_modules/@types/filewriter/index.d.ts +166 -0
- package/node_modules/@types/filewriter/package.json +25 -0
- package/node_modules/@types/har-format/LICENSE +21 -0
- package/node_modules/@types/har-format/README.md +15 -0
- package/node_modules/@types/har-format/index.d.ts +938 -0
- package/node_modules/@types/har-format/package.json +31 -0
- package/node_modules/adm-zip/LICENSE +21 -0
- package/node_modules/adm-zip/README.md +90 -0
- package/node_modules/adm-zip/adm-zip.js +1020 -0
- package/node_modules/adm-zip/headers/entryHeader.js +396 -0
- package/node_modules/adm-zip/headers/index.js +2 -0
- package/node_modules/adm-zip/headers/mainHeader.js +177 -0
- package/node_modules/adm-zip/methods/deflater.js +33 -0
- package/node_modules/adm-zip/methods/index.js +3 -0
- package/node_modules/adm-zip/methods/inflater.js +64 -0
- package/node_modules/adm-zip/methods/zipcrypto.js +175 -0
- package/node_modules/adm-zip/package.json +56 -0
- package/node_modules/adm-zip/types.d.ts +223 -0
- package/node_modules/adm-zip/util/constants.js +142 -0
- package/node_modules/adm-zip/util/decoder.js +5 -0
- package/node_modules/adm-zip/util/errors.js +66 -0
- package/node_modules/adm-zip/util/fattr.js +76 -0
- package/node_modules/adm-zip/util/index.js +5 -0
- package/node_modules/adm-zip/util/utils.js +481 -0
- package/node_modules/adm-zip/zipEntry.js +415 -0
- package/node_modules/adm-zip/zipFile.js +466 -0
- package/node_modules/debug/LICENSE +20 -0
- package/node_modules/debug/README.md +481 -0
- package/node_modules/debug/package.json +64 -0
- package/node_modules/debug/src/browser.js +272 -0
- package/node_modules/debug/src/common.js +292 -0
- package/node_modules/debug/src/index.js +10 -0
- package/node_modules/debug/src/node.js +263 -0
- package/node_modules/electron-chrome-web-store/README.md +143 -0
- package/node_modules/electron-chrome-web-store/dist/chrome-web-store.preload.js +299 -0
- package/node_modules/electron-chrome-web-store/dist/cjs/browser/index.js +1674 -0
- package/node_modules/electron-chrome-web-store/dist/esm/browser/index.mjs +950 -0
- package/node_modules/electron-chrome-web-store/dist/types/browser/api.d.ts +2 -0
- package/node_modules/electron-chrome-web-store/dist/types/browser/crx3.d.ts +20 -0
- package/node_modules/electron-chrome-web-store/dist/types/browser/id.d.ts +9 -0
- package/node_modules/electron-chrome-web-store/dist/types/browser/index.d.ts +62 -0
- package/node_modules/electron-chrome-web-store/dist/types/browser/installer.d.ts +29 -0
- package/node_modules/electron-chrome-web-store/dist/types/browser/loader.d.ts +18 -0
- package/node_modules/electron-chrome-web-store/dist/types/browser/types.d.ts +21 -0
- package/node_modules/electron-chrome-web-store/dist/types/browser/updater.d.ts +6 -0
- package/node_modules/electron-chrome-web-store/dist/types/browser/utils.d.ts +4 -0
- package/node_modules/electron-chrome-web-store/dist/types/common/constants.d.ts +44 -0
- package/node_modules/electron-chrome-web-store/dist/types/renderer/chrome-web-store.preload.d.ts +1 -0
- package/node_modules/electron-chrome-web-store/package.json +43 -0
- package/node_modules/ms/index.js +162 -0
- package/node_modules/ms/license.md +21 -0
- package/node_modules/ms/package.json +38 -0
- package/node_modules/ms/readme.md +59 -0
- package/node_modules/pbf/LICENSE +27 -0
- package/node_modules/pbf/README.md +293 -0
- package/node_modules/pbf/bin/pbf +17 -0
- package/node_modules/pbf/compile.js +441 -0
- package/node_modules/pbf/dist/pbf-dev.js +838 -0
- package/node_modules/pbf/dist/pbf.js +1 -0
- package/node_modules/pbf/index.d.ts +206 -0
- package/node_modules/pbf/index.js +830 -0
- package/node_modules/pbf/package.json +63 -0
- package/node_modules/protocol-buffers-schema/.travis.yml +7 -0
- package/node_modules/protocol-buffers-schema/LICENSE +21 -0
- package/node_modules/protocol-buffers-schema/README.md +122 -0
- package/node_modules/protocol-buffers-schema/example.js +11 -0
- package/node_modules/protocol-buffers-schema/example.proto +13 -0
- package/node_modules/protocol-buffers-schema/index.js +6 -0
- package/node_modules/protocol-buffers-schema/package.json +31 -0
- package/node_modules/protocol-buffers-schema/parse.js +769 -0
- package/node_modules/protocol-buffers-schema/stringify.js +206 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/basic.json +90 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/basic.proto +11 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/comments.json +99 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/comments.proto +19 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/complex.json +125 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/complex.proto +30 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/enum.json +42 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/enum.proto +8 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/escaped-quotes.json +32 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/escaped-quotes.proto +3 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/extend.json +167 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/extend.proto +19 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/import.json +30 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/import.proto +6 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/map.json +33 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/map.proto +3 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/no-tags.proto +8 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/oneof.json +41 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/oneof.proto +6 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/option.json +364 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/option.proto +72 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/options.json +47 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/options.proto +8 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/pheromon-trajectories.proto +8 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/reserved.json +55 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/reserved.proto +17 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/search.json +30 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/search.proto +5 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/service.json +108 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/service.proto +30 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/valid-packed.proto +35 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/version.json +90 -0
- package/node_modules/protocol-buffers-schema/test/fixtures/version.proto +13 -0
- package/node_modules/protocol-buffers-schema/test/index.js +157 -0
- package/node_modules/protocol-buffers-schema/tokenize.js +56 -0
- package/node_modules/resolve-protobuf-schema/.travis.yml +3 -0
- package/node_modules/resolve-protobuf-schema/LICENSE +21 -0
- package/node_modules/resolve-protobuf-schema/README.md +49 -0
- package/node_modules/resolve-protobuf-schema/index.js +50 -0
- package/node_modules/resolve-protobuf-schema/package.json +25 -0
- package/node_modules/resolve-protobuf-schema/test/a.proto +5 -0
- package/node_modules/resolve-protobuf-schema/test/b.proto +5 -0
- package/node_modules/resolve-protobuf-schema/test/c.proto +3 -0
- package/node_modules/resolve-protobuf-schema/test/index.js +49 -0
- package/package.json +35 -11
- package/bin/stage.js +0 -52
- package/src/main/cli-args.js +0 -28
- package/src/main/context-menu.js +0 -64
- package/src/main/extensions.js +0 -61
- package/src/main/main.js +0 -310
- package/src/main/menu.js +0 -171
- package/src/main/reveal.js +0 -141
- package/src/main/selftest.js +0 -383
- package/src/main/store.js +0 -77
- package/src/main/suggest.js +0 -50
- package/src/main/tabs.js +0 -351
- package/src/main/url.js +0 -37
- package/src/main/window.js +0 -71
- package/src/preload/extension-compat.js +0 -34
- package/src/preload/ui-preload.js +0 -40
- package/src/ui/app.js +0 -588
- package/src/ui/mock.js +0 -455
- /package/{src → dist}/ui/newtab.html +0 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
var onimport = function (i, result) {
|
|
2
|
+
result.push('import "' + i + '";', '')
|
|
3
|
+
return result
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
var onfield = function (f, result) {
|
|
7
|
+
var prefix = f.repeated ? 'repeated' : f.required ? 'required' : 'optional'
|
|
8
|
+
if (f.type === 'map') prefix = 'map<' + f.map.from + ',' + f.map.to + '>'
|
|
9
|
+
if (f.oneof) prefix = ''
|
|
10
|
+
|
|
11
|
+
var opts = Object.keys(f.options || {}).map(function (key) {
|
|
12
|
+
return key + ' = ' + f.options[key]
|
|
13
|
+
}).join(',')
|
|
14
|
+
|
|
15
|
+
if (opts) opts = ' [' + opts + ']'
|
|
16
|
+
|
|
17
|
+
result.push((prefix ? prefix + ' ' : '') + (f.map === 'map' ? '' : f.type + ' ') + f.name + ' = ' + f.tag + opts + ';')
|
|
18
|
+
return result
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
var onmessage = function (m, result) {
|
|
22
|
+
result.push('message ' + m.name + ' {')
|
|
23
|
+
|
|
24
|
+
if (!m.options) m.options = {}
|
|
25
|
+
onoption(m.options, result)
|
|
26
|
+
|
|
27
|
+
if (!m.enums) m.enums = []
|
|
28
|
+
m.enums.forEach(function (e) {
|
|
29
|
+
result.push(onenum(e, []))
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
if (!m.messages) m.messages = []
|
|
33
|
+
m.messages.forEach(function (m) {
|
|
34
|
+
result.push(onmessage(m, []))
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
var oneofs = {}
|
|
38
|
+
|
|
39
|
+
if (!m.fields) m.fields = []
|
|
40
|
+
m.fields.forEach(function (f) {
|
|
41
|
+
if (f.oneof) {
|
|
42
|
+
if (!oneofs[f.oneof]) oneofs[f.oneof] = []
|
|
43
|
+
oneofs[f.oneof].push(onfield(f, []))
|
|
44
|
+
} else {
|
|
45
|
+
result.push(onfield(f, []))
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
Object.keys(oneofs).forEach(function (n) {
|
|
50
|
+
oneofs[n].unshift('oneof ' + n + ' {')
|
|
51
|
+
oneofs[n].push('}')
|
|
52
|
+
result.push(oneofs[n])
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
result.push('}', '')
|
|
56
|
+
return result
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
var onenum = function (e, result) {
|
|
60
|
+
result.push('enum ' + e.name + ' {')
|
|
61
|
+
if (!e.options) e.options = {}
|
|
62
|
+
var options = onoption(e.options, [])
|
|
63
|
+
if (options.length > 1) {
|
|
64
|
+
result.push(options.slice(0, -1))
|
|
65
|
+
}
|
|
66
|
+
Object.keys(e.values).map(function (v) {
|
|
67
|
+
var val = onenumvalue(e.values[v])
|
|
68
|
+
result.push([v + ' = ' + val + ';'])
|
|
69
|
+
})
|
|
70
|
+
result.push('}', '')
|
|
71
|
+
return result
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
var onenumvalue = function (v, result) {
|
|
75
|
+
var opts = Object.keys(v.options || {}).map(function (key) {
|
|
76
|
+
return key + ' = ' + v.options[key]
|
|
77
|
+
}).join(',')
|
|
78
|
+
|
|
79
|
+
if (opts) opts = ' [' + opts + ']'
|
|
80
|
+
var val = v.value + opts
|
|
81
|
+
return val
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
var onoption = function (o, result) {
|
|
85
|
+
var keys = Object.keys(o)
|
|
86
|
+
keys.forEach(function (option) {
|
|
87
|
+
var v = o[option]
|
|
88
|
+
if (~option.indexOf('.')) option = '(' + option + ')'
|
|
89
|
+
|
|
90
|
+
var type = typeof v
|
|
91
|
+
|
|
92
|
+
if (type === 'object') {
|
|
93
|
+
v = onoptionMap(v, [])
|
|
94
|
+
if (v.length) result.push('option ' + option + ' = {', v, '};')
|
|
95
|
+
} else {
|
|
96
|
+
if (type === 'string' && option !== 'optimize_for') v = '"' + v + '"'
|
|
97
|
+
result.push('option ' + option + ' = ' + v + ';')
|
|
98
|
+
}
|
|
99
|
+
})
|
|
100
|
+
if (keys.length > 0) {
|
|
101
|
+
result.push('')
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return result
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
var onoptionMap = function (o, result) {
|
|
108
|
+
var keys = Object.keys(o)
|
|
109
|
+
keys.forEach(function (k) {
|
|
110
|
+
var v = o[k]
|
|
111
|
+
|
|
112
|
+
var type = typeof v
|
|
113
|
+
|
|
114
|
+
if (type === 'object') {
|
|
115
|
+
if (Array.isArray(v)) {
|
|
116
|
+
v.forEach(function (v) {
|
|
117
|
+
v = onoptionMap(v, [])
|
|
118
|
+
if (v.length) result.push(k + ' {', v, '}')
|
|
119
|
+
})
|
|
120
|
+
} else {
|
|
121
|
+
v = onoptionMap(v, [])
|
|
122
|
+
if (v.length) result.push(k + ' {', v, '}')
|
|
123
|
+
}
|
|
124
|
+
} else {
|
|
125
|
+
if (type === 'string') v = '"' + v + '"'
|
|
126
|
+
result.push(k + ': ' + v)
|
|
127
|
+
}
|
|
128
|
+
})
|
|
129
|
+
|
|
130
|
+
return result
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
var onservices = function (s, result) {
|
|
134
|
+
result.push('service ' + s.name + ' {')
|
|
135
|
+
|
|
136
|
+
if (!s.options) s.options = {}
|
|
137
|
+
onoption(s.options, result)
|
|
138
|
+
if (!s.methods) s.methods = []
|
|
139
|
+
s.methods.forEach(function (m) {
|
|
140
|
+
result.push(onrpc(m, []))
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
result.push('}', '')
|
|
144
|
+
return result
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
var onrpc = function (rpc, result) {
|
|
148
|
+
var def = 'rpc ' + rpc.name + '('
|
|
149
|
+
if (rpc.client_streaming) def += 'stream '
|
|
150
|
+
def += rpc.input_type + ') returns ('
|
|
151
|
+
if (rpc.server_streaming) def += 'stream '
|
|
152
|
+
def += rpc.output_type + ')'
|
|
153
|
+
|
|
154
|
+
if (!rpc.options) rpc.options = {}
|
|
155
|
+
|
|
156
|
+
var options = onoption(rpc.options, [])
|
|
157
|
+
if (options.length > 1) {
|
|
158
|
+
result.push(def + ' {', options.slice(0, -1), '}')
|
|
159
|
+
} else {
|
|
160
|
+
result.push(def + ';')
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return result
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
var indent = function (lvl) {
|
|
167
|
+
return function (line) {
|
|
168
|
+
if (Array.isArray(line)) return line.map(indent(lvl + ' ')).join('\n')
|
|
169
|
+
return lvl + line
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
module.exports = function (schema) {
|
|
174
|
+
var result = []
|
|
175
|
+
|
|
176
|
+
result.push('syntax = "proto' + schema.syntax + '";', '')
|
|
177
|
+
|
|
178
|
+
if (schema.package) result.push('package ' + schema.package + ';', '')
|
|
179
|
+
|
|
180
|
+
if (schema.imports) {
|
|
181
|
+
schema.imports.forEach(function (i) {
|
|
182
|
+
onimport(i, result)
|
|
183
|
+
})
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
if (!schema.options) schema.options = {}
|
|
187
|
+
|
|
188
|
+
onoption(schema.options, result)
|
|
189
|
+
|
|
190
|
+
if (!schema.enums) schema.enums = []
|
|
191
|
+
schema.enums.forEach(function (e) {
|
|
192
|
+
onenum(e, result)
|
|
193
|
+
})
|
|
194
|
+
|
|
195
|
+
if (!schema.messages) schema.messages = []
|
|
196
|
+
schema.messages.forEach(function (m) {
|
|
197
|
+
onmessage(m, result)
|
|
198
|
+
})
|
|
199
|
+
|
|
200
|
+
if (schema.services) {
|
|
201
|
+
schema.services.forEach(function (s) {
|
|
202
|
+
onservices(s, result)
|
|
203
|
+
})
|
|
204
|
+
}
|
|
205
|
+
return result.map(indent('')).join('\n')
|
|
206
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"syntax": 3,
|
|
3
|
+
"package": null,
|
|
4
|
+
"imports": [],
|
|
5
|
+
"enums": [],
|
|
6
|
+
"extends": [],
|
|
7
|
+
"messages": [
|
|
8
|
+
{
|
|
9
|
+
"name": "Point",
|
|
10
|
+
"enums": [],
|
|
11
|
+
"extends": [],
|
|
12
|
+
"messages": [],
|
|
13
|
+
"options": {},
|
|
14
|
+
"extensions": null,
|
|
15
|
+
"fields": [
|
|
16
|
+
{
|
|
17
|
+
"name": "x",
|
|
18
|
+
"type": "int32",
|
|
19
|
+
"tag": 1,
|
|
20
|
+
"map": null,
|
|
21
|
+
"oneof": null,
|
|
22
|
+
"required": true,
|
|
23
|
+
"repeated": false,
|
|
24
|
+
"options": {}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "y",
|
|
28
|
+
"type": "int32",
|
|
29
|
+
"tag": 2,
|
|
30
|
+
"map": null,
|
|
31
|
+
"oneof": null,
|
|
32
|
+
"required": true,
|
|
33
|
+
"repeated": false,
|
|
34
|
+
"options": {}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "label",
|
|
38
|
+
"type": "string",
|
|
39
|
+
"tag": 3,
|
|
40
|
+
"map": null,
|
|
41
|
+
"oneof": null,
|
|
42
|
+
"required": false,
|
|
43
|
+
"repeated": false,
|
|
44
|
+
"options": {}
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "Line",
|
|
50
|
+
"enums": [],
|
|
51
|
+
"extends": [],
|
|
52
|
+
"extensions": null,
|
|
53
|
+
"messages": [],
|
|
54
|
+
"options": {},
|
|
55
|
+
"fields": [
|
|
56
|
+
{
|
|
57
|
+
"name": "start",
|
|
58
|
+
"type": "Point",
|
|
59
|
+
"tag": 1,
|
|
60
|
+
"map": null,
|
|
61
|
+
"oneof": null,
|
|
62
|
+
"required": true,
|
|
63
|
+
"repeated": false,
|
|
64
|
+
"options": {}
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "end",
|
|
68
|
+
"type": "Point",
|
|
69
|
+
"tag": 2,
|
|
70
|
+
"map": null,
|
|
71
|
+
"oneof": null,
|
|
72
|
+
"required": true,
|
|
73
|
+
"repeated": false,
|
|
74
|
+
"options": {}
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "label",
|
|
78
|
+
"type": "string",
|
|
79
|
+
"tag": 3,
|
|
80
|
+
"map": null,
|
|
81
|
+
"oneof": null,
|
|
82
|
+
"required": false,
|
|
83
|
+
"repeated": false,
|
|
84
|
+
"options": {}
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"options":{}
|
|
90
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{
|
|
2
|
+
"syntax": 3,
|
|
3
|
+
"package": null,
|
|
4
|
+
"imports": [],
|
|
5
|
+
"enums": [],
|
|
6
|
+
"extends": [],
|
|
7
|
+
"messages": [
|
|
8
|
+
{
|
|
9
|
+
"name": "Point",
|
|
10
|
+
"enums": [],
|
|
11
|
+
"extends": [],
|
|
12
|
+
"messages": [],
|
|
13
|
+
"options": {},
|
|
14
|
+
"extensions": null,
|
|
15
|
+
"fields": [
|
|
16
|
+
{
|
|
17
|
+
"name": "x",
|
|
18
|
+
"type": "int32",
|
|
19
|
+
"tag": 1,
|
|
20
|
+
"map": null,
|
|
21
|
+
"oneof": null,
|
|
22
|
+
"required": true,
|
|
23
|
+
"repeated": false,
|
|
24
|
+
"options": {}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "y",
|
|
28
|
+
"type": "int32",
|
|
29
|
+
"tag": 2,
|
|
30
|
+
"map": null,
|
|
31
|
+
"oneof": null,
|
|
32
|
+
"required": true,
|
|
33
|
+
"repeated": false,
|
|
34
|
+
"options": {}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "label",
|
|
38
|
+
"type": "string",
|
|
39
|
+
"tag": 3,
|
|
40
|
+
"map": null,
|
|
41
|
+
"oneof": null,
|
|
42
|
+
"required": false,
|
|
43
|
+
"repeated": false,
|
|
44
|
+
"options": {}
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "Line",
|
|
50
|
+
"enums": [],
|
|
51
|
+
"extends": [],
|
|
52
|
+
"options": {},
|
|
53
|
+
"extensions": null,
|
|
54
|
+
"messages": [],
|
|
55
|
+
"fields": [
|
|
56
|
+
{
|
|
57
|
+
"name": "start",
|
|
58
|
+
"type": "Point",
|
|
59
|
+
"tag": 1,
|
|
60
|
+
"map": null,
|
|
61
|
+
"oneof": null,
|
|
62
|
+
"required": true,
|
|
63
|
+
"repeated": false,
|
|
64
|
+
"options": {}
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "end",
|
|
68
|
+
"type": "Point",
|
|
69
|
+
"tag": 2,
|
|
70
|
+
"map": null,
|
|
71
|
+
"oneof": null,
|
|
72
|
+
"required": true,
|
|
73
|
+
"repeated": false,
|
|
74
|
+
"options": {}
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "label",
|
|
78
|
+
"type": "string",
|
|
79
|
+
"tag": 3,
|
|
80
|
+
"map": null,
|
|
81
|
+
"oneof": null,
|
|
82
|
+
"required": false,
|
|
83
|
+
"repeated": false,
|
|
84
|
+
"options": {}
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "A",
|
|
90
|
+
"enums": [],
|
|
91
|
+
"extends": [],
|
|
92
|
+
"options": {},
|
|
93
|
+
"messages": [],
|
|
94
|
+
"fields": [],
|
|
95
|
+
"extensions": null
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
"options":{}
|
|
99
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//Single-line comment
|
|
2
|
+
message Point {
|
|
3
|
+
required int32 x = 1;
|
|
4
|
+
required int32 y = 2;
|
|
5
|
+
optional string label = 3;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/*Multi-line comment*/
|
|
9
|
+
message Line {/*
|
|
10
|
+
*/required Point start = 1;
|
|
11
|
+
required Point end = 2;
|
|
12
|
+
optional string label = 3;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Doxygen-style comment
|
|
17
|
+
**/
|
|
18
|
+
message A {
|
|
19
|
+
}//Comment after closing brace of last message
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
{
|
|
2
|
+
"syntax": 3,
|
|
3
|
+
"package": "tutorial",
|
|
4
|
+
"imports": [],
|
|
5
|
+
"enums": [],
|
|
6
|
+
"messages": [{
|
|
7
|
+
"name": "Person",
|
|
8
|
+
"options": {},
|
|
9
|
+
"enums": [{
|
|
10
|
+
"name": "PhoneType",
|
|
11
|
+
"values": {
|
|
12
|
+
"MOBILE": {
|
|
13
|
+
"value": 0,
|
|
14
|
+
"options": {
|
|
15
|
+
"some_enum_option": "true"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"HOME": {
|
|
19
|
+
"value": 1,
|
|
20
|
+
"options": {}
|
|
21
|
+
},
|
|
22
|
+
"WORK": {
|
|
23
|
+
"value": 2,
|
|
24
|
+
"options": {}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"options": {
|
|
28
|
+
"allow_alias": true,
|
|
29
|
+
"custom_option": true
|
|
30
|
+
}
|
|
31
|
+
}],
|
|
32
|
+
"extends": [],
|
|
33
|
+
"messages": [{
|
|
34
|
+
"name": "PhoneNumber",
|
|
35
|
+
"enums": [],
|
|
36
|
+
"extends": [],
|
|
37
|
+
"messages": [],
|
|
38
|
+
"options": {},
|
|
39
|
+
"fields": [{
|
|
40
|
+
"name": "number",
|
|
41
|
+
"type": "string",
|
|
42
|
+
"tag": 1,
|
|
43
|
+
"map": null,
|
|
44
|
+
"oneof": null,
|
|
45
|
+
"required": true,
|
|
46
|
+
"repeated": false,
|
|
47
|
+
"options": {}
|
|
48
|
+
}, {
|
|
49
|
+
"name": "type",
|
|
50
|
+
"type": "PhoneType",
|
|
51
|
+
"tag": 2,
|
|
52
|
+
"map": null,
|
|
53
|
+
"oneof": null,
|
|
54
|
+
"required": false,
|
|
55
|
+
"repeated": false,
|
|
56
|
+
"options": {
|
|
57
|
+
"default": "HOME"
|
|
58
|
+
}
|
|
59
|
+
}],
|
|
60
|
+
"extensions": null
|
|
61
|
+
}],
|
|
62
|
+
"fields": [{
|
|
63
|
+
"name": "name",
|
|
64
|
+
"type": "string",
|
|
65
|
+
"tag": 1,
|
|
66
|
+
"map": null,
|
|
67
|
+
"oneof": null,
|
|
68
|
+
"required": true,
|
|
69
|
+
"repeated": false,
|
|
70
|
+
"options": {}
|
|
71
|
+
}, {
|
|
72
|
+
"name": "id",
|
|
73
|
+
"type": "int32",
|
|
74
|
+
"tag": 2,
|
|
75
|
+
"map": null,
|
|
76
|
+
"oneof": null,
|
|
77
|
+
"required": true,
|
|
78
|
+
"repeated": false,
|
|
79
|
+
"options": {}
|
|
80
|
+
}, {
|
|
81
|
+
"name": "email",
|
|
82
|
+
"type": "string",
|
|
83
|
+
"tag": 3,
|
|
84
|
+
"map": null,
|
|
85
|
+
"oneof": null,
|
|
86
|
+
"required": false,
|
|
87
|
+
"repeated": false,
|
|
88
|
+
"options": {}
|
|
89
|
+
}, {
|
|
90
|
+
"name": "phone",
|
|
91
|
+
"type": "PhoneNumber",
|
|
92
|
+
"tag": 4,
|
|
93
|
+
"map": null,
|
|
94
|
+
"oneof": null,
|
|
95
|
+
"required": false,
|
|
96
|
+
"repeated": true,
|
|
97
|
+
"options": {}
|
|
98
|
+
}],
|
|
99
|
+
"extensions": null
|
|
100
|
+
}, {
|
|
101
|
+
"name": "AddressBook",
|
|
102
|
+
"enums": [],
|
|
103
|
+
"extends": [],
|
|
104
|
+
"messages": [],
|
|
105
|
+
"options": {},
|
|
106
|
+
"fields": [{
|
|
107
|
+
"name": "person",
|
|
108
|
+
"type": "Person",
|
|
109
|
+
"tag": 1,
|
|
110
|
+
"map": null,
|
|
111
|
+
"oneof": null,
|
|
112
|
+
"required": false,
|
|
113
|
+
"repeated": true,
|
|
114
|
+
"options": {}
|
|
115
|
+
}],
|
|
116
|
+
"extensions": null
|
|
117
|
+
}],
|
|
118
|
+
"options": {
|
|
119
|
+
"java_package": "com.mafintosh.generated",
|
|
120
|
+
"java_outer_classname": "Example",
|
|
121
|
+
"java_generate_equals_and_hash": true,
|
|
122
|
+
"optimize_for": "SPEED"
|
|
123
|
+
},
|
|
124
|
+
"extends": []
|
|
125
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
package tutorial;
|
|
2
|
+
|
|
3
|
+
option java_package = "com.mafintosh.generated";
|
|
4
|
+
option java_outer_classname = "Example";
|
|
5
|
+
option java_generate_equals_and_hash = true;
|
|
6
|
+
option optimize_for = SPEED;
|
|
7
|
+
|
|
8
|
+
message Person {
|
|
9
|
+
enum PhoneType {
|
|
10
|
+
option allow_alias = true;
|
|
11
|
+
option custom_option = true;
|
|
12
|
+
MOBILE = 0 [some_enum_option = true];
|
|
13
|
+
HOME = 1;
|
|
14
|
+
WORK = 2;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
message PhoneNumber {
|
|
18
|
+
required string number = 1;
|
|
19
|
+
optional PhoneType type = 2 [default = HOME];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
required string name = 1;
|
|
23
|
+
required int32 id = 2;
|
|
24
|
+
optional string email = 3;
|
|
25
|
+
repeated PhoneNumber phone = 4;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
message AddressBook {
|
|
29
|
+
repeated Person person = 1;
|
|
30
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"syntax": 3,
|
|
3
|
+
"package": null,
|
|
4
|
+
"imports": [],
|
|
5
|
+
"enums": [],
|
|
6
|
+
"messages": [{
|
|
7
|
+
"name": "Person",
|
|
8
|
+
"enums": [{
|
|
9
|
+
"name": "PhoneType",
|
|
10
|
+
"values": {
|
|
11
|
+
"MOBILE": {
|
|
12
|
+
"value": 0,
|
|
13
|
+
"options": {
|
|
14
|
+
"enum_value_is_deprecated": "true",
|
|
15
|
+
"some_second_option": "\"value1, value2, value3\"",
|
|
16
|
+
"some_third_option": "'[value1, value2, value3]'"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"HOME": {
|
|
20
|
+
"value": 1,
|
|
21
|
+
"options": {
|
|
22
|
+
"enum_value_is_deprecated": "true"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"WORK": {
|
|
26
|
+
"value": 2,
|
|
27
|
+
"options": {}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"options": {
|
|
31
|
+
"allow_alias": true
|
|
32
|
+
}
|
|
33
|
+
}],
|
|
34
|
+
"extends": [],
|
|
35
|
+
"messages": [],
|
|
36
|
+
"options": {},
|
|
37
|
+
"fields": [],
|
|
38
|
+
"extensions": null
|
|
39
|
+
}],
|
|
40
|
+
"options": {},
|
|
41
|
+
"extends": []
|
|
42
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
message Person {
|
|
2
|
+
enum PhoneType {
|
|
3
|
+
option allow_alias = true;
|
|
4
|
+
MOBILE = 0 [(enum_value_is_deprecated) = true, (some_second_option) = "value1, value2, value3", (some_third_option) = '[value1, value2, value3]'];
|
|
5
|
+
HOME = 1 [(enum_value_is_deprecated) = true];
|
|
6
|
+
WORK = 2;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"syntax": 3,
|
|
3
|
+
"package": null,
|
|
4
|
+
"imports": [],
|
|
5
|
+
"enums": [],
|
|
6
|
+
"messages": [
|
|
7
|
+
{
|
|
8
|
+
"name": "Event",
|
|
9
|
+
"enums": [],
|
|
10
|
+
"options": {},
|
|
11
|
+
"extends": [],
|
|
12
|
+
"messages": [],
|
|
13
|
+
"fields": [
|
|
14
|
+
{
|
|
15
|
+
"name": "id",
|
|
16
|
+
"type": "EntityId",
|
|
17
|
+
"tag": 1,
|
|
18
|
+
"map": null,
|
|
19
|
+
"oneof": null,
|
|
20
|
+
"required": false,
|
|
21
|
+
"repeated": false,
|
|
22
|
+
"options": {
|
|
23
|
+
"tagger.tags": "\"a:'Hello, there', bson:\\\"_id,omitempty\\\"\""
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"extensions": null
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"options": {},
|
|
31
|
+
"extends": []
|
|
32
|
+
}
|