@postman-cse/onboarding-bootstrap 2.1.0 → 2.1.2

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/action.cjs CHANGED
@@ -298358,9 +298358,19 @@ function collectParameterChecks(root, pathItem, operation, version2, operationId
298358
298358
  if (defaultSerialization) warnings.push(`CONTRACT_SCHEMA_NOT_COMPILED: parameter ${location2}:${name} schema on ${operationId} skipped (${packed.unsupported})`);
298359
298359
  continue;
298360
298360
  }
298361
- if (location2 === "path" && !pathTemplate.split("/").includes(`{${name}}`)) {
298362
- warnings.push(`CONTRACT_PATH_PARAM_COMPOUND_SEGMENT_NOT_VALIDATED: path parameter ${name} of ${operationId} is embedded in a compound path segment and is not schema-validated`);
298363
- continue;
298361
+ if (location2 === "path") {
298362
+ const containingSegment = pathTemplate.split("/").find((segment) => segment.includes(`{${name}}`));
298363
+ if (containingSegment !== void 0 && containingSegment !== `{${name}}`) {
298364
+ const segmentParts = containingSegment.split(/(\{[^}]+\})/).filter(Boolean);
298365
+ let extractable = true;
298366
+ for (let partIndex = 0; partIndex < segmentParts.length - 1; partIndex += 1) {
298367
+ if (/^\{[^}]+\}$/.test(segmentParts[partIndex]) && /^\{[^}]+\}$/.test(segmentParts[partIndex + 1])) extractable = false;
298368
+ }
298369
+ if (!extractable) {
298370
+ warnings.push(`CONTRACT_PATH_PARAM_COMPOUND_SEGMENT_NOT_VALIDATED: path parameter ${name} of ${operationId} is in an ambiguous adjacent-parameter path segment and is not schema-validated`);
298371
+ continue;
298372
+ }
298373
+ }
298364
298374
  }
298365
298375
  const scalarSchema = packedScalarSchema(packed);
