@postman-cse/onboarding-bootstrap 2.7.1 → 2.8.0

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
@@ -263423,6 +263423,14 @@ function asRecord7(value) {
263423
263423
  }
263424
263424
  return value;
263425
263425
  }
263426
+ function resolvePollBudget(explicit, envValue, fallback, min) {
263427
+ if (typeof explicit === "number" && Number.isFinite(explicit) && explicit >= min) return explicit;
263428
+ if (envValue !== void 0) {
263429
+ const parsed = Number(envValue);
263430
+ if (Number.isFinite(parsed) && parsed >= min) return parsed;
263431
+ }
263432
+ return fallback;
263433
+ }
263426
263434
  function adviseWorkspaceFlipForbidden(error2) {
263427
263435
  if (error2 instanceof HttpError && error2.status === 403) {
263428
263436
  const body2 = error2.responseBody || "";
@@ -263459,13 +263467,27 @@ function extractGitRepoUrl(value) {
263459
263467
  }
263460
263468
  var PostmanGatewayAssetsClient = class _PostmanGatewayAssetsClient {
263461
263469
  static GENERATION_LOCKED_MAX_RETRIES = 5;
263462
- static GENERATION_POLL_ATTEMPTS = 90;
263463
- static GENERATION_POLL_DELAY_MS = 2e3;
263470
+ static DEFAULT_GENERATION_POLL_ATTEMPTS = 90;
263471
+ static DEFAULT_GENERATION_POLL_DELAY_MS = 2e3;
263464
263472
  gateway;
263465
263473
  sleep;
263474
+ generationPollAttempts;
263475
+ generationPollDelayMs;
263466
263476
  constructor(options) {
263467
263477
  this.gateway = options.gateway;
263468
263478
  this.sleep = options.sleep ?? ((delayMs) => new Promise((resolve5) => setTimeout(resolve5, delayMs)));
263479
+ this.generationPollAttempts = resolvePollBudget(
263480
+ options.generationPollAttempts,
263481
+ process.env.POSTMAN_GENERATION_POLL_ATTEMPTS,
263482
+ _PostmanGatewayAssetsClient.DEFAULT_GENERATION_POLL_ATTEMPTS,
263483
+ 1
263484
+ );
263485
+ this.generationPollDelayMs = resolvePollBudget(
263486
+ options.generationPollDelayMs,
263487
+ process.env.POSTMAN_GENERATION_POLL_DELAY_MS,
263488
+ _PostmanGatewayAssetsClient.DEFAULT_GENERATION_POLL_DELAY_MS,
263489
+ 0
263490
+ );
263469
263491
  }
263470
263492
  configureTeamContext(teamId, orgMode) {
263471
263493
  this.gateway.configureTeamContext(teamId, orgMode);
@@ -263610,8 +263632,8 @@ var PostmanGatewayAssetsClient = class _PostmanGatewayAssetsClient {
263610
263632
  };
263611
263633
  const taskId = await this.postGenerationWithLockRetry(specId, body2);
263612
263634
  if (taskId) {
263613
- for (let attempt = 0; attempt < _PostmanGatewayAssetsClient.GENERATION_POLL_ATTEMPTS; attempt += 1) {
263614
- await this.sleep(_PostmanGatewayAssetsClient.GENERATION_POLL_DELAY_MS);
263635
+ for (let attempt = 0; attempt < this.generationPollAttempts; attempt += 1) {
263636
+ await this.sleep(this.generationPollDelayMs);
263615
263637
  const task = await this.gateway.requestJson({
263616
263638
  service: "specification",
263617
263639
  method: "get",
@@ -263625,7 +263647,7 @@ var PostmanGatewayAssetsClient = class _PostmanGatewayAssetsClient {
263625
263647
  if (status && status !== "in-progress" && status !== "pending" && status !== "queued") {
263626
263648
  break;
263627
263649
  }
263628
- if (attempt === _PostmanGatewayAssetsClient.GENERATION_POLL_ATTEMPTS - 1) {
263650
+ if (attempt === this.generationPollAttempts - 1) {
263629
263651
  throw new Error(`Collection generation timed out for ${prefix}`);
263630
263652
  }
263631
263653
  }
package/dist/cli.cjs CHANGED
@@ -261741,6 +261741,14 @@ function asRecord7(value) {
261741
261741
  }
261742
261742
  return value;
261743
261743
  }
261744
+ function resolvePollBudget(explicit, envValue, fallback, min) {
261745
+ if (typeof explicit === "number" && Number.isFinite(explicit) && explicit >= min) return explicit;
261746
+ if (envValue !== void 0) {
261747
+ const parsed = Number(envValue);
261748
+ if (Number.isFinite(parsed) && parsed >= min) return parsed;
261749
+ }
261750
+ return fallback;
261751
+ }
261744
261752
  function adviseWorkspaceFlipForbidden(error) {
261745
261753
  if (error instanceof HttpError && error.status === 403) {
261746
261754
  const body2 = error.responseBody || "";
@@ -261777,13 +261785,27 @@ function extractGitRepoUrl(value) {
261777
261785
  }
261778
261786
  var PostmanGatewayAssetsClient = class _PostmanGatewayAssetsClient {
261779
261787
  static GENERATION_LOCKED_MAX_RETRIES = 5;
261780
- static GENERATION_POLL_ATTEMPTS = 90;
261781
- static GENERATION_POLL_DELAY_MS = 2e3;
261788
+ static DEFAULT_GENERATION_POLL_ATTEMPTS = 90;
261789
+ static DEFAULT_GENERATION_POLL_DELAY_MS = 2e3;
261782
261790
  gateway;
261783
261791
  sleep;
261792
+ generationPollAttempts;
261793
+ generationPollDelayMs;
261784
261794
  constructor(options) {
261785
261795
  this.gateway = options.gateway;
261786
261796
  this.sleep = options.sleep ?? ((delayMs) => new Promise((resolve4) => setTimeout(resolve4, delayMs)));
261797
+ this.generationPollAttempts = resolvePollBudget(
261798
+ options.generationPollAttempts,
261799
+ process.env.POSTMAN_GENERATION_POLL_ATTEMPTS,
261800
+ _PostmanGatewayAssetsClient.DEFAULT_GENERATION_POLL_ATTEMPTS,
261801
+ 1
261802
+ );
261803
+ this.generationPollDelayMs = resolvePollBudget(
261804
+ options.generationPollDelayMs,
261805
+ process.env.POSTMAN_GENERATION_POLL_DELAY_MS,
261806
+ _PostmanGatewayAssetsClient.DEFAULT_GENERATION_POLL_DELAY_MS,
261807
+ 0
261808
+ );
261787
261809
  }
261788
261810
  configureTeamContext(teamId, orgMode) {
261789
261811
  this.gateway.configureTeamContext(teamId, orgMode);
@@ -261928,8 +261950,8 @@ var PostmanGatewayAssetsClient = class _PostmanGatewayAssetsClient {
261928
261950
  };
261929
261951
  const taskId = await this.postGenerationWithLockRetry(specId, body2);
261930
261952
  if (taskId) {
261931
- for (let attempt = 0; attempt < _PostmanGatewayAssetsClient.GENERATION_POLL_ATTEMPTS; attempt += 1) {
261932
- await this.sleep(_PostmanGatewayAssetsClient.GENERATION_POLL_DELAY_MS);
261953
+ for (let attempt = 0; attempt < this.generationPollAttempts; attempt += 1) {
261954
+ await this.sleep(this.generationPollDelayMs);
261933
261955
  const task = await this.gateway.requestJson({
261934
261956
  service: "specification",
261935
261957
  method: "get",
@@ -261943,7 +261965,7 @@ var PostmanGatewayAssetsClient = class _PostmanGatewayAssetsClient {
261943
261965
  if (status && status !== "in-progress" && status !== "pending" && status !== "queued") {
261944
261966
  break;
261945
261967
  }
261946
- if (attempt === _PostmanGatewayAssetsClient.GENERATION_POLL_ATTEMPTS - 1) {
261968
+ if (attempt === this.generationPollAttempts - 1) {
261947
261969
  throw new Error(`Collection generation timed out for ${prefix}`);
261948
261970
  }
261949
261971
  }
package/dist/index.cjs CHANGED
@@ -263441,6 +263441,14 @@ function asRecord7(value) {
263441
263441
  }
263442
263442
  return value;
263443
263443
  }
263444
+ function resolvePollBudget(explicit, envValue, fallback, min) {
263445
+ if (typeof explicit === "number" && Number.isFinite(explicit) && explicit >= min) return explicit;
263446
+ if (envValue !== void 0) {
263447
+ const parsed = Number(envValue);
263448
+ if (Number.isFinite(parsed) && parsed >= min) return parsed;
263449
+ }
263450
+ return fallback;
263451
+ }
263444
263452
  function adviseWorkspaceFlipForbidden(error2) {
263445
263453
  if (error2 instanceof HttpError && error2.status === 403) {
263446
263454
  const body2 = error2.responseBody || "";
@@ -263477,13 +263485,27 @@ function extractGitRepoUrl(value) {
263477
263485
  }
263478
263486
  var PostmanGatewayAssetsClient = class _PostmanGatewayAssetsClient {
263479
263487
  static GENERATION_LOCKED_MAX_RETRIES = 5;
263480
- static GENERATION_POLL_ATTEMPTS = 90;
263481
- static GENERATION_POLL_DELAY_MS = 2e3;
263488
+ static DEFAULT_GENERATION_POLL_ATTEMPTS = 90;
263489
+ static DEFAULT_GENERATION_POLL_DELAY_MS = 2e3;
263482
263490
  gateway;
263483
263491
  sleep;
263492
+ generationPollAttempts;
263493
+ generationPollDelayMs;
263484
263494
  constructor(options) {
263485
263495
  this.gateway = options.gateway;
263486
263496
  this.sleep = options.sleep ?? ((delayMs) => new Promise((resolve5) => setTimeout(resolve5, delayMs)));
263497
+ this.generationPollAttempts = resolvePollBudget(
263498
+ options.generationPollAttempts,
263499
+ process.env.POSTMAN_GENERATION_POLL_ATTEMPTS,
263500
+ _PostmanGatewayAssetsClient.DEFAULT_GENERATION_POLL_ATTEMPTS,
263501
+ 1
263502
+ );
263503
+ this.generationPollDelayMs = resolvePollBudget(
263504
+ options.generationPollDelayMs,
263505
+ process.env.POSTMAN_GENERATION_POLL_DELAY_MS,
263506
+ _PostmanGatewayAssetsClient.DEFAULT_GENERATION_POLL_DELAY_MS,
263507
+ 0
263508
+ );
263487
263509
  }
263488
263510
  configureTeamContext(teamId, orgMode) {
263489
263511
  this.gateway.configureTeamContext(teamId, orgMode);
@@ -263628,8 +263650,8 @@ var PostmanGatewayAssetsClient = class _PostmanGatewayAssetsClient {
263628
263650
  };
263629
263651
  const taskId = await this.postGenerationWithLockRetry(specId, body2);
263630
263652
  if (taskId) {
263631
- for (let attempt = 0; attempt < _PostmanGatewayAssetsClient.GENERATION_POLL_ATTEMPTS; attempt += 1) {
263632
- await this.sleep(_PostmanGatewayAssetsClient.GENERATION_POLL_DELAY_MS);
263653
+ for (let attempt = 0; attempt < this.generationPollAttempts; attempt += 1) {
263654
+ await this.sleep(this.generationPollDelayMs);
263633
263655
  const task = await this.gateway.requestJson({
263634
263656
  service: "specification",
263635
263657
  method: "get",
@@ -263643,7 +263665,7 @@ var PostmanGatewayAssetsClient = class _PostmanGatewayAssetsClient {
263643
263665
  if (status && status !== "in-progress" && status !== "pending" && status !== "queued") {
263644
263666
  break;
263645
263667
  }
263646
- if (attempt === _PostmanGatewayAssetsClient.GENERATION_POLL_ATTEMPTS - 1) {
263668
+ if (attempt === this.generationPollAttempts - 1) {
263647
263669
  throw new Error(`Collection generation timed out for ${prefix}`);
263648
263670
  }
263649
263671
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@postman-cse/onboarding-bootstrap",
3
- "version": "2.7.1",
3
+ "version": "2.8.0",
4
4
  "description": "Bootstrap Postman workspaces, specs, and collections from OpenAPI.",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -61,6 +61,8 @@
61
61
  "@commitlint/cli": "^21.0.2",
62
62
  "@commitlint/config-conventional": "^21.0.2",
63
63
  "@eslint/js": "^10.0.1",
64
+ "@grpc/grpc-js": "^1.14.4",
65
+ "@grpc/proto-loader": "^0.8.1",
64
66
  "@types/node": "^26.1.0",
65
67
  "esbuild": "0.28.1",
66
68
  "eslint": "^10.4.1",