@zuplo/cli 6.70.69 → 6.70.70

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.
Files changed (35) hide show
  1. package/node_modules/@zuplo/core/package.json +1 -1
  2. package/node_modules/@zuplo/graphql/package.json +1 -1
  3. package/node_modules/@zuplo/openapi-tools/package.json +1 -1
  4. package/node_modules/@zuplo/otel/package.json +1 -1
  5. package/node_modules/@zuplo/runtime/out/esm/{chunk-YLRLRHUN.js → chunk-MJPI3GFA.js} +93 -92
  6. package/node_modules/@zuplo/runtime/out/esm/chunk-MJPI3GFA.js.map +1 -0
  7. package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
  8. package/node_modules/@zuplo/runtime/out/esm/index.js.map +1 -1
  9. package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +7 -7
  10. package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js.map +1 -1
  11. package/node_modules/@zuplo/runtime/out/types/index.d.ts +323 -0
  12. package/node_modules/@zuplo/runtime/out/types/mcp-gateway/index.d.ts +3 -1
  13. package/node_modules/@zuplo/runtime/package.json +1 -1
  14. package/node_modules/protobufjs/dist/light/protobuf.js +18 -17
  15. package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
  16. package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
  17. package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
  18. package/node_modules/protobufjs/dist/minimal/protobuf.js +3 -3
  19. package/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -1
  20. package/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
  21. package/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -1
  22. package/node_modules/protobufjs/dist/protobuf.js +18 -17
  23. package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
  24. package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
  25. package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
  26. package/node_modules/protobufjs/package.json +1 -1
  27. package/node_modules/protobufjs/src/converter.js +5 -4
  28. package/node_modules/protobufjs/src/decoder.js +1 -1
  29. package/node_modules/protobufjs/src/service.js +5 -7
  30. package/node_modules/protobufjs/src/type.js +3 -1
  31. package/node_modules/protobufjs/src/util/minimal.js +1 -1
  32. package/node_modules/protobufjs/src/verifier.js +1 -1
  33. package/package.json +6 -6
  34. package/node_modules/@zuplo/runtime/out/esm/chunk-YLRLRHUN.js.map +0 -1
  35. /package/node_modules/@zuplo/runtime/out/esm/{chunk-YLRLRHUN.js.LEGAL.txt → chunk-MJPI3GFA.js.LEGAL.txt} +0 -0
@@ -2899,6 +2899,291 @@ export declare class DataDogMetricsPlugin extends MetricsPlugin {
2899
2899
  static setContext(context: ZuploContext, data: DataDogMetricsContext): void;
2900
2900
  }
2901
2901
 
