rearrage_stuff
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 448 KiB After Width: | Height: | Size: 448 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 783 B After Width: | Height: | Size: 783 B |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
1
node_modules/.bin/conc
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../concurrently/dist/bin/concurrently.js
|
||||
1
node_modules/.bin/concurrently
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../concurrently/dist/bin/concurrently.js
|
||||
1
node_modules/.bin/detect-libc
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../detect-libc/bin/detect-libc.js
|
||||
1
node_modules/.bin/esbuild
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../esbuild/bin/esbuild
|
||||
1
node_modules/.bin/figlet
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../figlet/bin/index.js
|
||||
1
node_modules/.bin/nanoid
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../nanoid/bin/nanoid.cjs
|
||||
1
node_modules/.bin/nodemon
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../nodemon/bin/nodemon.js
|
||||
1
node_modules/.bin/nodetouch
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../touch/bin/nodetouch.js
|
||||
1
node_modules/.bin/prettier
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../prettier/bin/prettier.cjs
|
||||
1
node_modules/.bin/rollup
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../rollup/dist/bin/rollup
|
||||
1
node_modules/.bin/sass
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../sass/sass.js
|
||||
1
node_modules/.bin/semver
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../semver/bin/semver.js
|
||||
1
node_modules/.bin/tree-kill
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../tree-kill/cli.js
|
||||
1
node_modules/.bin/uuid
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../uuid/dist/esm/bin/uuid
|
||||
1
node_modules/.bin/vite
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../vite/bin/vite.js
|
||||
2740
node_modules/.package-lock.json
generated
vendored
Executable file
15
node_modules/.vite/deps/_metadata.json
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"hash": "1298e9eb",
|
||||
"configHash": "cb01c801",
|
||||
"lockfileHash": "772b6e1c",
|
||||
"browserHash": "c0c2802c",
|
||||
"optimized": {
|
||||
"sprintf-js": {
|
||||
"src": "../../sprintf-js/src/sprintf.js",
|
||||
"file": "sprintf-js.js",
|
||||
"fileHash": "009972ba",
|
||||
"needsInterop": true
|
||||
}
|
||||
},
|
||||
"chunks": {}
|
||||
}
|
||||
3
node_modules/.vite/deps/package.json
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"type": "module"
|
||||
}
|
||||
209
node_modules/.vite/deps/sprintf-js.js
generated
vendored
Normal file
@@ -0,0 +1,209 @@
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __commonJS = (cb, mod) => function __require() {
|
||||
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||
};
|
||||
|
||||
// node_modules/sprintf-js/src/sprintf.js
|
||||
var require_sprintf = __commonJS({
|
||||
"node_modules/sprintf-js/src/sprintf.js"(exports) {
|
||||
!(function() {
|
||||
"use strict";
|
||||
var re = {
|
||||
not_string: /[^s]/,
|
||||
not_bool: /[^t]/,
|
||||
not_type: /[^T]/,
|
||||
not_primitive: /[^v]/,
|
||||
number: /[diefg]/,
|
||||
numeric_arg: /[bcdiefguxX]/,
|
||||
json: /[j]/,
|
||||
not_json: /[^j]/,
|
||||
text: /^[^\x25]+/,
|
||||
modulo: /^\x25{2}/,
|
||||
placeholder: /^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,
|
||||
key: /^([a-z_][a-z_\d]*)/i,
|
||||
key_access: /^\.([a-z_][a-z_\d]*)/i,
|
||||
index_access: /^\[(\d+)\]/,
|
||||
sign: /^[+-]/
|
||||
};
|
||||
function sprintf(key) {
|
||||
return sprintf_format(sprintf_parse(key), arguments);
|
||||
}
|
||||
function vsprintf(fmt, argv) {
|
||||
return sprintf.apply(null, [fmt].concat(argv || []));
|
||||
}
|
||||
function sprintf_format(parse_tree, argv) {
|
||||
var cursor = 1, tree_length = parse_tree.length, arg, output = "", i, k, ph, pad, pad_character, pad_length, is_positive, sign;
|
||||
for (i = 0; i < tree_length; i++) {
|
||||
if (typeof parse_tree[i] === "string") {
|
||||
output += parse_tree[i];
|
||||
} else if (typeof parse_tree[i] === "object") {
|
||||
ph = parse_tree[i];
|
||||
if (ph.keys) {
|
||||
arg = argv[cursor];
|
||||
for (k = 0; k < ph.keys.length; k++) {
|
||||
if (arg == void 0) {
|
||||
throw new Error(sprintf('[sprintf] Cannot access property "%s" of undefined value "%s"', ph.keys[k], ph.keys[k - 1]));
|
||||
}
|
||||
arg = arg[ph.keys[k]];
|
||||
}
|
||||
} else if (ph.param_no) {
|
||||
arg = argv[ph.param_no];
|
||||
} else {
|
||||
arg = argv[cursor++];
|
||||
}
|
||||
if (re.not_type.test(ph.type) && re.not_primitive.test(ph.type) && arg instanceof Function) {
|
||||
arg = arg();
|
||||
}
|
||||
if (re.numeric_arg.test(ph.type) && (typeof arg !== "number" && isNaN(arg))) {
|
||||
throw new TypeError(sprintf("[sprintf] expecting number but found %T", arg));
|
||||
}
|
||||
if (re.number.test(ph.type)) {
|
||||
is_positive = arg >= 0;
|
||||
}
|
||||
switch (ph.type) {
|
||||
case "b":
|
||||
arg = parseInt(arg, 10).toString(2);
|
||||
break;
|
||||
case "c":
|
||||
arg = String.fromCharCode(parseInt(arg, 10));
|
||||
break;
|
||||
case "d":
|
||||
case "i":
|
||||
arg = parseInt(arg, 10);
|
||||
break;
|
||||
case "j":
|
||||
arg = JSON.stringify(arg, null, ph.width ? parseInt(ph.width) : 0);
|
||||
break;
|
||||
case "e":
|
||||
arg = ph.precision ? parseFloat(arg).toExponential(ph.precision) : parseFloat(arg).toExponential();
|
||||
break;
|
||||
case "f":
|
||||
arg = ph.precision ? parseFloat(arg).toFixed(ph.precision) : parseFloat(arg);
|
||||
break;
|
||||
case "g":
|
||||
arg = ph.precision ? String(Number(arg.toPrecision(ph.precision))) : parseFloat(arg);
|
||||
break;
|
||||
case "o":
|
||||
arg = (parseInt(arg, 10) >>> 0).toString(8);
|
||||
break;
|
||||
case "s":
|
||||
arg = String(arg);
|
||||
arg = ph.precision ? arg.substring(0, ph.precision) : arg;
|
||||
break;
|
||||
case "t":
|
||||
arg = String(!!arg);
|
||||
arg = ph.precision ? arg.substring(0, ph.precision) : arg;
|
||||
break;
|
||||
case "T":
|
||||
arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase();
|
||||
arg = ph.precision ? arg.substring(0, ph.precision) : arg;
|
||||
break;
|
||||
case "u":
|
||||
arg = parseInt(arg, 10) >>> 0;
|
||||
break;
|
||||
case "v":
|
||||
arg = arg.valueOf();
|
||||
arg = ph.precision ? arg.substring(0, ph.precision) : arg;
|
||||
break;
|
||||
case "x":
|
||||
arg = (parseInt(arg, 10) >>> 0).toString(16);
|
||||
break;
|
||||
case "X":
|
||||
arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase();
|
||||
break;
|
||||
}
|
||||
if (re.json.test(ph.type)) {
|
||||
output += arg;
|
||||
} else {
|
||||
if (re.number.test(ph.type) && (!is_positive || ph.sign)) {
|
||||
sign = is_positive ? "+" : "-";
|
||||
arg = arg.toString().replace(re.sign, "");
|
||||
} else {
|
||||
sign = "";
|
||||
}
|
||||
pad_character = ph.pad_char ? ph.pad_char === "0" ? "0" : ph.pad_char.charAt(1) : " ";
|
||||
pad_length = ph.width - (sign + arg).length;
|
||||
pad = ph.width ? pad_length > 0 ? pad_character.repeat(pad_length) : "" : "";
|
||||
output += ph.align ? sign + arg + pad : pad_character === "0" ? sign + pad + arg : pad + sign + arg;
|
||||
}
|
||||
}
|
||||
}
|
||||
return output;
|
||||
}
|
||||
var sprintf_cache = /* @__PURE__ */ Object.create(null);
|
||||
function sprintf_parse(fmt) {
|
||||
if (sprintf_cache[fmt]) {
|
||||
return sprintf_cache[fmt];
|
||||
}
|
||||
var _fmt = fmt, match, parse_tree = [], arg_names = 0;
|
||||
while (_fmt) {
|
||||
if ((match = re.text.exec(_fmt)) !== null) {
|
||||
parse_tree.push(match[0]);
|
||||
} else if ((match = re.modulo.exec(_fmt)) !== null) {
|
||||
parse_tree.push("%");
|
||||
} else if ((match = re.placeholder.exec(_fmt)) !== null) {
|
||||
if (match[2]) {
|
||||
arg_names |= 1;
|
||||
var field_list = [], replacement_field = match[2], field_match = [];
|
||||
if ((field_match = re.key.exec(replacement_field)) !== null) {
|
||||
field_list.push(field_match[1]);
|
||||
while ((replacement_field = replacement_field.substring(field_match[0].length)) !== "") {
|
||||
if ((field_match = re.key_access.exec(replacement_field)) !== null) {
|
||||
field_list.push(field_match[1]);
|
||||
} else if ((field_match = re.index_access.exec(replacement_field)) !== null) {
|
||||
field_list.push(field_match[1]);
|
||||
} else {
|
||||
throw new SyntaxError("[sprintf] failed to parse named argument key");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw new SyntaxError("[sprintf] failed to parse named argument key");
|
||||
}
|
||||
match[2] = field_list;
|
||||
} else {
|
||||
arg_names |= 2;
|
||||
}
|
||||
if (arg_names === 3) {
|
||||
throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");
|
||||
}
|
||||
parse_tree.push(
|
||||
{
|
||||
placeholder: match[0],
|
||||
param_no: match[1],
|
||||
keys: match[2],
|
||||
sign: match[3],
|
||||
pad_char: match[4],
|
||||
align: match[5],
|
||||
width: match[6],
|
||||
precision: match[7],
|
||||
type: match[8]
|
||||
}
|
||||
);
|
||||
} else {
|
||||
throw new SyntaxError("[sprintf] unexpected placeholder");
|
||||
}
|
||||
_fmt = _fmt.substring(match[0].length);
|
||||
}
|
||||
return sprintf_cache[fmt] = parse_tree;
|
||||
}
|
||||
if (typeof exports !== "undefined") {
|
||||
exports["sprintf"] = sprintf;
|
||||
exports["vsprintf"] = vsprintf;
|
||||
}
|
||||
if (typeof window !== "undefined") {
|
||||
window["sprintf"] = sprintf;
|
||||
window["vsprintf"] = vsprintf;
|
||||
if (typeof define === "function" && define["amd"]) {
|
||||
define(function() {
|
||||
return {
|
||||
"sprintf": sprintf,
|
||||
"vsprintf": vsprintf
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
})();
|
||||
}
|
||||
});
|
||||
export default require_sprintf();
|
||||
//# sourceMappingURL=sprintf-js.js.map
|
||||
7
node_modules/.vite/deps/sprintf-js.js.map
generated
vendored
Normal file
1
node_modules/.vite/uuid.json
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
9cbcdb16-9371-4676-b0f2-be9c5185f138
|
||||
44
node_modules/@bufbuild/protobuf/README.md
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
# @bufbuild/protobuf
|
||||
|
||||
This package provides the runtime library for the [protoc-gen-es](https://www.npmjs.com/package/@bufbuild/protoc-gen-es)
|
||||
code generator plugin.
|
||||
|
||||
## Protocol Buffers for ECMAScript
|
||||
|
||||
A complete implementation of [Protocol Buffers](https://protobuf.dev/) in TypeScript,
|
||||
suitable for web browsers and Node.js, created by [Buf](https://buf.build).
|
||||
|
||||
**Protobuf-ES** is a solid, modern alternative to existing Protobuf implementations for the JavaScript ecosystem. It's
|
||||
the first project in this space to provide a comprehensive plugin framework and decouple the base types from RPC
|
||||
functionality.
|
||||
|
||||
Some additional features that set it apart from the others:
|
||||
|
||||
- ECMAScript module support
|
||||
- First-class TypeScript support
|
||||
- Generation of idiomatic JavaScript and TypeScript code
|
||||
- Generation of [much smaller bundles](https://github.com/bufbuild/protobuf-es/tree/main/packages/bundle-size/)
|
||||
- Implementation of all proto3 features, including the [canonical JSON format](https://protobuf.dev/programming-guides/proto3/#json)
|
||||
- Implementation of all proto2 features, except for extensions and the text format
|
||||
- Usage of standard JavaScript APIs instead of the [Closure Library](http://googlecode.blogspot.com/2009/11/introducing-closure-tools.html)
|
||||
- Compatibility is covered by the Protocol Buffers [conformance tests](https://github.com/bufbuild/protobuf-es/tree/main/packages/protobuf-conformance/)
|
||||
- Descriptor and reflection support
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install @bufbuild/protobuf
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
To learn how to work with `@bufbuild/protobuf`, check out the docs for the [Runtime API](https://github.com/bufbuild/protobuf-es/tree/main/MANUAL.md#working-with-messages)
|
||||
and the [generated code](https://github.com/bufbuild/protobuf-es/tree/main/MANUAL.md#generated-code).
|
||||
|
||||
Official documentation for the Protobuf-ES project can be found at [github.com/bufbuild/protobuf-es](https://github.com/bufbuild/protobuf-es).
|
||||
|
||||
For more information on Buf, check out the official [Buf documentation](https://buf.build/docs/).
|
||||
|
||||
## Examples
|
||||
|
||||
A complete code example can be found in the **Protobuf-ES** repo [here](https://github.com/bufbuild/protobuf-es/tree/main/packages/protobuf-example).
|
||||
6
node_modules/@bufbuild/protobuf/dist/cjs/clone.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import type { MessageShape } from "./types.js";
|
||||
import { type DescMessage } from "./descriptors.js";
|
||||
/**
|
||||
* Create a deep copy of a message, including extensions and unknown fields.
|
||||
*/
|
||||
export declare function clone<Desc extends DescMessage>(schema: Desc, message: MessageShape<Desc>): MessageShape<Desc>;
|
||||
66
node_modules/@bufbuild/protobuf/dist/cjs/clone.js
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
"use strict";
|
||||
// Copyright 2021-2025 Buf Technologies, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.clone = clone;
|
||||
const descriptors_js_1 = require("./descriptors.js");
|
||||
const reflect_js_1 = require("./reflect/reflect.js");
|
||||
const guard_js_1 = require("./reflect/guard.js");
|
||||
/**
|
||||
* Create a deep copy of a message, including extensions and unknown fields.
|
||||
*/
|
||||
function clone(schema, message) {
|
||||
return cloneReflect((0, reflect_js_1.reflect)(schema, message)).message;
|
||||
}
|
||||
function cloneReflect(i) {
|
||||
const o = (0, reflect_js_1.reflect)(i.desc);
|
||||
for (const f of i.fields) {
|
||||
if (!i.isSet(f)) {
|
||||
continue;
|
||||
}
|
||||
switch (f.fieldKind) {
|
||||
case "list":
|
||||
const list = o.get(f);
|
||||
for (const item of i.get(f)) {
|
||||
list.add(cloneSingular(f, item));
|
||||
}
|
||||
break;
|
||||
case "map":
|
||||
const map = o.get(f);
|
||||
for (const entry of i.get(f).entries()) {
|
||||
map.set(entry[0], cloneSingular(f, entry[1]));
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
o.set(f, cloneSingular(f, i.get(f)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
const unknown = i.getUnknown();
|
||||
if (unknown && unknown.length > 0) {
|
||||
o.setUnknown([...unknown]);
|
||||
}
|
||||
return o;
|
||||
}
|
||||
function cloneSingular(field, value) {
|
||||
if (field.message !== undefined && (0, guard_js_1.isReflectMessage)(value)) {
|
||||
return cloneReflect(value);
|
||||
}
|
||||
if (field.scalar == descriptors_js_1.ScalarType.BYTES && value instanceof Uint8Array) {
|
||||
// @ts-expect-error T cannot extend Uint8Array in practice
|
||||
return value.slice();
|
||||
}
|
||||
return value;
|
||||
}
|
||||
10
node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/enum.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import type { DescFile } from "../descriptors.js";
|
||||
import type { GenEnum } from "./types.js";
|
||||
import type { JsonValue } from "../json-value.js";
|
||||
export { tsEnum } from "../codegenv2/enum.js";
|
||||
/**
|
||||
* Hydrate an enum descriptor.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
export declare function enumDesc<Shape extends number, JsonType extends JsonValue = JsonValue>(file: DescFile, path: number, ...paths: number[]): GenEnum<Shape, JsonType>;
|
||||
31
node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/enum.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
// Copyright 2021-2025 Buf Technologies, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.tsEnum = void 0;
|
||||
exports.enumDesc = enumDesc;
|
||||
var enum_js_1 = require("../codegenv2/enum.js");
|
||||
Object.defineProperty(exports, "tsEnum", { enumerable: true, get: function () { return enum_js_1.tsEnum; } });
|
||||
/**
|
||||
* Hydrate an enum descriptor.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function enumDesc(file, path, ...paths) {
|
||||
if (paths.length == 0) {
|
||||
return file.enums[path];
|
||||
}
|
||||
const e = paths.pop(); // we checked length above
|
||||
return paths.reduce((acc, cur) => acc.nestedMessages[cur], file.messages[path]).nestedEnums[e];
|
||||
}
|
||||
9
node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/extension.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { Message } from "../types.js";
|
||||
import type { DescFile } from "../descriptors.js";
|
||||
import type { GenExtension } from "./types.js";
|
||||
/**
|
||||
* Hydrate an extension descriptor.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
export declare function extDesc<Extendee extends Message, Value>(file: DescFile, path: number, ...paths: number[]): GenExtension<Extendee, Value>;
|
||||
28
node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/extension.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
// Copyright 2021-2025 Buf Technologies, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.extDesc = extDesc;
|
||||
/**
|
||||
* Hydrate an extension descriptor.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function extDesc(file, path, ...paths) {
|
||||
if (paths.length == 0) {
|
||||
return file.extensions[path];
|
||||
}
|
||||
const e = paths.pop(); // we checked length above
|
||||
return paths.reduce((acc, cur) => acc.nestedMessages[cur], file.messages[path]).nestedExtensions[e];
|
||||
}
|
||||
1
node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/file.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export { fileDesc } from "../codegenv2/file.js";
|
||||
18
node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/file.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
// Copyright 2021-2025 Buf Technologies, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.fileDesc = void 0;
|
||||
var file_js_1 = require("../codegenv2/file.js");
|
||||
Object.defineProperty(exports, "fileDesc", { enumerable: true, get: function () { return file_js_1.fileDesc; } });
|
||||
10
node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
export * from "../codegenv2/boot.js";
|
||||
export * from "../codegenv2/embed.js";
|
||||
export * from "./enum.js";
|
||||
export * from "./extension.js";
|
||||
export * from "./file.js";
|
||||
export * from "./message.js";
|
||||
export * from "./service.js";
|
||||
export * from "./symbols.js";
|
||||
export * from "../codegenv2/scalar.js";
|
||||
export * from "./types.js";
|
||||
39
node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/index.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
"use strict";
|
||||
// Copyright 2021-2025 Buf Technologies, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__exportStar(require("../codegenv2/boot.js"), exports);
|
||||
__exportStar(require("../codegenv2/embed.js"), exports);
|
||||
__exportStar(require("./enum.js"), exports);
|
||||
__exportStar(require("./extension.js"), exports);
|
||||
__exportStar(require("./file.js"), exports);
|
||||
__exportStar(require("./message.js"), exports);
|
||||
__exportStar(require("./service.js"), exports);
|
||||
__exportStar(require("./symbols.js"), exports);
|
||||
__exportStar(require("../codegenv2/scalar.js"), exports);
|
||||
__exportStar(require("./types.js"), exports);
|
||||
10
node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/message.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import type { Message } from "../types.js";
|
||||
import type { DescFile } from "../descriptors.js";
|
||||
import type { GenMessage } from "./types.js";
|
||||
import type { JsonValue } from "../json-value.js";
|
||||
/**
|
||||
* Hydrate a message descriptor.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
export declare function messageDesc<Shape extends Message, JsonType extends JsonValue = JsonValue>(file: DescFile, path: number, ...paths: number[]): GenMessage<Shape, JsonType>;
|
||||
24
node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/message.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
// Copyright 2021-2025 Buf Technologies, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.messageDesc = messageDesc;
|
||||
/**
|
||||
* Hydrate a message descriptor.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function messageDesc(file, path, ...paths) {
|
||||
return paths.reduce((acc, cur) => acc.nestedMessages[cur], file.messages[path]);
|
||||
}
|
||||
8
node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/service.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import type { GenService, GenServiceMethods } from "./types.js";
|
||||
import type { DescFile } from "../descriptors.js";
|
||||
/**
|
||||
* Hydrate a service descriptor.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
export declare function serviceDesc<T extends GenServiceMethods>(file: DescFile, path: number, ...paths: number[]): GenService<T>;
|
||||
27
node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/service.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
// Copyright 2021-2025 Buf Technologies, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.serviceDesc = serviceDesc;
|
||||
/**
|
||||
* Hydrate a service descriptor.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function serviceDesc(file, path, ...paths) {
|
||||
if (paths.length > 0) {
|
||||
throw new Error();
|
||||
}
|
||||
return file.services[path];
|
||||
}
|
||||
135
node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/symbols.d.ts
generated
vendored
Normal file
@@ -0,0 +1,135 @@
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare const packageName = "@bufbuild/protobuf";
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare const wktPublicImportPaths: Readonly<Record<string, string>>;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare const symbols: {
|
||||
readonly codegen: {
|
||||
readonly boot: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../codegenv1/boot.js";
|
||||
readonly from: string;
|
||||
};
|
||||
readonly fileDesc: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../codegenv1/file.js";
|
||||
readonly from: string;
|
||||
};
|
||||
readonly enumDesc: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../codegenv1/enum.js";
|
||||
readonly from: string;
|
||||
};
|
||||
readonly extDesc: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../codegenv1/extension.js";
|
||||
readonly from: string;
|
||||
};
|
||||
readonly messageDesc: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../codegenv1/message.js";
|
||||
readonly from: string;
|
||||
};
|
||||
readonly serviceDesc: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../codegenv1/service.js";
|
||||
readonly from: string;
|
||||
};
|
||||
readonly tsEnum: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../codegenv1/enum.js";
|
||||
readonly from: string;
|
||||
};
|
||||
readonly GenFile: {
|
||||
readonly typeOnly: true;
|
||||
readonly bootstrapWktFrom: "../../codegenv1/types.js";
|
||||
readonly from: string;
|
||||
};
|
||||
readonly GenEnum: {
|
||||
readonly typeOnly: true;
|
||||
readonly bootstrapWktFrom: "../../codegenv1/types.js";
|
||||
readonly from: string;
|
||||
};
|
||||
readonly GenExtension: {
|
||||
readonly typeOnly: true;
|
||||
readonly bootstrapWktFrom: "../../codegenv1/types.js";
|
||||
readonly from: string;
|
||||
};
|
||||
readonly GenMessage: {
|
||||
readonly typeOnly: true;
|
||||
readonly bootstrapWktFrom: "../../codegenv1/types.js";
|
||||
readonly from: string;
|
||||
};
|
||||
readonly GenService: {
|
||||
readonly typeOnly: true;
|
||||
readonly bootstrapWktFrom: "../../codegenv1/types.js";
|
||||
readonly from: string;
|
||||
};
|
||||
};
|
||||
readonly isMessage: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../is-message.js";
|
||||
readonly from: "@bufbuild/protobuf";
|
||||
};
|
||||
readonly Message: {
|
||||
readonly typeOnly: true;
|
||||
readonly bootstrapWktFrom: "../../types.js";
|
||||
readonly from: "@bufbuild/protobuf";
|
||||
};
|
||||
readonly create: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../create.js";
|
||||
readonly from: "@bufbuild/protobuf";
|
||||
};
|
||||
readonly fromJson: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../from-json.js";
|
||||
readonly from: "@bufbuild/protobuf";
|
||||
};
|
||||
readonly fromJsonString: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../from-json.js";
|
||||
readonly from: "@bufbuild/protobuf";
|
||||
};
|
||||
readonly fromBinary: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../from-binary.js";
|
||||
readonly from: "@bufbuild/protobuf";
|
||||
};
|
||||
readonly toBinary: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../to-binary.js";
|
||||
readonly from: "@bufbuild/protobuf";
|
||||
};
|
||||
readonly toJson: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../to-json.js";
|
||||
readonly from: "@bufbuild/protobuf";
|
||||
};
|
||||
readonly toJsonString: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../to-json.js";
|
||||
readonly from: "@bufbuild/protobuf";
|
||||
};
|
||||
readonly protoInt64: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../proto-int64.js";
|
||||
readonly from: "@bufbuild/protobuf";
|
||||
};
|
||||
readonly JsonValue: {
|
||||
readonly typeOnly: true;
|
||||
readonly bootstrapWktFrom: "../../json-value.js";
|
||||
readonly from: "@bufbuild/protobuf";
|
||||
};
|
||||
readonly JsonObject: {
|
||||
readonly typeOnly: true;
|
||||
readonly bootstrapWktFrom: "../../json-value.js";
|
||||
readonly from: "@bufbuild/protobuf";
|
||||
};
|
||||
};
|
||||
43
node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/symbols.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
"use strict";
|
||||
// Copyright 2021-2025 Buf Technologies, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.symbols = exports.wktPublicImportPaths = exports.packageName = void 0;
|
||||
const symbols_js_1 = require("../codegenv2/symbols.js");
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
exports.packageName = symbols_js_1.packageName;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
exports.wktPublicImportPaths = symbols_js_1.wktPublicImportPaths;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
// biome-ignore format: want this to read well
|
||||
exports.symbols = Object.assign(Object.assign({}, symbols_js_1.symbols), { codegen: {
|
||||
boot: { typeOnly: false, bootstrapWktFrom: "../../codegenv1/boot.js", from: exports.packageName + "/codegenv1" },
|
||||
fileDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv1/file.js", from: exports.packageName + "/codegenv1" },
|
||||
enumDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv1/enum.js", from: exports.packageName + "/codegenv1" },
|
||||
extDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv1/extension.js", from: exports.packageName + "/codegenv1" },
|
||||
messageDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv1/message.js", from: exports.packageName + "/codegenv1" },
|
||||
serviceDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv1/service.js", from: exports.packageName + "/codegenv1" },
|
||||
tsEnum: { typeOnly: false, bootstrapWktFrom: "../../codegenv1/enum.js", from: exports.packageName + "/codegenv1" },
|
||||
GenFile: { typeOnly: true, bootstrapWktFrom: "../../codegenv1/types.js", from: exports.packageName + "/codegenv1" },
|
||||
GenEnum: { typeOnly: true, bootstrapWktFrom: "../../codegenv1/types.js", from: exports.packageName + "/codegenv1" },
|
||||
GenExtension: { typeOnly: true, bootstrapWktFrom: "../../codegenv1/types.js", from: exports.packageName + "/codegenv1" },
|
||||
GenMessage: { typeOnly: true, bootstrapWktFrom: "../../codegenv1/types.js", from: exports.packageName + "/codegenv1" },
|
||||
GenService: { typeOnly: true, bootstrapWktFrom: "../../codegenv1/types.js", from: exports.packageName + "/codegenv1" },
|
||||
} });
|
||||
75
node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
import type { Message } from "../types.js";
|
||||
import type { DescEnum, DescEnumValue, DescExtension, DescField, DescFile, DescMessage, DescMethod, DescService } from "../descriptors.js";
|
||||
import type { JsonValue } from "../json-value.js";
|
||||
/**
|
||||
* Describes a protobuf source file.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
export type GenFile = DescFile;
|
||||
/**
|
||||
* Describes a message declaration in a protobuf source file.
|
||||
*
|
||||
* This type is identical to DescMessage, but carries additional type
|
||||
* information.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
export type GenMessage<RuntimeShape extends Message, JsonType = JsonValue> = Omit<DescMessage, "field" | "typeName"> & {
|
||||
field: Record<MessageFieldNames<RuntimeShape>, DescField>;
|
||||
typeName: RuntimeShape["$typeName"];
|
||||
} & brandv1<RuntimeShape, JsonType>;
|
||||
/**
|
||||
* Describes an enumeration in a protobuf source file.
|
||||
*
|
||||
* This type is identical to DescEnum, but carries additional type
|
||||
* information.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
export type GenEnum<RuntimeShape extends number, JsonType extends JsonValue = JsonValue> = Omit<DescEnum, "value"> & {
|
||||
value: Record<RuntimeShape, DescEnumValue>;
|
||||
} & brandv1<RuntimeShape, JsonType>;
|
||||
/**
|
||||
* Describes an extension in a protobuf source file.
|
||||
*
|
||||
* This type is identical to DescExtension, but carries additional type
|
||||
* information.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
export type GenExtension<Extendee extends Message = Message, RuntimeShape = unknown> = DescExtension & brandv1<Extendee, RuntimeShape>;
|
||||
/**
|
||||
* Describes a service declaration in a protobuf source file.
|
||||
*
|
||||
* This type is identical to DescService, but carries additional type
|
||||
* information.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
export type GenService<RuntimeShape extends GenServiceMethods> = Omit<DescService, "method"> & {
|
||||
method: {
|
||||
[K in keyof RuntimeShape]: RuntimeShape[K] & DescMethod;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export type GenServiceMethods = Record<string, Pick<DescMethod, "input" | "output" | "methodKind">>;
|
||||
declare class brandv1<A, B = unknown> {
|
||||
protected v: "codegenv1";
|
||||
protected a: A | boolean;
|
||||
protected b: B | boolean;
|
||||
}
|
||||
/**
|
||||
* Union of the property names of all fields, including oneof members.
|
||||
* For an anonymous message (no generated message shape), it's simply a string.
|
||||
*/
|
||||
type MessageFieldNames<T extends Message> = Message extends T ? string : Exclude<keyof {
|
||||
[P in keyof T as P extends ("$typeName" | "$unknown") ? never : T[P] extends Oneof<infer K> ? K : P]-?: true;
|
||||
}, number | symbol>;
|
||||
type Oneof<K extends string> = {
|
||||
case: K | undefined;
|
||||
value?: unknown;
|
||||
};
|
||||
export {};
|
||||
22
node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/types.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
// Copyright 2021-2025 Buf Technologies, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
class brandv1 {
|
||||
constructor() {
|
||||
this.v = "codegenv1";
|
||||
this.a = false;
|
||||
this.b = false;
|
||||
}
|
||||
}
|
||||
63
node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/boot.d.ts
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
import type { DescriptorProto_ExtensionRange, FieldDescriptorProto_Label, FieldDescriptorProto_Type, FieldOptions_OptionRetention, FieldOptions_OptionTargetType, FieldOptions_EditionDefault, EnumValueDescriptorProto, FileDescriptorProto } from "../wkt/gen/google/protobuf/descriptor_pb.js";
|
||||
import type { DescFile } from "../descriptors.js";
|
||||
/**
|
||||
* Hydrate a file descriptor for google/protobuf/descriptor.proto from a plain
|
||||
* object.
|
||||
*
|
||||
* See createFileDescriptorProtoBoot() for details.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
export declare function boot(boot: FileDescriptorProtoBoot): DescFile;
|
||||
/**
|
||||
* An object literal for initializing the message google.protobuf.FileDescriptorProto
|
||||
* for google/protobuf/descriptor.proto.
|
||||
*
|
||||
* See createFileDescriptorProtoBoot() for details.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
export type FileDescriptorProtoBoot = {
|
||||
name: "google/protobuf/descriptor.proto";
|
||||
package: "google.protobuf";
|
||||
messageType: DescriptorProtoBoot[];
|
||||
enumType: EnumDescriptorProtoBoot[];
|
||||
};
|
||||
export type DescriptorProtoBoot = {
|
||||
name: string;
|
||||
field?: FieldDescriptorProtoBoot[];
|
||||
nestedType?: DescriptorProtoBoot[];
|
||||
enumType?: EnumDescriptorProtoBoot[];
|
||||
extensionRange?: Pick<DescriptorProto_ExtensionRange, "start" | "end">[];
|
||||
};
|
||||
export type FieldDescriptorProtoBoot = {
|
||||
name: string;
|
||||
number: number;
|
||||
label?: FieldDescriptorProto_Label;
|
||||
type: FieldDescriptorProto_Type;
|
||||
typeName?: string;
|
||||
extendee?: string;
|
||||
defaultValue?: string;
|
||||
options?: FieldOptionsBoot;
|
||||
};
|
||||
export type FieldOptionsBoot = {
|
||||
packed?: boolean;
|
||||
deprecated?: boolean;
|
||||
retention?: FieldOptions_OptionRetention;
|
||||
targets?: FieldOptions_OptionTargetType[];
|
||||
editionDefaults?: FieldOptions_EditionDefaultBoot[];
|
||||
};
|
||||
export type FieldOptions_EditionDefaultBoot = Pick<FieldOptions_EditionDefault, "edition" | "value">;
|
||||
export type EnumDescriptorProtoBoot = {
|
||||
name: string;
|
||||
value: EnumValueDescriptorProtoBoot[];
|
||||
};
|
||||
export type EnumValueDescriptorProtoBoot = Pick<EnumValueDescriptorProto, "name" | "number">;
|
||||
/**
|
||||
* Creates the message google.protobuf.FileDescriptorProto from an object literal.
|
||||
*
|
||||
* See createFileDescriptorProtoBoot() for details.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
export declare function bootFileDescriptorProto(init: FileDescriptorProtoBoot): FileDescriptorProto;
|
||||
105
node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/boot.js
generated
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
"use strict";
|
||||
// Copyright 2021-2025 Buf Technologies, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.boot = boot;
|
||||
exports.bootFileDescriptorProto = bootFileDescriptorProto;
|
||||
const restore_json_names_js_1 = require("./restore-json-names.js");
|
||||
const registry_js_1 = require("../registry.js");
|
||||
/**
|
||||
* Hydrate a file descriptor for google/protobuf/descriptor.proto from a plain
|
||||
* object.
|
||||
*
|
||||
* See createFileDescriptorProtoBoot() for details.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function boot(boot) {
|
||||
const root = bootFileDescriptorProto(boot);
|
||||
root.messageType.forEach(restore_json_names_js_1.restoreJsonNames);
|
||||
const reg = (0, registry_js_1.createFileRegistry)(root, () => undefined);
|
||||
// biome-ignore lint/style/noNonNullAssertion: non-null assertion because we just created the registry from the file we look up
|
||||
return reg.getFile(root.name);
|
||||
}
|
||||
/**
|
||||
* Creates the message google.protobuf.FileDescriptorProto from an object literal.
|
||||
*
|
||||
* See createFileDescriptorProtoBoot() for details.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function bootFileDescriptorProto(init) {
|
||||
const proto = Object.create({
|
||||
syntax: "",
|
||||
edition: 0,
|
||||
});
|
||||
return Object.assign(proto, Object.assign(Object.assign({ $typeName: "google.protobuf.FileDescriptorProto", dependency: [], publicDependency: [], weakDependency: [], optionDependency: [], service: [], extension: [] }, init), { messageType: init.messageType.map(bootDescriptorProto), enumType: init.enumType.map(bootEnumDescriptorProto) }));
|
||||
}
|
||||
function bootDescriptorProto(init) {
|
||||
var _a, _b, _c, _d, _e, _f, _g, _h;
|
||||
const proto = Object.create({
|
||||
visibility: 0,
|
||||
});
|
||||
return Object.assign(proto, {
|
||||
$typeName: "google.protobuf.DescriptorProto",
|
||||
name: init.name,
|
||||
field: (_b = (_a = init.field) === null || _a === void 0 ? void 0 : _a.map(bootFieldDescriptorProto)) !== null && _b !== void 0 ? _b : [],
|
||||
extension: [],
|
||||
nestedType: (_d = (_c = init.nestedType) === null || _c === void 0 ? void 0 : _c.map(bootDescriptorProto)) !== null && _d !== void 0 ? _d : [],
|
||||
enumType: (_f = (_e = init.enumType) === null || _e === void 0 ? void 0 : _e.map(bootEnumDescriptorProto)) !== null && _f !== void 0 ? _f : [],
|
||||
extensionRange: (_h = (_g = init.extensionRange) === null || _g === void 0 ? void 0 : _g.map((e) => (Object.assign({ $typeName: "google.protobuf.DescriptorProto.ExtensionRange" }, e)))) !== null && _h !== void 0 ? _h : [],
|
||||
oneofDecl: [],
|
||||
reservedRange: [],
|
||||
reservedName: [],
|
||||
});
|
||||
}
|
||||
function bootFieldDescriptorProto(init) {
|
||||
const proto = Object.create({
|
||||
label: 1,
|
||||
typeName: "",
|
||||
extendee: "",
|
||||
defaultValue: "",
|
||||
oneofIndex: 0,
|
||||
jsonName: "",
|
||||
proto3Optional: false,
|
||||
});
|
||||
return Object.assign(proto, Object.assign(Object.assign({ $typeName: "google.protobuf.FieldDescriptorProto" }, init), { options: init.options ? bootFieldOptions(init.options) : undefined }));
|
||||
}
|
||||
function bootFieldOptions(init) {
|
||||
var _a, _b, _c;
|
||||
const proto = Object.create({
|
||||
ctype: 0,
|
||||
packed: false,
|
||||
jstype: 0,
|
||||
lazy: false,
|
||||
unverifiedLazy: false,
|
||||
deprecated: false,
|
||||
weak: false,
|
||||
debugRedact: false,
|
||||
retention: 0,
|
||||
});
|
||||
return Object.assign(proto, Object.assign(Object.assign({ $typeName: "google.protobuf.FieldOptions" }, init), { targets: (_a = init.targets) !== null && _a !== void 0 ? _a : [], editionDefaults: (_c = (_b = init.editionDefaults) === null || _b === void 0 ? void 0 : _b.map((e) => (Object.assign({ $typeName: "google.protobuf.FieldOptions.EditionDefault" }, e)))) !== null && _c !== void 0 ? _c : [], uninterpretedOption: [] }));
|
||||
}
|
||||
function bootEnumDescriptorProto(init) {
|
||||
const proto = Object.create({
|
||||
visibility: 0,
|
||||
});
|
||||
return Object.assign(proto, {
|
||||
$typeName: "google.protobuf.EnumDescriptorProto",
|
||||
name: init.name,
|
||||
reservedName: [],
|
||||
reservedRange: [],
|
||||
value: init.value.map((e) => (Object.assign({ $typeName: "google.protobuf.EnumValueDescriptorProto" }, e))),
|
||||
});
|
||||
}
|
||||
43
node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/embed.d.ts
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
import type { DescEnum, DescExtension, DescMessage, DescService } from "../descriptors.js";
|
||||
import { type FileDescriptorProto } from "../wkt/gen/google/protobuf/descriptor_pb.js";
|
||||
import type { FileDescriptorProtoBoot } from "./boot.js";
|
||||
type EmbedUnknown = {
|
||||
bootable: false;
|
||||
proto(): FileDescriptorProto;
|
||||
base64(): string;
|
||||
};
|
||||
type EmbedDescriptorProto = Omit<EmbedUnknown, "bootable"> & {
|
||||
bootable: true;
|
||||
boot(): FileDescriptorProtoBoot;
|
||||
};
|
||||
/**
|
||||
* Create necessary information to embed a file descriptor in
|
||||
* generated code.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
export declare function embedFileDesc(file: FileDescriptorProto): EmbedUnknown | EmbedDescriptorProto;
|
||||
/**
|
||||
* Compute the path to a message, enumeration, extension, or service in a
|
||||
* file descriptor.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
export declare function pathInFileDesc(desc: DescMessage | DescEnum | DescExtension | DescService): number[];
|
||||
/**
|
||||
* The file descriptor for google/protobuf/descriptor.proto cannot be embedded
|
||||
* in serialized form, since it is required to parse itself.
|
||||
*
|
||||
* This function takes an instance of the message, and returns a plain object
|
||||
* that can be hydrated to the message again via bootFileDescriptorProto().
|
||||
*
|
||||
* This function only works with a message google.protobuf.FileDescriptorProto
|
||||
* for google/protobuf/descriptor.proto, and only supports features that are
|
||||
* relevant for the specific use case. For example, it discards file options,
|
||||
* reserved ranges and reserved names, and field options that are unused in
|
||||
* descriptor.proto.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
export declare function createFileDescriptorProtoBoot(proto: FileDescriptorProto): FileDescriptorProtoBoot;
|
||||
export {};
|
||||
244
node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/embed.js
generated
vendored
Normal file
@@ -0,0 +1,244 @@
|
||||
"use strict";
|
||||
// Copyright 2021-2025 Buf Technologies, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.embedFileDesc = embedFileDesc;
|
||||
exports.pathInFileDesc = pathInFileDesc;
|
||||
exports.createFileDescriptorProtoBoot = createFileDescriptorProtoBoot;
|
||||
const names_js_1 = require("../reflect/names.js");
|
||||
const fields_js_1 = require("../fields.js");
|
||||
const base64_encoding_js_1 = require("../wire/base64-encoding.js");
|
||||
const to_binary_js_1 = require("../to-binary.js");
|
||||
const clone_js_1 = require("../clone.js");
|
||||
const descriptor_pb_js_1 = require("../wkt/gen/google/protobuf/descriptor_pb.js");
|
||||
/**
|
||||
* Create necessary information to embed a file descriptor in
|
||||
* generated code.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function embedFileDesc(file) {
|
||||
const embed = {
|
||||
bootable: false,
|
||||
proto() {
|
||||
const stripped = (0, clone_js_1.clone)(descriptor_pb_js_1.FileDescriptorProtoSchema, file);
|
||||
(0, fields_js_1.clearField)(stripped, descriptor_pb_js_1.FileDescriptorProtoSchema.field.dependency);
|
||||
(0, fields_js_1.clearField)(stripped, descriptor_pb_js_1.FileDescriptorProtoSchema.field.sourceCodeInfo);
|
||||
stripped.messageType.map(stripJsonNames);
|
||||
return stripped;
|
||||
},
|
||||
base64() {
|
||||
const bytes = (0, to_binary_js_1.toBinary)(descriptor_pb_js_1.FileDescriptorProtoSchema, this.proto());
|
||||
return (0, base64_encoding_js_1.base64Encode)(bytes, "std_raw");
|
||||
},
|
||||
};
|
||||
return file.name == "google/protobuf/descriptor.proto"
|
||||
? Object.assign(Object.assign({}, embed), { bootable: true, boot() {
|
||||
return createFileDescriptorProtoBoot(this.proto());
|
||||
} }) : embed;
|
||||
}
|
||||
function stripJsonNames(d) {
|
||||
for (const f of d.field) {
|
||||
if (f.jsonName === (0, names_js_1.protoCamelCase)(f.name)) {
|
||||
(0, fields_js_1.clearField)(f, descriptor_pb_js_1.FieldDescriptorProtoSchema.field.jsonName);
|
||||
}
|
||||
}
|
||||
for (const n of d.nestedType) {
|
||||
stripJsonNames(n);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Compute the path to a message, enumeration, extension, or service in a
|
||||
* file descriptor.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function pathInFileDesc(desc) {
|
||||
if (desc.kind == "service") {
|
||||
return [desc.file.services.indexOf(desc)];
|
||||
}
|
||||
const parent = desc.parent;
|
||||
if (parent == undefined) {
|
||||
switch (desc.kind) {
|
||||
case "enum":
|
||||
return [desc.file.enums.indexOf(desc)];
|
||||
case "message":
|
||||
return [desc.file.messages.indexOf(desc)];
|
||||
case "extension":
|
||||
return [desc.file.extensions.indexOf(desc)];
|
||||
}
|
||||
}
|
||||
function findPath(cur) {
|
||||
const nested = [];
|
||||
for (let parent = cur.parent; parent;) {
|
||||
const idx = parent.nestedMessages.indexOf(cur);
|
||||
nested.unshift(idx);
|
||||
cur = parent;
|
||||
parent = cur.parent;
|
||||
}
|
||||
nested.unshift(cur.file.messages.indexOf(cur));
|
||||
return nested;
|
||||
}
|
||||
const path = findPath(parent);
|
||||
switch (desc.kind) {
|
||||
case "extension":
|
||||
return [...path, parent.nestedExtensions.indexOf(desc)];
|
||||
case "message":
|
||||
return [...path, parent.nestedMessages.indexOf(desc)];
|
||||
case "enum":
|
||||
return [...path, parent.nestedEnums.indexOf(desc)];
|
||||
}
|
||||
}
|
||||
/**
|
||||
* The file descriptor for google/protobuf/descriptor.proto cannot be embedded
|
||||
* in serialized form, since it is required to parse itself.
|
||||
*
|
||||
* This function takes an instance of the message, and returns a plain object
|
||||
* that can be hydrated to the message again via bootFileDescriptorProto().
|
||||
*
|
||||
* This function only works with a message google.protobuf.FileDescriptorProto
|
||||
* for google/protobuf/descriptor.proto, and only supports features that are
|
||||
* relevant for the specific use case. For example, it discards file options,
|
||||
* reserved ranges and reserved names, and field options that are unused in
|
||||
* descriptor.proto.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function createFileDescriptorProtoBoot(proto) {
|
||||
var _a;
|
||||
assert(proto.name == "google/protobuf/descriptor.proto");
|
||||
assert(proto.package == "google.protobuf");
|
||||
assert(!proto.dependency.length);
|
||||
assert(!proto.publicDependency.length);
|
||||
assert(!proto.weakDependency.length);
|
||||
assert(!proto.optionDependency.length);
|
||||
assert(!proto.service.length);
|
||||
assert(!proto.extension.length);
|
||||
assert(proto.sourceCodeInfo === undefined);
|
||||
assert(proto.syntax == "" || proto.syntax == "proto2");
|
||||
assert(!((_a = proto.options) === null || _a === void 0 ? void 0 : _a.features)); // we're dropping file options
|
||||
assert(proto.edition === descriptor_pb_js_1.Edition.EDITION_UNKNOWN);
|
||||
return {
|
||||
name: proto.name,
|
||||
package: proto.package,
|
||||
messageType: proto.messageType.map(createDescriptorBoot),
|
||||
enumType: proto.enumType.map(createEnumDescriptorBoot),
|
||||
};
|
||||
}
|
||||
function createDescriptorBoot(proto) {
|
||||
assert(proto.extension.length == 0);
|
||||
assert(!proto.oneofDecl.length);
|
||||
assert(!proto.options);
|
||||
assert(!(0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.DescriptorProtoSchema.field.visibility));
|
||||
const b = {
|
||||
name: proto.name,
|
||||
};
|
||||
if (proto.field.length) {
|
||||
b.field = proto.field.map(createFieldDescriptorBoot);
|
||||
}
|
||||
if (proto.nestedType.length) {
|
||||
b.nestedType = proto.nestedType.map(createDescriptorBoot);
|
||||
}
|
||||
if (proto.enumType.length) {
|
||||
b.enumType = proto.enumType.map(createEnumDescriptorBoot);
|
||||
}
|
||||
if (proto.extensionRange.length) {
|
||||
b.extensionRange = proto.extensionRange.map((r) => {
|
||||
assert(!r.options);
|
||||
return { start: r.start, end: r.end };
|
||||
});
|
||||
}
|
||||
return b;
|
||||
}
|
||||
function createFieldDescriptorBoot(proto) {
|
||||
assert((0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldDescriptorProtoSchema.field.name));
|
||||
assert((0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldDescriptorProtoSchema.field.number));
|
||||
assert((0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldDescriptorProtoSchema.field.type));
|
||||
assert(!(0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldDescriptorProtoSchema.field.oneofIndex));
|
||||
assert(!(0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldDescriptorProtoSchema.field.jsonName) ||
|
||||
proto.jsonName === (0, names_js_1.protoCamelCase)(proto.name));
|
||||
const b = {
|
||||
name: proto.name,
|
||||
number: proto.number,
|
||||
type: proto.type,
|
||||
};
|
||||
if ((0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldDescriptorProtoSchema.field.label)) {
|
||||
b.label = proto.label;
|
||||
}
|
||||
if ((0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldDescriptorProtoSchema.field.typeName)) {
|
||||
b.typeName = proto.typeName;
|
||||
}
|
||||
if ((0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldDescriptorProtoSchema.field.extendee)) {
|
||||
b.extendee = proto.extendee;
|
||||
}
|
||||
if ((0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldDescriptorProtoSchema.field.defaultValue)) {
|
||||
b.defaultValue = proto.defaultValue;
|
||||
}
|
||||
if (proto.options) {
|
||||
b.options = createFieldOptionsBoot(proto.options);
|
||||
}
|
||||
return b;
|
||||
}
|
||||
function createFieldOptionsBoot(proto) {
|
||||
const b = {};
|
||||
assert(!(0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldOptionsSchema.field.ctype));
|
||||
if ((0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldOptionsSchema.field.packed)) {
|
||||
b.packed = proto.packed;
|
||||
}
|
||||
assert(!(0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldOptionsSchema.field.jstype));
|
||||
assert(!(0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldOptionsSchema.field.lazy));
|
||||
assert(!(0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldOptionsSchema.field.unverifiedLazy));
|
||||
if ((0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldOptionsSchema.field.deprecated)) {
|
||||
b.deprecated = proto.deprecated;
|
||||
}
|
||||
assert(!(0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldOptionsSchema.field.weak));
|
||||
assert(!(0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldOptionsSchema.field.debugRedact));
|
||||
if ((0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldOptionsSchema.field.retention)) {
|
||||
b.retention = proto.retention;
|
||||
}
|
||||
if (proto.targets.length) {
|
||||
b.targets = proto.targets;
|
||||
}
|
||||
if (proto.editionDefaults.length) {
|
||||
b.editionDefaults = proto.editionDefaults.map((d) => ({
|
||||
value: d.value,
|
||||
edition: d.edition,
|
||||
}));
|
||||
}
|
||||
assert(!(0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldOptionsSchema.field.features));
|
||||
assert(!(0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldOptionsSchema.field.uninterpretedOption));
|
||||
return b;
|
||||
}
|
||||
function createEnumDescriptorBoot(proto) {
|
||||
assert(!proto.options);
|
||||
assert(!(0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.EnumDescriptorProtoSchema.field.visibility));
|
||||
return {
|
||||
name: proto.name,
|
||||
value: proto.value.map((v) => {
|
||||
assert(!v.options);
|
||||
return {
|
||||
name: v.name,
|
||||
number: v.number,
|
||||
};
|
||||
}),
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Assert that condition is truthy or throw error.
|
||||
*/
|
||||
function assert(condition) {
|
||||
if (!condition) {
|
||||
throw new Error();
|
||||
}
|
||||
}
|
||||
18
node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/enum.d.ts
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { DescEnum, DescFile } from "../descriptors.js";
|
||||
import type { GenEnum } from "./types.js";
|
||||
import type { JsonValue } from "../json-value.js";
|
||||
/**
|
||||
* Hydrate an enum descriptor.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
export declare function enumDesc<Shape extends number, JsonType extends JsonValue = JsonValue>(file: DescFile, path: number, ...paths: number[]): GenEnum<Shape, JsonType>;
|
||||
/**
|
||||
* Construct a TypeScript enum object at runtime from a descriptor.
|
||||
*/
|
||||
export declare function tsEnum(desc: DescEnum): enumObject;
|
||||
type enumObject = {
|
||||
[key: number]: string;
|
||||
[k: string]: number | string;
|
||||
};
|
||||
export {};
|
||||
40
node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/enum.js
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
"use strict";
|
||||
// Copyright 2021-2025 Buf Technologies, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.enumDesc = enumDesc;
|
||||
exports.tsEnum = tsEnum;
|
||||
/**
|
||||
* Hydrate an enum descriptor.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function enumDesc(file, path, ...paths) {
|
||||
if (paths.length == 0) {
|
||||
return file.enums[path];
|
||||
}
|
||||
const e = paths.pop(); // we checked length above
|
||||
return paths.reduce((acc, cur) => acc.nestedMessages[cur], file.messages[path]).nestedEnums[e];
|
||||
}
|
||||
/**
|
||||
* Construct a TypeScript enum object at runtime from a descriptor.
|
||||
*/
|
||||
function tsEnum(desc) {
|
||||
const enumObject = {};
|
||||
for (const value of desc.values) {
|
||||
enumObject[value.localName] = value.number;
|
||||
enumObject[value.number] = value.localName;
|
||||
}
|
||||
return enumObject;
|
||||
}
|
||||
9
node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/extension.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { Message } from "../types.js";
|
||||
import type { DescFile } from "../descriptors.js";
|
||||
import type { GenExtension } from "./types.js";
|
||||
/**
|
||||
* Hydrate an extension descriptor.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
export declare function extDesc<Extendee extends Message, Value>(file: DescFile, path: number, ...paths: number[]): GenExtension<Extendee, Value>;
|
||||
28
node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/extension.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
// Copyright 2021-2025 Buf Technologies, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.extDesc = extDesc;
|
||||
/**
|
||||
* Hydrate an extension descriptor.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function extDesc(file, path, ...paths) {
|
||||
if (paths.length == 0) {
|
||||
return file.extensions[path];
|
||||
}
|
||||
const e = paths.pop(); // we checked length above
|
||||
return paths.reduce((acc, cur) => acc.nestedMessages[cur], file.messages[path]).nestedExtensions[e];
|
||||
}
|
||||
7
node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/file.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { DescFile } from "../descriptors.js";
|
||||
/**
|
||||
* Hydrate a file descriptor.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
export declare function fileDesc(b64: string, imports?: DescFile[]): DescFile;
|
||||
35
node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/file.js
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
"use strict";
|
||||
// Copyright 2021-2025 Buf Technologies, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.fileDesc = fileDesc;
|
||||
const base64_encoding_js_1 = require("../wire/base64-encoding.js");
|
||||
const descriptor_pb_js_1 = require("../wkt/gen/google/protobuf/descriptor_pb.js");
|
||||
const registry_js_1 = require("../registry.js");
|
||||
const restore_json_names_js_1 = require("./restore-json-names.js");
|
||||
const from_binary_js_1 = require("../from-binary.js");
|
||||
/**
|
||||
* Hydrate a file descriptor.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function fileDesc(b64, imports) {
|
||||
var _a;
|
||||
const root = (0, from_binary_js_1.fromBinary)(descriptor_pb_js_1.FileDescriptorProtoSchema, (0, base64_encoding_js_1.base64Decode)(b64));
|
||||
root.messageType.forEach(restore_json_names_js_1.restoreJsonNames);
|
||||
root.dependency = (_a = imports === null || imports === void 0 ? void 0 : imports.map((f) => f.proto.name)) !== null && _a !== void 0 ? _a : [];
|
||||
const reg = (0, registry_js_1.createFileRegistry)(root, (protoFileName) => imports === null || imports === void 0 ? void 0 : imports.find((f) => f.proto.name === protoFileName));
|
||||
// biome-ignore lint/style/noNonNullAssertion: non-null assertion because we just created the registry from the file we look up
|
||||
return reg.getFile(root.name);
|
||||
}
|
||||
10
node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
export * from "./boot.js";
|
||||
export * from "./embed.js";
|
||||
export * from "./enum.js";
|
||||
export * from "./extension.js";
|
||||
export * from "./file.js";
|
||||
export * from "./message.js";
|
||||
export * from "./service.js";
|
||||
export * from "./symbols.js";
|
||||
export * from "./scalar.js";
|
||||
export * from "./types.js";
|
||||
39
node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/index.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
"use strict";
|
||||
// Copyright 2021-2025 Buf Technologies, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__exportStar(require("./boot.js"), exports);
|
||||
__exportStar(require("./embed.js"), exports);
|
||||
__exportStar(require("./enum.js"), exports);
|
||||
__exportStar(require("./extension.js"), exports);
|
||||
__exportStar(require("./file.js"), exports);
|
||||
__exportStar(require("./message.js"), exports);
|
||||
__exportStar(require("./service.js"), exports);
|
||||
__exportStar(require("./symbols.js"), exports);
|
||||
__exportStar(require("./scalar.js"), exports);
|
||||
__exportStar(require("./types.js"), exports);
|
||||
15
node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/message.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import type { Message } from "../types.js";
|
||||
import type { DescFile } from "../descriptors.js";
|
||||
import type { GenMessage } from "./types.js";
|
||||
/**
|
||||
* Hydrate a message descriptor.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
export declare function messageDesc<Shape extends Message, Opt extends {
|
||||
jsonType?: unknown;
|
||||
validType?: unknown;
|
||||
} = {
|
||||
jsonType: undefined;
|
||||
validType: undefined;
|
||||
}>(file: DescFile, path: number, ...paths: number[]): GenMessage<Shape, Opt>;
|
||||
24
node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/message.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
// Copyright 2021-2025 Buf Technologies, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.messageDesc = messageDesc;
|
||||
/**
|
||||
* Hydrate a message descriptor.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function messageDesc(file, path, ...paths) {
|
||||
return paths.reduce((acc, cur) => acc.nestedMessages[cur], file.messages[path]);
|
||||
}
|
||||
5
node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/restore-json-names.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import type { DescriptorProto } from "../wkt/gen/google/protobuf/descriptor_pb.js";
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function restoreJsonNames(message: DescriptorProto): void;
|
||||
29
node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/restore-json-names.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
"use strict";
|
||||
// Copyright 2021-2025 Buf Technologies, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.restoreJsonNames = restoreJsonNames;
|
||||
const names_js_1 = require("../reflect/names.js");
|
||||
const unsafe_js_1 = require("../reflect/unsafe.js");
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
function restoreJsonNames(message) {
|
||||
for (const f of message.field) {
|
||||
if (!(0, unsafe_js_1.unsafeIsSetExplicit)(f, "jsonName")) {
|
||||
f.jsonName = (0, names_js_1.protoCamelCase)(f.name);
|
||||
}
|
||||
}
|
||||
message.nestedType.forEach(restoreJsonNames);
|
||||
}
|
||||
9
node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/scalar.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { ScalarType } from "../descriptors.js";
|
||||
/**
|
||||
* Return the TypeScript type (as a string) for the given scalar type.
|
||||
*/
|
||||
export declare function scalarTypeScriptType(scalar: ScalarType, longAsString: boolean): "string" | "boolean" | "bigint" | "bigint | string" | "Uint8Array" | "number";
|
||||
/**
|
||||
* Return the JSON type (as a string) for the given scalar type.
|
||||
*/
|
||||
export declare function scalarJsonType(scalar: ScalarType): "string" | "boolean" | "number" | `number | "NaN" | "Infinity" | "-Infinity"`;
|
||||
67
node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/scalar.js
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
"use strict";
|
||||
// Copyright 2021-2025 Buf Technologies, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.scalarTypeScriptType = scalarTypeScriptType;
|
||||
exports.scalarJsonType = scalarJsonType;
|
||||
const descriptors_js_1 = require("../descriptors.js");
|
||||
/**
|
||||
* Return the TypeScript type (as a string) for the given scalar type.
|
||||
*/
|
||||
function scalarTypeScriptType(scalar, longAsString) {
|
||||
switch (scalar) {
|
||||
case descriptors_js_1.ScalarType.STRING:
|
||||
return "string";
|
||||
case descriptors_js_1.ScalarType.BOOL:
|
||||
return "boolean";
|
||||
case descriptors_js_1.ScalarType.UINT64:
|
||||
case descriptors_js_1.ScalarType.SFIXED64:
|
||||
case descriptors_js_1.ScalarType.FIXED64:
|
||||
case descriptors_js_1.ScalarType.SINT64:
|
||||
case descriptors_js_1.ScalarType.INT64:
|
||||
return longAsString ? "string" : "bigint";
|
||||
case descriptors_js_1.ScalarType.BYTES:
|
||||
return "Uint8Array";
|
||||
default:
|
||||
return "number";
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Return the JSON type (as a string) for the given scalar type.
|
||||
*/
|
||||
function scalarJsonType(scalar) {
|
||||
switch (scalar) {
|
||||
case descriptors_js_1.ScalarType.DOUBLE:
|
||||
case descriptors_js_1.ScalarType.FLOAT:
|
||||
return `number | "NaN" | "Infinity" | "-Infinity"`;
|
||||
case descriptors_js_1.ScalarType.UINT64:
|
||||
case descriptors_js_1.ScalarType.SFIXED64:
|
||||
case descriptors_js_1.ScalarType.FIXED64:
|
||||
case descriptors_js_1.ScalarType.SINT64:
|
||||
case descriptors_js_1.ScalarType.INT64:
|
||||
return "string";
|
||||
case descriptors_js_1.ScalarType.INT32:
|
||||
case descriptors_js_1.ScalarType.FIXED32:
|
||||
case descriptors_js_1.ScalarType.UINT32:
|
||||
case descriptors_js_1.ScalarType.SFIXED32:
|
||||
case descriptors_js_1.ScalarType.SINT32:
|
||||
return "number";
|
||||
case descriptors_js_1.ScalarType.STRING:
|
||||
return "string";
|
||||
case descriptors_js_1.ScalarType.BOOL:
|
||||
return "boolean";
|
||||
case descriptors_js_1.ScalarType.BYTES:
|
||||
return "string";
|
||||
}
|
||||
}
|
||||
8
node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/service.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import type { GenService, GenServiceMethods } from "./types.js";
|
||||
import type { DescFile } from "../descriptors.js";
|
||||
/**
|
||||
* Hydrate a service descriptor.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
export declare function serviceDesc<T extends GenServiceMethods>(file: DescFile, path: number, ...paths: number[]): GenService<T>;
|
||||
27
node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/service.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
// Copyright 2021-2025 Buf Technologies, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.serviceDesc = serviceDesc;
|
||||
/**
|
||||
* Hydrate a service descriptor.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function serviceDesc(file, path, ...paths) {
|
||||
if (paths.length > 0) {
|
||||
throw new Error();
|
||||
}
|
||||
return file.services[path];
|
||||
}
|
||||
135
node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/symbols.d.ts
generated
vendored
Normal file
@@ -0,0 +1,135 @@
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare const packageName = "@bufbuild/protobuf";
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare const wktPublicImportPaths: Readonly<Record<string, string>>;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare const symbols: {
|
||||
readonly isMessage: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../is-message.js";
|
||||
readonly from: "@bufbuild/protobuf";
|
||||
};
|
||||
readonly Message: {
|
||||
readonly typeOnly: true;
|
||||
readonly bootstrapWktFrom: "../../types.js";
|
||||
readonly from: "@bufbuild/protobuf";
|
||||
};
|
||||
readonly create: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../create.js";
|
||||
readonly from: "@bufbuild/protobuf";
|
||||
};
|
||||
readonly fromJson: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../from-json.js";
|
||||
readonly from: "@bufbuild/protobuf";
|
||||
};
|
||||
readonly fromJsonString: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../from-json.js";
|
||||
readonly from: "@bufbuild/protobuf";
|
||||
};
|
||||
readonly fromBinary: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../from-binary.js";
|
||||
readonly from: "@bufbuild/protobuf";
|
||||
};
|
||||
readonly toBinary: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../to-binary.js";
|
||||
readonly from: "@bufbuild/protobuf";
|
||||
};
|
||||
readonly toJson: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../to-json.js";
|
||||
readonly from: "@bufbuild/protobuf";
|
||||
};
|
||||
readonly toJsonString: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../to-json.js";
|
||||
readonly from: "@bufbuild/protobuf";
|
||||
};
|
||||
readonly protoInt64: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../proto-int64.js";
|
||||
readonly from: "@bufbuild/protobuf";
|
||||
};
|
||||
readonly JsonValue: {
|
||||
readonly typeOnly: true;
|
||||
readonly bootstrapWktFrom: "../../json-value.js";
|
||||
readonly from: "@bufbuild/protobuf";
|
||||
};
|
||||
readonly JsonObject: {
|
||||
readonly typeOnly: true;
|
||||
readonly bootstrapWktFrom: "../../json-value.js";
|
||||
readonly from: "@bufbuild/protobuf";
|
||||
};
|
||||
readonly codegen: {
|
||||
readonly boot: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../codegenv2/boot.js";
|
||||
readonly from: string;
|
||||
};
|
||||
readonly fileDesc: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../codegenv2/file.js";
|
||||
readonly from: string;
|
||||
};
|
||||
readonly enumDesc: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../codegenv2/enum.js";
|
||||
readonly from: string;
|
||||
};
|
||||
readonly extDesc: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../codegenv2/extension.js";
|
||||
readonly from: string;
|
||||
};
|
||||
readonly messageDesc: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../codegenv2/message.js";
|
||||
readonly from: string;
|
||||
};
|
||||
readonly serviceDesc: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../codegenv2/service.js";
|
||||
readonly from: string;
|
||||
};
|
||||
readonly tsEnum: {
|
||||
readonly typeOnly: false;
|
||||
readonly bootstrapWktFrom: "../../codegenv2/enum.js";
|
||||
readonly from: string;
|
||||
};
|
||||
readonly GenFile: {
|
||||
readonly typeOnly: true;
|
||||
readonly bootstrapWktFrom: "../../codegenv2/types.js";
|
||||
readonly from: string;
|
||||
};
|
||||
readonly GenEnum: {
|
||||
readonly typeOnly: true;
|
||||
readonly bootstrapWktFrom: "../../codegenv2/types.js";
|
||||
readonly from: string;
|
||||
};
|
||||
readonly GenExtension: {
|
||||
readonly typeOnly: true;
|
||||
readonly bootstrapWktFrom: "../../codegenv2/types.js";
|
||||
readonly from: string;
|
||||
};
|
||||
readonly GenMessage: {
|
||||
readonly typeOnly: true;
|
||||
readonly bootstrapWktFrom: "../../codegenv2/types.js";
|
||||
readonly from: string;
|
||||
};
|
||||
readonly GenService: {
|
||||
readonly typeOnly: true;
|
||||
readonly bootstrapWktFrom: "../../codegenv2/types.js";
|
||||
readonly from: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
72
node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/symbols.js
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
"use strict";
|
||||
// Copyright 2021-2025 Buf Technologies, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.symbols = exports.wktPublicImportPaths = exports.packageName = void 0;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
exports.packageName = "@bufbuild/protobuf";
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
exports.wktPublicImportPaths = {
|
||||
"google/protobuf/compiler/plugin.proto": exports.packageName + "/wkt",
|
||||
"google/protobuf/any.proto": exports.packageName + "/wkt",
|
||||
"google/protobuf/api.proto": exports.packageName + "/wkt",
|
||||
"google/protobuf/cpp_features.proto": exports.packageName + "/wkt",
|
||||
"google/protobuf/descriptor.proto": exports.packageName + "/wkt",
|
||||
"google/protobuf/duration.proto": exports.packageName + "/wkt",
|
||||
"google/protobuf/empty.proto": exports.packageName + "/wkt",
|
||||
"google/protobuf/field_mask.proto": exports.packageName + "/wkt",
|
||||
"google/protobuf/go_features.proto": exports.packageName + "/wkt",
|
||||
"google/protobuf/java_features.proto": exports.packageName + "/wkt",
|
||||
"google/protobuf/source_context.proto": exports.packageName + "/wkt",
|
||||
"google/protobuf/struct.proto": exports.packageName + "/wkt",
|
||||
"google/protobuf/timestamp.proto": exports.packageName + "/wkt",
|
||||
"google/protobuf/type.proto": exports.packageName + "/wkt",
|
||||
"google/protobuf/wrappers.proto": exports.packageName + "/wkt",
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
// biome-ignore format: want this to read well
|
||||
exports.symbols = {
|
||||
isMessage: { typeOnly: false, bootstrapWktFrom: "../../is-message.js", from: exports.packageName },
|
||||
Message: { typeOnly: true, bootstrapWktFrom: "../../types.js", from: exports.packageName },
|
||||
create: { typeOnly: false, bootstrapWktFrom: "../../create.js", from: exports.packageName },
|
||||
fromJson: { typeOnly: false, bootstrapWktFrom: "../../from-json.js", from: exports.packageName },
|
||||
fromJsonString: { typeOnly: false, bootstrapWktFrom: "../../from-json.js", from: exports.packageName },
|
||||
fromBinary: { typeOnly: false, bootstrapWktFrom: "../../from-binary.js", from: exports.packageName },
|
||||
toBinary: { typeOnly: false, bootstrapWktFrom: "../../to-binary.js", from: exports.packageName },
|
||||
toJson: { typeOnly: false, bootstrapWktFrom: "../../to-json.js", from: exports.packageName },
|
||||
toJsonString: { typeOnly: false, bootstrapWktFrom: "../../to-json.js", from: exports.packageName },
|
||||
protoInt64: { typeOnly: false, bootstrapWktFrom: "../../proto-int64.js", from: exports.packageName },
|
||||
JsonValue: { typeOnly: true, bootstrapWktFrom: "../../json-value.js", from: exports.packageName },
|
||||
JsonObject: { typeOnly: true, bootstrapWktFrom: "../../json-value.js", from: exports.packageName },
|
||||
codegen: {
|
||||
boot: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/boot.js", from: exports.packageName + "/codegenv2" },
|
||||
fileDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/file.js", from: exports.packageName + "/codegenv2" },
|
||||
enumDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/enum.js", from: exports.packageName + "/codegenv2" },
|
||||
extDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/extension.js", from: exports.packageName + "/codegenv2" },
|
||||
messageDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/message.js", from: exports.packageName + "/codegenv2" },
|
||||
serviceDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/service.js", from: exports.packageName + "/codegenv2" },
|
||||
tsEnum: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/enum.js", from: exports.packageName + "/codegenv2" },
|
||||
GenFile: { typeOnly: true, bootstrapWktFrom: "../../codegenv2/types.js", from: exports.packageName + "/codegenv2" },
|
||||
GenEnum: { typeOnly: true, bootstrapWktFrom: "../../codegenv2/types.js", from: exports.packageName + "/codegenv2" },
|
||||
GenExtension: { typeOnly: true, bootstrapWktFrom: "../../codegenv2/types.js", from: exports.packageName + "/codegenv2" },
|
||||
GenMessage: { typeOnly: true, bootstrapWktFrom: "../../codegenv2/types.js", from: exports.packageName + "/codegenv2" },
|
||||
GenService: { typeOnly: true, bootstrapWktFrom: "../../codegenv2/types.js", from: exports.packageName + "/codegenv2" },
|
||||
},
|
||||
};
|
||||
81
node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
import type { Message } from "../types.js";
|
||||
import type { DescEnum, DescEnumValue, DescExtension, DescField, DescFile, DescMessage, DescMethod, DescService } from "../descriptors.js";
|
||||
import type { JsonValue } from "../json-value.js";
|
||||
/**
|
||||
* Describes a protobuf source file.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
export type GenFile = DescFile;
|
||||
/**
|
||||
* Describes a message declaration in a protobuf source file.
|
||||
*
|
||||
* This type is identical to DescMessage, but carries additional type
|
||||
* information.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
export type GenMessage<RuntimeShape extends Message, Opt extends {
|
||||
jsonType?: unknown;
|
||||
validType?: unknown;
|
||||
} = {
|
||||
jsonType?: unknown;
|
||||
validType?: unknown;
|
||||
}> = Omit<DescMessage, "field" | "typeName"> & {
|
||||
field: Record<MessageFieldNames<RuntimeShape>, DescField>;
|
||||
typeName: RuntimeShape["$typeName"];
|
||||
} & brandv2<RuntimeShape, Opt>;
|
||||
/**
|
||||
* Describes an enumeration in a protobuf source file.
|
||||
*
|
||||
* This type is identical to DescEnum, but carries additional type
|
||||
* information.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
export type GenEnum<RuntimeShape extends number, JsonType extends JsonValue = JsonValue> = Omit<DescEnum, "value"> & {
|
||||
value: Record<RuntimeShape, DescEnumValue>;
|
||||
} & brandv2<RuntimeShape, JsonType>;
|
||||
/**
|
||||
* Describes an extension in a protobuf source file.
|
||||
*
|
||||
* This type is identical to DescExtension, but carries additional type
|
||||
* information.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
export type GenExtension<Extendee extends Message = Message, RuntimeShape = unknown> = DescExtension & brandv2<Extendee, RuntimeShape>;
|
||||
/**
|
||||
* Describes a service declaration in a protobuf source file.
|
||||
*
|
||||
* This type is identical to DescService, but carries additional type
|
||||
* information.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
export type GenService<RuntimeShape extends GenServiceMethods> = Omit<DescService, "method"> & {
|
||||
method: {
|
||||
[K in keyof RuntimeShape]: RuntimeShape[K] & DescMethod;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export type GenServiceMethods = Record<string, Pick<DescMethod, "input" | "output" | "methodKind">>;
|
||||
declare class brandv2<A, B = unknown> {
|
||||
protected v: "codegenv2";
|
||||
protected a: A | boolean;
|
||||
protected b: B | boolean;
|
||||
}
|
||||
/**
|
||||
* Union of the property names of all fields, including oneof members.
|
||||
* For an anonymous message (no generated message shape), it's simply a string.
|
||||
*/
|
||||
type MessageFieldNames<T extends Message> = Message extends T ? string : Exclude<keyof {
|
||||
[P in keyof T as P extends ("$typeName" | "$unknown") ? never : T[P] extends Oneof<infer K> ? K : P]-?: true;
|
||||
}, number | symbol>;
|
||||
type Oneof<K extends string> = {
|
||||
case: K | undefined;
|
||||
value?: unknown;
|
||||
};
|
||||
export {};
|
||||
22
node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/types.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
// Copyright 2021-2025 Buf Technologies, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
class brandv2 {
|
||||
constructor() {
|
||||
this.v = "codegenv2";
|
||||
this.a = false;
|
||||
this.b = false;
|
||||
}
|
||||
}
|
||||
9
node_modules/@bufbuild/protobuf/dist/cjs/create.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { type DescMessage } from "./descriptors.js";
|
||||
import type { MessageInitShape, MessageShape } from "./types.js";
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* The second argument is an optional initializer object, where all fields are
|
||||
* optional.
|
||||
*/
|
||||
export declare function create<Desc extends DescMessage>(schema: Desc, init?: MessageInitShape<Desc>): MessageShape<Desc>;
|
||||
259
node_modules/@bufbuild/protobuf/dist/cjs/create.js
generated
vendored
Normal file
@@ -0,0 +1,259 @@
|
||||
"use strict";
|
||||
// Copyright 2021-2025 Buf Technologies, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.create = create;
|
||||
const is_message_js_1 = require("./is-message.js");
|
||||
const descriptors_js_1 = require("./descriptors.js");
|
||||
const scalar_js_1 = require("./reflect/scalar.js");
|
||||
const guard_js_1 = require("./reflect/guard.js");
|
||||
const unsafe_js_1 = require("./reflect/unsafe.js");
|
||||
const wrappers_js_1 = require("./wkt/wrappers.js");
|
||||
// bootstrap-inject google.protobuf.Edition.EDITION_PROTO3: const $name: Edition.$localName = $number;
|
||||
const EDITION_PROTO3 = 999;
|
||||
// bootstrap-inject google.protobuf.Edition.EDITION_PROTO2: const $name: Edition.$localName = $number;
|
||||
const EDITION_PROTO2 = 998;
|
||||
// bootstrap-inject google.protobuf.FeatureSet.FieldPresence.IMPLICIT: const $name: FeatureSet_FieldPresence.$localName = $number;
|
||||
const IMPLICIT = 2;
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* The second argument is an optional initializer object, where all fields are
|
||||
* optional.
|
||||
*/
|
||||
function create(schema, init) {
|
||||
if ((0, is_message_js_1.isMessage)(init, schema)) {
|
||||
return init;
|
||||
}
|
||||
const message = createZeroMessage(schema);
|
||||
if (init !== undefined) {
|
||||
initMessage(schema, message, init);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
/**
|
||||
* Sets field values from a MessageInitShape on a zero message.
|
||||
*/
|
||||
function initMessage(messageDesc, message, init) {
|
||||
for (const member of messageDesc.members) {
|
||||
let value = init[member.localName];
|
||||
if (value == null) {
|
||||
// intentionally ignore undefined and null
|
||||
continue;
|
||||
}
|
||||
let field;
|
||||
if (member.kind == "oneof") {
|
||||
const oneofField = (0, unsafe_js_1.unsafeOneofCase)(init, member);
|
||||
if (!oneofField) {
|
||||
continue;
|
||||
}
|
||||
field = oneofField;
|
||||
value = (0, unsafe_js_1.unsafeGet)(init, oneofField);
|
||||
}
|
||||
else {
|
||||
field = member;
|
||||
}
|
||||
switch (field.fieldKind) {
|
||||
case "message":
|
||||
value = toMessage(field, value);
|
||||
break;
|
||||
case "scalar":
|
||||
value = initScalar(field, value);
|
||||
break;
|
||||
case "list":
|
||||
value = initList(field, value);
|
||||
break;
|
||||
case "map":
|
||||
value = initMap(field, value);
|
||||
break;
|
||||
}
|
||||
(0, unsafe_js_1.unsafeSet)(message, field, value);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
function initScalar(field, value) {
|
||||
if (field.scalar == descriptors_js_1.ScalarType.BYTES) {
|
||||
return toU8Arr(value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function initMap(field, value) {
|
||||
if ((0, guard_js_1.isObject)(value)) {
|
||||
if (field.scalar == descriptors_js_1.ScalarType.BYTES) {
|
||||
return convertObjectValues(value, toU8Arr);
|
||||
}
|
||||
if (field.mapKind == "message") {
|
||||
return convertObjectValues(value, (val) => toMessage(field, val));
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function initList(field, value) {
|
||||
if (Array.isArray(value)) {
|
||||
if (field.scalar == descriptors_js_1.ScalarType.BYTES) {
|
||||
return value.map(toU8Arr);
|
||||
}
|
||||
if (field.listKind == "message") {
|
||||
return value.map((item) => toMessage(field, item));
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function toMessage(field, value) {
|
||||
if (field.fieldKind == "message" &&
|
||||
!field.oneof &&
|
||||
(0, wrappers_js_1.isWrapperDesc)(field.message)) {
|
||||
// Types from google/protobuf/wrappers.proto are unwrapped when used in
|
||||
// a singular field that is not part of a oneof group.
|
||||
return initScalar(field.message.fields[0], value);
|
||||
}
|
||||
if ((0, guard_js_1.isObject)(value)) {
|
||||
if (field.message.typeName == "google.protobuf.Struct" &&
|
||||
field.parent.typeName !== "google.protobuf.Value") {
|
||||
// google.protobuf.Struct is represented with JsonObject when used in a
|
||||
// field, except when used in google.protobuf.Value.
|
||||
return value;
|
||||
}
|
||||
if (!(0, is_message_js_1.isMessage)(value, field.message)) {
|
||||
return create(field.message, value);
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
// converts any ArrayLike<number> to Uint8Array if necessary.
|
||||
function toU8Arr(value) {
|
||||
return Array.isArray(value) ? new Uint8Array(value) : value;
|
||||
}
|
||||
function convertObjectValues(obj, fn) {
|
||||
const ret = {};
|
||||
for (const entry of Object.entries(obj)) {
|
||||
ret[entry[0]] = fn(entry[1]);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
const tokenZeroMessageField = Symbol();
|
||||
const messagePrototypes = new WeakMap();
|
||||
/**
|
||||
* Create a zero message.
|
||||
*/
|
||||
function createZeroMessage(desc) {
|
||||
let msg;
|
||||
if (!needsPrototypeChain(desc)) {
|
||||
msg = {
|
||||
$typeName: desc.typeName,
|
||||
};
|
||||
for (const member of desc.members) {
|
||||
if (member.kind == "oneof" || member.presence == IMPLICIT) {
|
||||
msg[member.localName] = createZeroField(member);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Support default values and track presence via the prototype chain
|
||||
const cached = messagePrototypes.get(desc);
|
||||
let prototype;
|
||||
let members;
|
||||
if (cached) {
|
||||
({ prototype, members } = cached);
|
||||
}
|
||||
else {
|
||||
prototype = {};
|
||||
members = new Set();
|
||||
for (const member of desc.members) {
|
||||
if (member.kind == "oneof") {
|
||||
// we can only put immutable values on the prototype,
|
||||
// oneof ADTs are mutable
|
||||
continue;
|
||||
}
|
||||
if (member.fieldKind != "scalar" && member.fieldKind != "enum") {
|
||||
// only scalar and enum values are immutable, map, list, and message
|
||||
// are not
|
||||
continue;
|
||||
}
|
||||
if (member.presence == IMPLICIT) {
|
||||
// implicit presence tracks field presence by zero values - e.g. 0, false, "", are unset, 1, true, "x" are set.
|
||||
// message, map, list fields are mutable, and also have IMPLICIT presence.
|
||||
continue;
|
||||
}
|
||||
members.add(member);
|
||||
prototype[member.localName] = createZeroField(member);
|
||||
}
|
||||
messagePrototypes.set(desc, { prototype, members });
|
||||
}
|
||||
msg = Object.create(prototype);
|
||||
msg.$typeName = desc.typeName;
|
||||
for (const member of desc.members) {
|
||||
if (members.has(member)) {
|
||||
continue;
|
||||
}
|
||||
if (member.kind == "field") {
|
||||
if (member.fieldKind == "message") {
|
||||
continue;
|
||||
}
|
||||
if (member.fieldKind == "scalar" || member.fieldKind == "enum") {
|
||||
if (member.presence != IMPLICIT) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
msg[member.localName] = createZeroField(member);
|
||||
}
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
/**
|
||||
* Do we need the prototype chain to track field presence?
|
||||
*/
|
||||
function needsPrototypeChain(desc) {
|
||||
switch (desc.file.edition) {
|
||||
case EDITION_PROTO3:
|
||||
// proto3 always uses implicit presence, we never need the prototype chain.
|
||||
return false;
|
||||
case EDITION_PROTO2:
|
||||
// proto2 never uses implicit presence, we always need the prototype chain.
|
||||
return true;
|
||||
default:
|
||||
// If a message uses scalar or enum fields with explicit presence, we need
|
||||
// the prototype chain to track presence. This rule does not apply to fields
|
||||
// in a oneof group - they use a different mechanism to track presence.
|
||||
return desc.fields.some((f) => f.presence != IMPLICIT && f.fieldKind != "message" && !f.oneof);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns a zero value for oneof groups, and for every field kind except
|
||||
* messages. Scalar and enum fields can have default values.
|
||||
*/
|
||||
function createZeroField(field) {
|
||||
if (field.kind == "oneof") {
|
||||
return { case: undefined };
|
||||
}
|
||||
if (field.fieldKind == "list") {
|
||||
return [];
|
||||
}
|
||||
if (field.fieldKind == "map") {
|
||||
return {}; // Object.create(null) would be desirable here, but is unsupported by react https://react.dev/reference/react/use-server#serializable-parameters-and-return-values
|
||||
}
|
||||
if (field.fieldKind == "message") {
|
||||
return tokenZeroMessageField;
|
||||
}
|
||||
const defaultValue = field.getDefaultValue();
|
||||
if (defaultValue !== undefined) {
|
||||
return field.fieldKind == "scalar" && field.longAsString
|
||||
? defaultValue.toString()
|
||||
: defaultValue;
|
||||
}
|
||||
return field.fieldKind == "scalar"
|
||||
? (0, scalar_js_1.scalarZeroValue)(field.scalar, field.longAsString)
|
||||
: field.enum.values[0].number;
|
||||
}
|
||||
627
node_modules/@bufbuild/protobuf/dist/cjs/descriptors.d.ts
generated
vendored
Normal file
@@ -0,0 +1,627 @@
|
||||
import type { DescriptorProto, Edition, EnumDescriptorProto, EnumValueDescriptorProto, FeatureSet_FieldPresence, FieldDescriptorProto, FileDescriptorProto, MethodDescriptorProto, MethodOptions_IdempotencyLevel, OneofDescriptorProto, ServiceDescriptorProto } from "./wkt/gen/google/protobuf/descriptor_pb.js";
|
||||
import type { ScalarValue } from "./reflect/scalar.js";
|
||||
export type SupportedEdition = Extract<Edition, Edition.EDITION_PROTO2 | Edition.EDITION_PROTO3 | Edition.EDITION_2023 | Edition.EDITION_2024>;
|
||||
type SupportedFieldPresence = Extract<FeatureSet_FieldPresence, FeatureSet_FieldPresence.EXPLICIT | FeatureSet_FieldPresence.IMPLICIT | FeatureSet_FieldPresence.LEGACY_REQUIRED>;
|
||||
/**
|
||||
* Scalar value types. This is a subset of field types declared by protobuf
|
||||
* enum google.protobuf.FieldDescriptorProto.Type The types GROUP and MESSAGE
|
||||
* are omitted, but the numerical values are identical.
|
||||
*/
|
||||
export declare enum ScalarType {
|
||||
DOUBLE = 1,
|
||||
FLOAT = 2,
|
||||
INT64 = 3,
|
||||
UINT64 = 4,
|
||||
INT32 = 5,
|
||||
FIXED64 = 6,
|
||||
FIXED32 = 7,
|
||||
BOOL = 8,
|
||||
STRING = 9,
|
||||
BYTES = 12,
|
||||
UINT32 = 13,
|
||||
SFIXED32 = 15,
|
||||
SFIXED64 = 16,
|
||||
SINT32 = 17,// Uses ZigZag encoding.
|
||||
SINT64 = 18
|
||||
}
|
||||
/**
|
||||
* A union of all descriptors, discriminated by a `kind` property.
|
||||
*/
|
||||
export type AnyDesc = DescFile | DescEnum | DescEnumValue | DescMessage | DescField | DescExtension | DescOneof | DescService | DescMethod;
|
||||
/**
|
||||
* Describes a protobuf source file.
|
||||
*/
|
||||
export interface DescFile {
|
||||
readonly kind: "file";
|
||||
/**
|
||||
* The edition of the protobuf file. Will be EDITION_PROTO2 for syntax="proto2",
|
||||
* EDITION_PROTO3 for syntax="proto3";
|
||||
*/
|
||||
readonly edition: SupportedEdition;
|
||||
/**
|
||||
* The name of the file, excluding the .proto suffix.
|
||||
* For a protobuf file `foo/bar.proto`, this is `foo/bar`.
|
||||
*/
|
||||
readonly name: string;
|
||||
/**
|
||||
* Files imported by this file.
|
||||
*/
|
||||
readonly dependencies: DescFile[];
|
||||
/**
|
||||
* Top-level enumerations declared in this file.
|
||||
* Note that more enumerations might be declared within message declarations.
|
||||
*/
|
||||
readonly enums: DescEnum[];
|
||||
/**
|
||||
* Top-level messages declared in this file.
|
||||
* Note that more messages might be declared within message declarations.
|
||||
*/
|
||||
readonly messages: DescMessage[];
|
||||
/**
|
||||
* Top-level extensions declared in this file.
|
||||
* Note that more extensions might be declared within message declarations.
|
||||
*/
|
||||
readonly extensions: DescExtension[];
|
||||
/**
|
||||
* Services declared in this file.
|
||||
*/
|
||||
readonly services: DescService[];
|
||||
/**
|
||||
* Marked as deprecated in the protobuf source.
|
||||
*/
|
||||
readonly deprecated: boolean;
|
||||
/**
|
||||
* The compiler-generated descriptor.
|
||||
*/
|
||||
readonly proto: FileDescriptorProto;
|
||||
toString(): string;
|
||||
}
|
||||
/**
|
||||
* Describes an enumeration in a protobuf source file.
|
||||
*/
|
||||
export interface DescEnum {
|
||||
readonly kind: "enum";
|
||||
/**
|
||||
* The fully qualified name of the enumeration. (We omit the leading dot.)
|
||||
*/
|
||||
readonly typeName: string;
|
||||
/**
|
||||
* The name of the enumeration, as declared in the protobuf source.
|
||||
*/
|
||||
readonly name: string;
|
||||
/**
|
||||
* The file this enumeration was declared in.
|
||||
*/
|
||||
readonly file: DescFile;
|
||||
/**
|
||||
* The parent message, if this enumeration was declared inside a message declaration.
|
||||
*/
|
||||
readonly parent: DescMessage | undefined;
|
||||
/**
|
||||
* Enumerations can be open or closed.
|
||||
* See https://protobuf.dev/programming-guides/enum/
|
||||
*/
|
||||
readonly open: boolean;
|
||||
/**
|
||||
* Values declared for this enumeration.
|
||||
*/
|
||||
readonly values: DescEnumValue[];
|
||||
/**
|
||||
* All values of this enum by their number.
|
||||
*/
|
||||
readonly value: Record<number, DescEnumValue>;
|
||||
/**
|
||||
* A prefix shared by all enum values.
|
||||
* For example, `my_enum_` for `enum MyEnum {MY_ENUM_A=0; MY_ENUM_B=1;}`
|
||||
*/
|
||||
readonly sharedPrefix?: string;
|
||||
/**
|
||||
* Marked as deprecated in the protobuf source.
|
||||
*/
|
||||
readonly deprecated: boolean;
|
||||
/**
|
||||
* The compiler-generated descriptor.
|
||||
*/
|
||||
readonly proto: EnumDescriptorProto;
|
||||
toString(): string;
|
||||
}
|
||||
/**
|
||||
* Describes an individual value of an enumeration in a protobuf source file.
|
||||
*/
|
||||
export interface DescEnumValue {
|
||||
readonly kind: "enum_value";
|
||||
/**
|
||||
* The name of the enumeration value, as specified in the protobuf source.
|
||||
*/
|
||||
readonly name: string;
|
||||
/**
|
||||
* A safe and idiomatic name for the value in a TypeScript enum.
|
||||
*/
|
||||
readonly localName: string;
|
||||
/**
|
||||
* The enumeration this value belongs to.
|
||||
*/
|
||||
readonly parent: DescEnum;
|
||||
/**
|
||||
* The numeric enumeration value, as specified in the protobuf source.
|
||||
*/
|
||||
readonly number: number;
|
||||
/**
|
||||
* Marked as deprecated in the protobuf source.
|
||||
*/
|
||||
readonly deprecated: boolean;
|
||||
/**
|
||||
* The compiler-generated descriptor.
|
||||
*/
|
||||
readonly proto: EnumValueDescriptorProto;
|
||||
toString(): string;
|
||||
}
|
||||
/**
|
||||
* Describes a message declaration in a protobuf source file.
|
||||
*/
|
||||
export interface DescMessage {
|
||||
readonly kind: "message";
|
||||
/**
|
||||
* The fully qualified name of the message. (We omit the leading dot.)
|
||||
*/
|
||||
readonly typeName: string;
|
||||
/**
|
||||
* The name of the message, as specified in the protobuf source.
|
||||
*/
|
||||
readonly name: string;
|
||||
/**
|
||||
* The file this message was declared in.
|
||||
*/
|
||||
readonly file: DescFile;
|
||||
/**
|
||||
* The parent message, if this message was declared inside a message declaration.
|
||||
*/
|
||||
readonly parent: DescMessage | undefined;
|
||||
/**
|
||||
* Fields declared for this message, including fields declared in a oneof
|
||||
* group.
|
||||
*/
|
||||
readonly fields: DescField[];
|
||||
/**
|
||||
* All fields of this message by their "localName".
|
||||
*/
|
||||
readonly field: Record<string, DescField>;
|
||||
/**
|
||||
* Oneof groups declared for this message.
|
||||
* This does not include synthetic oneofs for proto3 optionals.
|
||||
*/
|
||||
readonly oneofs: DescOneof[];
|
||||
/**
|
||||
* Fields and oneof groups for this message, ordered by their appearance in the
|
||||
* protobuf source.
|
||||
*/
|
||||
readonly members: (DescField | DescOneof)[];
|
||||
/**
|
||||
* Enumerations declared within the message, if any.
|
||||
*/
|
||||
readonly nestedEnums: DescEnum[];
|
||||
/**
|
||||
* Messages declared within the message, if any.
|
||||
* This does not include synthetic messages like map entries.
|
||||
*/
|
||||
readonly nestedMessages: DescMessage[];
|
||||
/**
|
||||
* Extensions declared within the message, if any.
|
||||
*/
|
||||
readonly nestedExtensions: DescExtension[];
|
||||
/**
|
||||
* Marked as deprecated in the protobuf source.
|
||||
*/
|
||||
readonly deprecated: boolean;
|
||||
/**
|
||||
* The compiler-generated descriptor.
|
||||
*/
|
||||
readonly proto: DescriptorProto;
|
||||
toString(): string;
|
||||
}
|
||||
/**
|
||||
* Describes a field declaration in a protobuf source file.
|
||||
*/
|
||||
export type DescField = (descFieldScalar & descFieldCommon) | (descFieldList & descFieldCommon) | (descFieldMessage & descFieldCommon) | (descFieldEnum & descFieldCommon) | (descFieldMap & descFieldCommon);
|
||||
type descFieldCommon = descFieldAndExtensionShared & {
|
||||
readonly kind: "field";
|
||||
/**
|
||||
* The message this field is declared on.
|
||||
*/
|
||||
readonly parent: DescMessage;
|
||||
/**
|
||||
* A safe and idiomatic name for the field as a property in ECMAScript.
|
||||
*/
|
||||
readonly localName: string;
|
||||
};
|
||||
/**
|
||||
* Describes an extension in a protobuf source file.
|
||||
*/
|
||||
export type DescExtension = (Omit<descFieldScalar, "oneof"> & descExtensionCommon) | (Omit<descFieldEnum, "oneof"> & descExtensionCommon) | (Omit<descFieldMessage, "oneof"> & descExtensionCommon) | (descFieldList & descExtensionCommon);
|
||||
type descExtensionCommon = descFieldAndExtensionShared & {
|
||||
readonly kind: "extension";
|
||||
/**
|
||||
* The fully qualified name of the extension.
|
||||
*/
|
||||
readonly typeName: string;
|
||||
/**
|
||||
* The file this extension was declared in.
|
||||
*/
|
||||
readonly file: DescFile;
|
||||
/**
|
||||
* The parent message, if this extension was declared inside a message declaration.
|
||||
*/
|
||||
readonly parent: DescMessage | undefined;
|
||||
/**
|
||||
* The message that this extension extends.
|
||||
*/
|
||||
readonly extendee: DescMessage;
|
||||
/**
|
||||
* The `oneof` group this field belongs to, if any.
|
||||
*/
|
||||
readonly oneof: undefined;
|
||||
};
|
||||
interface descFieldAndExtensionShared {
|
||||
/**
|
||||
* The field name, as specified in the protobuf source
|
||||
*/
|
||||
readonly name: string;
|
||||
/**
|
||||
* The field number, as specified in the protobuf source.
|
||||
*/
|
||||
readonly number: number;
|
||||
/**
|
||||
* The field name in JSON.
|
||||
*/
|
||||
readonly jsonName: string;
|
||||
/**
|
||||
* Marked as deprecated in the protobuf source.
|
||||
*/
|
||||
readonly deprecated: boolean;
|
||||
/**
|
||||
* Presence of the field.
|
||||
* See https://protobuf.dev/programming-guides/field_presence/
|
||||
*/
|
||||
readonly presence: SupportedFieldPresence;
|
||||
/**
|
||||
* The compiler-generated descriptor.
|
||||
*/
|
||||
readonly proto: FieldDescriptorProto;
|
||||
/**
|
||||
* Get the edition features for this protobuf element.
|
||||
*/
|
||||
toString(): string;
|
||||
}
|
||||
type descFieldSingularCommon = {
|
||||
/**
|
||||
* The `oneof` group this field belongs to, if any.
|
||||
*
|
||||
* This does not include synthetic oneofs for proto3 optionals.
|
||||
*/
|
||||
readonly oneof: DescOneof | undefined;
|
||||
};
|
||||
type descFieldScalar<T extends ScalarType = ScalarType> = T extends T ? {
|
||||
readonly fieldKind: "scalar";
|
||||
/**
|
||||
* Scalar type, if it is a scalar field.
|
||||
*/
|
||||
readonly scalar: T;
|
||||
/**
|
||||
* By default, 64-bit integral types (int64, uint64, sint64, fixed64,
|
||||
* sfixed64) are represented with BigInt.
|
||||
*
|
||||
* If the field option `jstype = JS_STRING` is set, this property
|
||||
* is true, and 64-bit integral types are represented with String.
|
||||
*/
|
||||
readonly longAsString: boolean;
|
||||
/**
|
||||
* The message type, if it is a message field.
|
||||
*/
|
||||
readonly message: undefined;
|
||||
/**
|
||||
* The enum type, if it is an enum field.
|
||||
*/
|
||||
readonly enum: undefined;
|
||||
/**
|
||||
* Return the default value specified in the protobuf source.
|
||||
*/
|
||||
getDefaultValue(): ScalarValue<T> | undefined;
|
||||
} & descFieldSingularCommon : never;
|
||||
type descFieldMessage = {
|
||||
readonly fieldKind: "message";
|
||||
/**
|
||||
* Scalar type, if it is a scalar field.
|
||||
*/
|
||||
readonly scalar: undefined;
|
||||
/**
|
||||
* The message type, if it is a message field.
|
||||
*/
|
||||
readonly message: DescMessage;
|
||||
/**
|
||||
* Encode the message delimited (a.k.a. proto2 group encoding), or
|
||||
* length-prefixed?
|
||||
*/
|
||||
readonly delimitedEncoding: boolean;
|
||||
/**
|
||||
* The enum type, if it is an enum field.
|
||||
*/
|
||||
readonly enum: undefined;
|
||||
/**
|
||||
* Return the default value specified in the protobuf source.
|
||||
*/
|
||||
getDefaultValue(): undefined;
|
||||
} & descFieldSingularCommon;
|
||||
type descFieldEnum = {
|
||||
readonly fieldKind: "enum";
|
||||
/**
|
||||
* Scalar type, if it is a scalar field.
|
||||
*/
|
||||
readonly scalar: undefined;
|
||||
/**
|
||||
* The message type, if it is a message field.
|
||||
*/
|
||||
readonly message: undefined;
|
||||
/**
|
||||
* The enum type, if it is an enum field.
|
||||
*/
|
||||
readonly enum: DescEnum;
|
||||
/**
|
||||
* Return the default value specified in the protobuf source.
|
||||
*/
|
||||
getDefaultValue(): number | undefined;
|
||||
} & descFieldSingularCommon;
|
||||
type descFieldList = (descFieldListScalar & descFieldListCommon) | (descFieldListEnum & descFieldListCommon) | (descFieldListMessage & descFieldListCommon);
|
||||
type descFieldListCommon = {
|
||||
readonly fieldKind: "list";
|
||||
/**
|
||||
* Pack this repeated field? Only valid for repeated enum fields, and
|
||||
* for repeated scalar fields except BYTES and STRING.
|
||||
*/
|
||||
readonly packed: boolean;
|
||||
/**
|
||||
* The `oneof` group this field belongs to, if any.
|
||||
*/
|
||||
readonly oneof: undefined;
|
||||
};
|
||||
type descFieldListScalar<T extends ScalarType = ScalarType> = T extends T ? {
|
||||
readonly listKind: "scalar";
|
||||
/**
|
||||
* The enum list element type.
|
||||
*/
|
||||
readonly enum: undefined;
|
||||
/**
|
||||
* The message list element type.
|
||||
*/
|
||||
readonly message: undefined;
|
||||
/**
|
||||
* Scalar list element type.
|
||||
*/
|
||||
readonly scalar: T;
|
||||
/**
|
||||
* By default, 64-bit integral types (int64, uint64, sint64, fixed64,
|
||||
* sfixed64) are represented with BigInt.
|
||||
*
|
||||
* If the field option `jstype = JS_STRING` is set, this property
|
||||
* is true, and 64-bit integral types are represented with String.
|
||||
*/
|
||||
readonly longAsString: boolean;
|
||||
} : never;
|
||||
type descFieldListEnum = {
|
||||
readonly listKind: "enum";
|
||||
/**
|
||||
* The enum list element type.
|
||||
*/
|
||||
readonly enum: DescEnum;
|
||||
/**
|
||||
* The message list element type.
|
||||
*/
|
||||
readonly message: undefined;
|
||||
/**
|
||||
* Scalar list element type.
|
||||
*/
|
||||
readonly scalar: undefined;
|
||||
};
|
||||
type descFieldListMessage = {
|
||||
readonly listKind: "message";
|
||||
/**
|
||||
* The enum list element type.
|
||||
*/
|
||||
readonly enum: undefined;
|
||||
/**
|
||||
* The message list element type.
|
||||
*/
|
||||
readonly message: DescMessage;
|
||||
/**
|
||||
* Scalar list element type.
|
||||
*/
|
||||
readonly scalar: undefined;
|
||||
/**
|
||||
* Encode the message delimited (a.k.a. proto2 group encoding), or
|
||||
* length-prefixed?
|
||||
*/
|
||||
readonly delimitedEncoding: boolean;
|
||||
};
|
||||
type descFieldMap = (descFieldMapScalar & descFieldMapCommon) | (descFieldMapEnum & descFieldMapCommon) | (descFieldMapMessage & descFieldMapCommon);
|
||||
type descFieldMapCommon<T extends ScalarType = ScalarType> = T extends Exclude<ScalarType, ScalarType.FLOAT | ScalarType.DOUBLE | ScalarType.BYTES> ? {
|
||||
readonly fieldKind: "map";
|
||||
/**
|
||||
* The scalar map key type.
|
||||
*/
|
||||
readonly mapKey: T;
|
||||
/**
|
||||
* The `oneof` group this field belongs to, if any.
|
||||
*/
|
||||
readonly oneof: undefined;
|
||||
/**
|
||||
* Encode the map entry message delimited (a.k.a. proto2 group encoding),
|
||||
* or length-prefixed? As of Edition 2023, this is always false for map fields,
|
||||
* and also applies to map values, if they are messages.
|
||||
*/
|
||||
readonly delimitedEncoding: false;
|
||||
} : never;
|
||||
type descFieldMapScalar<T extends ScalarType = ScalarType> = T extends T ? {
|
||||
readonly mapKind: "scalar";
|
||||
/**
|
||||
* The enum map value type.
|
||||
*/
|
||||
readonly enum: undefined;
|
||||
/**
|
||||
* The message map value type.
|
||||
*/
|
||||
readonly message: undefined;
|
||||
/**
|
||||
* Scalar map value type.
|
||||
*/
|
||||
readonly scalar: T;
|
||||
} : never;
|
||||
type descFieldMapEnum = {
|
||||
readonly mapKind: "enum";
|
||||
/**
|
||||
* The enum map value type.
|
||||
*/
|
||||
readonly enum: DescEnum;
|
||||
/**
|
||||
* The message map value type.
|
||||
*/
|
||||
readonly message: undefined;
|
||||
/**
|
||||
* Scalar map value type.
|
||||
*/
|
||||
readonly scalar: undefined;
|
||||
};
|
||||
type descFieldMapMessage = {
|
||||
readonly mapKind: "message";
|
||||
/**
|
||||
* The enum map value type.
|
||||
*/
|
||||
readonly enum: undefined;
|
||||
/**
|
||||
* The message map value type.
|
||||
*/
|
||||
readonly message: DescMessage;
|
||||
/**
|
||||
* Scalar map value type.
|
||||
*/
|
||||
readonly scalar: undefined;
|
||||
};
|
||||
/**
|
||||
* Describes a oneof group in a protobuf source file.
|
||||
*/
|
||||
export interface DescOneof {
|
||||
readonly kind: "oneof";
|
||||
/**
|
||||
* The name of the oneof group, as specified in the protobuf source.
|
||||
*/
|
||||
readonly name: string;
|
||||
/**
|
||||
* A safe and idiomatic name for the oneof group as a property in ECMAScript.
|
||||
*/
|
||||
readonly localName: string;
|
||||
/**
|
||||
* The message this oneof group was declared in.
|
||||
*/
|
||||
readonly parent: DescMessage;
|
||||
/**
|
||||
* The fields declared in this oneof group.
|
||||
*/
|
||||
readonly fields: DescField[];
|
||||
/**
|
||||
* Marked as deprecated in the protobuf source.
|
||||
* Note that oneof groups cannot be marked as deprecated, this property
|
||||
* only exists for consistency and will always be false.
|
||||
*/
|
||||
readonly deprecated: boolean;
|
||||
/**
|
||||
* The compiler-generated descriptor.
|
||||
*/
|
||||
readonly proto: OneofDescriptorProto;
|
||||
toString(): string;
|
||||
}
|
||||
/**
|
||||
* Describes a service declaration in a protobuf source file.
|
||||
*/
|
||||
export interface DescService {
|
||||
readonly kind: "service";
|
||||
/**
|
||||
* The fully qualified name of the service. (We omit the leading dot.)
|
||||
*/
|
||||
readonly typeName: string;
|
||||
/**
|
||||
* The name of the service, as specified in the protobuf source.
|
||||
*/
|
||||
readonly name: string;
|
||||
/**
|
||||
* The file this service was declared in.
|
||||
*/
|
||||
readonly file: DescFile;
|
||||
/**
|
||||
* The RPCs this service declares.
|
||||
*/
|
||||
readonly methods: DescMethod[];
|
||||
/**
|
||||
* All methods of this service by their "localName".
|
||||
*/
|
||||
readonly method: Record<string, DescMethod>;
|
||||
/**
|
||||
* Marked as deprecated in the protobuf source.
|
||||
*/
|
||||
readonly deprecated: boolean;
|
||||
/**
|
||||
* The compiler-generated descriptor.
|
||||
*/
|
||||
readonly proto: ServiceDescriptorProto;
|
||||
toString(): string;
|
||||
}
|
||||
/**
|
||||
* Describes an RPC declaration in a protobuf source file.
|
||||
*/
|
||||
export interface DescMethod {
|
||||
readonly kind: "rpc";
|
||||
/**
|
||||
* The name of the RPC, as specified in the protobuf source.
|
||||
*/
|
||||
readonly name: string;
|
||||
/**
|
||||
* A safe and idiomatic name for the RPC as a method in ECMAScript.
|
||||
*/
|
||||
readonly localName: string;
|
||||
/**
|
||||
* The parent service.
|
||||
*/
|
||||
readonly parent: DescService;
|
||||
/**
|
||||
* One of the four available method types.
|
||||
*/
|
||||
readonly methodKind: "unary" | "server_streaming" | "client_streaming" | "bidi_streaming";
|
||||
/**
|
||||
* The message type for requests.
|
||||
*/
|
||||
readonly input: DescMessage;
|
||||
/**
|
||||
* The message type for responses.
|
||||
*/
|
||||
readonly output: DescMessage;
|
||||
/**
|
||||
* The idempotency level declared in the protobuf source, if any.
|
||||
*/
|
||||
readonly idempotency: MethodOptions_IdempotencyLevel;
|
||||
/**
|
||||
* Marked as deprecated in the protobuf source.
|
||||
*/
|
||||
readonly deprecated: boolean;
|
||||
/**
|
||||
* The compiler-generated descriptor.
|
||||
*/
|
||||
readonly proto: MethodDescriptorProto;
|
||||
toString(): string;
|
||||
}
|
||||
/**
|
||||
* Comments on an element in a protobuf source file.
|
||||
*/
|
||||
export interface DescComments {
|
||||
readonly leadingDetached: readonly string[];
|
||||
readonly leading?: string;
|
||||
readonly trailing?: string;
|
||||
readonly sourcePath: readonly number[];
|
||||
}
|
||||
export {};
|
||||
53
node_modules/@bufbuild/protobuf/dist/cjs/descriptors.js
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
"use strict";
|
||||
// Copyright 2021-2025 Buf Technologies, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ScalarType = void 0;
|
||||
/**
|
||||
* Scalar value types. This is a subset of field types declared by protobuf
|
||||
* enum google.protobuf.FieldDescriptorProto.Type The types GROUP and MESSAGE
|
||||
* are omitted, but the numerical values are identical.
|
||||
*/
|
||||
var ScalarType;
|
||||
(function (ScalarType) {
|
||||
// 0 is reserved for errors.
|
||||
// Order is weird for historical reasons.
|
||||
ScalarType[ScalarType["DOUBLE"] = 1] = "DOUBLE";
|
||||
ScalarType[ScalarType["FLOAT"] = 2] = "FLOAT";
|
||||
// Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if
|
||||
// negative values are likely.
|
||||
ScalarType[ScalarType["INT64"] = 3] = "INT64";
|
||||
ScalarType[ScalarType["UINT64"] = 4] = "UINT64";
|
||||
// Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if
|
||||
// negative values are likely.
|
||||
ScalarType[ScalarType["INT32"] = 5] = "INT32";
|
||||
ScalarType[ScalarType["FIXED64"] = 6] = "FIXED64";
|
||||
ScalarType[ScalarType["FIXED32"] = 7] = "FIXED32";
|
||||
ScalarType[ScalarType["BOOL"] = 8] = "BOOL";
|
||||
ScalarType[ScalarType["STRING"] = 9] = "STRING";
|
||||
// Tag-delimited aggregate.
|
||||
// Group type is deprecated and not supported in proto3. However, Proto3
|
||||
// implementations should still be able to parse the group wire format and
|
||||
// treat group fields as unknown fields.
|
||||
// TYPE_GROUP = 10,
|
||||
// TYPE_MESSAGE = 11, // Length-delimited aggregate.
|
||||
// New in version 2.
|
||||
ScalarType[ScalarType["BYTES"] = 12] = "BYTES";
|
||||
ScalarType[ScalarType["UINT32"] = 13] = "UINT32";
|
||||
// TYPE_ENUM = 14,
|
||||
ScalarType[ScalarType["SFIXED32"] = 15] = "SFIXED32";
|
||||
ScalarType[ScalarType["SFIXED64"] = 16] = "SFIXED64";
|
||||
ScalarType[ScalarType["SINT32"] = 17] = "SINT32";
|
||||
ScalarType[ScalarType["SINT64"] = 18] = "SINT64";
|
||||
})(ScalarType || (exports.ScalarType = ScalarType = {}));
|
||||
41
node_modules/@bufbuild/protobuf/dist/cjs/equals.d.ts
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
import type { MessageShape } from "./types.js";
|
||||
import { type DescMessage } from "./descriptors.js";
|
||||
import type { Registry } from "./registry.js";
|
||||
interface EqualsOptions {
|
||||
/**
|
||||
* A registry to look up extensions, and messages packed in Any.
|
||||
*
|
||||
* @private Experimental API, does not follow semantic versioning.
|
||||
*/
|
||||
registry: Registry;
|
||||
/**
|
||||
* Unpack google.protobuf.Any before comparing.
|
||||
* If a type is not in the registry, comparison falls back to comparing the
|
||||
* fields of Any.
|
||||
*
|
||||
* @private Experimental API, does not follow semantic versioning.
|
||||
*/
|
||||
unpackAny?: boolean;
|
||||
/**
|
||||
* Consider extensions when comparing.
|
||||
*
|
||||
* @private Experimental API, does not follow semantic versioning.
|
||||
*/
|
||||
extensions?: boolean;
|
||||
/**
|
||||
* Consider unknown fields when comparing.
|
||||
* The registry is used to distinguish between extensions, and unknown fields
|
||||
* caused by schema changes.
|
||||
*
|
||||
* @private Experimental API, does not follow semantic versioning.
|
||||
*/
|
||||
unknown?: boolean;
|
||||
}
|
||||
/**
|
||||
* Compare two messages of the same type.
|
||||
*
|
||||
* Note that this function disregards extensions and unknown fields, and that
|
||||
* NaN is not equal NaN, following the IEEE standard.
|
||||
*/
|
||||
export declare function equals<Desc extends DescMessage>(schema: Desc, a: MessageShape<Desc>, b: MessageShape<Desc>, options?: EqualsOptions): boolean;
|
||||
export {};
|
||||
204
node_modules/@bufbuild/protobuf/dist/cjs/equals.js
generated
vendored
Normal file
@@ -0,0 +1,204 @@
|
||||
"use strict";
|
||||
// Copyright 2021-2025 Buf Technologies, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.equals = equals;
|
||||
const scalar_js_1 = require("./reflect/scalar.js");
|
||||
const reflect_js_1 = require("./reflect/reflect.js");
|
||||
const descriptors_js_1 = require("./descriptors.js");
|
||||
const index_js_1 = require("./wkt/index.js");
|
||||
const extensions_js_1 = require("./extensions.js");
|
||||
/**
|
||||
* Compare two messages of the same type.
|
||||
*
|
||||
* Note that this function disregards extensions and unknown fields, and that
|
||||
* NaN is not equal NaN, following the IEEE standard.
|
||||
*/
|
||||
function equals(schema, a, b, options) {
|
||||
if (a.$typeName != schema.typeName || b.$typeName != schema.typeName) {
|
||||
return false;
|
||||
}
|
||||
if (a === b) {
|
||||
return true;
|
||||
}
|
||||
return reflectEquals((0, reflect_js_1.reflect)(schema, a), (0, reflect_js_1.reflect)(schema, b), options);
|
||||
}
|
||||
function reflectEquals(a, b, opts) {
|
||||
if (a.desc.typeName === "google.protobuf.Any" && (opts === null || opts === void 0 ? void 0 : opts.unpackAny) == true) {
|
||||
return anyUnpackedEquals(a.message, b.message, opts);
|
||||
}
|
||||
for (const f of a.fields) {
|
||||
if (!fieldEquals(f, a, b, opts)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if ((opts === null || opts === void 0 ? void 0 : opts.unknown) == true && !unknownEquals(a, b, opts.registry)) {
|
||||
return false;
|
||||
}
|
||||
if ((opts === null || opts === void 0 ? void 0 : opts.extensions) == true && !extensionsEquals(a, b, opts)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
// TODO(tstamm) add an option to consider NaN equal to NaN?
|
||||
function fieldEquals(f, a, b, opts) {
|
||||
if (!a.isSet(f) && !b.isSet(f)) {
|
||||
return true;
|
||||
}
|
||||
if (!a.isSet(f) || !b.isSet(f)) {
|
||||
return false;
|
||||
}
|
||||
switch (f.fieldKind) {
|
||||
case "scalar":
|
||||
return (0, scalar_js_1.scalarEquals)(f.scalar, a.get(f), b.get(f));
|
||||
case "enum":
|
||||
return a.get(f) === b.get(f);
|
||||
case "message":
|
||||
return reflectEquals(a.get(f), b.get(f), opts);
|
||||
case "map": {
|
||||
// TODO(tstamm) can't we compare sizes first?
|
||||
const mapA = a.get(f);
|
||||
const mapB = b.get(f);
|
||||
const keys = [];
|
||||
for (const k of mapA.keys()) {
|
||||
if (!mapB.has(k)) {
|
||||
return false;
|
||||
}
|
||||
keys.push(k);
|
||||
}
|
||||
for (const k of mapB.keys()) {
|
||||
if (!mapA.has(k)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (const key of keys) {
|
||||
const va = mapA.get(key);
|
||||
const vb = mapB.get(key);
|
||||
if (va === vb) {
|
||||
continue;
|
||||
}
|
||||
switch (f.mapKind) {
|
||||
case "enum":
|
||||
return false;
|
||||
case "message":
|
||||
if (!reflectEquals(va, vb, opts)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case "scalar":
|
||||
if (!(0, scalar_js_1.scalarEquals)(f.scalar, va, vb)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "list": {
|
||||
const listA = a.get(f);
|
||||
const listB = b.get(f);
|
||||
if (listA.size != listB.size) {
|
||||
return false;
|
||||
}
|
||||
for (let i = 0; i < listA.size; i++) {
|
||||
const va = listA.get(i);
|
||||
const vb = listB.get(i);
|
||||
if (va === vb) {
|
||||
continue;
|
||||
}
|
||||
switch (f.listKind) {
|
||||
case "enum":
|
||||
return false;
|
||||
case "message":
|
||||
if (!reflectEquals(va, vb, opts)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case "scalar":
|
||||
if (!(0, scalar_js_1.scalarEquals)(f.scalar, va, vb)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function anyUnpackedEquals(a, b, opts) {
|
||||
if (a.typeUrl !== b.typeUrl) {
|
||||
return false;
|
||||
}
|
||||
const unpackedA = (0, index_js_1.anyUnpack)(a, opts.registry);
|
||||
const unpackedB = (0, index_js_1.anyUnpack)(b, opts.registry);
|
||||
if (unpackedA && unpackedB) {
|
||||
const schema = opts.registry.getMessage(unpackedA.$typeName);
|
||||
if (schema) {
|
||||
return equals(schema, unpackedA, unpackedB, opts);
|
||||
}
|
||||
}
|
||||
return (0, scalar_js_1.scalarEquals)(descriptors_js_1.ScalarType.BYTES, a.value, b.value);
|
||||
}
|
||||
function unknownEquals(a, b, registry) {
|
||||
function getTrulyUnknown(msg, registry) {
|
||||
var _a;
|
||||
const u = (_a = msg.getUnknown()) !== null && _a !== void 0 ? _a : [];
|
||||
return registry
|
||||
? u.filter((uf) => !registry.getExtensionFor(msg.desc, uf.no))
|
||||
: u;
|
||||
}
|
||||
const unknownA = getTrulyUnknown(a, registry);
|
||||
const unknownB = getTrulyUnknown(b, registry);
|
||||
if (unknownA.length != unknownB.length) {
|
||||
return false;
|
||||
}
|
||||
for (let i = 0; i < unknownA.length; i++) {
|
||||
const a = unknownA[i];
|
||||
const b = unknownB[i];
|
||||
if (a.no != b.no) {
|
||||
return false;
|
||||
}
|
||||
if (a.wireType != b.wireType) {
|
||||
return false;
|
||||
}
|
||||
if (!(0, scalar_js_1.scalarEquals)(descriptors_js_1.ScalarType.BYTES, a.data, b.data)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function extensionsEquals(a, b, opts) {
|
||||
function getSetExtensions(msg, registry) {
|
||||
var _a;
|
||||
return ((_a = msg.getUnknown()) !== null && _a !== void 0 ? _a : [])
|
||||
.map((uf) => registry.getExtensionFor(msg.desc, uf.no))
|
||||
.filter((e) => e != undefined)
|
||||
.filter((e, index, arr) => arr.indexOf(e) === index);
|
||||
}
|
||||
const extensionsA = getSetExtensions(a, opts.registry);
|
||||
const extensionsB = getSetExtensions(b, opts.registry);
|
||||
if (extensionsA.length != extensionsB.length ||
|
||||
extensionsA.some((e) => !extensionsB.includes(e))) {
|
||||
return false;
|
||||
}
|
||||
for (const extension of extensionsA) {
|
||||
const [containerA, field] = (0, extensions_js_1.createExtensionContainer)(extension, (0, extensions_js_1.getExtension)(a.message, extension));
|
||||
const [containerB] = (0, extensions_js_1.createExtensionContainer)(extension, (0, extensions_js_1.getExtension)(b.message, extension));
|
||||
if (!fieldEquals(field, containerA, containerB, opts)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
59
node_modules/@bufbuild/protobuf/dist/cjs/extensions.d.ts
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
import type { AnyDesc, DescEnum, DescEnumValue, DescExtension, DescField, DescFile, DescMessage, DescMethod, DescOneof, DescService } from "./descriptors.js";
|
||||
import type { ReflectMessage } from "./reflect/reflect-types.js";
|
||||
import type { Extendee, ExtensionValueShape } from "./types.js";
|
||||
import type { EnumOptions, EnumValueOptions, FieldOptions, FileOptions, MessageOptions, MethodOptions, OneofOptions, ServiceOptions } from "./wkt/gen/google/protobuf/descriptor_pb.js";
|
||||
/**
|
||||
* Retrieve an extension value from a message.
|
||||
*
|
||||
* The function never returns undefined. Use hasExtension() to check whether an
|
||||
* extension is set. If the extension is not set, this function returns the
|
||||
* default value (if one was specified in the protobuf source), or the zero value
|
||||
* (for example `0` for numeric types, `[]` for repeated extension fields, and
|
||||
* an empty message instance for message fields).
|
||||
*
|
||||
* Extensions are stored as unknown fields on a message. To mutate an extension
|
||||
* value, make sure to store the new value with setExtension() after mutating.
|
||||
*
|
||||
* If the extension does not extend the given message, an error is raised.
|
||||
*/
|
||||
export declare function getExtension<Desc extends DescExtension>(message: Extendee<Desc>, extension: Desc): ExtensionValueShape<Desc>;
|
||||
/**
|
||||
* Set an extension value on a message. If the message already has a value for
|
||||
* this extension, the value is replaced.
|
||||
*
|
||||
* If the extension does not extend the given message, an error is raised.
|
||||
*/
|
||||
export declare function setExtension<Desc extends DescExtension>(message: Extendee<Desc>, extension: Desc, value: ExtensionValueShape<Desc>): void;
|
||||
/**
|
||||
* Remove an extension value from a message.
|
||||
*
|
||||
* If the extension does not extend the given message, an error is raised.
|
||||
*/
|
||||
export declare function clearExtension<Desc extends DescExtension>(message: Extendee<Desc>, extension: Desc): void;
|
||||
/**
|
||||
* Check whether an extension is set on a message.
|
||||
*/
|
||||
export declare function hasExtension<Desc extends DescExtension>(message: Extendee<Desc>, extension: Desc): boolean;
|
||||
/**
|
||||
* Check whether an option is set on a descriptor.
|
||||
*
|
||||
* Options are extensions to the `google.protobuf.*Options` messages defined in
|
||||
* google/protobuf/descriptor.proto. This function gets the option message from
|
||||
* the descriptor, and calls hasExtension().
|
||||
*/
|
||||
export declare function hasOption<Ext extends DescExtension, Desc extends DescForOptionExtension<Ext>>(element: Desc, option: Ext): boolean;
|
||||
/**
|
||||
* Retrieve an option value from a descriptor.
|
||||
*
|
||||
* Options are extensions to the `google.protobuf.*Options` messages defined in
|
||||
* google/protobuf/descriptor.proto. This function gets the option message from
|
||||
* the descriptor, and calls getExtension(). Same as getExtension(), this
|
||||
* function never returns undefined.
|
||||
*/
|
||||
export declare function getOption<Ext extends DescExtension, Desc extends DescForOptionExtension<Ext>>(element: Desc, option: Ext): ExtensionValueShape<Ext>;
|
||||
type DescForOptionExtension<Ext extends DescExtension> = Extendee<Ext> extends FileOptions ? DescFile : Extendee<Ext> extends EnumOptions ? DescEnum : Extendee<Ext> extends EnumValueOptions ? DescEnumValue : Extendee<Ext> extends MessageOptions ? DescMessage : Extendee<Ext> extends MessageOptions ? DescEnum : Extendee<Ext> extends FieldOptions ? DescField | DescExtension : Extendee<Ext> extends OneofOptions ? DescOneof : Extendee<Ext> extends ServiceOptions ? DescService : Extendee<Ext> extends EnumOptions ? DescEnum : Extendee<Ext> extends MethodOptions ? DescMethod : AnyDesc;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function createExtensionContainer<Desc extends DescExtension>(extension: Desc, value?: ExtensionValueShape<Desc>): [ReflectMessage, DescField, () => ExtensionValueShape<Desc>];
|
||||
export {};
|
||||
169
node_modules/@bufbuild/protobuf/dist/cjs/extensions.js
generated
vendored
Normal file
@@ -0,0 +1,169 @@
|
||||
"use strict";
|
||||
// Copyright 2021-2025 Buf Technologies, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getExtension = getExtension;
|
||||
exports.setExtension = setExtension;
|
||||
exports.clearExtension = clearExtension;
|
||||
exports.hasExtension = hasExtension;
|
||||
exports.hasOption = hasOption;
|
||||
exports.getOption = getOption;
|
||||
exports.createExtensionContainer = createExtensionContainer;
|
||||
const create_js_1 = require("./create.js");
|
||||
const from_binary_js_1 = require("./from-binary.js");
|
||||
const reflect_js_1 = require("./reflect/reflect.js");
|
||||
const scalar_js_1 = require("./reflect/scalar.js");
|
||||
const to_binary_js_1 = require("./to-binary.js");
|
||||
const binary_encoding_js_1 = require("./wire/binary-encoding.js");
|
||||
const wrappers_js_1 = require("./wkt/wrappers.js");
|
||||
/**
|
||||
* Retrieve an extension value from a message.
|
||||
*
|
||||
* The function never returns undefined. Use hasExtension() to check whether an
|
||||
* extension is set. If the extension is not set, this function returns the
|
||||
* default value (if one was specified in the protobuf source), or the zero value
|
||||
* (for example `0` for numeric types, `[]` for repeated extension fields, and
|
||||
* an empty message instance for message fields).
|
||||
*
|
||||
* Extensions are stored as unknown fields on a message. To mutate an extension
|
||||
* value, make sure to store the new value with setExtension() after mutating.
|
||||
*
|
||||
* If the extension does not extend the given message, an error is raised.
|
||||
*/
|
||||
function getExtension(message, extension) {
|
||||
assertExtendee(extension, message);
|
||||
const ufs = filterUnknownFields(message.$unknown, extension);
|
||||
const [container, field, get] = createExtensionContainer(extension);
|
||||
for (const uf of ufs) {
|
||||
(0, from_binary_js_1.readField)(container, new binary_encoding_js_1.BinaryReader(uf.data), field, uf.wireType, {
|
||||
readUnknownFields: true,
|
||||
});
|
||||
}
|
||||
return get();
|
||||
}
|
||||
/**
|
||||
* Set an extension value on a message. If the message already has a value for
|
||||
* this extension, the value is replaced.
|
||||
*
|
||||
* If the extension does not extend the given message, an error is raised.
|
||||
*/
|
||||
function setExtension(message, extension, value) {
|
||||
var _a;
|
||||
assertExtendee(extension, message);
|
||||
const ufs = ((_a = message.$unknown) !== null && _a !== void 0 ? _a : []).filter((uf) => uf.no !== extension.number);
|
||||
const [container, field] = createExtensionContainer(extension, value);
|
||||
const writer = new binary_encoding_js_1.BinaryWriter();
|
||||
(0, to_binary_js_1.writeField)(writer, { writeUnknownFields: true }, container, field);
|
||||
const reader = new binary_encoding_js_1.BinaryReader(writer.finish());
|
||||
while (reader.pos < reader.len) {
|
||||
const [no, wireType] = reader.tag();
|
||||
const data = reader.skip(wireType, no);
|
||||
ufs.push({ no, wireType, data });
|
||||
}
|
||||
message.$unknown = ufs;
|
||||
}
|
||||
/**
|
||||
* Remove an extension value from a message.
|
||||
*
|
||||
* If the extension does not extend the given message, an error is raised.
|
||||
*/
|
||||
function clearExtension(message, extension) {
|
||||
assertExtendee(extension, message);
|
||||
if (message.$unknown === undefined) {
|
||||
return;
|
||||
}
|
||||
message.$unknown = message.$unknown.filter((uf) => uf.no !== extension.number);
|
||||
}
|
||||
/**
|
||||
* Check whether an extension is set on a message.
|
||||
*/
|
||||
function hasExtension(message, extension) {
|
||||
var _a;
|
||||
return (extension.extendee.typeName === message.$typeName &&
|
||||
!!((_a = message.$unknown) === null || _a === void 0 ? void 0 : _a.find((uf) => uf.no === extension.number)));
|
||||
}
|
||||
/**
|
||||
* Check whether an option is set on a descriptor.
|
||||
*
|
||||
* Options are extensions to the `google.protobuf.*Options` messages defined in
|
||||
* google/protobuf/descriptor.proto. This function gets the option message from
|
||||
* the descriptor, and calls hasExtension().
|
||||
*/
|
||||
function hasOption(element, option) {
|
||||
const message = element.proto.options;
|
||||
if (!message) {
|
||||
return false;
|
||||
}
|
||||
return hasExtension(message, option);
|
||||
}
|
||||
/**
|
||||
* Retrieve an option value from a descriptor.
|
||||
*
|
||||
* Options are extensions to the `google.protobuf.*Options` messages defined in
|
||||
* google/protobuf/descriptor.proto. This function gets the option message from
|
||||
* the descriptor, and calls getExtension(). Same as getExtension(), this
|
||||
* function never returns undefined.
|
||||
*/
|
||||
function getOption(element, option) {
|
||||
const message = element.proto.options;
|
||||
if (!message) {
|
||||
const [, , get] = createExtensionContainer(option);
|
||||
return get();
|
||||
}
|
||||
return getExtension(message, option);
|
||||
}
|
||||
function filterUnknownFields(unknownFields, extension) {
|
||||
if (unknownFields === undefined)
|
||||
return [];
|
||||
if (extension.fieldKind === "enum" || extension.fieldKind === "scalar") {
|
||||
// singular scalar fields do not merge, we pick the last
|
||||
for (let i = unknownFields.length - 1; i >= 0; --i) {
|
||||
if (unknownFields[i].no == extension.number) {
|
||||
return [unknownFields[i]];
|
||||
}
|
||||
}
|
||||
return [];
|
||||
}
|
||||
return unknownFields.filter((uf) => uf.no === extension.number);
|
||||
}
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
function createExtensionContainer(extension, value) {
|
||||
const localName = extension.typeName;
|
||||
const field = Object.assign(Object.assign({}, extension), { kind: "field", parent: extension.extendee, localName });
|
||||
const desc = Object.assign(Object.assign({}, extension.extendee), { fields: [field], members: [field], oneofs: [] });
|
||||
const container = (0, create_js_1.create)(desc, value !== undefined ? { [localName]: value } : undefined);
|
||||
return [
|
||||
(0, reflect_js_1.reflect)(desc, container),
|
||||
field,
|
||||
() => {
|
||||
const value = container[localName];
|
||||
if (value === undefined) {
|
||||
// biome-ignore lint/style/noNonNullAssertion: Only message fields are undefined, rest will have a zero value.
|
||||
const desc = extension.message;
|
||||
if ((0, wrappers_js_1.isWrapperDesc)(desc)) {
|
||||
return (0, scalar_js_1.scalarZeroValue)(desc.fields[0].scalar, desc.fields[0].longAsString);
|
||||
}
|
||||
return (0, create_js_1.create)(desc);
|
||||
}
|
||||
return value;
|
||||
},
|
||||
];
|
||||
}
|
||||
function assertExtendee(extension, message) {
|
||||
if (extension.extendee.typeName != message.$typeName) {
|
||||
throw new Error(`extension ${extension.typeName} can only be applied to message ${extension.extendee.typeName}`);
|
||||
}
|
||||
}
|
||||
23
node_modules/@bufbuild/protobuf/dist/cjs/fields.d.ts
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
import type { MessageShape } from "./types.js";
|
||||
import type { DescField, DescMessage } from "./descriptors.js";
|
||||
/**
|
||||
* Returns true if the field is set.
|
||||
*
|
||||
* - Scalar and enum fields with implicit presence (proto3):
|
||||
* Set if not a zero value.
|
||||
*
|
||||
* - Scalar and enum fields with explicit presence (proto2, oneof):
|
||||
* Set if a value was set when creating or parsing the message, or when a
|
||||
* value was assigned to the field's property.
|
||||
*
|
||||
* - Message fields:
|
||||
* Set if the property is not undefined.
|
||||
*
|
||||
* - List and map fields:
|
||||
* Set if not empty.
|
||||
*/
|
||||
export declare function isFieldSet<Desc extends DescMessage>(message: MessageShape<Desc>, field: DescField): boolean;
|
||||
/**
|
||||
* Resets the field, so that isFieldSet() will return false.
|
||||
*/
|
||||
export declare function clearField<Desc extends DescMessage>(message: MessageShape<Desc>, field: DescField): void;
|
||||
45
node_modules/@bufbuild/protobuf/dist/cjs/fields.js
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
"use strict";
|
||||
// Copyright 2021-2025 Buf Technologies, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isFieldSet = isFieldSet;
|
||||
exports.clearField = clearField;
|
||||
const unsafe_js_1 = require("./reflect/unsafe.js");
|
||||
/**
|
||||
* Returns true if the field is set.
|
||||
*
|
||||
* - Scalar and enum fields with implicit presence (proto3):
|
||||
* Set if not a zero value.
|
||||
*
|
||||
* - Scalar and enum fields with explicit presence (proto2, oneof):
|
||||
* Set if a value was set when creating or parsing the message, or when a
|
||||
* value was assigned to the field's property.
|
||||
*
|
||||
* - Message fields:
|
||||
* Set if the property is not undefined.
|
||||
*
|
||||
* - List and map fields:
|
||||
* Set if not empty.
|
||||
*/
|
||||
function isFieldSet(message, field) {
|
||||
return (field.parent.typeName == message.$typeName && (0, unsafe_js_1.unsafeIsSet)(message, field));
|
||||
}
|
||||
/**
|
||||
* Resets the field, so that isFieldSet() will return false.
|
||||
*/
|
||||
function clearField(message, field) {
|
||||
if (field.parent.typeName == message.$typeName) {
|
||||
(0, unsafe_js_1.unsafeClear)(message, field);
|
||||
}
|
||||
}
|
||||
34
node_modules/@bufbuild/protobuf/dist/cjs/from-binary.d.ts
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
import { type DescField, type DescMessage } from "./descriptors.js";
|
||||
import type { MessageShape } from "./types.js";
|
||||
import type { ReflectMessage } from "./reflect/index.js";
|
||||
import { BinaryReader, WireType } from "./wire/binary-encoding.js";
|
||||
/**
|
||||
* Options for parsing binary data.
|
||||
*/
|
||||
export interface BinaryReadOptions {
|
||||
/**
|
||||
* Retain unknown fields during parsing? The default behavior is to retain
|
||||
* unknown fields and include them in the serialized output.
|
||||
*
|
||||
* For more details see https://developers.google.com/protocol-buffers/docs/proto3#unknowns
|
||||
*/
|
||||
readUnknownFields: boolean;
|
||||
}
|
||||
/**
|
||||
* Parse serialized binary data.
|
||||
*/
|
||||
export declare function fromBinary<Desc extends DescMessage>(schema: Desc, bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MessageShape<Desc>;
|
||||
/**
|
||||
* Parse from binary data, merging fields.
|
||||
*
|
||||
* Repeated fields are appended. Map entries are added, overwriting
|
||||
* existing keys.
|
||||
*
|
||||
* If a message field is already present, it will be merged with the
|
||||
* new data.
|
||||
*/
|
||||
export declare function mergeFromBinary<Desc extends DescMessage>(schema: Desc, target: MessageShape<Desc>, bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MessageShape<Desc>;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function readField(message: ReflectMessage, reader: BinaryReader, field: DescField, wireType: WireType, options: BinaryReadOptions): void;
|
||||