@bufbuild/protoc-gen-es 2.6.1 → 2.6.3
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/dist/cjs/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bufbuild/protoc-gen-es",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Protocol Buffers code generator for ECMAScript",
|
|
6
6
|
"keywords": [
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
},
|
|
33
33
|
"preferUnplugged": true,
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@bufbuild/protobuf": "
|
|
36
|
-
"@bufbuild/protoplugin": "2.6.
|
|
35
|
+
"@bufbuild/protobuf": "2.6.3",
|
|
36
|
+
"@bufbuild/protoplugin": "2.6.3"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"upstream-protobuf": "*"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@bufbuild/protobuf": "2.6.
|
|
42
|
+
"@bufbuild/protobuf": "2.6.3"
|
|
43
43
|
},
|
|
44
44
|
"peerDependenciesMeta": {
|
|
45
45
|
"@bufbuild/protobuf": {
|
|
@@ -1,24 +1,10 @@
|
|
|
1
|
-
import type { GenEnum, GenExtension, GenFile, GenMessage } from "@bufbuild/protobuf/
|
|
2
|
-
import type { FieldOptions,
|
|
1
|
+
import type { GenEnum, GenExtension, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
|
|
2
|
+
import type { FieldOptions, OneofOptions } from "@bufbuild/protobuf/wkt";
|
|
3
3
|
import type { Message } from "@bufbuild/protobuf";
|
|
4
4
|
/**
|
|
5
5
|
* Describes the file minimal-validate.proto.
|
|
6
6
|
*/
|
|
7
7
|
export declare const file_minimal_validate: GenFile;
|
|
8
|
-
/**
|
|
9
|
-
* @generated from message buf.validate.MessageRules
|
|
10
|
-
*/
|
|
11
|
-
export type MessageRules = Message<"buf.validate.MessageRules"> & {
|
|
12
|
-
/**
|
|
13
|
-
* @generated from field: optional bool disabled = 1;
|
|
14
|
-
*/
|
|
15
|
-
disabled: boolean;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Describes the message buf.validate.MessageRules.
|
|
19
|
-
* Use `create(MessageRulesSchema)` to create a new message.
|
|
20
|
-
*/
|
|
21
|
-
export declare const MessageRulesSchema: GenMessage<MessageRules>;
|
|
22
8
|
/**
|
|
23
9
|
* @generated from message buf.validate.OneofRules
|
|
24
10
|
*/
|
|
@@ -107,13 +93,9 @@ export declare enum Ignore {
|
|
|
107
93
|
*/
|
|
108
94
|
UNSPECIFIED = 0,
|
|
109
95
|
/**
|
|
110
|
-
* @generated from enum value:
|
|
111
|
-
*/
|
|
112
|
-
IF_UNPOPULATED = 1,
|
|
113
|
-
/**
|
|
114
|
-
* @generated from enum value: IGNORE_IF_DEFAULT_VALUE = 2;
|
|
96
|
+
* @generated from enum value: IGNORE_IF_ZERO_VALUE = 1;
|
|
115
97
|
*/
|
|
116
|
-
|
|
98
|
+
IF_ZERO_VALUE = 1,
|
|
117
99
|
/**
|
|
118
100
|
* @generated from enum value: IGNORE_ALWAYS = 3;
|
|
119
101
|
*/
|
|
@@ -123,10 +105,6 @@ export declare enum Ignore {
|
|
|
123
105
|
* Describes the enum buf.validate.Ignore.
|
|
124
106
|
*/
|
|
125
107
|
export declare const IgnoreSchema: GenEnum<Ignore>;
|
|
126
|
-
/**
|
|
127
|
-
* @generated from extension: optional buf.validate.MessageRules message = 1159;
|
|
128
|
-
*/
|
|
129
|
-
export declare const message: GenExtension<MessageOptions, MessageRules>;
|
|
130
108
|
/**
|
|
131
109
|
* @generated from extension: optional buf.validate.OneofRules oneof = 1159;
|
|
132
110
|
*/
|
|
@@ -13,38 +13,33 @@
|
|
|
13
13
|
// See the License for the specific language governing permissions and
|
|
14
14
|
// limitations under the License.
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.field = exports.oneof = exports.
|
|
17
|
-
const
|
|
16
|
+
exports.field = exports.oneof = exports.IgnoreSchema = exports.Ignore = exports.MapRulesSchema = exports.RepeatedRulesSchema = exports.FieldRulesSchema = exports.OneofRulesSchema = exports.file_minimal_validate = void 0;
|
|
17
|
+
const codegenv2_1 = require("@bufbuild/protobuf/codegenv2");
|
|
18
18
|
const wkt_1 = require("@bufbuild/protobuf/wkt");
|
|
19
19
|
/**
|
|
20
20
|
* Describes the file minimal-validate.proto.
|
|
21
21
|
*/
|
|
22
|
-
exports.file_minimal_validate = (0,
|
|
23
|
-
/**
|
|
24
|
-
* Describes the message buf.validate.MessageRules.
|
|
25
|
-
* Use `create(MessageRulesSchema)` to create a new message.
|
|
26
|
-
*/
|
|
27
|
-
exports.MessageRulesSchema = (0, codegenv1_1.messageDesc)(exports.file_minimal_validate, 0);
|
|
22
|
+
exports.file_minimal_validate = (0, codegenv2_1.fileDesc)("ChZtaW5pbWFsLXZhbGlkYXRlLnByb3RvEgxidWYudmFsaWRhdGUiHgoKT25lb2ZSdWxlcxIQCghyZXF1aXJlZBgBIAEoCCKkAQoKRmllbGRSdWxlcxIQCghyZXF1aXJlZBgZIAEoCBIkCgZpZ25vcmUYGyABKA4yFC5idWYudmFsaWRhdGUuSWdub3JlEi8KCHJlcGVhdGVkGBIgASgLMhsuYnVmLnZhbGlkYXRlLlJlcGVhdGVkUnVsZXNIABIlCgNtYXAYEyABKAsyFi5idWYudmFsaWRhdGUuTWFwUnVsZXNIAEIGCgR0eXBlIjgKDVJlcGVhdGVkUnVsZXMSJwoFaXRlbXMYBCABKAsyGC5idWYudmFsaWRhdGUuRmllbGRSdWxlcyI0CghNYXBSdWxlcxIoCgZ2YWx1ZXMYBSABKAsyGC5idWYudmFsaWRhdGUuRmllbGRSdWxlcypNCgZJZ25vcmUSFgoSSUdOT1JFX1VOU1BFQ0lGSUVEEAASGAoUSUdOT1JFX0lGX1pFUk9fVkFMVUUQARIRCg1JR05PUkVfQUxXQVlTEAM6TgoFb25lb2YSHS5nb29nbGUucHJvdG9idWYuT25lb2ZPcHRpb25zGIcJIAEoCzIYLmJ1Zi52YWxpZGF0ZS5PbmVvZlJ1bGVzUgVvbmVvZjpOCgVmaWVsZBIdLmdvb2dsZS5wcm90b2J1Zi5GaWVsZE9wdGlvbnMYhwkgASgLMhguYnVmLnZhbGlkYXRlLkZpZWxkUnVsZXNSBWZpZWxk", [wkt_1.file_google_protobuf_descriptor]);
|
|
28
23
|
/**
|
|
29
24
|
* Describes the message buf.validate.OneofRules.
|
|
30
25
|
* Use `create(OneofRulesSchema)` to create a new message.
|
|
31
26
|
*/
|
|
32
|
-
exports.OneofRulesSchema = (0,
|
|
27
|
+
exports.OneofRulesSchema = (0, codegenv2_1.messageDesc)(exports.file_minimal_validate, 0);
|
|
33
28
|
/**
|
|
34
29
|
* Describes the message buf.validate.FieldRules.
|
|
35
30
|
* Use `create(FieldRulesSchema)` to create a new message.
|
|
36
31
|
*/
|
|
37
|
-
exports.FieldRulesSchema = (0,
|
|
32
|
+
exports.FieldRulesSchema = (0, codegenv2_1.messageDesc)(exports.file_minimal_validate, 1);
|
|
38
33
|
/**
|
|
39
34
|
* Describes the message buf.validate.RepeatedRules.
|
|
40
35
|
* Use `create(RepeatedRulesSchema)` to create a new message.
|
|
41
36
|
*/
|
|
42
|
-
exports.RepeatedRulesSchema = (0,
|
|
37
|
+
exports.RepeatedRulesSchema = (0, codegenv2_1.messageDesc)(exports.file_minimal_validate, 2);
|
|
43
38
|
/**
|
|
44
39
|
* Describes the message buf.validate.MapRules.
|
|
45
40
|
* Use `create(MapRulesSchema)` to create a new message.
|
|
46
41
|
*/
|
|
47
|
-
exports.MapRulesSchema = (0,
|
|
42
|
+
exports.MapRulesSchema = (0, codegenv2_1.messageDesc)(exports.file_minimal_validate, 3);
|
|
48
43
|
/**
|
|
49
44
|
* @generated from enum buf.validate.Ignore
|
|
50
45
|
*/
|
|
@@ -55,13 +50,9 @@ var Ignore;
|
|
|
55
50
|
*/
|
|
56
51
|
Ignore[Ignore["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
57
52
|
/**
|
|
58
|
-
* @generated from enum value:
|
|
59
|
-
*/
|
|
60
|
-
Ignore[Ignore["IF_UNPOPULATED"] = 1] = "IF_UNPOPULATED";
|
|
61
|
-
/**
|
|
62
|
-
* @generated from enum value: IGNORE_IF_DEFAULT_VALUE = 2;
|
|
53
|
+
* @generated from enum value: IGNORE_IF_ZERO_VALUE = 1;
|
|
63
54
|
*/
|
|
64
|
-
Ignore[Ignore["
|
|
55
|
+
Ignore[Ignore["IF_ZERO_VALUE"] = 1] = "IF_ZERO_VALUE";
|
|
65
56
|
/**
|
|
66
57
|
* @generated from enum value: IGNORE_ALWAYS = 3;
|
|
67
58
|
*/
|
|
@@ -70,16 +61,12 @@ var Ignore;
|
|
|
70
61
|
/**
|
|
71
62
|
* Describes the enum buf.validate.Ignore.
|
|
72
63
|
*/
|
|
73
|
-
exports.IgnoreSchema = (0,
|
|
74
|
-
/**
|
|
75
|
-
* @generated from extension: optional buf.validate.MessageRules message = 1159;
|
|
76
|
-
*/
|
|
77
|
-
exports.message = (0, codegenv1_1.extDesc)(exports.file_minimal_validate, 0);
|
|
64
|
+
exports.IgnoreSchema = (0, codegenv2_1.enumDesc)(exports.file_minimal_validate, 0);
|
|
78
65
|
/**
|
|
79
66
|
* @generated from extension: optional buf.validate.OneofRules oneof = 1159;
|
|
80
67
|
*/
|
|
81
|
-
exports.oneof = (0,
|
|
68
|
+
exports.oneof = (0, codegenv2_1.extDesc)(exports.file_minimal_validate, 0);
|
|
82
69
|
/**
|
|
83
70
|
* @generated from extension: optional buf.validate.FieldRules field = 1159;
|
|
84
71
|
*/
|
|
85
|
-
exports.field = (0,
|
|
72
|
+
exports.field = (0, codegenv2_1.extDesc)(exports.file_minimal_validate, 1);
|
|
@@ -29,14 +29,8 @@ function isProtovalidateDisabled(descField) {
|
|
|
29
29
|
if (descField.message === undefined) {
|
|
30
30
|
return false;
|
|
31
31
|
}
|
|
32
|
-
const messageRules = (0, protobuf_1.getOption)(descField.parent, minimal_validate_pb_js_1.message);
|
|
33
|
-
if (messageRules.disabled) {
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
32
|
const fieldRules = (0, protobuf_1.getOption)(descField, minimal_validate_pb_js_1.field);
|
|
37
|
-
if (fieldRules.ignore == minimal_validate_pb_js_1.Ignore.ALWAYS
|
|
38
|
-
(descField.fieldKind == "message" &&
|
|
39
|
-
fieldRules.ignore == minimal_validate_pb_js_1.Ignore.IF_DEFAULT_VALUE)) {
|
|
33
|
+
if (fieldRules.ignore == minimal_validate_pb_js_1.Ignore.ALWAYS) {
|
|
40
34
|
return true;
|
|
41
35
|
}
|
|
42
36
|
const childRules = descField.fieldKind == "list" && fieldRules.type.case == "repeated"
|
|
@@ -45,8 +39,7 @@ function isProtovalidateDisabled(descField) {
|
|
|
45
39
|
? fieldRules.type.value.values
|
|
46
40
|
: undefined;
|
|
47
41
|
if (childRules) {
|
|
48
|
-
return
|
|
49
|
-
childRules.ignore == minimal_validate_pb_js_1.Ignore.IF_DEFAULT_VALUE);
|
|
42
|
+
return childRules.ignore == minimal_validate_pb_js_1.Ignore.ALWAYS;
|
|
50
43
|
}
|
|
51
44
|
return false;
|
|
52
45
|
}
|
|
@@ -60,10 +53,6 @@ function isProtovalidateRequired(descField) {
|
|
|
60
53
|
if (!(0, protobuf_1.hasOption)(descField, minimal_validate_pb_js_1.field)) {
|
|
61
54
|
return false;
|
|
62
55
|
}
|
|
63
|
-
const messageRules = (0, protobuf_1.getOption)(descField.parent, minimal_validate_pb_js_1.message);
|
|
64
|
-
if (messageRules.disabled) {
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
56
|
const fieldRules = (0, protobuf_1.getOption)(descField, minimal_validate_pb_js_1.field);
|
|
68
57
|
if (fieldRules.ignore === minimal_validate_pb_js_1.Ignore.ALWAYS) {
|
|
69
58
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bufbuild/protoc-gen-es",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Protocol Buffers code generator for ECMAScript",
|
|
6
6
|
"keywords": [
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
},
|
|
33
33
|
"preferUnplugged": true,
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@bufbuild/protobuf": "
|
|
36
|
-
"@bufbuild/protoplugin": "2.6.
|
|
35
|
+
"@bufbuild/protobuf": "2.6.3",
|
|
36
|
+
"@bufbuild/protoplugin": "2.6.3"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"upstream-protobuf": "*"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@bufbuild/protobuf": "2.6.
|
|
42
|
+
"@bufbuild/protobuf": "2.6.3"
|
|
43
43
|
},
|
|
44
44
|
"peerDependenciesMeta": {
|
|
45
45
|
"@bufbuild/protobuf": {
|