2902
+ /**
2903
+ * Scans the incoming request body for sensitive data — PII, secrets, and
2904
+ * financial identifiers — using an extensible catalog of built-in recognizers
2905
+ * plus any custom patterns, and takes a configurable action when a match is
2906
+ * found.
2907
+ *
2908
+ * The action is one of `mask` (redact matches before forwarding the request),
2909
+ * `block` (reject with a `422` listing the detected entity names only), or
2910
+ * `log` (record a warning and forward unchanged). Only text content types are
2911
+ * inspected; binary bodies pass through untouched, and the body is read from a
2912
+ * clone so the upstream still receives the original stream.
2913
+ *
2914
+ * @title Data Loss Prevention
2915
+ * @product api-gateway
2916
+ * @public
2917
+ * @param request - The ZuploRequest
2918
+ * @param context - The ZuploContext
2919
+ * @param options - The policy options set in policies.json
2920
+ * @param policyName - The name of the policy as set in policies.json
2921
+ * @returns A Request or a Response
2922
+ */
2923
+ export declare const DataLossPreventionInboundPolicy: InboundPolicyHandler<DataLossPreventionInboundPolicyOptions>;
2924
+
2925
+ /**
2926
+ * The options for the Data Loss Prevention inbound policy. Scans the incoming request body for sensitive data and applies the configured action (mask, block, or log).
2927
+ * @public
2928
+ */
2929
+ export declare interface DataLossPreventionInboundPolicyOptions {
2930
+ /**
2931
+ * The detection engine. Only `builtin` (in-isolate regex + checksum detection with context-word scoring) is available today. This is the extension point for a future hosted `presidio-service` mode; declaring it now keeps adding that mode an additive, non-breaking change.
2932
+ */
2933
+ engine?: "builtin";
2934
+ /**
2935
+ * Built-in recognizer ids and/or group selectors to enable. Entity ids follow a {category}-{scope}-{name} taxonomy, and any dash-aligned id prefix acts as a selector (for example `secret` is every secret, `id-au` is Australia's identifiers, `secret-aws` is both AWS entities), plus the named groups `pii` and `region-eu`. Available selectors: `contact`, `finance`, `finance-us`, `id`, `id-au`, `id-br`, `id-ca`, `id-es`, `id-fr`, `id-in`, `id-it`, `id-nl`, `id-pl`, `id-sg`, `id-uk`, `id-us`, `network`, `pii`, `region-eu`, `secret`, `secret-aws`. When omitted, the full built-in catalog is used.
2936
+ */
2937
+ entities?: (
2938
+ | "contact"
2939
+ | "finance"
2940
+ | "finance-us"
2941
+ | "id"
2942
+ | "id-au"
2943
+ | "id-br"
2944
+ | "id-ca"
2945
+ | "id-es"
2946
+ | "id-fr"
2947
+ | "id-in"
2948
+ | "id-it"
2949
+ | "id-nl"
2950
+ | "id-pl"
2951
+ | "id-sg"
2952
+ | "id-uk"
2953
+ | "id-us"
2954
+ | "network"
2955
+ | "pii"
2956
+ | "region-eu"
2957
+ | "secret"
2958
+ | "secret-aws"
2959
+ | "contact-email"
2960
+ | "contact-phone"
2961
+ | "finance-credit-card"
2962
+ | "finance-crypto-wallet"
2963
+ | "finance-cvv"
2964
+ | "finance-iban"
2965
+ | "finance-swift-bic"
2966
+ | "finance-us-aba-routing"
2967
+ | "finance-us-bank-account"
2968
+ | "id-au-abn"
2969
+ | "id-au-acn"
2970
+ | "id-au-medicare"
2971
+ | "id-au-tfn"
2972
+ | "id-br-cpf"
2973
+ | "id-ca-sin"
2974
+ | "id-es-nif"
2975
+ | "id-fr-nir"
2976
+ | "id-in-aadhaar"
2977
+ | "id-in-pan"
2978
+ | "id-it-fiscal-code"
2979
+ | "id-nl-bsn"
2980
+ | "id-pl-pesel"
2981
+ | "id-sg-nric"
2982
+ | "id-uk-nhs"
2983
+ | "id-uk-nino"
2984
+ | "id-us-itin"
2985
+ | "id-us-passport"
2986
+ | "id-us-ssn"
2987
+ | "network-ipv4"
2988
+ | "network-ipv6"
2989
+ | "network-mac"
2990
+ | "secret-anthropic"
2991
+ | "secret-aws-access-key"
2992
+ | "secret-aws-bedrock"
2993
+ | "secret-azure-client"
2994
+ | "secret-databricks"
2995
+ | "secret-digitalocean"
2996
+ | "secret-discord-webhook"
2997
+ | "secret-github"
2998
+ | "secret-gitlab"
2999
+ | "secret-google-api-key"
3000
+ | "secret-heroku"
3001
+ | "secret-hugging-face"
3002
+ | "secret-jwt"
3003
+ | "secret-mailchimp"
3004
+ | "secret-mailgun"
3005
+ | "secret-npm"
3006
+ | "secret-openai"
3007
+ | "secret-perplexity"
3008
+ | "secret-postman"
3009
+ | "secret-private-key"
3010
+ | "secret-pypi"
3011
+ | "secret-sendgrid"
3012
+ | "secret-sentry"
3013
+ | "secret-shopify"
3014
+ | "secret-slack"
3015
+ | "secret-square"
3016
+ | "secret-stripe"
3017
+ | "secret-telegram-bot"
3018
+ | "secret-terraform"
3019
+ | "secret-twilio"
3020
+ | "secret-zuplo"
3021
+ )[];
3022
+ /**
3023
+ * Additional customer-defined regex recognizers. Invalid patterns are logged and skipped rather than failing the request.
3024
+ */
3025
+ customPatterns?: DlpCustomPattern[];
3026
+ /**
3027
+ * What to do when sensitive data is detected. `mask` redacts matches before forwarding the request, `block` rejects with a 422 listing only the detected entity names, and `log` records a warning and forwards the request unchanged.
3028
+ */
3029
+ action?: "mask" | "block" | "log";
3030
+ /**
3031
+ * The string that replaces detected values when `action` is `mask`.
3032
+ */
3033
+ mask?: string;
3034
+ /**
3035
+ * Minimum confidence (0-1) a match must reach to count as a finding. Context-dependent recognizers (for example `finance-us-bank-account` or `finance-us-aba-routing`) sit below the default threshold of 0.5 until a context word near the match boosts them above it. Lower the threshold to surface them everywhere; raise it to keep only prefix- or checksum-validated matches.
3036
+ */
3037
+ minConfidence?: number;
3038
+ /**
3039
+ * Override the set of scannable content-type prefixes. When omitted, the built-in text content-type allow-list (JSON, XML, form-encoded, text/*) is used.
3040
+ */
3041
+ contentTypes?: string[];
3042
+ }
3043
+
3044
+ /**
3045
+ * Scans the upstream response body for sensitive data — PII, secrets, and
3046
+ * financial identifiers — using an extensible catalog of built-in recognizers
3047
+ * plus any custom patterns, and takes a configurable action when a match is
3048
+ * found.
3049
+ *
3050
+ * The action is one of `mask` (redact matches before returning the response),
3051
+ * `block` (replace the response with a `422` listing the detected entity names
3052
+ * only), or `log` (record a warning and return unchanged). Only text content
3053
+ * types are inspected; binary bodies pass through untouched, and the body is
3054
+ * read from a clone so the client still receives the original stream.
3055
+ *
3056
+ * @title Data Loss Prevention
3057
+ * @product api-gateway
3058
+ * @public
3059
+ * @param response - The outgoing Response from the handler
3060
+ * @param request - The original incoming Request
3061
+ * @param context - The current context of the Request
3062
+ * @param options - The configuration options for the policy
3063
+ * @param policyName - The name of the policy as set in policies.json
3064
+ * @returns A Response
3065
+ */
3066
+ export declare const DataLossPreventionOutboundPolicy: OutboundPolicyHandler<DataLossPreventionOutboundPolicyOptions>;
3067
+
3068
+ /**
3069
+ * The options for the Data Loss Prevention outbound policy. Scans the upstream response body for sensitive data and applies the configured action (mask, block, or log).
3070
+ * @public
3071
+ */
3072
+ export declare interface DataLossPreventionOutboundPolicyOptions {
3073
+ /**
3074
+ * The detection engine. Only `builtin` (in-isolate regex + checksum detection with context-word scoring) is available today. This is the extension point for a future hosted `presidio-service` mode; declaring it now keeps adding that mode an additive, non-breaking change.
3075
+ */
3076
+ engine?: "builtin";
3077
+ /**
3078
+ * Built-in recognizer ids and/or group selectors to enable. Entity ids follow a {category}-{scope}-{name} taxonomy, and any dash-aligned id prefix acts as a selector (for example `secret` is every secret, `id-au` is Australia's identifiers, `secret-aws` is both AWS entities), plus the named groups `pii` and `region-eu`. Available selectors: `contact`, `finance`, `finance-us`, `id`, `id-au`, `id-br`, `id-ca`, `id-es`, `id-fr`, `id-in`, `id-it`, `id-nl`, `id-pl`, `id-sg`, `id-uk`, `id-us`, `network`, `pii`, `region-eu`, `secret`, `secret-aws`. When omitted, the full built-in catalog is used.
3079
+ */
3080
+ entities?: (
3081
+ | "contact"
3082
+ | "finance"
3083
+ | "finance-us"
3084
+ | "id"
3085
+ | "id-au"
3086
+ | "id-br"
3087
+ | "id-ca"
3088
+ | "id-es"
3089
+ | "id-fr"
3090
+ | "id-in"
3091
+ | "id-it"
3092
+ | "id-nl"
3093
+ | "id-pl"
3094
+ | "id-sg"
3095
+ | "id-uk"
3096
+ | "id-us"
3097
+ | "network"
3098
+ | "pii"
3099
+ | "region-eu"
3100
+ | "secret"
3101
+ | "secret-aws"
3102
+ | "contact-email"
3103
+ | "contact-phone"
3104
+ | "finance-credit-card"
3105
+ | "finance-crypto-wallet"
3106
+ | "finance-cvv"
3107
+ | "finance-iban"
3108
+ | "finance-swift-bic"
3109
+ | "finance-us-aba-routing"
3110
+ | "finance-us-bank-account"
3111
+ | "id-au-abn"
3112
+ | "id-au-acn"
3113
+ | "id-au-medicare"
3114
+ | "id-au-tfn"
3115
+ | "id-br-cpf"
3116
+ | "id-ca-sin"
3117
+ | "id-es-nif"
3118
+ | "id-fr-nir"
3119
+ | "id-in-aadhaar"
3120
+ | "id-in-pan"
3121
+ | "id-it-fiscal-code"
3122
+ | "id-nl-bsn"
3123
+ | "id-pl-pesel"
3124
+ | "id-sg-nric"
3125
+ | "id-uk-nhs"
3126
+ | "id-uk-nino"
3127
+ | "id-us-itin"
3128
+ | "id-us-passport"
3129
+ | "id-us-ssn"
3130
+ | "network-ipv4"
3131
+ | "network-ipv6"
3132
+ | "network-mac"
3133
+ | "secret-anthropic"
3134
+ | "secret-aws-access-key"
3135
+ | "secret-aws-bedrock"
3136
+ | "secret-azure-client"
3137
+ | "secret-databricks"
3138
+ | "secret-digitalocean"
3139
+ | "secret-discord-webhook"
3140
+ | "secret-github"
3141
+ | "secret-gitlab"
3142
+ | "secret-google-api-key"
3143
+ | "secret-heroku"
3144
+ | "secret-hugging-face"
3145
+ | "secret-jwt"
3146
+ | "secret-mailchimp"
3147
+ | "secret-mailgun"
3148
+ | "secret-npm"
3149
+ | "secret-openai"
3150
+ | "secret-perplexity"
3151
+ | "secret-postman"
3152
+ | "secret-private-key"
3153
+ | "secret-pypi"
3154
+ | "secret-sendgrid"
3155
+ | "secret-sentry"
3156
+ | "secret-shopify"
3157
+ | "secret-slack"
3158
+ | "secret-square"
3159
+ | "secret-stripe"
3160
+ | "secret-telegram-bot"
3161
+ | "secret-terraform"
3162
+ | "secret-twilio"
3163
+ | "secret-zuplo"
3164
+ )[];
3165
+ /**
3166
+ * Additional customer-defined regex recognizers. Invalid patterns are logged and skipped rather than failing the response.
3167
+ */
3168
+ customPatterns?: DlpCustomPattern_2[];
3169
+ /**
3170
+ * What to do when sensitive data is detected. `mask` redacts matches before returning the response, `block` replaces the response with a 422 listing only the detected entity names, and `log` records a warning and returns the response unchanged.
3171
+ */
3172
+ action?: "mask" | "block" | "log";
3173
+ /**
3174
+ * The string that replaces detected values when `action` is `mask`.
3175
+ */
3176
+ mask?: string;
3177
+ /**
3178
+ * Minimum confidence (0-1) a match must reach to count as a finding. Context-dependent recognizers (for example `finance-us-bank-account` or `finance-us-aba-routing`) sit below the default threshold of 0.5 until a context word near the match boosts them above it. Lower the threshold to surface them everywhere; raise it to keep only prefix- or checksum-validated matches.
3179
+ */
3180
+ minConfidence?: number;
3181
+ /**
3182
+ * Override the set of scannable content-type prefixes. When omitted, the built-in text content-type allow-list (JSON, XML, form-encoded, text/*) is used.
3183
+ */
3184
+ contentTypes?: string[];
3185
+ }
3186
+
2902
3187
  /**
2903
3188
  * Default function to generate Hydrolix log entries
2904
3189
  * @public
@@ -2924,6 +3209,44 @@ export declare interface DispatchRequestLoggerEntries<T> {
2924
3209
  (entries: T[]): Promise<void>;
2925
3210
  }
2926
3211
 
3212
+ declare interface DlpCustomPattern {
3213
+ /**
3214
+ * Identifier reported in findings and block details for this pattern.
3215
+ */
3216
+ name: string;
3217
+ /**
3218
+ * A JavaScript regular expression source string. Remember to escape backslashes for JSON (for example `\\d` for a digit).
3219
+ */
3220
+ pattern: string;
3221
+ /**
3222
+ * Base confidence (0-1) for matches of this pattern. The default of 0.85 is above the default detection threshold; combine a low value with `context` words for patterns that are only sensitive in context.
3223
+ */
3224
+ confidence?: number;
3225
+ /**
3226
+ * Context words that boost a match's confidence by 0.45 when one appears near the match (in the surrounding field, label, or key).
3227
+ */
3228
+ context?: string[];
3229
+ }
3230
+
3231
+ declare interface DlpCustomPattern_2 {
3232
+ /**
3233
+ * Identifier reported in findings and block details for this pattern.
3234
+ */
3235
+ name: string;
3236
+ /**
3237
+ * A JavaScript regular expression source string. Remember to escape backslashes for JSON (for example `\\d` for a digit).
3238
+ */
3239
+ pattern: string;
3240
+ /**
3241
+ * Base confidence (0-1) for matches of this pattern. The default of 0.85 is above the default detection threshold; combine a low value with `context` words for patterns that are only sensitive in context.
3242
+ */
3243
+ confidence?: number;
3244
+ /**
3245
+ * Context words that boost a match's confidence by 0.45 when one appears near the match (in the surrounding field, label, or key).
3246
+ */
3247
+ context?: string[];
3248
+ }
3249
+
2927
3250
  declare interface DynaTraceLoggingOptions {
2928
3251
  url: string;
2929
3252
  apiToken: string;
@@ -1462,7 +1462,9 @@ export declare interface McpEntraOAuthInboundPolicyOptions {
1462
1462
  /**
1463
1463
  * Activates the MCP Gateway internal routes (OAuth authorization server,
1464
1464
  * upstream connection management, well-known metadata) on the runtime router.
1465
- * The plugin is a no-op when no MCP-related policy is present.
1465
+ * When no MCP-related policy is present the plugin registers no routes; it
1466
+ * still records `plugin.mcp-gateway` feature usage on construction so gateway
1467
+ * adoption is visible in telemetry regardless of route configuration.
1466
1468
  *
1467
1469
  * Importing from `@zuplo/runtime/mcp-gateway` is the opt-in: the runtime core
1468
1470
  * does not statically reference any MCP gateway code, so unrelated projects
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/runtime",
3
3
  "type": "module",
4
- "version": "6.70.69",
4
+ "version": "6.70.70",
5
5
  "repository": "https://github.com/zuplo/zuplo",
6
6
  "author": "Zuplo, Inc.",
7
7
  "exports": {
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * protobuf.js v7.6.2 (c) 2016, daniel wirtz
3
- * compiled sat, 30 may 2026 21:57:57 utc
2
+ * protobuf.js v7.6.3 (c) 2016, daniel wirtz
3
+ * compiled tue, 09 jun 2026 20:47:47 utc
4
4
  * licensed under the bsd-3-clause license
5
5
  * see: https://github.com/dcodeio/protobuf.js for details
6
6
  */
@@ -1273,14 +1273,15 @@ converter.fromObject = function fromObject(mtype) {
1273
1273
  var fields = mtype.fieldsArray;
1274
1274
  var gen = util.codegen(["d", "n"], mtype.name + "$fromObject")
1275
1275
  ("if(d instanceof this.ctor)")
1276
- ("return d")
1276
+ ("return d");
1277
+ if (!fields.length) return gen
1278
+ ("return new this.ctor");
1279
+ gen
1277
1280
  ("if(!util.isObject(d))")
1278
1281
  ("throw TypeError(%j)", mtype.fullName + ": object expected")
1279
1282
  ("if(n===undefined)n=0")
1280
1283
  ("if(n>util.recursionLimit)")
1281
1284
  ("throw Error(\"maximum nesting depth exceeded\")");
1282
- if (!fields.length) return gen
1283
- ("return new this.ctor");
1284
1285
  gen
1285
1286
  ("var m=new this.ctor");
1286
1287
  for (var i = 0; i < fields.length; ++i) {
@@ -1468,7 +1469,7 @@ converter.toObject = function toObject(mtype) {
1468
1469
  genValuePartial_toObject(gen, field, /* sorted */ index, prop + "[j]")
1469
1470
  ("}");
1470
1471
  } else { gen
1471
- ("if(m%s!=null&&m.hasOwnProperty(%j)){", prop, field.name); // !== undefined && !== null
1472
+ ("if(m%s!=null&&Object.hasOwnProperty.call(m,%j)){", prop, field.name); // !== undefined && !== null
1472
1473
  genValuePartial_toObject(gen, field, /* sorted */ index, prop);
1473
1474
  if (field.partOf) gen
1474
1475
  ("if(o.oneofs)")
@@ -1610,7 +1611,7 @@ function decoder(mtype) {
1610
1611
  for (i = 0; i < mtype._fieldsArray.length; ++i) {
1611
1612
  var rfield = mtype._fieldsArray[i];
1612
1613
  if (rfield.required) gen
1613
- ("if(!m.hasOwnProperty(%j))", rfield.name)
1614
+ ("if(!Object.hasOwnProperty.call(m,%j))", rfield.name)
1614
1615
  ("throw util.ProtocolError(%j,{instance:m})", missing(rfield));
1615
1616
  }
1616
1617
 
@@ -5263,8 +5264,6 @@ var Method = require(22),
5263
5264
  util = require(35),
5264
5265
  rpc = require(30);
5265
5266
 
5266
- var reservedRe = util.patterns.reservedRe;
5267
-
5268
5267
  /**
5269
5268
  * Constructs a new service instance.
5270
5269
  * @classdesc Reflected service.
@@ -5439,11 +5438,11 @@ Service.prototype.create = function create(rpcImpl, requestDelimited, responseDe
5439
5438
  var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited);
5440
5439
  for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) {
5441
5440
  var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\w_]/g, "");
5442
- rpcService[methodName] = util.codegen(["r","c"], reservedRe.test(methodName) ? methodName + "_" : methodName)("return this.rpcCall(m,q,s,r,c)")({
5443
- m: method,
5444
- q: method.resolvedRequestType.ctor,
5445
- s: method.resolvedResponseType.ctor
5446
- });
5441
+ rpcService[methodName] = (function(method, requestType, responseType) {
5442
+ return function rpcMethod(request, callback) {
5443
+ return rpc.Service.prototype.rpcCall.call(this, method, requestType, responseType, request, callback);
5444
+ };
5445
+ })(method, method.resolvedRequestType.ctor, method.resolvedResponseType.ctor);
5447
5446
  }
5448
5447
  return rpcService;
5449
5448
  };
@@ -5824,7 +5823,7 @@ Type.prototype.add = function add(object) {
5824
5823
  throw Error("duplicate id " + object.id + " in " + this);
5825
5824
  if (this.isReservedId(object.id))
5826
5825
  throw Error("id " + object.id + " is reserved in " + this);
5827
- if (this.isReservedName(object.name))
5826
+ if (this.isReservedName(object.name) || object.name.charAt(0) === "$")
5828
5827
  throw Error("name '" + object.name + "' is reserved in " + this);
5829
5828
  if (object.name === "__proto__")
5830
5829
  return this;
@@ -5837,6 +5836,8 @@ Type.prototype.add = function add(object) {
5837
5836
  return clearCache(this);
5838
5837
  }
5839
5838
  if (object instanceof OneOf) {
5839
+ if (object.name.charAt(0) === "$")
5840
+ throw Error("name '" + object.name + "' is reserved in " + this);
5840
5841
  if (object.name === "__proto__")
5841
5842
  return this;
5842
5843
  if (!this.oneofs)
@@ -6847,7 +6848,7 @@ util.isset =
6847
6848
  */
6848
6849
  util.isSet = function isSet(obj, prop) {
6849
6850
  var value = obj[prop];
6850
- if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins
6851
+ if (value != null && Object.hasOwnProperty.call(obj, prop)) // eslint-disable-line eqeqeq
6851
6852
  return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;
6852
6853
  return false;
6853
6854
  };
@@ -7371,7 +7372,7 @@ function verifier(mtype) {
7371
7372
  ref = "m" + util.safeProp(field.name);
7372
7373
 
7373
7374
  if (field.optional) gen
7374
- ("if(%s!=null&&m.hasOwnProperty(%j)){", ref, field.name); // !== undefined && !== null
7375
+ ("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){", ref, field.name); // !== undefined && !== null
7375
7376
 
7376
7377
  // map fields
7377
7378
  if (field.map) { gen