ts-proto 1.144.0 → 1.144.1
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.
|
@@ -67,12 +67,11 @@ function generateMethodOptions(ctx, options) {
|
|
|
67
67
|
else if (options.idempotencyLevel === ts_proto_descriptors_1.MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS) {
|
|
68
68
|
chunks.push((0, ts_poet_1.code) `idempotencyLevel: 'NO_SIDE_EFFECTS',`);
|
|
69
69
|
}
|
|
70
|
-
if (
|
|
71
|
-
const msgUnknownFields = options["_unknownFields"];
|
|
70
|
+
if (options._unknownFields !== undefined) {
|
|
72
71
|
const unknownFieldsChunks = [];
|
|
73
72
|
unknownFieldsChunks.push((0, ts_poet_1.code) `{`);
|
|
74
|
-
for (const key
|
|
75
|
-
const values =
|
|
73
|
+
for (const key in options._unknownFields) {
|
|
74
|
+
const values = options._unknownFields[key];
|
|
76
75
|
const valuesChunks = [];
|
|
77
76
|
for (const value of values) {
|
|
78
77
|
valuesChunks.push((0, ts_poet_1.code) `${ctx.options.env == "node" ? "Buffer.from" : "new Uint8Array"}([${value.join(", ")}])`);
|
package/build/schema.js
CHANGED
|
@@ -78,8 +78,8 @@ function generateSchema(ctx, fileDesc, sourceInfo) {
|
|
|
78
78
|
};
|
|
79
79
|
let fileOptions;
|
|
80
80
|
if (fileDesc.options) {
|
|
81
|
-
fileOptions = encodedOptionsToOptions(ctx, ".google.protobuf.FileOptions", fileDesc.options
|
|
82
|
-
delete fileDesc.options
|
|
81
|
+
fileOptions = encodedOptionsToOptions(ctx, ".google.protobuf.FileOptions", fileDesc.options._unknownFields);
|
|
82
|
+
delete fileDesc.options._unknownFields;
|
|
83
83
|
}
|
|
84
84
|
const messagesOptions = [];
|
|
85
85
|
(fileDesc.messageType || []).forEach((message) => {
|
|
@@ -93,8 +93,8 @@ function generateSchema(ctx, fileDesc, sourceInfo) {
|
|
|
93
93
|
const methodsOptions = [];
|
|
94
94
|
service.method.forEach((method) => {
|
|
95
95
|
if (method.options) {
|
|
96
|
-
const methodOptions = encodedOptionsToOptions(ctx, ".google.protobuf.MethodOptions", method.options
|
|
97
|
-
delete method.options
|
|
96
|
+
const methodOptions = encodedOptionsToOptions(ctx, ".google.protobuf.MethodOptions", method.options._unknownFields);
|
|
97
|
+
delete method.options._unknownFields;
|
|
98
98
|
if (methodOptions) {
|
|
99
99
|
methodsOptions.push((0, ts_poet_1.code) `'${method.name}': ${methodOptions}`);
|
|
100
100
|
}
|
|
@@ -102,8 +102,8 @@ function generateSchema(ctx, fileDesc, sourceInfo) {
|
|
|
102
102
|
});
|
|
103
103
|
let serviceOptions;
|
|
104
104
|
if (service.options) {
|
|
105
|
-
serviceOptions = encodedOptionsToOptions(ctx, ".google.protobuf.ServiceOptions", service.options
|
|
106
|
-
delete service.options
|
|
105
|
+
serviceOptions = encodedOptionsToOptions(ctx, ".google.protobuf.ServiceOptions", service.options._unknownFields);
|
|
106
|
+
delete service.options._unknownFields;
|
|
107
107
|
}
|
|
108
108
|
if (methodsOptions.length > 0 || serviceOptions) {
|
|
109
109
|
servicesOptions.push((0, ts_poet_1.code) `
|
|
@@ -119,8 +119,8 @@ function generateSchema(ctx, fileDesc, sourceInfo) {
|
|
|
119
119
|
const valuesOptions = [];
|
|
120
120
|
Enum.value.forEach((value) => {
|
|
121
121
|
if (value.options) {
|
|
122
|
-
const valueOptions = encodedOptionsToOptions(ctx, ".google.protobuf.EnumValueOptions", value.options
|
|
123
|
-
delete value.options
|
|
122
|
+
const valueOptions = encodedOptionsToOptions(ctx, ".google.protobuf.EnumValueOptions", value.options._unknownFields);
|
|
123
|
+
delete value.options._unknownFields;
|
|
124
124
|
if (valueOptions) {
|
|
125
125
|
valuesOptions.push((0, ts_poet_1.code) `'${value.name}': ${valueOptions}`);
|
|
126
126
|
}
|
|
@@ -128,8 +128,8 @@ function generateSchema(ctx, fileDesc, sourceInfo) {
|
|
|
128
128
|
});
|
|
129
129
|
let enumOptions;
|
|
130
130
|
if (Enum.options) {
|
|
131
|
-
enumOptions = encodedOptionsToOptions(ctx, ".google.protobuf.EnumOptions", Enum.options
|
|
132
|
-
delete Enum.options
|
|
131
|
+
enumOptions = encodedOptionsToOptions(ctx, ".google.protobuf.EnumOptions", Enum.options._unknownFields);
|
|
132
|
+
delete Enum.options._unknownFields;
|
|
133
133
|
}
|
|
134
134
|
if (valuesOptions.length > 0 || enumOptions) {
|
|
135
135
|
enumsOptions.push((0, ts_poet_1.code) `
|
|
@@ -185,7 +185,8 @@ function encodedOptionsToOptions(ctx, extendee, encodedOptions) {
|
|
|
185
185
|
return undefined;
|
|
186
186
|
}
|
|
187
187
|
const resultOptions = [];
|
|
188
|
-
for (const
|
|
188
|
+
for (const key in encodedOptions) {
|
|
189
|
+
const value = encodedOptions[key];
|
|
189
190
|
const extension = extensionCache[extendee][parseInt(key, 10) >>> 3];
|
|
190
191
|
resultOptions.push(getExtensionValue(ctx, extension, value));
|
|
191
192
|
}
|
|
@@ -198,8 +199,8 @@ function resolveMessageOptions(ctx, message) {
|
|
|
198
199
|
const fieldsOptions = [];
|
|
199
200
|
message.field.forEach((field) => {
|
|
200
201
|
if (field.options) {
|
|
201
|
-
const fieldOptions = encodedOptionsToOptions(ctx, ".google.protobuf.FieldOptions", field.options
|
|
202
|
-
delete field.options
|
|
202
|
+
const fieldOptions = encodedOptionsToOptions(ctx, ".google.protobuf.FieldOptions", field.options._unknownFields);
|
|
203
|
+
delete field.options._unknownFields;
|
|
203
204
|
if (fieldOptions) {
|
|
204
205
|
fieldsOptions.push((0, ts_poet_1.code) `'${field.name}': ${fieldOptions}`);
|
|
205
206
|
}
|
|
@@ -208,8 +209,8 @@ function resolveMessageOptions(ctx, message) {
|
|
|
208
209
|
const oneOfsOptions = [];
|
|
209
210
|
message.oneofDecl.forEach((oneOf) => {
|
|
210
211
|
if (oneOf.options) {
|
|
211
|
-
const oneOfOptions = encodedOptionsToOptions(ctx, ".google.protobuf.OneofOptions", oneOf.options
|
|
212
|
-
delete oneOf.options
|
|
212
|
+
const oneOfOptions = encodedOptionsToOptions(ctx, ".google.protobuf.OneofOptions", oneOf.options._unknownFields);
|
|
213
|
+
delete oneOf.options._unknownFields;
|
|
213
214
|
if (oneOfOptions) {
|
|
214
215
|
oneOfsOptions.push((0, ts_poet_1.code) `'${oneOf.name}': ${oneOfOptions}`);
|
|
215
216
|
}
|
|
@@ -226,8 +227,8 @@ function resolveMessageOptions(ctx, message) {
|
|
|
226
227
|
}
|
|
227
228
|
let messageOptions;
|
|
228
229
|
if (message.options) {
|
|
229
|
-
messageOptions = encodedOptionsToOptions(ctx, ".google.protobuf.MessageOptions", message.options
|
|
230
|
-
delete message.options
|
|
230
|
+
messageOptions = encodedOptionsToOptions(ctx, ".google.protobuf.MessageOptions", message.options._unknownFields);
|
|
231
|
+
delete message.options._unknownFields;
|
|
231
232
|
}
|
|
232
233
|
if (fieldsOptions.length > 0 || oneOfsOptions.length > 0 || nestedOptions.length > 0 || messageOptions) {
|
|
233
234
|
return (0, ts_poet_1.code) `
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-proto",
|
|
3
|
-
"version": "1.144.
|
|
3
|
+
"version": "1.144.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "build/plugin.js",
|
|
6
6
|
"repository": "github:stephenh/ts-proto",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"object-hash": "^1.3.1",
|
|
66
66
|
"protobufjs": "^6.11.3",
|
|
67
67
|
"ts-poet": "^6.4.1",
|
|
68
|
-
"ts-proto-descriptors": "1.
|
|
68
|
+
"ts-proto-descriptors": "1.8.0"
|
|
69
69
|
},
|
|
70
70
|
"packageManager": "yarn@3.3.0"
|
|
71
71
|
}
|