@bufbuild/protobuf 1.1.0 → 1.1.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.
@@ -141,16 +141,15 @@ function createRegistryFromDescriptors(input, replaceWkt = true) {
141
141
  const O = this.findMessage(method.output.typeName);
142
142
  (0, assert_js_1.assert)(I, `message "${method.input.typeName}" for ${method.toString()} not found`);
143
143
  (0, assert_js_1.assert)(O, `output message "${method.output.typeName}" for ${method.toString()} not found`);
144
- const m = {
144
+ methods[(0, names_js_1.localName)(method)] = {
145
145
  name: method.name,
146
- localName: (0, names_js_1.localName)(method),
147
146
  I,
148
147
  O,
149
148
  kind: method.methodKind,
150
149
  idempotency: method.idempotency,
151
- options: {},
150
+ // We do not surface options at this time
151
+ // options: {},
152
152
  };
153
- methods[m.localName] = m;
154
153
  }
155
154
  return (services[typeName] = {
156
155
  typeName: desc.typeName,
@@ -14,7 +14,7 @@
14
14
  // limitations under the License.
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.ListValue = exports.Value = exports.Struct = exports.NullValue = void 0;
17
- // @generated by protoc-gen-es v1.1.0 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
17
+ // @generated by protoc-gen-es v1.1.1 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
18
18
  // @generated from file google/protobuf/struct.proto (package google.protobuf, syntax proto3)
19
19
  /* eslint-disable */
20
20
  const proto3_js_1 = require("../../proto3.js");
@@ -14,7 +14,7 @@
14
14
  // limitations under the License.
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.Option = exports.EnumValue = exports.Enum = exports.Field_Cardinality = exports.Field_Kind = exports.Field = exports.Type = exports.Syntax = void 0;
17
- // @generated by protoc-gen-es v1.1.0 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
17
+ // @generated by protoc-gen-es v1.1.1 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
18
18
  // @generated from file google/protobuf/type.proto (package google.protobuf, syntax proto3)
19
19
  /* eslint-disable */
20
20
  const proto3_js_1 = require("../../proto3.js");
@@ -125,18 +125,18 @@ function makeUtilCommon() {
125
125
  if (va.case !== vb.case) {
126
126
  return false;
127
127
  }
128
- const k = va.case, s = m.findField(k);
128
+ const s = m.findField(va.case);
129
129
  if (s === undefined) {
130
130
  return true;
131
131
  }
132
132
  // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check -- oneof fields are never "map"
133
133
  switch (s.kind) {
134
134
  case "message":
135
- return s.T.equals(va[k], vb[k]);
135
+ return s.T.equals(va.value, vb.value);
136
136
  case "enum":
137
- return (0, scalars_js_1.scalarEquals)(field_js_1.ScalarType.INT32, va, vb);
137
+ return (0, scalars_js_1.scalarEquals)(field_js_1.ScalarType.INT32, va.value, vb.value);
138
138
  case "scalar":
139
- return (0, scalars_js_1.scalarEquals)(s.T, va, vb);
139
+ return (0, scalars_js_1.scalarEquals)(s.T, va.value, vb.value);
140
140
  }
141
141
  throw new Error(`oneof cannot contain ${s.kind}`);
142
142
  case "map":
@@ -39,8 +39,6 @@ exports.protoBase64 = {
39
39
  dec(base64Str) {
40
40
  // estimate byte size, not accounting for inner padding and whitespace
41
41
  let es = (base64Str.length * 3) / 4;
42
- // if (es % 3 !== 0)
43
- // throw new Error("invalid base64 string");
44
42
  if (base64Str[base64Str.length - 2] == "=")
45
43
  es -= 2;
46
44
  else if (base64Str[base64Str.length - 1] == "=")
@@ -138,16 +138,15 @@ export function createRegistryFromDescriptors(input, replaceWkt = true) {
138
138
  const O = this.findMessage(method.output.typeName);
139
139
  assert(I, `message "${method.input.typeName}" for ${method.toString()} not found`);
140
140
  assert(O, `output message "${method.output.typeName}" for ${method.toString()} not found`);
141
- const m = {
141
+ methods[localName(method)] = {
142
142
  name: method.name,
143
- localName: localName(method),
144
143
  I,
145
144
  O,
146
145
  kind: method.methodKind,
147
146
  idempotency: method.idempotency,
148
- options: {},
147
+ // We do not surface options at this time
148
+ // options: {},
149
149
  };
150
- methods[m.localName] = m;
151
150
  }
152
151
  return (services[typeName] = {
153
152
  typeName: desc.typeName,
@@ -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
- // @generated by protoc-gen-es v1.1.0 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
14
+ // @generated by protoc-gen-es v1.1.1 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
15
15
  // @generated from file google/protobuf/struct.proto (package google.protobuf, syntax proto3)
16
16
  /* eslint-disable */
17
17
  import { proto3 } from "../../proto3.js";
@@ -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
- // @generated by protoc-gen-es v1.1.0 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
14
+ // @generated by protoc-gen-es v1.1.1 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
15
15
  // @generated from file google/protobuf/type.proto (package google.protobuf, syntax proto3)
16
16
  /* eslint-disable */
17
17
  import { proto3 } from "../../proto3.js";
@@ -122,18 +122,18 @@ export function makeUtilCommon() {
122
122
  if (va.case !== vb.case) {
123
123
  return false;
124
124
  }
125
- const k = va.case, s = m.findField(k);
125
+ const s = m.findField(va.case);
126
126
  if (s === undefined) {
127
127
  return true;
128
128
  }
129
129
  // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check -- oneof fields are never "map"
130
130
  switch (s.kind) {
131
131
  case "message":
132
- return s.T.equals(va[k], vb[k]);
132
+ return s.T.equals(va.value, vb.value);
133
133
  case "enum":
134
- return scalarEquals(ScalarType.INT32, va, vb);
134
+ return scalarEquals(ScalarType.INT32, va.value, vb.value);
135
135
  case "scalar":
136
- return scalarEquals(s.T, va, vb);
136
+ return scalarEquals(s.T, va.value, vb.value);
137
137
  }
138
138
  throw new Error(`oneof cannot contain ${s.kind}`);
139
139
  case "map":
@@ -36,8 +36,6 @@ export const protoBase64 = {
36
36
  dec(base64Str) {
37
37
  // estimate byte size, not accounting for inner padding and whitespace
38
38
  let es = (base64Str.length * 3) / 4;
39
- // if (es % 3 !== 0)
40
- // throw new Error("invalid base64 string");
41
39
  if (base64Str[base64Str.length - 2] == "=")
42
40
  es -= 2;
43
41
  else if (base64Str[base64Str.length - 1] == "=")
@@ -21,8 +21,6 @@ export interface ServiceType {
21
21
  * call. All methods provide the following properties:
22
22
  *
23
23
  * - "name": The original name of the protobuf rpc.
24
- * - "localName": A variation of the name that follows the lowerCamelCase
25
- * naming convention in ECMAScript.
26
24
  * - "I": The input message type.
27
25
  * - "O": The output message type.
28
26
  * - "kind": The method type.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bufbuild/protobuf",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "license": "(Apache-2.0 AND BSD-3-Clause)",
5
5
  "description": "A complete implementation of Protocol Buffers in TypeScript, suitable for web browsers and Node.js.",
6
6
  "repository": {
@@ -24,6 +24,6 @@
24
24
  "types": "./dist/types/index.d.ts"
25
25
  },
26
26
  "files": [
27
- "dist/**/"
27
+ "dist/**"
28
28
  ]
29
29
  }