298366
298376
  if (scalarSchema !== void 0) {
@@ -299080,7 +299090,7 @@ function createContractScript(operation, warnings = []) {
299080
299090
  ' function requestPathSegments() { var raw = ""; try { raw = typeof pm.request.url.getPath === "function" ? String(pm.request.url.getPath() || "") : ""; } catch (ignored) {} if (!raw) { var path = pm.request.url.path; raw = Array.isArray(path) ? "/" + path.join("/") : String(path || ""); } return raw.split("?")[0].split("#")[0].split("/").filter(function (segment) { return segment.length > 0; }); }',
299081
299091
  // Server path prefixes sit ahead of the template segments, so the
299082
299092
  // template aligns against the trailing request segments.
299083
- ' function pathParamValue(name) { var template = String(contract.path).split("/").filter(function (segment) { return segment.length > 0; }); var actual = requestPathSegments(); var offset = actual.length - template.length; if (offset < 0) return undefined; for (var i = 0; i < template.length; i += 1) { if (template[i] === "{" + name + "}") { var segment = actual[offset + i]; try { return decodeURIComponent(segment); } catch (ignored) { return segment; } } } return undefined; }',
299093
+ ' function pathParamValue(name) { var template = String(contract.path).split("/").filter(function (segment) { return segment.length > 0; }); var actual = requestPathSegments(); var offset = actual.length - template.length; if (offset < 0) return undefined; var token = "{" + name + "}"; for (var i = 0; i < template.length; i += 1) { var seg = template[i]; var actualSeg = actual[offset + i]; if (actualSeg === undefined) continue; if (seg === token) { try { return decodeURIComponent(actualSeg); } catch (ignored) { return actualSeg; } } if (seg.indexOf(token) === -1) continue; var chunks = [], j = 0, bad = false; while (j < seg.length) { if (seg.charAt(j) === "{") { var close = seg.indexOf("}", j); if (close === -1) { bad = true; break; } chunks.push({ p: seg.slice(j + 1, close) }); j = close + 1; } else { var nb = seg.indexOf("{", j); var lit = nb === -1 ? seg.slice(j) : seg.slice(j, nb); chunks.push({ l: lit }); j = nb === -1 ? seg.length : nb; } } if (bad) return undefined; var pos = 0, found, ok = true; for (var c = 0; c < chunks.length; c += 1) { var ch = chunks[c]; if (ch.l !== undefined) { if (actualSeg.indexOf(ch.l, pos) === pos) pos += ch.l.length; else { ok = false; break; } } else { var nextLit = (chunks[c + 1] && chunks[c + 1].l !== undefined) ? chunks[c + 1].l : undefined; var isLast = c === chunks.length - 1; var end; if (isLast) { end = actualSeg.length; } else if (nextLit === undefined) { ok = false; break; } else { var idx = actualSeg.indexOf(nextLit, pos + 1); if (idx === -1) { ok = false; break; } end = idx; } if (end <= pos) { ok = false; break; } if (ch.p === name) found = actualSeg.slice(pos, end); pos = end; } } if (ok && pos === actualSeg.length && found !== undefined) { try { return decodeURIComponent(found); } catch (ignored) { return found; } } } return undefined; }',
299084
299094
  ' function isPlaceholder(value) { var text = String(value).trim(); return /^<[^<>]*>$/.test(text) || text.indexOf("{{") !== -1; }',
299085
299095
  ' function splitDelimited(value, decode) { if (decode === "csv") return value.split(","); if (decode === "ssv") return value.split(/%20| /); return value.split(/%7C|\\|/i); }',
299086
299096
  " function decodeComponent(value) { try { return decodeURIComponent(value); } catch (ignored) { return value; } }",
@@ -299512,7 +299522,7 @@ function extractGitRepoUrl(value) {
299512
299522
  }
299513
299523
  var PostmanGatewayAssetsClient = class _PostmanGatewayAssetsClient {
299514
299524
  static GENERATION_LOCKED_MAX_RETRIES = 5;
299515
- static GENERATION_POLL_ATTEMPTS = 45;
299525
+ static GENERATION_POLL_ATTEMPTS = 90;
299516
299526
  static GENERATION_POLL_DELAY_MS = 2e3;
299517
299527
  gateway;
299518
299528
  sleep;
@@ -299887,6 +299897,40 @@ var PostmanGatewayAssetsClient = class _PostmanGatewayAssetsClient {
299887
299897
  const u = String(uid ?? "").trim();
299888
299898
  return u.includes("-") ? u.slice(u.indexOf("-") + 1) : u;
299889
299899
  }
299900
+ /**
299901
+ * PATCH a freshly-created item's `/scripts`, tolerating the two transient
299902
+ * failures this immediate-after-create write is prone to on the shared gateway:
299903
+ * - `404 RESOURCE_NOT_FOUND` — the create write returns the assigned id, but
299904
+ * an immediate PATCH can hit a replica that has not yet observed the create
299905
+ * (read-after-write lag, live-observed on org-mode teams).
299906
+ * - a downstream `5xx` (e.g. `500 ESOCKETTIMEDOUT`) — a Bifrost/gateway read
299907
+ * timeout, not a durable rejection.
299908
+ * `op:add /scripts` is idempotent (overwrites), so retrying either is safe.
299909
+ * This is a deeper, longer-backoff budget than the gateway client's inner
299910
+ * transient retry, to wait out a longer platform hiccup on this fragile write.
299911
+ * Non-transient errors (e.g. 4xx schema rejections) surface immediately.
299912
+ */
299913
+ async patchNewItemScripts(cid, itemId, scripts) {
299914
+ const maxAttempts = 6;
299915
+ for (let attempt = 0; attempt < maxAttempts; attempt += 1) {
299916
+ try {
299917
+ await this.gateway.requestJson({
299918
+ service: "collection",
299919
+ method: "patch",
299920
+ path: `/v3/collections/${cid}/items/${itemId}`,
299921
+ headers: { "X-Entity-Type": "http-request" },
299922
+ body: [{ op: "add", path: "/scripts", value: scripts }]
299923
+ });
299924
+ return;
299925
+ } catch (error2) {
299926
+ const retriable = error2 instanceof HttpError && (error2.status === 404 || error2.status >= 500);
299927
+ if (!retriable || attempt === maxAttempts - 1) {
299928
+ throw error2;
299929
+ }
299930
+ await this.sleep(Math.min(2e3, 300 * 2 ** attempt));
299931
+ }
299932
+ }
299933
+ }
299890
299934
  /**
299891
299935
  * Apply tag slugs via the dedicated `tagging` service:
299892
299936
  * `PUT /v1/tags/collections/:uid` (full uid), body `{ tags:[{ slug }] }` — the
@@ -300004,26 +300048,14 @@ var PostmanGatewayAssetsClient = class _PostmanGatewayAssetsClient {
300004
300048
  });
300005
300049
  const newItemId = String(asRecord7(created?.data)?.id ?? "").trim();
300006
300050
  if (!newItemId) return;
300007
- await this.gateway.requestJson({
300008
- service: "collection",
300009
- method: "patch",
300010
- path: `/v3/collections/${cid}/items/${newItemId}`,
300011
- headers: { "X-Entity-Type": "http-request" },
300012
- body: [
300013
- {
300014
- op: "add",
300015
- path: "/scripts",
300016
- value: toV3Scripts([
300017
- 'if (pm.environment.get("CI") === "true") { return; }',
300018
- "const body = pm.response.json();",
300019
- "if (body.SecretString) {",
300020
- " const secrets = JSON.parse(body.SecretString);",
300021
- " Object.entries(secrets).forEach(([k, v]) => pm.collectionVariables.set(k, v));",
300022
- "}"
300023
- ])
300024
- }
300025
- ]
300026
- });
300051
+ await this.patchNewItemScripts(cid, newItemId, toV3Scripts([
300052
+ 'if (pm.environment.get("CI") === "true") { return; }',
300053
+ "const body = pm.response.json();",
300054
+ "if (body.SecretString) {",
300055
+ " const secrets = JSON.parse(body.SecretString);",
300056
+ " Object.entries(secrets).forEach(([k, v]) => pm.collectionVariables.set(k, v));",
300057
+ "}"
300058
+ ]));
300027
300059
  }
300028
300060
  // --- workspace roles + member resolution (live-proven 2026-06-30) ---
300029
300061
  //
@@ -300182,26 +300214,14 @@ var PostmanGatewayAssetsClient = class _PostmanGatewayAssetsClient {
300182
300214
  });
300183
300215
  const newItemId = String(asRecord7(created?.data)?.id ?? "").trim();
300184
300216
  if (newItemId) {
300185
- await this.gateway.requestJson({
300186
- service: "collection",
300187
- method: "patch",
300188
- path: `/v3/collections/${cid}/items/${newItemId}`,
300189
- headers: { "X-Entity-Type": "http-request" },
300190
- body: [
300191
- {
300192
- op: "add",
300193
- path: "/scripts",
300194
- value: toV3Scripts([
300195
- 'if (pm.environment.get("CI") === "true") { return; }',
300196
- "const body = pm.response.json();",
300197
- "if (body.SecretString) {",
300198
- " const secrets = JSON.parse(body.SecretString);",
300199
- " Object.entries(secrets).forEach(([k, v]) => pm.collectionVariables.set(k, v));",
300200
- "}"
300201
- ])
300202
- }
300203
- ]
300204
- });
300217
+ await this.patchNewItemScripts(cid, newItemId, toV3Scripts([
300218
+ 'if (pm.environment.get("CI") === "true") { return; }',
300219
+ "const body = pm.response.json();",
300220
+ "if (body.SecretString) {",
300221
+ " const secrets = JSON.parse(body.SecretString);",
300222
+ " Object.entries(secrets).forEach(([k, v]) => pm.collectionVariables.set(k, v));",
300223
+ "}"
300224
+ ]));
300205
300225
  }
300206
300226
  }
300207
300227
  return plan.warnings;
@@ -301037,7 +301057,7 @@ function resolveActionVersion(explicit) {
301037
301057
  if (explicit) {
301038
301058
  return explicit;
301039
301059
  }
301040
- return "2.1.0" ? "2.1.0" : "unknown";
301060
+ return "2.1.2" ? "2.1.2" : "unknown";
301041
301061
  }
301042
301062
  function telemetryDisabled(env) {
301043
301063
  const flag = String(env.POSTMAN_ACTIONS_TELEMETRY ?? "").trim().toLowerCase();
@@ -313621,27 +313641,28 @@ function classifyNamedType(named) {
313621
313641
  function describeType(type) {
313622
313642
  let current = type;
313623
313643
  let nonNull = false;
313624
- let list = false;
313625
- let listItemNonNull = false;
313626
313644
  if ((0, import_graphql.isNonNullType)(current)) {
313627
313645
  nonNull = true;
313628
313646
  current = current.ofType;
313629
313647
  }
313630
- if ((0, import_graphql.isListType)(current)) {
313631
- list = true;
313648
+ const lists = [];
313649
+ while ((0, import_graphql.isListType)(current)) {
313632
313650
  current = current.ofType;
313651
+ let itemNonNull = false;
313633
313652
  if ((0, import_graphql.isNonNullType)(current)) {
313634
- listItemNonNull = true;
313653
+ itemNonNull = true;
313635
313654
  current = current.ofType;
313636
313655
  }
313656
+ lists.push({ itemNonNull });
313637
313657
  }
313638
313658
  const named = (0, import_graphql.getNamedType)(current);
313639
313659
  return {
313640
313660
  name: named.name,
313641
313661
  kind: classifyNamedType(named),
313642
313662
  nonNull,
313643
- list,
313644
- listItemNonNull
313663
+ list: lists.length > 0,
313664
+ listItemNonNull: lists.length > 0 ? lists[0].itemNonNull : false,
313665
+ lists
313645
313666
  };
313646
313667
  }
313647
313668
  function describeArgument(arg) {
@@ -313678,7 +313699,7 @@ function collectRootOperations(rootType, kind, schema, shapes) {
313678
313699
  }
313679
313700
  if (returns.kind === "union") {
313680
313701
  opWarnings.push(
313681
- `GQL_UNION_RETURN_NOT_SHAPE_ASSERTED: ${kind}.${fieldName} returns union ${returns.name}; only data.${fieldName} presence is asserted, not member-type fields`
313702
+ `GQL_UNION_MEMBER_FIELDS_NOT_EXPANDED: ${kind}.${fieldName} returns union ${returns.name}; its __typename is validated (object + declared member name) but member-specific fields are not expanded or asserted`
313682
313703
  );
313683
313704
  }
313684
313705
  if (returns.kind === "unknown") {
@@ -313742,9 +313763,12 @@ function parseGraphQLSchema(content, opts = {}) {
313742
313763
  }
313743
313764
  for (const operation of operations) warnings.push(...operation.warnings);
313744
313765
  const enumValues = {};
313766
+ const unionMembers = {};
313745
313767
  for (const namedType of Object.values(schema.getTypeMap())) {
313746
313768
  if ((0, import_graphql.isEnumType)(namedType)) {
313747
313769
  enumValues[namedType.name] = namedType.getValues().map((value) => value.name);
313770
+ } else if ((0, import_graphql.isUnionType)(namedType)) {
313771
+ unionMembers[namedType.name] = namedType.getTypes().map((member) => member.name).sort((x, y) => x.localeCompare(y));
313748
313772
  }
313749
313773
  }
313750
313774
  return {
@@ -313752,6 +313776,7 @@ function parseGraphQLSchema(content, opts = {}) {
313752
313776
  operations,
313753
313777
  objectShapes,
313754
313778
  enumValues,
313779
+ unionMembers,
313755
313780
  warnings
313756
313781
  };
313757
313782
  }
@@ -313759,6 +313784,7 @@ function parseGraphQLSchema(content, opts = {}) {
313759
313784
  // src/lib/protocols/graphql/selection.ts
313760
313785
  var SELECTION_DEPTH = 1;
313761
313786
  function selectFields(typeRef, index, depth) {
313787
+ if (typeRef.kind === "union") return [];
313762
313788
  if (typeRef.kind !== "object" && typeRef.kind !== "interface") return null;
313763
313789
  const shape = index.objectShapes[typeRef.name];
313764
313790
  if (!shape) return [];
@@ -313792,8 +313818,8 @@ var DEFAULT_URL = "{{baseUrl}}/graphql";
313792
313818
  function argTypeSdl(arg) {
313793
313819
  const ref = arg.type;
313794
313820
  let inner = ref.name;
313795
- if (ref.list) {
313796
- inner = ref.listItemNonNull ? `[${ref.name}!]` : `[${ref.name}]`;
313821
+ for (let i = ref.lists.length - 1; i >= 0; i -= 1) {
313822
+ inner = ref.lists[i].itemNonNull ? `[${inner}!]` : `[${inner}]`;
313797
313823
  }
313798
313824
  return ref.nonNull ? `${inner}!` : inner;
313799
313825
  }
@@ -313962,12 +313988,25 @@ function buildShapeAssertions(operation, index, warnings) {
313962
313988
  return emitValueAssertions("value", operation.returns, selection, operation.id, index, warnings);
313963
313989
  }
313964
313990
  function emitValueAssertions(accessor, ref, selection, ctx, index, warnings) {
313965
- if (ref.list) {
313966
- const elementRef = { ...ref, list: false };
313967
- const elementLines = emitValueAssertions("__el", elementRef, selection, `${ctx} (list element)`, index, warnings);
313991
+ if (ref.lists.length > 0) {
313992
+ const [outer, ...rest] = ref.lists;
313993
+ const innerRef = {
313994
+ ...ref,
313995
+ lists: rest,
313996
+ list: rest.length > 0,
313997
+ listItemNonNull: rest.length > 0 ? rest[0].itemNonNull : false
313998
+ };
313999
+ const elementLines = emitValueAssertions("__el", innerRef, selection, `${ctx} (list element)`, index, warnings);
313968
314000
  const lines = [`pm.expect(${accessor}, ${JSON.stringify(`${ctx}: expected a list`)}).to.be.an("array");`];
313969
- if (elementLines.length > 0) {
313970
- lines.push(`${accessor}.forEach(function (__el) {`, ...elementLines.map((line) => ` ${line}`), "});");
314001
+ const body = [];
314002
+ if (outer.itemNonNull) {
314003
+ body.push(`pm.expect(__el, ${JSON.stringify(`${ctx} (list element): a non-null list item ([T!]) was null`)}).to.not.be.null;`);
314004
+ body.push(...elementLines);
314005
+ } else if (elementLines.length > 0) {
314006
+ body.push("if (__el === null || __el === undefined) return;", ...elementLines);
314007
+ }
314008
+ if (body.length > 0) {
314009
+ lines.push(`${accessor}.forEach(function (__el) {`, ...body.map((line) => ` ${line}`), "});");
313971
314010
  }
313972
314011
  return lines;
313973
314012
  }
@@ -313985,8 +314024,22 @@ function emitValueAssertions(accessor, ref, selection, ctx, index, warnings) {
313985
314024
  return lines;
313986
314025
  }
313987
314026
  if (ref.kind === "union") {
313988
- warnings.push(`GQL_UNION_RETURN_NOT_SHAPE_ASSERTED: ${ctx} returns union ${ref.name}; only presence is asserted`);
313989
- return [];
314027
+ const members = index.unionMembers[ref.name];
314028
+ const objMsg = JSON.stringify(ctx + ": expected union " + ref.name + " value as an object");
314029
+ const presentMsg = JSON.stringify(ctx + ": union " + ref.name + " value must carry __typename");
314030
+ const stringMsg = JSON.stringify(ctx + ": union " + ref.name + " __typename must be a string");
314031
+ const lines = [
314032
+ "pm.expect(" + accessor + ", " + objMsg + ').to.be.an("object");',
314033
+ "pm.expect(" + accessor + ", " + presentMsg + ').to.have.property("__typename");',
314034
+ "pm.expect(" + accessor + " && " + accessor + ".__typename, " + stringMsg + ').to.be.a("string");'
314035
+ ];
314036
+ if (members && members.length > 0) {
314037
+ const memberMsg = JSON.stringify(ctx + ": __typename is not a declared member of union " + ref.name);
314038
+ lines.push("pm.expect(" + accessor + " && " + accessor + ".__typename, " + memberMsg + ").to.be.oneOf(" + JSON.stringify(members) + ");");
314039
+ } else {
314040
+ warnings.push("GQL_UNION_MEMBERS_UNKNOWN: " + ctx + " union " + ref.name + " member set was not resolved; only object + string __typename is asserted");
314041
+ }
314042
+ return lines;
313990
314043
  }
313991
314044
  warnings.push(`GQL_UNKNOWN_RETURN_TYPE: ${ctx} return type ${ref.name} could not be classified; only presence is asserted`);
313992
314045
  return [];
@@ -313997,6 +314050,7 @@ function emitFieldAssertions(objectAccessor, parentTypeName, field, ctx, index,
313997
314050
  const lines = [];
313998
314051
  if (field.type.nonNull) {
313999
314052
  lines.push(`pm.expect(${objectAccessor}, ${JSON.stringify(`${parentTypeName} is missing non-null field '${field.name}'`)}).to.have.property(${propName});`);
314053
+ lines.push(`pm.expect(${prop}, ${JSON.stringify(`${parentTypeName}.${field.name} is declared non-null but was null`)}).to.not.be.null;`);
314000
314054
  }
314001
314055
  const valueLines = emitValueAssertions(prop, field.type, field.selection, `${ctx}.${field.name}`, index, warnings);
314002
314056
  if (valueLines.length > 0) {
@@ -314102,19 +314156,25 @@ function asArray6(value) {
314102
314156
  }
314103
314157
  var SCALAR_JSON_TYPE = {
314104
314158
  double: { jsonType: "double" },
314105
- float: { jsonType: "double" },
314106
- int32: { jsonType: "number" },
314107
- sint32: { jsonType: "number" },
314108
- sfixed32: { jsonType: "number" },
314109
- fixed32: { jsonType: "number" },
314110
- uint32: { jsonType: "number" },
314111
- // 64-bit integers are JSON-encoded as strings by the proto JSON mapping and
314112
- // by protobufjs default toObject, so we assert `string`.
314113
- int64: { jsonType: "string" },
314114
- uint64: { jsonType: "string" },
314115
- sint64: { jsonType: "string" },
314116
- fixed64: { jsonType: "string" },
314117
- sfixed64: { jsonType: "string" },
314159
+ // proto float is float32; carry a format so the runtime enforces float32 range
314160
+ // (a finite double like 3.5e38 overflows float32 and must fail).
314161
+ float: { jsonType: "double", jsonFormat: "proto-float32" },
314162
+ // 32-bit integers JSON-encode as numbers; `intType` carries the exact protobuf
314163
+ // integer domain so the runtime range/sign-checks it (not just integrality).
314164
+ int32: { jsonType: "number", intType: "int32" },
314165
+ sint32: { jsonType: "number", intType: "sint32" },
314166
+ sfixed32: { jsonType: "number", intType: "sfixed32" },
314167
+ fixed32: { jsonType: "number", intType: "fixed32" },
314168
+ uint32: { jsonType: "number", intType: "uint32" },
314169
+ // 64-bit integers are JSON-encoded as strings by the proto JSON mapping and by
314170
+ // protobufjs default toObject; `intType` carries the exact domain so the runtime
314171
+ // lexically validates and RANGE-checks the string (string comparison avoids JS
314172
+ // double precision loss beyond 2^53).
314173
+ int64: { jsonType: "string", intType: "int64" },
314174
+ uint64: { jsonType: "string", intType: "uint64" },
314175
+ sint64: { jsonType: "string", intType: "sint64" },
314176
+ fixed64: { jsonType: "string", intType: "fixed64" },
314177
+ sfixed64: { jsonType: "string", intType: "sfixed64" },
314118
314178
  bool: { jsonType: "boolean" },
314119
314179
  string: { jsonType: "string" },
314120
314180
  // bytes are base64 strings in proto JSON.
@@ -314125,11 +314185,11 @@ var WELL_KNOWN_JSON_TYPE = {
314125
314185
  "google.protobuf.Duration": { jsonType: "string", jsonFormat: "proto-duration" },
314126
314186
  "google.protobuf.FieldMask": { jsonType: "string", jsonFormat: "proto-field-mask" },
314127
314187
  "google.protobuf.DoubleValue": { jsonType: "double", nullable: true },
314128
- "google.protobuf.FloatValue": { jsonType: "double", nullable: true },
314129
- "google.protobuf.Int32Value": { jsonType: "number", nullable: true },
314130
- "google.protobuf.UInt32Value": { jsonType: "number", nullable: true },
314131
- "google.protobuf.Int64Value": { jsonType: "string", nullable: true },
314132
- "google.protobuf.UInt64Value": { jsonType: "string", nullable: true },
314188
+ "google.protobuf.FloatValue": { jsonType: "double", jsonFormat: "proto-float32", nullable: true },
314189
+ "google.protobuf.Int32Value": { jsonType: "number", intType: "int32", nullable: true },
314190
+ "google.protobuf.UInt32Value": { jsonType: "number", intType: "uint32", nullable: true },
314191
+ "google.protobuf.Int64Value": { jsonType: "string", intType: "int64", nullable: true },
314192
+ "google.protobuf.UInt64Value": { jsonType: "string", intType: "uint64", nullable: true },
314133
314193
  "google.protobuf.BoolValue": { jsonType: "boolean", nullable: true },
314134
314194
  "google.protobuf.StringValue": { jsonType: "string", nullable: true },
314135
314195
  "google.protobuf.BytesValue": { jsonType: "string", jsonFormat: "proto-bytes", nullable: true },
@@ -314176,7 +314236,7 @@ function stripLeadingDot(name) {
314176
314236
  }
314177
314237
  function classifyValueType(protoType, resolved) {
314178
314238
  const wkt = WELL_KNOWN_JSON_TYPE[stripLeadingDot(protoType)];
314179
- if (wkt) return { jsonType: wkt.jsonType, jsonFormat: wkt.jsonFormat, nullable: wkt.nullable };
314239
+ if (wkt) return { jsonType: wkt.jsonType, jsonFormat: wkt.jsonFormat, nullable: wkt.nullable, intType: wkt.intType };
314180
314240
  if (resolved && Array.isArray(resolved.fieldsArray)) {
314181
314241
  return { jsonType: "object", messageType: stripLeadingDot(resolved.fullName) };
314182
314242
  }
@@ -314184,9 +314244,14 @@ function classifyValueType(protoType, resolved) {
314184
314244
  return { jsonType: "enum", enumType: stripLeadingDot(resolved.fullName) };
314185
314245
  }
314186
314246
  const scalar = SCALAR_JSON_TYPE[protoType];
314187
- if (scalar) return { jsonType: scalar.jsonType, jsonFormat: scalar.jsonFormat };
314247
+ if (scalar) return { jsonType: scalar.jsonType, jsonFormat: scalar.jsonFormat, intType: scalar.intType };
314188
314248
  return { jsonType: "unknown" };
314189
314249
  }
314250
+ function classifyMapKey(keyType) {
314251
+ if (keyType === "bool") return "boolean";
314252
+ if (keyType && /^(?:u?int|sint|s?fixed)(?:32|64)$/.test(keyType)) return keyType;
314253
+ return void 0;
314254
+ }
314190
314255
  function toLowerCamelCase(name) {
314191
314256
  return name.replace(/_+([a-zA-Z0-9])/g, (_match, char) => char.toUpperCase()).replace(/_+$/g, "");
314192
314257
  }
@@ -314215,6 +314280,7 @@ function fieldDescriptor(field, warnings, context) {
314215
314280
  if (value.jsonType === "unknown") {
314216
314281
  warnings.push(`PROTO_FIELD_TYPE_UNRESOLVED: map field ${context}.${field.name} has value type ${protoType} that could not be resolved; map values are not asserted`);
314217
314282
  }
314283
+ const mapKeyType = classifyMapKey(field.keyType);
314218
314284
  return {
314219
314285
  name: String(field.name),
314220
314286
  jsonName: protoJsonName(field),
@@ -314224,8 +314290,10 @@ function fieldDescriptor(field, warnings, context) {
314224
314290
  map: true,
314225
314291
  optional: Boolean(field.optional),
314226
314292
  required: Boolean(field.required),
314293
+ ...mapKeyType ? { mapKeyType } : {},
314227
314294
  ...value.jsonType !== "unknown" ? { mapValueType: value.jsonType } : {},
314228
314295
  ...value.jsonFormat ? { mapValueFormat: value.jsonFormat } : {},
314296
+ ...value.intType ? { mapValueIntType: value.intType } : {},
314229
314297
  ...value.enumType ? { mapValueEnumType: value.enumType } : {},
314230
314298
  ...value.messageType ? { mapValueMessageType: value.messageType } : {}
314231
314299
  };
@@ -314245,6 +314313,7 @@ function fieldDescriptor(field, warnings, context) {
314245
314313
  optional: Boolean(field.optional),
314246
314314
  required: Boolean(field.required),
314247
314315
  ...classified.nullable ? { nullable: true } : {},
314316
+ ...classified.intType ? { intType: classified.intType } : {},
314248
314317
  ...classified.messageType ? { messageType: classified.messageType } : {},
314249
314318
  ...classified.enumType ? { enumType: classified.enumType } : {}
314250
314319
  };
@@ -314480,13 +314549,16 @@ function buildShape(messageFullName, index, warnings, operationId, label, depth,
314480
314549
  jsonName: field.jsonName,
314481
314550
  jsonType: field.jsonType,
314482
314551
  ...field.jsonFormat ? { jsonFormat: field.jsonFormat } : {},
314552
+ ...field.intType ? { intType: field.intType } : {},
314483
314553
  repeated: field.repeated,
314484
314554
  map: field.map,
314485
314555
  required: field.required,
314486
314556
  ...field.nullable ? { nullable: true } : {},
314487
314557
  ...enumValues ? { enumValues } : {},
314558
+ ...field.mapKeyType ? { mapKeyType: field.mapKeyType } : {},
314488
314559
  ...field.mapValueType ? { mapValueType: field.mapValueType } : {},
314489
314560
  ...field.mapValueFormat ? { mapValueFormat: field.mapValueFormat } : {},
314561
+ ...field.mapValueIntType ? { mapValueIntType: field.mapValueIntType } : {},
314490
314562
  ...mapValueEnumValues ? { mapValueEnumValues } : {}
314491
314563
  };
314492
314564
  if (field.messageType && field.jsonType === "object" && !field.map) {
@@ -314553,18 +314625,38 @@ function createGrpcScript(spec) {
314553
314625
  ' if (expected === "any") return true;',
314554
314626
  " return true;",
314555
314627
  "}",
314628
+ 'var GRPC_INT_SPECS = { int32:{s:true,b:32,min:"-2147483648",max:"2147483647"}, sint32:{s:true,b:32,min:"-2147483648",max:"2147483647"}, sfixed32:{s:true,b:32,min:"-2147483648",max:"2147483647"}, uint32:{s:false,b:32,min:"0",max:"4294967295"}, fixed32:{s:false,b:32,min:"0",max:"4294967295"}, int64:{s:true,b:64,min:"-9223372036854775808",max:"9223372036854775807"}, sint64:{s:true,b:64,min:"-9223372036854775808",max:"9223372036854775807"}, sfixed64:{s:true,b:64,min:"-9223372036854775808",max:"9223372036854775807"}, uint64:{s:false,b:64,min:"0",max:"18446744073709551615"}, fixed64:{s:false,b:64,min:"0",max:"18446744073709551615"} };',
314629
+ 'function grpcDecStr(n) { var s = String(n); return (s.indexOf("e") === -1 && s.indexOf("E") === -1 && s.indexOf(".") === -1) ? s : null; }',
314630
+ 'function grpcCmpIntStr(a, b) { var na = a.charAt(0) === "-", nb = b.charAt(0) === "-"; if (na !== nb) return na ? -1 : 1; var aa = (na ? a.slice(1) : a).replace(/^0+(?=[0-9])/, ""); var bb = (nb ? b.slice(1) : b).replace(/^0+(?=[0-9])/, ""); var mag; if (aa.length !== bb.length) mag = aa.length < bb.length ? -1 : 1; else mag = aa < bb ? -1 : (aa > bb ? 1 : 0); return na ? -mag : mag; }',
314631
+ 'function grpcNormIntStr(s) { var neg = false; if (s.charAt(0) === "-") { neg = true; s = s.slice(1); } else if (s.charAt(0) === "+") { s = s.slice(1); } var ei = s.indexOf("e"); if (ei === -1) ei = s.indexOf("E"); var exp = 0; if (ei !== -1) { exp = parseInt(s.slice(ei + 1), 10); s = s.slice(0, ei); } var dot = s.indexOf("."); var intp = dot === -1 ? s : s.slice(0, dot); var frac = dot === -1 ? "" : s.slice(dot + 1); var digits = intp + frac; if (digits.length === 0) return null; if (/^0+$/.test(digits)) return "0"; if (exp >= 0) { var intpSize = intp === "0" ? 0 : intp.length; if (intpSize + exp > 20) return null; } var netExp = exp - frac.length; var out; if (netExp >= 0) { if (digits.length + netExp > 40) return null; out = digits; for (var z = 0; z < netExp; z++) out += "0"; } else { var cut = -netExp; var keepLen = digits.length - cut; var dropped = keepLen <= 0 ? digits : digits.slice(keepLen); for (var d = 0; d < dropped.length; d++) { if (dropped.charAt(d) !== "0") return null; } out = keepLen <= 0 ? "0" : digits.slice(0, keepLen); } var st = 0; while (st < out.length - 1 && out.charAt(st) === "0") st++; out = out.slice(st); if (out === "0") return "0"; if (out.length > 40) return null; return neg ? "-" + out : out; }',
314632
+ "function matchesInt(intType, value) {",
314633
+ " var spec = GRPC_INT_SPECS[intType]; if (!spec) return true;",
314634
+ " var num, canonical;",
314635
+ ' if (typeof value === "number") { if (!Number.isFinite(value) || !Number.isInteger(value)) return false; num = value; canonical = grpcDecStr(value); }',
314636
+ ' else if (typeof value === "string") { if (!/^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$/.test(value)) return false; canonical = grpcNormIntStr(value); if (canonical === null) return false; num = Number(value); }',
314637
+ " else { return false; }",
314638
+ ' if (canonical === "-0") canonical = "0";',
314639
+ ' if (!spec.s && ((canonical !== null && canonical.charAt(0) === "-") || num < 0)) return false;',
314640
+ " if (spec.b === 32) return num >= Number(spec.min) && num <= Number(spec.max);",
314641
+ " if (canonical !== null) return grpcCmpIntStr(canonical, spec.min) >= 0 && grpcCmpIntStr(canonical, spec.max) <= 0;",
314642
+ " return false;",
314643
+ "}",
314644
+ 'function matchesIntKey(intType, key) { var spec = GRPC_INT_SPECS[intType]; if (!spec) return true; if (!(spec.s ? /^[+-]?[0-9]+$/ : /^[0-9]+$/).test(key)) return false; var neg = key.charAt(0) === "-"; var body = (key.charAt(0) === "+" || key.charAt(0) === "-") ? key.slice(1) : key; if (body.length === 0) return false; var canon = neg ? "-" + body : body; return grpcCmpIntStr(canon, spec.min) >= 0 && grpcCmpIntStr(canon, spec.max) <= 0; }',
314645
+ "function matchesEnumNumber(n) { return Number.isInteger(n) && n >= -2147483648 && n <= 2147483647; }",
314556
314646
  "function daysFromCivil(y, m, d) { y -= m <= 2 ? 1 : 0; var era = Math.floor(y / 400); var yoe = y - era * 400; var mp = m + (m > 2 ? -3 : 9); var doy = Math.floor((153 * mp + 2) / 5) + d - 1; var doe = yoe * 365 + Math.floor(yoe / 4) - Math.floor(yoe / 100) + doy; return era * 146097 + doe - 719468; }",
314557
314647
  "function validDate(y, m, d) { if (y < 1 || y > 9999 || m < 1 || m > 12 || d < 1) return false; var mdays = [31, ((y % 4 === 0 && y % 100 !== 0) || y % 400 === 0) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; return d <= mdays[m - 1]; }",
314558
314648
  'function validProtoTimestamp(value) { if (typeof value !== "string") return false; var m = value.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\\.([0-9]{1,9}))?(Z|[+-][0-9]{2}:[0-9]{2})$/); if (!m) return false; var y = Number(m[1]), mo = Number(m[2]), d = Number(m[3]), h = Number(m[4]), mi = Number(m[5]), s = Number(m[6]); if (!validDate(y, mo, d) || h > 23 || mi > 59 || s > 59) return false; var off = 0; if (m[8] !== "Z") { var sign = m[8][0] === "-" ? -1 : 1; var oh = Number(m[8].slice(1, 3)), om = Number(m[8].slice(4, 6)); if (oh > 23 || om > 59) return false; off = sign * (oh * 3600 + om * 60); } var sec = daysFromCivil(y, mo, d) * 86400 + h * 3600 + mi * 60 + s - off; return sec >= -62135596800 && sec <= 253402300799; }',
314559
314649
  'function validProtoDuration(value) { if (typeof value !== "string") return false; var m = value.match(/^[+-]?(?:(0|[1-9][0-9]*)(?:\\.[0-9]{0,9})?|\\.[0-9]{0,9})s$/); if (!m) return false; return !m[1] || Number(m[1]) <= 315576000000; }',
314560
314650
  'function validProtoFieldMask(value) { if (typeof value !== "string") return false; if (value === "") return true; var paths = value.split(","); for (var i = 0; i < paths.length; i++) { if (!/^[a-z][A-Za-z0-9]*(\\.[a-z][A-Za-z0-9]*)*$/.test(paths[i])) return false; } return true; }',
314561
314651
  'function validProtoBytes(value) { if (typeof value !== "string") return false; if (!/^(?:[A-Za-z0-9+/]*|[A-Za-z0-9_-]*)={0,2}$/.test(value)) return false; var firstPad = value.indexOf("="); if (firstPad !== -1 && firstPad < value.length - (value.endsWith("==") ? 2 : 1)) return false; var pad = value.endsWith("==") ? 2 : value.endsWith("=") ? 1 : 0; var raw = value.length - pad; if (raw % 4 === 1) return false; return pad === 0 || (raw + pad) % 4 === 0 && pad === (4 - raw % 4) % 4; }',
314652
+ 'function validProtoFloat32(value) { if (value === "NaN" || value === "Infinity" || value === "-Infinity") return true; var n = typeof value === "number" ? value : Number(value); if (!Number.isFinite(n)) return false; return Number.isFinite(Math.fround(n)); }',
314562
314653
  "function matchesFormat(format, value) {",
314563
314654
  " if (!format) return true;",
314564
314655
  ' if (format === "proto-timestamp") return validProtoTimestamp(value);',
314565
314656
  ' if (format === "proto-duration") return validProtoDuration(value);',
314566
314657
  ' if (format === "proto-field-mask") return validProtoFieldMask(value);',
314567
314658
  ' if (format === "proto-bytes") return validProtoBytes(value);',
314659
+ ' if (format === "proto-float32") return validProtoFloat32(value);',
314568
314660
  " return true;",
314569
314661
  "}",
314570
314662
  "function formatLabel(format) {",
@@ -314572,6 +314664,7 @@ function createGrpcScript(spec) {
314572
314664
  ' if (format === "proto-duration") return "a valid ProtoJSON Duration";',
314573
314665
  ' if (format === "proto-field-mask") return "a valid ProtoJSON FieldMask";',
314574
314666
  ' if (format === "proto-bytes") return "valid ProtoJSON base64 bytes";',
314667
+ ' if (format === "proto-float32") return "a float32-representable number";',
314575
314668
  ' return format || "valid ProtoJSON";',
314576
314669
  "}",
314577
314670
  // Recursive shape checker: validates fields (with nested message descent,
@@ -314585,14 +314678,15 @@ function createGrpcScript(spec) {
314585
314678
  ' if (field.required && !present) { pm.expect.fail("gRPC response is missing required field " + label); return; }',
314586
314679
  " if (!present) return;",
314587
314680
  " var value = obj[key];",
314588
- " if (field.nullable && value === null) return;",
314681
+ " if (value === null) return;",
314589
314682
  " if (field.repeated) {",
314590
314683
  ' if (!matchesScalar("array", value)) { pm.expect.fail("gRPC field " + label + " must be a repeated (array) value but was " + jsonTypeOf(value)); return; }',
314591
314684
  " for (var i = 0; i < value.length; i++) {",
314592
314685
  ' var elem = value[i]; var elemLabel = label + "[" + i + "]";',
314593
314686
  ' if (field.shape) { if (!matchesScalar("object", elem)) { pm.expect.fail("gRPC repeated field " + elemLabel + " must be an object but was " + jsonTypeOf(elem)); } else { grpcCheckShape(elem, field.shape, elemLabel + "."); } continue; }',
314594
- ' if (field.enumValues && field.enumValues.length > 0) { if (typeof elem === "number") { if (!Number.isInteger(elem)) pm.expect.fail("gRPC repeated enum field " + elemLabel + " must be an integer but was " + elem); continue; } if (typeof elem !== "string") { pm.expect.fail("gRPC repeated enum field " + elemLabel + " must be a string or number but was " + jsonTypeOf(elem)); } else if (field.enumValues.indexOf(elem) === -1) { pm.expect.fail("gRPC repeated enum field " + elemLabel + " has value " + elem + " not in [" + field.enumValues.join(", ") + "]"); } continue; }',
314687
+ ' if (field.enumValues && field.enumValues.length > 0) { if (typeof elem === "number") { if (!matchesEnumNumber(elem)) pm.expect.fail("gRPC repeated enum field " + elemLabel + " must be an int32-range integer but was " + elem); continue; } if (typeof elem !== "string") { pm.expect.fail("gRPC repeated enum field " + elemLabel + " must be a string or number but was " + jsonTypeOf(elem)); } else if (field.enumValues.indexOf(elem) === -1) { pm.expect.fail("gRPC repeated enum field " + elemLabel + " has value " + elem + " not in [" + field.enumValues.join(", ") + "]"); } continue; }',
314595
314688
  ' if (field.jsonType === "any") continue;',
314689
+ ' if (field.intType) { if (!matchesInt(field.intType, elem)) pm.expect.fail("gRPC repeated field " + elemLabel + " must be a valid " + field.intType + " (in range) but was " + JSON.stringify(elem)); continue; }',
314596
314690
  ' if (!matchesScalar(field.jsonType, elem)) pm.expect.fail("gRPC repeated field " + elemLabel + " must be " + field.jsonType + " but was " + jsonTypeOf(elem));',
314597
314691
  ' else if (!matchesFormat(field.jsonFormat, elem)) pm.expect.fail("gRPC repeated field " + elemLabel + " must be " + formatLabel(field.jsonFormat));',
314598
314692
  " }",
@@ -314600,17 +314694,28 @@ function createGrpcScript(spec) {
314600
314694
  " }",
314601
314695
  " if (field.map) {",
314602
314696
  ' if (!matchesScalar("object", value)) { pm.expect.fail("gRPC map field " + label + " must be an object but was " + jsonTypeOf(value)); return; }',
314603
- ' if (field.mapValueType) { var keys = Object.keys(value); for (var k = 0; k < keys.length; k++) { var mv = value[keys[k]], mvLabel = label + "[" + keys[k] + "]"; if (field.mapValueShape && matchesScalar("object", mv)) { grpcCheckShape(mv, field.mapValueShape, mvLabel + "."); } else if (field.mapValueEnumValues && field.mapValueEnumValues.length > 0) { if (typeof mv === "number") { if (!Number.isInteger(mv)) pm.expect.fail("gRPC map enum value " + mvLabel + " must be an integer but was " + mv); } else if (typeof mv !== "string") { pm.expect.fail("gRPC map enum value " + mvLabel + " must be a string or number but was " + jsonTypeOf(mv)); } else if (field.mapValueEnumValues.indexOf(mv) === -1) { pm.expect.fail("gRPC map enum value " + mvLabel + " has value " + mv + " not in [" + field.mapValueEnumValues.join(", ") + "]"); } } else if (!matchesScalar(field.mapValueType, mv)) { pm.expect.fail("gRPC map value " + mvLabel + " must be " + field.mapValueType + " but was " + jsonTypeOf(mv)); } else if (!matchesFormat(field.mapValueFormat, mv)) { pm.expect.fail("gRPC map value " + mvLabel + " must be " + formatLabel(field.mapValueFormat)); } } }',
314697
+ " var keys = Object.keys(value);",
314698
+ " for (var k = 0; k < keys.length; k++) {",
314699
+ ' var mk = keys[k], mv = value[mk], mvLabel = label + "[" + mk + "]";',
314700
+ ' if (field.mapKeyType === "boolean") { if (mk !== "true" && mk !== "false") pm.expect.fail("gRPC map key " + mvLabel + " must be the string true or false but was " + mk); }',
314701
+ ' else if (field.mapKeyType) { if (!matchesIntKey(field.mapKeyType, mk)) pm.expect.fail("gRPC map key " + mvLabel + " must be a valid " + field.mapKeyType + " string (in range) but was " + mk); }',
314702
+ ' if (field.mapValueShape && matchesScalar("object", mv)) { grpcCheckShape(mv, field.mapValueShape, mvLabel + "."); }',
314703
+ ' else if (field.mapValueIntType) { if (!matchesInt(field.mapValueIntType, mv)) pm.expect.fail("gRPC map value " + mvLabel + " must be a valid " + field.mapValueIntType + " (in range) but was " + JSON.stringify(mv)); }',
314704
+ ' else if (field.mapValueEnumValues && field.mapValueEnumValues.length > 0) { if (typeof mv === "number") { if (!matchesEnumNumber(mv)) pm.expect.fail("gRPC map enum value " + mvLabel + " must be an int32-range integer but was " + mv); } else if (typeof mv !== "string") { pm.expect.fail("gRPC map enum value " + mvLabel + " must be a string or number but was " + jsonTypeOf(mv)); } else if (field.mapValueEnumValues.indexOf(mv) === -1) { pm.expect.fail("gRPC map enum value " + mvLabel + " has value " + mv + " not in [" + field.mapValueEnumValues.join(", ") + "]"); } }',
314705
+ ' else if (field.mapValueType && !matchesScalar(field.mapValueType, mv)) { pm.expect.fail("gRPC map value " + mvLabel + " must be " + field.mapValueType + " but was " + jsonTypeOf(mv)); }',
314706
+ ' else if (field.mapValueType && !matchesFormat(field.mapValueFormat, mv)) { pm.expect.fail("gRPC map value " + mvLabel + " must be " + formatLabel(field.mapValueFormat)); }',
314707
+ " }",
314604
314708
  " return;",
314605
314709
  " }",
314606
314710
  " if (field.enumValues && field.enumValues.length > 0) {",
314607
- ' if (typeof value === "number") { if (!Number.isInteger(value)) pm.expect.fail("gRPC enum field " + label + " must be an integer but was " + value); return; }',
314711
+ ' if (typeof value === "number") { if (!matchesEnumNumber(value)) pm.expect.fail("gRPC enum field " + label + " must be an int32-range integer but was " + value); return; }',
314608
314712
  ' if (typeof value !== "string") { pm.expect.fail("gRPC enum field " + label + " must be a string or number but was " + jsonTypeOf(value)); return; }',
314609
314713
  ' if (field.enumValues.indexOf(value) === -1) pm.expect.fail("gRPC enum field " + label + " has value " + value + " not in [" + field.enumValues.join(", ") + "]");',
314610
314714
  " return;",
314611
314715
  " }",
314612
314716
  ' if (field.jsonType === "any") return;',
314613
314717
  ' if (field.shape) { if (!matchesScalar("object", value)) { pm.expect.fail("gRPC field " + label + " must be an object but was " + jsonTypeOf(value)); return; } grpcCheckShape(value, field.shape, label + "."); return; }',
314718
+ ' if (field.intType) { if (!matchesInt(field.intType, value)) pm.expect.fail("gRPC field " + label + " must be a valid " + field.intType + " (in range) but was " + JSON.stringify(value)); return; }',
314614
314719
  ' if (!matchesScalar(field.jsonType, value)) pm.expect.fail("gRPC field " + label + " must be " + field.jsonType + " but was " + jsonTypeOf(value));',
314615
314720
  ' else if (!matchesFormat(field.jsonFormat, value)) pm.expect.fail("gRPC field " + label + " must be " + formatLabel(field.jsonFormat));',
314616
314721
  "}",
@@ -314660,6 +314765,103 @@ function methodPathOf(item) {
314660
314765
  const value = payload?.methodPath;
314661
314766
  return typeof value === "string" ? value : "";
314662
314767
  }
314768
+ var GRPC_INT_SPECS = {
314769
+ int32: { signed: true, bits: 32, min: "-2147483648", max: "2147483647" },
314770
+ sint32: { signed: true, bits: 32, min: "-2147483648", max: "2147483647" },
314771
+ sfixed32: { signed: true, bits: 32, min: "-2147483648", max: "2147483647" },
314772
+ uint32: { signed: false, bits: 32, min: "0", max: "4294967295" },
314773
+ fixed32: { signed: false, bits: 32, min: "0", max: "4294967295" },
314774
+ int64: { signed: true, bits: 64, min: "-9223372036854775808", max: "9223372036854775807" },
314775
+ sint64: { signed: true, bits: 64, min: "-9223372036854775808", max: "9223372036854775807" },
314776
+ sfixed64: { signed: true, bits: 64, min: "-9223372036854775808", max: "9223372036854775807" },
314777
+ uint64: { signed: false, bits: 64, min: "0", max: "18446744073709551615" },
314778
+ fixed64: { signed: false, bits: 64, min: "0", max: "18446744073709551615" }
314779
+ };
314780
+ function grpcDecStr(n) {
314781
+ const s = String(n);
314782
+ return s.indexOf("e") === -1 && s.indexOf("E") === -1 && s.indexOf(".") === -1 ? s : null;
314783
+ }
314784
+ function grpcCmpIntStr(a, b) {
314785
+ const na = a.charAt(0) === "-";
314786
+ const nb = b.charAt(0) === "-";
314787
+ if (na !== nb) return na ? -1 : 1;
314788
+ const aa = (na ? a.slice(1) : a).replace(/^0+(?=[0-9])/, "");
314789
+ const bb = (nb ? b.slice(1) : b).replace(/^0+(?=[0-9])/, "");
314790
+ let mag;
314791
+ if (aa.length !== bb.length) mag = aa.length < bb.length ? -1 : 1;
314792
+ else mag = aa < bb ? -1 : aa > bb ? 1 : 0;
314793
+ return na ? -mag : mag;
314794
+ }
314795
+ function grpcNormIntStr(input) {
314796
+ let s = input;
314797
+ let neg = false;
314798
+ if (s.charAt(0) === "-") {
314799
+ neg = true;
314800
+ s = s.slice(1);
314801
+ } else if (s.charAt(0) === "+") {
314802
+ s = s.slice(1);
314803
+ }
314804
+ let ei = s.indexOf("e");
314805
+ if (ei === -1) ei = s.indexOf("E");
314806
+ let exp = 0;
314807
+ if (ei !== -1) {
314808
+ exp = parseInt(s.slice(ei + 1), 10);
314809
+ s = s.slice(0, ei);
314810
+ }
314811
+ const dot = s.indexOf(".");
314812
+ const intp = dot === -1 ? s : s.slice(0, dot);
314813
+ const frac = dot === -1 ? "" : s.slice(dot + 1);
314814
+ const digits = intp + frac;
314815
+ if (digits.length === 0) return null;
314816
+ if (/^0+$/.test(digits)) return "0";
314817
+ if (exp >= 0) {
314818
+ const intpSize = intp === "0" ? 0 : intp.length;
314819
+ if (intpSize + exp > 20) return null;
314820
+ }
314821
+ const netExp = exp - frac.length;
314822
+ let out;
314823
+ if (netExp >= 0) {
314824
+ if (digits.length + netExp > 40) return null;
314825
+ out = digits + "0".repeat(netExp);
314826
+ } else {
314827
+ const cut = -netExp;
314828
+ const keepLen = digits.length - cut;
314829
+ const dropped = keepLen <= 0 ? digits : digits.slice(keepLen);
314830
+ for (let d = 0; d < dropped.length; d += 1) {
314831
+ if (dropped.charAt(d) !== "0") return null;
314832
+ }
314833
+ out = keepLen <= 0 ? "0" : digits.slice(0, keepLen);
314834
+ }
314835
+ let st = 0;
314836
+ while (st < out.length - 1 && out.charAt(st) === "0") st += 1;
314837
+ out = out.slice(st);
314838
+ if (out === "0") return "0";
314839
+ if (out.length > 40) return null;
314840
+ return neg ? `-${out}` : out;
314841
+ }
314842
+ function matchesIntValue(intType, value) {
314843
+ const spec = GRPC_INT_SPECS[intType];
314844
+ if (!spec) return true;
314845
+ let num;
314846
+ let canonical;
314847
+ if (typeof value === "number") {
314848
+ if (!Number.isFinite(value) || !Number.isInteger(value)) return false;
314849
+ num = value;
314850
+ canonical = grpcDecStr(value);
314851
+ } else if (typeof value === "string") {
314852
+ if (!/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$/.test(value)) return false;
314853
+ canonical = grpcNormIntStr(value);
314854
+ if (canonical === null) return false;
314855
+ num = Number(value);
314856
+ } else {
314857
+ return false;
314858
+ }
314859
+ if (canonical === "-0") canonical = "0";
314860
+ if (!spec.signed && (canonical !== null && canonical.charAt(0) === "-" || num < 0)) return false;
314861
+ if (spec.bits === 32) return num >= Number(spec.min) && num <= Number(spec.max);
314862
+ if (canonical !== null) return grpcCmpIntStr(canonical, spec.min) >= 0 && grpcCmpIntStr(canonical, spec.max) <= 0;
314863
+ return false;
314864
+ }
314663
314865
  function matchesScalarValue(expected, value) {
314664
314866
  const isJsonNumberString = (text) => /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$/.test(text) && Number.isFinite(Number(text));
314665
314867
  switch (expected) {
@@ -314748,6 +314950,12 @@ function validProtoBytes(value) {
314748
314950
  if (raw % 4 === 1) return false;
314749
314951
  return pad === 0 || (raw + pad) % 4 === 0 && pad === (4 - raw % 4) % 4;
314750
314952
  }
314953
+ function validProtoFloat32(value) {
314954
+ if (value === "NaN" || value === "Infinity" || value === "-Infinity") return true;
314955
+ const n = typeof value === "number" ? value : Number(value);
314956
+ if (!Number.isFinite(n)) return false;
314957
+ return Number.isFinite(Math.fround(n));
314958
+ }
314751
314959
  function matchesFormatValue(format3, value) {
314752
314960
  switch (format3) {
314753
314961
  case void 0:
@@ -314760,6 +314968,8 @@ function matchesFormatValue(format3, value) {
314760
314968
  return validProtoFieldMask(value);
314761
314969
  case "proto-bytes":
314762
314970
  return validProtoBytes(value);
314971
+ case "proto-float32":
314972
+ return validProtoFloat32(value);
314763
314973
  default:
314764
314974
  return true;
314765
314975
  }
@@ -314794,6 +315004,12 @@ function staticRequestCheck(item, shape, methodPath2, warnings) {
314794
315004
  continue;
314795
315005
  }
314796
315006
  if (field.jsonType === "any" || field.enumValues || field.map || field.shape) continue;
315007
+ if (field.intType) {
315008
+ if (!matchesIntValue(field.intType, value)) {
315009
+ warnings.push(`PROTO_REQUEST_FIELD_TYPE_MISMATCH: ${methodPath2} request field ${field.name} must be a valid ${field.intType} (in range)`);
315010
+ }
315011
+ continue;
315012
+ }
314797
315013
  if (!matchesScalarValue(field.jsonType, value)) {
314798
315014
  warnings.push(`PROTO_REQUEST_FIELD_TYPE_MISMATCH: ${methodPath2} request field ${field.name} must be ${field.jsonType}`);
314799
315015
  } else if (!matchesFormatValue(field.jsonFormat, value)) {
@@ -314803,6 +315019,7 @@ function staticRequestCheck(item, shape, methodPath2, warnings) {
314803
315019
  }
314804
315020
  function instrumentGrpcCollection(collection, index) {
314805
315021
  const warnings = [...index.warnings, ...index.operations.flatMap((operation) => operation.warnings)];
315022
+ warnings.push("GRPC_UNKNOWN_FIELDS_NOT_REJECTED: extra response JSON keys are not rejected (proto3 forward-compat + open well-known types; unknown wire fields are not surfaced by the binary->JSON decode)");
314806
315023
  const specs = /* @__PURE__ */ new Map();
314807
315024
  const requestShapes = /* @__PURE__ */ new Map();
314808
315025
  for (const operation of index.operations) {
@@ -315309,6 +315526,7 @@ function createSoapScript(operation, warnings = []) {
315309
315526
  ` pm.expect(bodyText, "expected SOAP response element <" + soap.expectedResponseElement + "> not found").to.match(new RegExp(${JSON.stringify(responseRegex)}));`,
315310
315527
  "});"
315311
315528
  );
315529
+ warnings.push(`SOAP_RESPONSE_BODY_WRAPPER_ONLY: operation ${operation.name} asserts the SOAP envelope/body/fault and the top-level response element <${operation.expectedResponseElement}> but NOT its child element/scalar shapes (WSDL/XSD payload validation is out of scope)`);
315312
315530
  } else if (operation.output) {
315313
315531
  warnings.push(`SOAP_RESPONSE_ELEMENT_UNKNOWN: operation ${operation.name} has an output message but no resolvable response element; only Envelope/Body/Fault are asserted`);
315314
315532
  }