@songtonyli/dsh-cli 0.1.54 → 0.1.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/dsh.mjs +1 -1
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/symbols.js +17 -1
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/embed.js +1 -1
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/file.js +1 -1
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/symbols.js +60 -41
- package/node_modules/@bufbuild/protobuf/dist/commonjs/create.js +2 -1
- package/node_modules/@bufbuild/protobuf/dist/commonjs/from-binary.js +9 -6
- package/node_modules/@bufbuild/protobuf/dist/commonjs/from-json.js +30 -12
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/message.js +3 -2
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect-check.js +3 -4
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect.js +2 -2
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/unsafe.js +31 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/registry.js +53 -5
- package/node_modules/@bufbuild/protobuf/dist/commonjs/to-json.js +27 -5
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/binary-encoding.js +5 -3
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/any.js +1 -1
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/duration.js +1 -1
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/any_pb.js +2 -2
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/api_pb.js +2 -2
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/google/protobuf/c_sharp_features_pb.js +33 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/compiler/plugin_pb.js +3 -3
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/cpp_features_pb.js +34 -6
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/google/protobuf/cpp_file_options_pb.js +33 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/google/protobuf/cpp_options_pb.js +22 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/descriptor_pb.js +49 -6
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/duration_pb.js +2 -2
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/empty_pb.js +2 -2
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/field_mask_pb.js +2 -2
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/go_features_pb.js +4 -4
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/java_features_pb.js +4 -4
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/google/protobuf/json_enumvalue_options_pb.js +33 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/google/protobuf/json_options_pb.js +22 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/source_context_pb.js +2 -2
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/struct_pb.js +11 -6
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/timestamp_pb.js +2 -2
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/type_pb.js +3 -3
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/wrappers_pb.js +2 -2
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/index.js +15 -15
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/timestamp.js +1 -1
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/symbols.js +18 -2
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/embed.js +1 -1
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/file.js +1 -1
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/symbols.js +60 -41
- package/node_modules/@bufbuild/protobuf/dist/esm/create.js +2 -1
- package/node_modules/@bufbuild/protobuf/dist/esm/from-binary.js +10 -7
- package/node_modules/@bufbuild/protobuf/dist/esm/from-json.js +31 -13
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/message.js +3 -2
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-check.js +4 -5
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect.js +3 -3
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/unsafe.js +29 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/registry.js +53 -5
- package/node_modules/@bufbuild/protobuf/dist/esm/to-json.js +28 -6
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.js +5 -3
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/any.js +1 -1
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/duration.js +1 -1
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/any_pb.js +2 -2
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/api_pb.js +2 -2
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/google/protobuf/c_sharp_features_pb.js +30 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/compiler/plugin_pb.js +3 -3
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/cpp_features_pb.js +33 -5
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/google/protobuf/cpp_file_options_pb.js +30 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/google/protobuf/cpp_options_pb.js +19 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/descriptor_pb.js +47 -4
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/duration_pb.js +2 -2
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/empty_pb.js +2 -2
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/field_mask_pb.js +2 -2
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/go_features_pb.js +4 -4
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/java_features_pb.js +4 -4
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/google/protobuf/json_enumvalue_options_pb.js +30 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/google/protobuf/json_options_pb.js +19 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/source_context_pb.js +2 -2
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/struct_pb.js +11 -6
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/timestamp_pb.js +2 -2
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/type_pb.js +3 -3
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/wrappers_pb.js +2 -2
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/index.js +15 -15
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/timestamp.js +1 -1
- package/node_modules/@bufbuild/protobuf/package.json +236 -13
- package/node_modules/@deepseek-ai/dsh-agent-preset/skills/cordis-composition-reference/references/packages.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-locale/lib/client.js +7 -7
- package/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/lib/client.js +61 -61
- package/node_modules/@deepseek-ai/dsh-client-ui-approval/lib/client.js +10 -10
- package/node_modules/@deepseek-ai/dsh-client-ui-attachment/lib/client.js +49 -49
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/client.js +207 -207
- package/node_modules/@deepseek-ai/dsh-client-ui-commands/lib/client.js +16 -16
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/client.js +153 -153
- package/node_modules/@deepseek-ai/dsh-client-ui-cordis/lib/client.js +74 -74
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/lib/client.js +80 -80
- package/node_modules/@deepseek-ai/dsh-client-ui-directory-picker-browse/lib/client.js +39 -39
- package/node_modules/@deepseek-ai/dsh-client-ui-goal/lib/client.js +16 -16
- package/node_modules/@deepseek-ai/dsh-client-ui-input-trigger/lib/client.js +23 -23
- package/node_modules/@deepseek-ai/dsh-client-ui-jobs/lib/client.js +37 -37
- package/node_modules/@deepseek-ai/dsh-client-ui-layout/lib/client.js +9 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-message-feedback/lib/client.js +12 -12
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/client.js +31 -31
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/lib/client.js +8 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-permission-presets/lib/client.js +18 -18
- package/node_modules/@deepseek-ai/dsh-client-ui-plan/lib/client.js +22 -22
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/client.js +139 -139
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/OnboardingSurface.module.css +28 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/OnboardingSurface.d.ts +11 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/client.js +182 -182
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/client.js +128 -128
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/client.js +49 -49
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/lib/client.js +87 -87
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugin-inventory/lib/client.js +41 -41
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/client.js +13 -13
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-session-log/lib/client.js +5 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-signin/lib/client.js +24 -24
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-subagent/lib/client.js +27 -27
- package/node_modules/@deepseek-ai/dsh-client-ui-shortcuts/lib/client.js +42 -42
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +44 -44
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-browser/lib/client.js +25 -25
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/client.excel.js +9 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/client.js +70 -70
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/client.pdf.js +9 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/lib/client.js +18 -18
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/lib/client.js +26 -26
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-terminal/lib/client.js +16 -16
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-terminal/lib/client.terminal.js +11 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-skill/lib/client.js +19 -19
- package/node_modules/@deepseek-ai/dsh-client-ui-subagent/lib/client.js +37 -37
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/lib/client.js +27 -27
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/client.js +99 -99
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/lib/client.js +197 -197
- package/node_modules/@deepseek-ai/dsh-client-ui-user-questions/lib/client.js +73 -73
- package/node_modules/@deepseek-ai/dsh-client-ui-workflow-run/lib/client.js +26 -26
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/client.js +92 -92
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/cordis.patch.yml +3 -0
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/lib/index.js +11 -5
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/package.json +4 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-agent-team/lib/client.js +32 -32
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/lib/client.js +24 -24
- package/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/lib/types-DxezulnA.js +1324 -0
- package/node_modules/@deepseek-ai/dsh-schedule/lib/types/persistence.js +30 -0
- package/node_modules/@deepseek-ai/dsh-schedule/lib/types/projection.js +68 -0
- package/node_modules/@deepseek-ai/dsh-schedule/lib/types/transaction.js +22 -0
- package/node_modules/@deepseek-ai/dsh-session-log-export/lib/client.js +3 -3
- package/node_modules/@deepseek-ai/dsh-subprocess-local/lib/runner-launch-DGV26RBf.js +1525 -0
- package/node_modules/@deepseek-ai/dsh-tui-app/README.i18n.yaml +8 -8
- package/node_modules/@deepseek-ai/dsh-tui-app/README.md +15 -4
- package/node_modules/@deepseek-ai/dsh-tui-app/README.zh.md +15 -4
- package/node_modules/@deepseek-ai/dsh-tui-app/lib/index.js +691 -42
- package/package.json +2 -2
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2021-2026 Buf Technologies, Inc.
|
|
3
|
+
//
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.json = exports.JsonEnumValueOptionsSchema = exports.file_google_protobuf_json_enumvalue_options = void 0;
|
|
17
|
+
const file_js_1 = require("../../../codegenv2/file.js");
|
|
18
|
+
const descriptor_pb_js_1 = require("./descriptor_pb.js");
|
|
19
|
+
const message_js_1 = require("../../../codegenv2/message.js");
|
|
20
|
+
const extension_js_1 = require("../../../codegenv2/extension.js");
|
|
21
|
+
/**
|
|
22
|
+
* Describes the file google/protobuf/json_enumvalue_options.proto.
|
|
23
|
+
*/
|
|
24
|
+
exports.file_google_protobuf_json_enumvalue_options = (0, file_js_1.fileDesc)("Cixnb29nbGUvcHJvdG9idWYvanNvbl9lbnVtdmFsdWVfb3B0aW9ucy5wcm90bxIMcGIuZW51bXZhbHVlIigKFEpzb25FbnVtVmFsdWVPcHRpb25zEg4KBnN0cmluZxgBIAEoCVgBOmIKBGpzb24SIS5nb29nbGUucHJvdG9idWYuRW51bVZhbHVlT3B0aW9ucxjmByABKAsyIi5wYi5lbnVtdmFsdWUuSnNvbkVudW1WYWx1ZU9wdGlvbnNCBrIBAwjqB1IEanNvbkIaChhjb20uZ29vZ2xlLnByb3RvYnVmLnV0aWxiCGVkaXRpb25zcOkH", [descriptor_pb_js_1.file_google_protobuf_descriptor]);
|
|
25
|
+
/**
|
|
26
|
+
* Describes the message pb.enumvalue.JsonEnumValueOptions.
|
|
27
|
+
* Use `create(JsonEnumValueOptionsSchema)` to create a new message.
|
|
28
|
+
*/
|
|
29
|
+
exports.JsonEnumValueOptionsSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_json_enumvalue_options, 0);
|
|
30
|
+
/**
|
|
31
|
+
* @generated from extension: pb.enumvalue.JsonEnumValueOptions json = 998;
|
|
32
|
+
*/
|
|
33
|
+
exports.json = (0, extension_js_1.extDesc)(exports.file_google_protobuf_json_enumvalue_options, 0);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2021-2026 Buf Technologies, Inc.
|
|
3
|
+
//
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.file_google_protobuf_json_options = void 0;
|
|
17
|
+
const file_js_1 = require("../../../codegenv2/file.js");
|
|
18
|
+
const json_enumvalue_options_pb_js_1 = require("./json_enumvalue_options_pb.js");
|
|
19
|
+
/**
|
|
20
|
+
* Describes the file google/protobuf/json_options.proto.
|
|
21
|
+
*/
|
|
22
|
+
exports.file_google_protobuf_json_options = (0, file_js_1.fileDesc)("CiJnb29nbGUvcHJvdG9idWYvanNvbl9vcHRpb25zLnByb3RvEgJwYkIaChhjb20uZ29vZ2xlLnByb3RvYnVmLnV0aWxQAGIIZWRpdGlvbnNw6Qc", [json_enumvalue_options_pb_js_1.file_google_protobuf_json_enumvalue_options]);
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
// limitations under the License.
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.SourceContextSchema = exports.file_google_protobuf_source_context = void 0;
|
|
17
|
-
const file_js_1 = require("
|
|
18
|
-
const message_js_1 = require("
|
|
17
|
+
const file_js_1 = require("../../../codegenv2/file.js");
|
|
18
|
+
const message_js_1 = require("../../../codegenv2/message.js");
|
|
19
19
|
/**
|
|
20
20
|
* Describes the file google/protobuf/source_context.proto.
|
|
21
21
|
*/
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
// limitations under the License.
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.NullValueSchema = exports.NullValue = exports.ListValueSchema = exports.ValueSchema = exports.StructSchema = exports.file_google_protobuf_struct = void 0;
|
|
17
|
-
const file_js_1 = require("
|
|
18
|
-
const message_js_1 = require("
|
|
19
|
-
const enum_js_1 = require("
|
|
17
|
+
const file_js_1 = require("../../../codegenv2/file.js");
|
|
18
|
+
const message_js_1 = require("../../../codegenv2/message.js");
|
|
19
|
+
const enum_js_1 = require("../../../codegenv2/enum.js");
|
|
20
20
|
/**
|
|
21
21
|
* Describes the file google/protobuf/struct.proto.
|
|
22
22
|
*/
|
|
@@ -37,10 +37,15 @@ exports.ValueSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf
|
|
|
37
37
|
*/
|
|
38
38
|
exports.ListValueSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_struct, 2);
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
41
|
-
* `Value` type union.
|
|
40
|
+
* Represents a JSON `null`.
|
|
42
41
|
*
|
|
43
|
-
*
|
|
42
|
+
* `NullValue` is a sentinel, using an enum with only one value to represent
|
|
43
|
+
* the null value for the `Value` type union.
|
|
44
|
+
*
|
|
45
|
+
* A field of type `NullValue` with any value other than `0` is considered
|
|
46
|
+
* invalid. Most ProtoJSON serializers will emit a `Value` with a `null_value`
|
|
47
|
+
* set as a JSON `null` regardless of the integer value, and so will round trip
|
|
48
|
+
* to a `0` value.
|
|
44
49
|
*
|
|
45
50
|
* @generated from enum google.protobuf.NullValue
|
|
46
51
|
*/
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
// limitations under the License.
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.TimestampSchema = exports.file_google_protobuf_timestamp = void 0;
|
|
17
|
-
const file_js_1 = require("
|
|
18
|
-
const message_js_1 = require("
|
|
17
|
+
const file_js_1 = require("../../../codegenv2/file.js");
|
|
18
|
+
const message_js_1 = require("../../../codegenv2/message.js");
|
|
19
19
|
/**
|
|
20
20
|
* Describes the file google/protobuf/timestamp.proto.
|
|
21
21
|
*/
|
package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/type_pb.js
RENAMED
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
// limitations under the License.
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.SyntaxSchema = exports.Syntax = exports.OptionSchema = exports.EnumValueSchema = exports.EnumSchema = exports.Field_CardinalitySchema = exports.Field_Cardinality = exports.Field_KindSchema = exports.Field_Kind = exports.FieldSchema = exports.TypeSchema = exports.file_google_protobuf_type = void 0;
|
|
17
|
-
const file_js_1 = require("
|
|
17
|
+
const file_js_1 = require("../../../codegenv2/file.js");
|
|
18
18
|
const any_pb_js_1 = require("./any_pb.js");
|
|
19
19
|
const source_context_pb_js_1 = require("./source_context_pb.js");
|
|
20
|
-
const message_js_1 = require("
|
|
21
|
-
const enum_js_1 = require("
|
|
20
|
+
const message_js_1 = require("../../../codegenv2/message.js");
|
|
21
|
+
const enum_js_1 = require("../../../codegenv2/enum.js");
|
|
22
22
|
/**
|
|
23
23
|
* Describes the file google/protobuf/type.proto.
|
|
24
24
|
*/
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
// limitations under the License.
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.BytesValueSchema = exports.StringValueSchema = exports.BoolValueSchema = exports.UInt32ValueSchema = exports.Int32ValueSchema = exports.UInt64ValueSchema = exports.Int64ValueSchema = exports.FloatValueSchema = exports.DoubleValueSchema = exports.file_google_protobuf_wrappers = void 0;
|
|
17
|
-
const file_js_1 = require("
|
|
18
|
-
const message_js_1 = require("
|
|
17
|
+
const file_js_1 = require("../../../codegenv2/file.js");
|
|
18
|
+
const message_js_1 = require("../../../codegenv2/message.js");
|
|
19
19
|
/**
|
|
20
20
|
* Describes the file google/protobuf/wrappers.proto.
|
|
21
21
|
*/
|
|
@@ -31,18 +31,18 @@ __exportStar(require("./timestamp.js"), exports);
|
|
|
31
31
|
__exportStar(require("./duration.js"), exports);
|
|
32
32
|
__exportStar(require("./any.js"), exports);
|
|
33
33
|
__exportStar(require("./wrappers.js"), exports);
|
|
34
|
-
__exportStar(require("./
|
|
35
|
-
__exportStar(require("./
|
|
36
|
-
__exportStar(require("./
|
|
37
|
-
__exportStar(require("./
|
|
38
|
-
__exportStar(require("./
|
|
39
|
-
__exportStar(require("./
|
|
40
|
-
__exportStar(require("./
|
|
41
|
-
__exportStar(require("./
|
|
42
|
-
__exportStar(require("./
|
|
43
|
-
__exportStar(require("./
|
|
44
|
-
__exportStar(require("./
|
|
45
|
-
__exportStar(require("./
|
|
46
|
-
__exportStar(require("./
|
|
47
|
-
__exportStar(require("./
|
|
48
|
-
__exportStar(require("./
|
|
34
|
+
__exportStar(require("./google/protobuf/any_pb.js"), exports);
|
|
35
|
+
__exportStar(require("./google/protobuf/api_pb.js"), exports);
|
|
36
|
+
__exportStar(require("./google/protobuf/cpp_features_pb.js"), exports);
|
|
37
|
+
__exportStar(require("./google/protobuf/descriptor_pb.js"), exports);
|
|
38
|
+
__exportStar(require("./google/protobuf/duration_pb.js"), exports);
|
|
39
|
+
__exportStar(require("./google/protobuf/empty_pb.js"), exports);
|
|
40
|
+
__exportStar(require("./google/protobuf/field_mask_pb.js"), exports);
|
|
41
|
+
__exportStar(require("./google/protobuf/go_features_pb.js"), exports);
|
|
42
|
+
__exportStar(require("./google/protobuf/java_features_pb.js"), exports);
|
|
43
|
+
__exportStar(require("./google/protobuf/source_context_pb.js"), exports);
|
|
44
|
+
__exportStar(require("./google/protobuf/struct_pb.js"), exports);
|
|
45
|
+
__exportStar(require("./google/protobuf/timestamp_pb.js"), exports);
|
|
46
|
+
__exportStar(require("./google/protobuf/type_pb.js"), exports);
|
|
47
|
+
__exportStar(require("./google/protobuf/wrappers_pb.js"), exports);
|
|
48
|
+
__exportStar(require("./google/protobuf/compiler/plugin_pb.js"), exports);
|
|
@@ -18,7 +18,7 @@ exports.timestampFromDate = timestampFromDate;
|
|
|
18
18
|
exports.timestampDate = timestampDate;
|
|
19
19
|
exports.timestampFromMs = timestampFromMs;
|
|
20
20
|
exports.timestampMs = timestampMs;
|
|
21
|
-
const timestamp_pb_js_1 = require("./
|
|
21
|
+
const timestamp_pb_js_1 = require("./google/protobuf/timestamp_pb.js");
|
|
22
22
|
const create_js_1 = require("../create.js");
|
|
23
23
|
const proto_int64_js_1 = require("../proto-int64.js");
|
|
24
24
|
/**
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
|
-
import { symbols as symbolsV2, packageName as packageNameV1,
|
|
14
|
+
import { symbols as symbolsV2, packageName as packageNameV1, } from "../codegenv2/symbols.js";
|
|
15
15
|
/**
|
|
16
16
|
* @private
|
|
17
17
|
*/
|
|
@@ -19,7 +19,23 @@ export const packageName = packageNameV1;
|
|
|
19
19
|
/**
|
|
20
20
|
* @private
|
|
21
21
|
*/
|
|
22
|
-
export const wktPublicImportPaths =
|
|
22
|
+
export const wktPublicImportPaths = {
|
|
23
|
+
"google/protobuf/compiler/plugin.proto": packageName + "/wkt",
|
|
24
|
+
"google/protobuf/any.proto": packageName + "/wkt",
|
|
25
|
+
"google/protobuf/api.proto": packageName + "/wkt",
|
|
26
|
+
"google/protobuf/cpp_features.proto": packageName + "/wkt",
|
|
27
|
+
"google/protobuf/descriptor.proto": packageName + "/wkt",
|
|
28
|
+
"google/protobuf/duration.proto": packageName + "/wkt",
|
|
29
|
+
"google/protobuf/empty.proto": packageName + "/wkt",
|
|
30
|
+
"google/protobuf/field_mask.proto": packageName + "/wkt",
|
|
31
|
+
"google/protobuf/go_features.proto": packageName + "/wkt",
|
|
32
|
+
"google/protobuf/java_features.proto": packageName + "/wkt",
|
|
33
|
+
"google/protobuf/source_context.proto": packageName + "/wkt",
|
|
34
|
+
"google/protobuf/struct.proto": packageName + "/wkt",
|
|
35
|
+
"google/protobuf/timestamp.proto": packageName + "/wkt",
|
|
36
|
+
"google/protobuf/type.proto": packageName + "/wkt",
|
|
37
|
+
"google/protobuf/wrappers.proto": packageName + "/wkt",
|
|
38
|
+
};
|
|
23
39
|
/**
|
|
24
40
|
* @private
|
|
25
41
|
*/
|
|
@@ -16,7 +16,7 @@ import { isFieldSet, clearField } from "../fields.js";
|
|
|
16
16
|
import { base64Encode } from "../wire/base64-encoding.js";
|
|
17
17
|
import { toBinary } from "../to-binary.js";
|
|
18
18
|
import { clone } from "../clone.js";
|
|
19
|
-
import { Edition, FieldDescriptorProtoSchema, FieldOptionsSchema, FileDescriptorProtoSchema, DescriptorProtoSchema, EnumDescriptorProtoSchema, } from "../wkt/
|
|
19
|
+
import { Edition, FieldDescriptorProtoSchema, FieldOptionsSchema, FileDescriptorProtoSchema, DescriptorProtoSchema, EnumDescriptorProtoSchema, } from "../wkt/google/protobuf/descriptor_pb.js";
|
|
20
20
|
/**
|
|
21
21
|
* Create necessary information to embed a file descriptor in
|
|
22
22
|
* generated code.
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
import { base64Decode } from "../wire/base64-encoding.js";
|
|
15
|
-
import { FileDescriptorProtoSchema } from "../wkt/
|
|
15
|
+
import { FileDescriptorProtoSchema } from "../wkt/google/protobuf/descriptor_pb.js";
|
|
16
16
|
import { createFileRegistry } from "../registry.js";
|
|
17
17
|
import { restoreJsonNames } from "./restore-json-names.js";
|
|
18
18
|
import { fromBinary } from "../from-binary.js";
|
|
@@ -15,57 +15,76 @@
|
|
|
15
15
|
* @private
|
|
16
16
|
*/
|
|
17
17
|
export const packageName = "@bufbuild/protobuf";
|
|
18
|
+
const legacyWktBarrel = packageName + "/wkt";
|
|
18
19
|
/**
|
|
19
20
|
* @private
|
|
21
|
+
*
|
|
22
|
+
* A map from Protobuf file path to import path for the well-known types.
|
|
23
|
+
*
|
|
24
|
+
* All well-known files are exported as subpaths from @bufbuild/protobuf/wkt,
|
|
25
|
+
* but have been historically exported from a barrel. For backwards-compatibility,
|
|
26
|
+
* the existing barrel exports are maintained.
|
|
27
|
+
*
|
|
28
|
+
* For convenience, generated code continues to import from the barrel for
|
|
29
|
+
* commonly used WKT, and only generates the full subpath import for files
|
|
30
|
+
* that are rarely used.
|
|
31
|
+
*
|
|
32
|
+
* All well-known files must be listed here. New files should import from the
|
|
33
|
+
* full subpath.
|
|
20
34
|
*/
|
|
21
35
|
export const wktPublicImportPaths = {
|
|
22
|
-
"google/protobuf/compiler/plugin.proto":
|
|
23
|
-
"google/protobuf/any.proto":
|
|
24
|
-
"google/protobuf/api.proto": packageName + "/wkt",
|
|
25
|
-
"google/protobuf/
|
|
26
|
-
"google/protobuf/
|
|
27
|
-
"google/protobuf/
|
|
28
|
-
"google/protobuf/
|
|
29
|
-
"google/protobuf/
|
|
30
|
-
"google/protobuf/
|
|
31
|
-
"google/protobuf/
|
|
32
|
-
"google/protobuf/
|
|
33
|
-
"google/protobuf/
|
|
34
|
-
"google/protobuf/
|
|
35
|
-
"google/protobuf/
|
|
36
|
-
"google/protobuf/
|
|
36
|
+
"google/protobuf/compiler/plugin.proto": legacyWktBarrel,
|
|
37
|
+
"google/protobuf/any.proto": legacyWktBarrel,
|
|
38
|
+
"google/protobuf/api.proto": packageName + "/wkt/google/protobuf/api_pb.js",
|
|
39
|
+
"google/protobuf/c_sharp_features.proto": packageName + "/wkt/google/protobuf/c_sharp_features_pb.js",
|
|
40
|
+
"google/protobuf/cpp_features.proto": packageName + "/wkt/google/protobuf/cpp_features_pb.js",
|
|
41
|
+
"google/protobuf/cpp_file_options.proto": packageName + "/wkt/google/protobuf/cpp_file_options_pb.js",
|
|
42
|
+
"google/protobuf/cpp_options.proto": packageName + "/wkt/google/protobuf/cpp_options_pb.js",
|
|
43
|
+
"google/protobuf/descriptor.proto": legacyWktBarrel,
|
|
44
|
+
"google/protobuf/duration.proto": legacyWktBarrel,
|
|
45
|
+
"google/protobuf/empty.proto": legacyWktBarrel,
|
|
46
|
+
"google/protobuf/field_mask.proto": legacyWktBarrel,
|
|
47
|
+
"google/protobuf/go_features.proto": packageName + "/wkt/google/protobuf/go_features_pb.js",
|
|
48
|
+
"google/protobuf/java_features.proto": packageName + "/wkt/google/protobuf/java_features_pb.js",
|
|
49
|
+
"google/protobuf/json_enumvalue_options.proto": packageName + "/wkt/google/protobuf/json_enumvalue_options_pb.js",
|
|
50
|
+
"google/protobuf/json_options.proto": packageName + "/wkt/google/protobuf/json_options_pb.js",
|
|
51
|
+
"google/protobuf/source_context.proto": packageName + "/wkt/google/protobuf/source_context_pb.js",
|
|
52
|
+
"google/protobuf/struct.proto": legacyWktBarrel,
|
|
53
|
+
"google/protobuf/timestamp.proto": legacyWktBarrel,
|
|
54
|
+
"google/protobuf/type.proto": packageName + "/wkt/google/protobuf/type_pb.js",
|
|
55
|
+
"google/protobuf/wrappers.proto": legacyWktBarrel,
|
|
37
56
|
};
|
|
38
57
|
/**
|
|
39
58
|
* @private
|
|
40
59
|
*/
|
|
41
60
|
// biome-ignore format: want this to read well
|
|
42
61
|
export const symbols = {
|
|
43
|
-
isMessage: { typeOnly: false, bootstrapWktFrom: "
|
|
44
|
-
Message: { typeOnly: true, bootstrapWktFrom: "
|
|
45
|
-
create: { typeOnly: false, bootstrapWktFrom: "
|
|
46
|
-
fromJson: { typeOnly: false, bootstrapWktFrom: "
|
|
47
|
-
fromJsonString: { typeOnly: false, bootstrapWktFrom: "
|
|
48
|
-
fromBinary: { typeOnly: false, bootstrapWktFrom: "
|
|
49
|
-
toBinary: { typeOnly: false, bootstrapWktFrom: "
|
|
50
|
-
toJson: { typeOnly: false, bootstrapWktFrom: "
|
|
51
|
-
toJsonString: { typeOnly: false, bootstrapWktFrom: "
|
|
52
|
-
protoInt64: { typeOnly: false, bootstrapWktFrom: "
|
|
53
|
-
JsonValue: { typeOnly: true, bootstrapWktFrom: "
|
|
54
|
-
JsonObject: { typeOnly: true, bootstrapWktFrom: "
|
|
55
|
-
UnknownEnum: { typeOnly: true, bootstrapWktFrom: "
|
|
62
|
+
isMessage: { typeOnly: false, bootstrapWktFrom: "../is-message.js", from: packageName },
|
|
63
|
+
Message: { typeOnly: true, bootstrapWktFrom: "../types.js", from: packageName },
|
|
64
|
+
create: { typeOnly: false, bootstrapWktFrom: "../create.js", from: packageName },
|
|
65
|
+
fromJson: { typeOnly: false, bootstrapWktFrom: "../from-json.js", from: packageName },
|
|
66
|
+
fromJsonString: { typeOnly: false, bootstrapWktFrom: "../from-json.js", from: packageName },
|
|
67
|
+
fromBinary: { typeOnly: false, bootstrapWktFrom: "../from-binary.js", from: packageName },
|
|
68
|
+
toBinary: { typeOnly: false, bootstrapWktFrom: "../to-binary.js", from: packageName },
|
|
69
|
+
toJson: { typeOnly: false, bootstrapWktFrom: "../to-json.js", from: packageName },
|
|
70
|
+
toJsonString: { typeOnly: false, bootstrapWktFrom: "../to-json.js", from: packageName },
|
|
71
|
+
protoInt64: { typeOnly: false, bootstrapWktFrom: "../proto-int64.js", from: packageName },
|
|
72
|
+
JsonValue: { typeOnly: true, bootstrapWktFrom: "../json-value.js", from: packageName },
|
|
73
|
+
JsonObject: { typeOnly: true, bootstrapWktFrom: "../json-value.js", from: packageName },
|
|
74
|
+
UnknownEnum: { typeOnly: true, bootstrapWktFrom: "../types.js", from: packageName },
|
|
56
75
|
codegen: {
|
|
57
|
-
boot: { typeOnly: false, bootstrapWktFrom: "
|
|
58
|
-
fileDesc: { typeOnly: false, bootstrapWktFrom: "
|
|
59
|
-
enumDesc: { typeOnly: false, bootstrapWktFrom: "
|
|
60
|
-
extDesc: { typeOnly: false, bootstrapWktFrom: "
|
|
61
|
-
messageDesc: { typeOnly: false, bootstrapWktFrom: "
|
|
62
|
-
serviceDesc: { typeOnly: false, bootstrapWktFrom: "
|
|
63
|
-
tsEnum: { typeOnly: false, bootstrapWktFrom: "
|
|
64
|
-
objEnum: { typeOnly: false, bootstrapWktFrom: "
|
|
65
|
-
GenFile: { typeOnly: true, bootstrapWktFrom: "
|
|
66
|
-
GenEnum: { typeOnly: true, bootstrapWktFrom: "
|
|
67
|
-
GenExtension: { typeOnly: true, bootstrapWktFrom: "
|
|
68
|
-
GenMessage: { typeOnly: true, bootstrapWktFrom: "
|
|
69
|
-
GenService: { typeOnly: true, bootstrapWktFrom: "
|
|
76
|
+
boot: { typeOnly: false, bootstrapWktFrom: "../codegenv2/boot.js", from: packageName + "/codegenv2" },
|
|
77
|
+
fileDesc: { typeOnly: false, bootstrapWktFrom: "../codegenv2/file.js", from: packageName + "/codegenv2" },
|
|
78
|
+
enumDesc: { typeOnly: false, bootstrapWktFrom: "../codegenv2/enum.js", from: packageName + "/codegenv2" },
|
|
79
|
+
extDesc: { typeOnly: false, bootstrapWktFrom: "../codegenv2/extension.js", from: packageName + "/codegenv2" },
|
|
80
|
+
messageDesc: { typeOnly: false, bootstrapWktFrom: "../codegenv2/message.js", from: packageName + "/codegenv2" },
|
|
81
|
+
serviceDesc: { typeOnly: false, bootstrapWktFrom: "../codegenv2/service.js", from: packageName + "/codegenv2" },
|
|
82
|
+
tsEnum: { typeOnly: false, bootstrapWktFrom: "../codegenv2/enum.js", from: packageName + "/codegenv2" },
|
|
83
|
+
objEnum: { typeOnly: false, bootstrapWktFrom: "../codegenv2/enum.js", from: packageName + "/codegenv2" },
|
|
84
|
+
GenFile: { typeOnly: true, bootstrapWktFrom: "../codegenv2/types.js", from: packageName + "/codegenv2" },
|
|
85
|
+
GenEnum: { typeOnly: true, bootstrapWktFrom: "../codegenv2/types.js", from: packageName + "/codegenv2" },
|
|
86
|
+
GenExtension: { typeOnly: true, bootstrapWktFrom: "../codegenv2/types.js", from: packageName + "/codegenv2" },
|
|
87
|
+
GenMessage: { typeOnly: true, bootstrapWktFrom: "../codegenv2/types.js", from: packageName + "/codegenv2" },
|
|
88
|
+
GenService: { typeOnly: true, bootstrapWktFrom: "../codegenv2/types.js", from: packageName + "/codegenv2" },
|
|
70
89
|
},
|
|
71
90
|
};
|
|
@@ -15,6 +15,7 @@ import { isMessage } from "./is-message.js";
|
|
|
15
15
|
import { ScalarType, } from "./descriptors.js";
|
|
16
16
|
import { scalarZeroValue } from "./reflect/scalar.js";
|
|
17
17
|
import { isObject } from "./reflect/guard.js";
|
|
18
|
+
import { setOwn } from "./reflect/unsafe.js";
|
|
18
19
|
import { isWrapperDesc } from "./wkt/wrappers.js";
|
|
19
20
|
// bootstrap-inject google.protobuf.Edition.EDITION_PROTO3: const $name = $number;
|
|
20
21
|
const EDITION_PROTO3 = 999;
|
|
@@ -99,7 +100,7 @@ function compileCreate(desc) {
|
|
|
99
100
|
const converted = {};
|
|
100
101
|
const keys = Object.keys(initValue);
|
|
101
102
|
for (let k = 0; k < keys.length; k++) {
|
|
102
|
-
converted
|
|
103
|
+
setOwn(converted, keys[k], property.convert(initValue[keys[k]]));
|
|
103
104
|
}
|
|
104
105
|
message[name] = converted;
|
|
105
106
|
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
import { ScalarType } from "./descriptors.js";
|
|
15
15
|
import { scalarZeroValue } from "./reflect/scalar.js";
|
|
16
16
|
import { FieldError } from "./reflect/error.js";
|
|
17
|
-
import { unsafeLocal } from "./reflect/unsafe.js";
|
|
17
|
+
import { setOwn, unsafeLocal } from "./reflect/unsafe.js";
|
|
18
18
|
import { localMessageMapper } from "./reflect/message.js";
|
|
19
19
|
import { create } from "./create.js";
|
|
20
20
|
import { BinaryReader, WireType } from "./wire/binary-encoding.js";
|
|
@@ -312,8 +312,10 @@ function compileMapFieldReader(field) {
|
|
|
312
312
|
case "message": {
|
|
313
313
|
const { toMessage, toLocal } = localMessageMapper(field);
|
|
314
314
|
const readChild = compiledReader(field.message).read;
|
|
315
|
-
|
|
316
|
-
|
|
315
|
+
// A repeated value field within one entry merges into the previous
|
|
316
|
+
// value, like any other singular message field.
|
|
317
|
+
readValue = (reader, ctx, existing) => {
|
|
318
|
+
const child = toMessage(existing);
|
|
317
319
|
readChild(child, reader, ctx, reader.uint32());
|
|
318
320
|
return toLocal(child);
|
|
319
321
|
};
|
|
@@ -338,7 +340,7 @@ function compileMapFieldReader(field) {
|
|
|
338
340
|
key = readKey(reader);
|
|
339
341
|
break;
|
|
340
342
|
case 2:
|
|
341
|
-
val = readValue(reader, ctx);
|
|
343
|
+
val = readValue(reader, ctx, val);
|
|
342
344
|
break;
|
|
343
345
|
}
|
|
344
346
|
}
|
|
@@ -348,9 +350,10 @@ function compileMapFieldReader(field) {
|
|
|
348
350
|
if (val === undefined) {
|
|
349
351
|
val = valueDefault();
|
|
350
352
|
}
|
|
351
|
-
//
|
|
352
|
-
//
|
|
353
|
-
|
|
353
|
+
// Map keys may be booleans, numbers, or bigints. Object keys are strings, so
|
|
354
|
+
// they are converted implicitly. setOwn() is needed because a key can be
|
|
355
|
+
// "__proto__".
|
|
356
|
+
setOwn(record, key, val);
|
|
354
357
|
};
|
|
355
358
|
}
|
|
356
359
|
/**
|
|
@@ -18,7 +18,7 @@ import { FieldError, isFieldError } from "./reflect/error.js";
|
|
|
18
18
|
import { formatVal, reasonSingular, checkScalarValue, } from "./reflect/reflect-check.js";
|
|
19
19
|
import { protoSnakeCase } from "./reflect/names.js";
|
|
20
20
|
import { scalarZeroValue } from "./reflect/scalar.js";
|
|
21
|
-
import { unsafeLocal } from "./reflect/unsafe.js";
|
|
21
|
+
import { setOwn, unsafeLocal } from "./reflect/unsafe.js";
|
|
22
22
|
import { localMessageMapper } from "./reflect/message.js";
|
|
23
23
|
import { base64Decode } from "./wire/base64-encoding.js";
|
|
24
24
|
import { hasCustomJsonRepresentation, isWrapperDesc, anyPack, ListValueSchema, NullValue, StructSchema, ValueSchema, } from "./wkt/index.js";
|
|
@@ -111,9 +111,14 @@ export function enumFromJson(descEnum, json) {
|
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
113
113
|
* Is the given value a JSON enum value?
|
|
114
|
+
*
|
|
115
|
+
* For an enum value with a custom JSON name set with the option
|
|
116
|
+
* `(pb.enumvalue.json).string`, this function only returns true for the
|
|
117
|
+
* custom name, while fromJson() and enumFromJson() also accept the Protobuf
|
|
118
|
+
* name.
|
|
114
119
|
*/
|
|
115
120
|
export function isEnumJson(descEnum, value) {
|
|
116
|
-
return
|
|
121
|
+
return descEnum.values.some((v) => v.jsonName === value);
|
|
117
122
|
}
|
|
118
123
|
const compiledReaders = new WeakMap();
|
|
119
124
|
/**
|
|
@@ -543,9 +548,10 @@ function compileMapFieldReader(field) {
|
|
|
543
548
|
throw new FieldError(field, `map entry ${formatVal(key)}: ${reasonSingular(field, value, check)}`);
|
|
544
549
|
}
|
|
545
550
|
}
|
|
546
|
-
//
|
|
547
|
-
//
|
|
548
|
-
|
|
551
|
+
// Map keys may be booleans, numbers, or bigints. Object keys are strings, so
|
|
552
|
+
// they are converted implicitly. setOwn() is needed because a key can be
|
|
553
|
+
// "__proto__".
|
|
554
|
+
setOwn(record, key, toLocalValue(value));
|
|
549
555
|
}
|
|
550
556
|
};
|
|
551
557
|
}
|
|
@@ -558,7 +564,16 @@ const tokenIgnoredUnknownEnum = Symbol();
|
|
|
558
564
|
*/
|
|
559
565
|
function compileEnumConverter(desc) {
|
|
560
566
|
const zero = desc.values[0].number;
|
|
561
|
-
|
|
567
|
+
// Protobuf compilers reject a custom JSON name that equals the Protobuf name
|
|
568
|
+
// of another value. As a fallback, the Protobuf name takes precedence, so we
|
|
569
|
+
// add Protobuf names last.
|
|
570
|
+
const numbers = new Map();
|
|
571
|
+
for (const value of desc.values) {
|
|
572
|
+
numbers.set(value.jsonName, value.number);
|
|
573
|
+
}
|
|
574
|
+
for (const value of desc.values) {
|
|
575
|
+
numbers.set(value.name, value.number);
|
|
576
|
+
}
|
|
562
577
|
return (json, ignoreUnknownFields) => {
|
|
563
578
|
if (json === null) {
|
|
564
579
|
return zero;
|
|
@@ -570,9 +585,9 @@ function compileEnumConverter(desc) {
|
|
|
570
585
|
}
|
|
571
586
|
break;
|
|
572
587
|
case "string": {
|
|
573
|
-
const
|
|
574
|
-
if (
|
|
575
|
-
return
|
|
588
|
+
const number = numbers.get(json);
|
|
589
|
+
if (number !== undefined) {
|
|
590
|
+
return number;
|
|
576
591
|
}
|
|
577
592
|
if (ignoreUnknownFields) {
|
|
578
593
|
return tokenIgnoredUnknownEnum;
|
|
@@ -902,9 +917,12 @@ function anyFromJson(any, json, ctx) {
|
|
|
902
917
|
compiledReader(desc)(message, json.value, ctx);
|
|
903
918
|
}
|
|
904
919
|
else {
|
|
905
|
-
const copy =
|
|
906
|
-
|
|
907
|
-
|
|
920
|
+
const copy = {};
|
|
921
|
+
for (const key of Object.keys(json)) {
|
|
922
|
+
if (key !== "@type") {
|
|
923
|
+
setOwn(copy, key, json[key]);
|
|
924
|
+
}
|
|
925
|
+
}
|
|
908
926
|
compiledReader(desc)(message, copy, ctx);
|
|
909
927
|
}
|
|
910
928
|
anyPack(desc, message, any);
|
|
@@ -979,7 +997,7 @@ function structFromJson(struct, json, ctx) {
|
|
|
979
997
|
const key = keys[i];
|
|
980
998
|
const parsedValue = create(ValueSchema);
|
|
981
999
|
valueFromJson(parsedValue, json[key], ctx);
|
|
982
|
-
struct.fields
|
|
1000
|
+
setOwn(struct.fields, key, parsedValue);
|
|
983
1001
|
}
|
|
984
1002
|
}
|
|
985
1003
|
function valueFromJson(value, json, ctx) {
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
import { create } from "../create.js";
|
|
15
15
|
import { isObject } from "./guard.js";
|
|
16
|
+
import { setOwn } from "./unsafe.js";
|
|
16
17
|
import { isWrapperDesc } from "../wkt/wrappers.js";
|
|
17
18
|
// google.protobuf.NullValue.NULL_VALUE;
|
|
18
19
|
const NULL_VALUE = 0;
|
|
@@ -76,7 +77,7 @@ export function wktStructToReflect(json) {
|
|
|
76
77
|
};
|
|
77
78
|
if (isObject(json)) {
|
|
78
79
|
for (const k of Object.keys(json)) {
|
|
79
|
-
struct.fields
|
|
80
|
+
setOwn(struct.fields, k, wktValueToReflect(json[k]));
|
|
80
81
|
}
|
|
81
82
|
}
|
|
82
83
|
return struct;
|
|
@@ -89,7 +90,7 @@ export function wktStructToReflect(json) {
|
|
|
89
90
|
export function wktStructToLocal(val) {
|
|
90
91
|
const json = {};
|
|
91
92
|
for (const k of Object.keys(val.fields)) {
|
|
92
|
-
json
|
|
93
|
+
setOwn(json, k, wktValueToLocal(val.fields[k]));
|
|
93
94
|
}
|
|
94
95
|
return json;
|
|
95
96
|
}
|
|
@@ -15,7 +15,7 @@ import { ScalarType, } from "../descriptors.js";
|
|
|
15
15
|
import { isMessage } from "../is-message.js";
|
|
16
16
|
import { FieldError } from "./error.js";
|
|
17
17
|
import { isReflectList, isReflectMap, isReflectMessage } from "./guard.js";
|
|
18
|
-
import {
|
|
18
|
+
import { INT32_MAX, INT32_MIN, UINT32_MAX } from "../wire/binary-encoding.js";
|
|
19
19
|
import { getTextEncoding } from "../wire/text-encoding.js";
|
|
20
20
|
import { protoInt64 } from "../proto-int64.js";
|
|
21
21
|
/**
|
|
@@ -96,10 +96,9 @@ export function checkScalarValue(scalar) {
|
|
|
96
96
|
if (typeof value != "number") {
|
|
97
97
|
return false;
|
|
98
98
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
if (value > FLOAT32_MAX || value < FLOAT32_MIN) {
|
|
99
|
+
// float32 is represented with regular 64-bit numbers. A value too large for
|
|
100
|
+
// a float32 becomes infinity when rounded. NaN and infinity are valid values.
|
|
101
|
+
if (!Number.isFinite(Math.fround(value)) && Number.isFinite(value)) {
|
|
103
102
|
return `${value.toFixed()} out of range`;
|
|
104
103
|
}
|
|
105
104
|
return true;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
import { ScalarType, } from "../descriptors.js";
|
|
15
15
|
import { checkField, checkListItem, checkMapEntry } from "./reflect-check.js";
|
|
16
16
|
import { FieldError } from "./error.js";
|
|
17
|
-
import { unsafeClear, unsafeGet, unsafeIsSet, unsafeLocal, unsafeOneofCase, unsafeSet, } from "./unsafe.js";
|
|
17
|
+
import { getOwn, setOwn, unsafeClear, unsafeGet, unsafeIsSet, unsafeLocal, unsafeOneofCase, unsafeSet, } from "./unsafe.js";
|
|
18
18
|
import { create } from "../create.js";
|
|
19
19
|
import { isWrapper, isWrapperDesc } from "../wkt/wrappers.js";
|
|
20
20
|
import { scalarZeroValue } from "./scalar.js";
|
|
@@ -243,7 +243,7 @@ class ReflectMapImpl {
|
|
|
243
243
|
throw err;
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
|
-
this.obj
|
|
246
|
+
setOwn(this.obj, mapKeyToLocal(key), mapValueToLocal(this._field, value));
|
|
247
247
|
return this;
|
|
248
248
|
}
|
|
249
249
|
delete(key) {
|
|
@@ -260,7 +260,7 @@ class ReflectMapImpl {
|
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
get(key) {
|
|
263
|
-
let val = this.obj
|
|
263
|
+
let val = getOwn(this.obj, mapKeyToLocal(key));
|
|
264
264
|
if (val !== undefined) {
|
|
265
265
|
val = mapValueToReflect(this._field, val, this.check);
|
|
266
266
|
}
|