securewithtrace 0.32.0 → 0.33.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.
Files changed (2) hide show
  1. package/dist/index.js +291 -191
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -10176,7 +10176,7 @@ var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
10176
10176
  function isValidBase64URL(data) {
10177
10177
  if (!base64url.test(data))
10178
10178
  return false;
10179
- const base643 = data.replace(/[-_]/g, (c49) => c49 === "-" ? "+" : "/");
10179
+ const base643 = data.replace(/[-_]/g, (c51) => c51 === "-" ? "+" : "/");
10180
10180
  const padded = base643.padEnd(Math.ceil(base643.length / 4) * 4, "=");
10181
10181
  return isValidBase64(padded);
10182
10182
  }
@@ -20220,9 +20220,9 @@ var ZodDate2 = /* @__PURE__ */ $constructor("ZodDate", (inst, def) => {
20220
20220
  inst._zod.processJSONSchema = (ctx, json2, params) => dateProcessor(inst, ctx, json2, params);
20221
20221
  inst.min = (value, params) => inst.check(_gte(value, params));
20222
20222
  inst.max = (value, params) => inst.check(_lte(value, params));
20223
- const c49 = inst._zod.bag;
20224
- inst.minDate = c49.minimum ? new Date(c49.minimum) : null;
20225
- inst.maxDate = c49.maximum ? new Date(c49.maximum) : null;
20223
+ const c51 = inst._zod.bag;
20224
+ inst.minDate = c51.minimum ? new Date(c51.minimum) : null;
20225
+ inst.maxDate = c51.maximum ? new Date(c51.maximum) : null;
20226
20226
  });
20227
20227
  function date3(params) {
20228
20228
  return _date(ZodDate2, params);
@@ -21911,7 +21911,8 @@ var OperatorPentestContextSchema = external_exports.object({
21911
21911
  environments: external_exports.array(
21912
21912
  external_exports.object({
21913
21913
  name: external_exports.string(),
21914
- primaryUrl: external_exports.string(),
21914
+ // Null for repo-only application types (CLI, MOBILE, DESKTOP).
21915
+ primaryUrl: external_exports.string().nullable(),
21915
21916
  isProduction: external_exports.boolean()
21916
21917
  })
21917
21918
  ),
@@ -22365,27 +22366,12 @@ var ApplicationRepositoryRoleValues = [
22365
22366
  "MOBILE_CLIENT",
22366
22367
  "OTHER"
22367
22368
  ];
22368
- var ScopeDomainSourceValues = ["DERIVED", "MANUAL"];
22369
22369
  var ApplicationIdParamsSchema = OrgIdParamsSchema.extend({
22370
22370
  applicationId: external_exports.uuid()
22371
22371
  });
22372
22372
  var ApplicationRepositoryIdParamsSchema = ApplicationIdParamsSchema.extend({
22373
22373
  applicationRepositoryId: external_exports.uuid()
22374
22374
  });
22375
- var AuthorizedDomainIdParamsSchema = ApplicationIdParamsSchema.extend({
22376
- applicationAuthorizedDomainId: external_exports.uuid()
22377
- });
22378
- var AuthorizedDomainResponseSchema = external_exports.object({
22379
- applicationAuthorizedDomainId: external_exports.uuid(),
22380
- applicationId: external_exports.uuid(),
22381
- organizationId: external_exports.uuid(),
22382
- domain: external_exports.string(),
22383
- source: external_exports.enum(ScopeDomainSourceValues),
22384
- createdAt: external_exports.date()
22385
- });
22386
- var CreateAuthorizedDomainRequestSchema = external_exports.object({
22387
- domain: external_exports.string().trim().min(1).max(253)
22388
- }).strict();
22389
22375
  var ApplicationRepositorySummarySchema = external_exports.object({
22390
22376
  applicationRepositoryId: external_exports.uuid().nullable(),
22391
22377
  applicationId: external_exports.uuid(),
@@ -22426,7 +22412,6 @@ var ApplicationResponseSchema = external_exports.object({
22426
22412
  // Environments-tab panel hydrates from this payload (no client GET). Defaulted
22427
22413
  // (like `type`) so a new client reading a pre-this-release API during a rolling
22428
22414
  // deploy doesn't reject application rows that predate the field.
22429
- authorizedDomains: external_exports.array(AuthorizedDomainResponseSchema).default([]),
22430
22415
  // Signed S3 URL for the Overview screenshot. Defaulted null so a new client
22431
22416
  // reading a pre-this-release API during a rolling deploy doesn't reject rows
22432
22417
  // that omit the field. The raw S3 key is never on the wire.
@@ -22602,35 +22587,6 @@ var applicationContract = c4.router({
22602
22587
  409: ErrorResponseSchema,
22603
22588
  500: ErrorResponseSchema
22604
22589
  }
22605
- },
22606
- addAuthorizedDomain: {
22607
- method: "POST",
22608
- path: "/organizations/:organizationId/applications/:applicationId/authorized-domains",
22609
- pathParams: ApplicationIdParamsSchema,
22610
- body: CreateAuthorizedDomainRequestSchema,
22611
- responses: {
22612
- 201: AuthorizedDomainResponseSchema,
22613
- // 400 = INVALID_DOMAIN (not a registrable domain / IP / bare suffix);
22614
- // 409 = DOMAIN_ALREADY_AUTHORIZED.
22615
- 400: ErrorResponseSchema,
22616
- 401: ErrorResponseSchema,
22617
- 403: ErrorResponseSchema,
22618
- 404: ErrorResponseSchema,
22619
- 409: ErrorResponseSchema,
22620
- 500: ErrorResponseSchema
22621
- }
22622
- },
22623
- deleteAuthorizedDomain: {
22624
- method: "DELETE",
22625
- path: "/organizations/:organizationId/applications/:applicationId/authorized-domains/:applicationAuthorizedDomainId",
22626
- pathParams: AuthorizedDomainIdParamsSchema,
22627
- responses: {
22628
- 204: DeleteResponseSchema,
22629
- 401: ErrorResponseSchema,
22630
- 403: ErrorResponseSchema,
22631
- 404: ErrorResponseSchema,
22632
- 500: ErrorResponseSchema
22633
- }
22634
22590
  }
22635
22591
  });
22636
22592
 
@@ -23871,6 +23827,68 @@ var cloudIntegrationContract = c7.router({
23871
23827
  }
23872
23828
  });
23873
23829
 
23830
+ // ../../packages/api-contracts/src/schemas/api/v1/code-size.api.ts
23831
+ var CodeSizeBucketTallySchema = external_exports.object({
23832
+ files: external_exports.number().int().nonnegative(),
23833
+ lines: external_exports.number().int().nonnegative(),
23834
+ code: external_exports.number().int().nonnegative()
23835
+ });
23836
+ var CodeSizeLanguageTallySchema = external_exports.object({
23837
+ language: external_exports.string(),
23838
+ files: external_exports.number().int().nonnegative(),
23839
+ code: external_exports.number().int().nonnegative()
23840
+ });
23841
+ var CodeSizePlatformValues = ["GITHUB", "BITBUCKET"];
23842
+ var CodeSizeRepositorySchema = external_exports.object({
23843
+ repositoryId: external_exports.uuid(),
23844
+ repositoryUrl: external_exports.url(),
23845
+ platform: external_exports.enum(CodeSizePlatformValues),
23846
+ /** Billable SLOC of the current resolved branch. null = not measured yet. */
23847
+ billableSloc: external_exports.number().int().nonnegative().nullable()
23848
+ });
23849
+ var CodeSizeBucketsSchema = external_exports.object({
23850
+ code: CodeSizeBucketTallySchema,
23851
+ tests: CodeSizeBucketTallySchema,
23852
+ docs: CodeSizeBucketTallySchema,
23853
+ config_data: CodeSizeBucketTallySchema,
23854
+ vendored_generated: CodeSizeBucketTallySchema
23855
+ });
23856
+ var OrganizationCodeSizeResponseSchema = external_exports.object({
23857
+ /** All CONNECTED GitHub/Bitbucket repos. Server-sorted: measured first by
23858
+ * billableSloc desc (ties repositoryUrl asc), then unmeasured by
23859
+ * repositoryUrl asc — clients render as-is (spec-pr-2 §3.3). */
23860
+ repositories: external_exports.array(CodeSizeRepositorySchema),
23861
+ /** Sums over measured repos only. All-zero when none are measured. */
23862
+ totals: external_exports.object({
23863
+ billableSloc: external_exports.number().int().nonnegative(),
23864
+ rawLines: external_exports.number().int().nonnegative(),
23865
+ buckets: CodeSizeBucketsSchema,
23866
+ /** Merged across repos, re-sorted code desc then language asc, capped
23867
+ * at 12 for display (stored lists are complete; spec-pr-2 §3.2). */
23868
+ codeByLanguage: external_exports.array(CodeSizeLanguageTallySchema),
23869
+ /** Distinct languages in the code bucket across measured repos — the
23870
+ * TRUE count, not codeByLanguage.length (which is display-capped). */
23871
+ languageCount: external_exports.number().int().nonnegative()
23872
+ })
23873
+ });
23874
+
23875
+ // ../../packages/api-contracts/src/contracts/v1/code-size.ts
23876
+ var c8 = initContract();
23877
+ var codeSizeContract = c8.router({
23878
+ getOrganizationCodeSize: {
23879
+ method: "GET",
23880
+ path: "/organizations/:organizationId/code-size",
23881
+ pathParams: OrgIdParamsSchema,
23882
+ responses: {
23883
+ 200: OrganizationCodeSizeResponseSchema,
23884
+ 401: ErrorResponseSchema,
23885
+ 403: ErrorResponseSchema,
23886
+ 404: ErrorResponseSchema,
23887
+ 500: ErrorResponseSchema
23888
+ }
23889
+ }
23890
+ });
23891
+
23874
23892
  // ../../packages/api-contracts/src/schemas/domain/credential.schema.ts
23875
23893
  var CredentialTypeValues = [
23876
23894
  "BEARER_TOKEN",
@@ -23978,13 +23996,13 @@ var StorageStateSchema = external_exports.object({
23978
23996
  } catch {
23979
23997
  return;
23980
23998
  }
23981
- s.cookies.forEach((c49, i) => {
23982
- const d2 = c49.domain.replace(/^\./, "").toLowerCase();
23999
+ s.cookies.forEach((c51, i) => {
24000
+ const d2 = c51.domain.replace(/^\./, "").toLowerCase();
23983
24001
  if (d2 !== host && !host.endsWith(`.${d2}`)) {
23984
24002
  ctx.addIssue({
23985
24003
  code: "custom",
23986
24004
  path: ["cookies", i, "domain"],
23987
- message: `cookie domain "${c49.domain}" is not the capture origin host "${host}" or a parent domain of it`
24005
+ message: `cookie domain "${c51.domain}" is not the capture origin host "${host}" or a parent domain of it`
23988
24006
  });
23989
24007
  }
23990
24008
  });
@@ -24192,8 +24210,8 @@ var RevealCredentialSecretResponseSchema = external_exports.discriminatedUnion("
24192
24210
  ]);
24193
24211
 
24194
24212
  // ../../packages/api-contracts/src/contracts/v1/credential.ts
24195
- var c8 = initContract();
24196
- var credentialContract = c8.router({
24213
+ var c9 = initContract();
24214
+ var credentialContract = c9.router({
24197
24215
  listCredentials: {
24198
24216
  method: "GET",
24199
24217
  path: "/organizations/:organizationId/environments/:environmentId/credentials",
@@ -24285,7 +24303,7 @@ var credentialContract = c8.router({
24285
24303
  method: "POST",
24286
24304
  path: "/organizations/:organizationId/environments/:environmentId/credentials/:credentialId/reveal",
24287
24305
  pathParams: CredentialIdParamsSchema,
24288
- body: c8.noBody(),
24306
+ body: c9.noBody(),
24289
24307
  responses: {
24290
24308
  200: RevealCredentialSecretResponseSchema,
24291
24309
  401: ErrorResponseSchema,
@@ -24512,8 +24530,8 @@ var DependencySummaryResponseSchema = external_exports.object({
24512
24530
  });
24513
24531
 
24514
24532
  // ../../packages/api-contracts/src/contracts/v1/dependency.ts
24515
- var c9 = initContract();
24516
- var dependencyContract = c9.router({
24533
+ var c10 = initContract();
24534
+ var dependencyContract = c10.router({
24517
24535
  /** Cross-repo dependency search. Two-phase: pg_trgm on Package, then join repos. */
24518
24536
  searchDependencies: {
24519
24537
  method: "POST",
@@ -24658,8 +24676,8 @@ var DockerScoutIntegrationResponseSchema = external_exports.object({
24658
24676
  });
24659
24677
 
24660
24678
  // ../../packages/api-contracts/src/contracts/v1/docker-scout-integration.ts
24661
- var c10 = initContract();
24662
- var dockerScoutIntegrationContract = c10.router({
24679
+ var c11 = initContract();
24680
+ var dockerScoutIntegrationContract = c11.router({
24663
24681
  createDockerScoutIntegration: {
24664
24682
  method: "POST",
24665
24683
  path: "/organizations/:organizationId/docker-scout-integration",
@@ -24848,12 +24866,12 @@ var EngagementResponseSchema = external_exports.object({
24848
24866
  });
24849
24867
 
24850
24868
  // ../../packages/api-contracts/src/contracts/v1/engagement.ts
24851
- var c11 = initContract();
24869
+ var c12 = initContract();
24852
24870
  var RecordDashboardSessionRequest = external_exports.object({
24853
24871
  sessionId: external_exports.string().min(1).max(100)
24854
24872
  });
24855
24873
  var RecordDashboardSessionResponse = external_exports.object({});
24856
- var engagementContract = c11.router({
24874
+ var engagementContract = c12.router({
24857
24875
  recordDashboardSession: {
24858
24876
  method: "POST",
24859
24877
  // `pathPrefix: '/v1'` is applied at the router level (see
@@ -24902,7 +24920,7 @@ var EnvironmentResponseSchema = external_exports.object({
24902
24920
  applicationId: external_exports.uuid(),
24903
24921
  organizationId: external_exports.uuid(),
24904
24922
  name: external_exports.string(),
24905
- primaryUrl: external_exports.string(),
24923
+ primaryUrl: external_exports.string().nullable(),
24906
24924
  description: external_exports.string().nullable(),
24907
24925
  isProduction: external_exports.boolean(),
24908
24926
  createdAt: external_exports.date(),
@@ -24911,7 +24929,7 @@ var EnvironmentResponseSchema = external_exports.object({
24911
24929
  var ListEnvironmentsResponseSchema = external_exports.array(EnvironmentResponseSchema);
24912
24930
  var CreateEnvironmentRequestSchema = external_exports.object({
24913
24931
  name: EnvNameSchema,
24914
- primaryUrl: external_exports.url().max(2048),
24932
+ primaryUrl: external_exports.url().max(2048).optional(),
24915
24933
  description: external_exports.string().max(1e3).optional(),
24916
24934
  isProduction: external_exports.boolean().optional().default(false)
24917
24935
  }).strict();
@@ -24923,8 +24941,8 @@ var UpdateEnvironmentRequestSchema = external_exports.object({
24923
24941
  }).strict();
24924
24942
 
24925
24943
  // ../../packages/api-contracts/src/contracts/v1/environment.ts
24926
- var c12 = initContract();
24927
- var environmentContract = c12.router({
24944
+ var c13 = initContract();
24945
+ var environmentContract = c13.router({
24928
24946
  listEnvironments: {
24929
24947
  method: "GET",
24930
24948
  path: "/organizations/:organizationId/applications/:applicationId/environments",
@@ -25174,8 +25192,8 @@ var GitHubRepoSchema = external_exports.object({
25174
25192
  var ListGitHubInstallationReposResponseSchema = external_exports.array(GitHubRepoSchema);
25175
25193
 
25176
25194
  // ../../packages/api-contracts/src/contracts/v1/github.ts
25177
- var c13 = initContract();
25178
- var githubContract = c13.router({
25195
+ var c14 = initContract();
25196
+ var githubContract = c14.router({
25179
25197
  // Tier chooser data: which app tiers this env can connect + the org's
25180
25198
  // entitlement default. Pure read (auth context + server config).
25181
25199
  getConnectOptions: {
@@ -25274,7 +25292,7 @@ var githubContract = c13.router({
25274
25292
  method: "POST",
25275
25293
  path: "/organizations/:organizationId/github/install-requests/:requestId/cancel",
25276
25294
  pathParams: GitHubInstallRequestParamsSchema,
25277
- body: c13.type(),
25295
+ body: c14.type(),
25278
25296
  responses: {
25279
25297
  200: GitHubInstallRequestSchema,
25280
25298
  401: ErrorResponseSchema,
@@ -25285,7 +25303,7 @@ var githubContract = c13.router({
25285
25303
  }
25286
25304
  }
25287
25305
  });
25288
- var staffGithubContract = c13.router({
25306
+ var staffGithubContract = c14.router({
25289
25307
  listStaffInstallations: {
25290
25308
  method: "GET",
25291
25309
  path: "/staff/github/installations",
@@ -25328,8 +25346,8 @@ var ManagedInboxLabelParamsSchema = OrgIdParamsSchema.extend({
25328
25346
  });
25329
25347
 
25330
25348
  // ../../packages/api-contracts/src/contracts/v1/inbox.ts
25331
- var c14 = initContract();
25332
- var inboxContract = c14.router({
25349
+ var c15 = initContract();
25350
+ var inboxContract = c15.router({
25333
25351
  listInboxes: {
25334
25352
  method: "GET",
25335
25353
  path: "/organizations/:organizationId/inboxes",
@@ -25406,8 +25424,8 @@ var UpdateKnowledgeBaseResponseSchema = external_exports.object({
25406
25424
  });
25407
25425
 
25408
25426
  // ../../packages/api-contracts/src/contracts/v1/knowledge-base.ts
25409
- var c15 = initContract();
25410
- var knowledgeBaseContract = c15.router({
25427
+ var c16 = initContract();
25428
+ var knowledgeBaseContract = c16.router({
25411
25429
  getKnowledgeBase: {
25412
25430
  method: "GET",
25413
25431
  path: "/organizations/:organizationId/knowledge-base",
@@ -25628,8 +25646,8 @@ var UpdateRepoDocumentContentResponseSchema = external_exports.object({
25628
25646
  });
25629
25647
 
25630
25648
  // ../../packages/api-contracts/src/contracts/v1/knowledge-document.ts
25631
- var c16 = initContract();
25632
- var knowledgeDocumentContract = c16.router({
25649
+ var c17 = initContract();
25650
+ var knowledgeDocumentContract = c17.router({
25633
25651
  createDocument: {
25634
25652
  method: "POST",
25635
25653
  path: "/organizations/:organizationId/knowledge-documents",
@@ -25955,8 +25973,8 @@ var LinearMetadataResponseSchema = external_exports.object({
25955
25973
  });
25956
25974
 
25957
25975
  // ../../packages/api-contracts/src/contracts/v1/linear-integration.ts
25958
- var c17 = initContract();
25959
- var linearIntegrationContract = c17.router({
25976
+ var c18 = initContract();
25977
+ var linearIntegrationContract = c18.router({
25960
25978
  getLinearIntegration: {
25961
25979
  method: "GET",
25962
25980
  path: "/organizations/:organizationId/integrations/linear",
@@ -25974,7 +25992,7 @@ var linearIntegrationContract = c17.router({
25974
25992
  method: "POST",
25975
25993
  path: "/organizations/:organizationId/integrations/linear/connect",
25976
25994
  pathParams: OrgIdParamsSchema,
25977
- body: c17.noBody(),
25995
+ body: c18.noBody(),
25978
25996
  responses: {
25979
25997
  200: LinearConnectResponseSchema,
25980
25998
  401: ErrorResponseSchema,
@@ -25989,7 +26007,7 @@ var linearIntegrationContract = c17.router({
25989
26007
  method: "POST",
25990
26008
  path: "/organizations/:organizationId/integrations/linear/disconnect",
25991
26009
  pathParams: OrgIdParamsSchema,
25992
- body: c17.noBody(),
26010
+ body: c18.noBody(),
25993
26011
  responses: {
25994
26012
  200: LinearIntegrationResponseSchema,
25995
26013
  401: ErrorResponseSchema,
@@ -26151,8 +26169,8 @@ var LinearTicketContextResponseSchema = external_exports.object({
26151
26169
  });
26152
26170
 
26153
26171
  // ../../packages/api-contracts/src/contracts/v1/linear-tickets.ts
26154
- var c18 = initContract();
26155
- var linearTicketContract = c18.router({
26172
+ var c19 = initContract();
26173
+ var linearTicketContract = c19.router({
26156
26174
  /**
26157
26175
  * Push one or more pentest findings to Linear as tickets. Customer-side
26158
26176
  * (VIEW_RESULTS + PENTEST capability); non-admins create into the org's
@@ -26256,8 +26274,8 @@ var LlmProviderKeyResponseSchema = external_exports.object({
26256
26274
  var ListLlmProviderKeysResponseSchema = external_exports.array(LlmProviderKeyResponseSchema);
26257
26275
 
26258
26276
  // ../../packages/api-contracts/src/contracts/v1/llm-provider-key.ts
26259
- var c19 = initContract();
26260
- var llmProviderKeyContract = c19.router({
26277
+ var c20 = initContract();
26278
+ var llmProviderKeyContract = c20.router({
26261
26279
  createLlmProviderKey: {
26262
26280
  method: "POST",
26263
26281
  path: "/organizations/:organizationId/llm-provider-keys",
@@ -26451,8 +26469,8 @@ var LogoDeleteRequestSchema = external_exports.object({
26451
26469
  });
26452
26470
 
26453
26471
  // ../../packages/api-contracts/src/contracts/v1/organization.ts
26454
- var c20 = initContract();
26455
- var organizationContract = c20.router({
26472
+ var c21 = initContract();
26473
+ var organizationContract = c21.router({
26456
26474
  listOrganizations: {
26457
26475
  method: "GET",
26458
26476
  path: "/organizations",
@@ -26656,7 +26674,7 @@ var organizationContract = c20.router({
26656
26674
  method: "POST",
26657
26675
  path: "/organizations/:organizationId/logos-from-homepage",
26658
26676
  pathParams: OrgIdParamsSchema,
26659
- body: c20.type(),
26677
+ body: c21.type(),
26660
26678
  responses: {
26661
26679
  200: OrganizationResponseSchema,
26662
26680
  // 400 — no homepage set on the organization.
@@ -27429,8 +27447,8 @@ var ScanReuseSuggestionsResponseSchema = external_exports.object({
27429
27447
  });
27430
27448
 
27431
27449
  // ../../packages/api-contracts/src/contracts/v1/pentest.ts
27432
- var c21 = initContract();
27433
- var pentestContract = c21.router({
27450
+ var c22 = initContract();
27451
+ var pentestContract = c22.router({
27434
27452
  listPentests: {
27435
27453
  method: "GET",
27436
27454
  path: "/organizations/:organizationId/pentests",
@@ -27866,8 +27884,8 @@ var ReadAttestationDownloadResponseSchema = external_exports.union([
27866
27884
  ]);
27867
27885
 
27868
27886
  // ../../packages/api-contracts/src/contracts/v1/pentest-attestation.ts
27869
- var c22 = initContract();
27870
- var pentestAttestationContract = c22.router({
27887
+ var c23 = initContract();
27888
+ var pentestAttestationContract = c23.router({
27871
27889
  getDefaults: {
27872
27890
  method: "GET",
27873
27891
  path: "/organizations/:organizationId/pentests/:pentestId/attestations/defaults",
@@ -28009,8 +28027,8 @@ var ListPentestAuditLogResponseSchema = external_exports.object({
28009
28027
  });
28010
28028
 
28011
28029
  // ../../packages/api-contracts/src/contracts/v1/pentest-audit-log.ts
28012
- var c23 = initContract();
28013
- var pentestAuditLogContract = c23.router({
28030
+ var c24 = initContract();
28031
+ var pentestAuditLogContract = c24.router({
28014
28032
  listAuditLog: {
28015
28033
  method: "GET",
28016
28034
  path: "/organizations/:organizationId/pentests/:pentestId/audit-log",
@@ -28026,6 +28044,86 @@ var pentestAuditLogContract = c23.router({
28026
28044
  }
28027
28045
  });
28028
28046
 
28047
+ // ../../packages/api-contracts/src/schemas/api/v1/pentest-authorized-domain.api.ts
28048
+ var PentestAuthorizedDomainIdParamsSchema = PentestIdParamsSchema.extend({
28049
+ pentestAuthorizedDomainId: external_exports.uuid()
28050
+ });
28051
+ var AuthorizedDomainOriginValues = ["DERIVED", "ENGAGEMENT"];
28052
+ var AuthorizedDomainOrigin = external_exports.enum(AuthorizedDomainOriginValues);
28053
+ var PentestAuthorizedDomainResponseSchema = external_exports.object({
28054
+ /**
28055
+ * NULL for a domain contributed by a bound application while the engagement is
28056
+ * still tracking — there is no row yet, and nothing to address by id.
28057
+ */
28058
+ pentestAuthorizedDomainId: external_exports.uuid().nullable(),
28059
+ pentestId: external_exports.uuid(),
28060
+ organizationId: external_exports.uuid(),
28061
+ domain: external_exports.string(),
28062
+ applicationIds: external_exports.array(external_exports.uuid()),
28063
+ origin: AuthorizedDomainOrigin,
28064
+ /** NULL when the row was written by materialization rather than by a person. */
28065
+ addedById: external_exports.uuid().nullable(),
28066
+ addedAt: external_exports.date().nullable()
28067
+ });
28068
+ var PentestAuthorizedScopeResponseSchema = external_exports.object({
28069
+ domains: external_exports.array(PentestAuthorizedDomainResponseSchema),
28070
+ /** Null while the engagement still tracks its bound applications. */
28071
+ materializedAt: external_exports.date().nullable()
28072
+ });
28073
+ var CreatePentestAuthorizedDomainRequestSchema = external_exports.object({
28074
+ domain: external_exports.string().trim().min(1).max(253)
28075
+ }).strict();
28076
+
28077
+ // ../../packages/api-contracts/src/contracts/v1/pentest-authorized-domain.ts
28078
+ var c25 = initContract();
28079
+ var pentestAuthorizedDomainContract = c25.router({
28080
+ getPentestAuthorizedScope: {
28081
+ method: "GET",
28082
+ path: "/organizations/:organizationId/pentests/:pentestId/authorized-scope",
28083
+ pathParams: PentestIdParamsSchema,
28084
+ responses: {
28085
+ 200: PentestAuthorizedScopeResponseSchema,
28086
+ 401: ErrorResponseSchema,
28087
+ 403: ErrorResponseSchema,
28088
+ 404: ErrorResponseSchema,
28089
+ 500: ErrorResponseSchema
28090
+ }
28091
+ },
28092
+ addPentestAuthorizedDomain: {
28093
+ method: "POST",
28094
+ path: "/organizations/:organizationId/pentests/:pentestId/authorized-scope/domains",
28095
+ pathParams: PentestIdParamsSchema,
28096
+ body: CreatePentestAuthorizedDomainRequestSchema,
28097
+ responses: {
28098
+ 201: PentestAuthorizedDomainResponseSchema,
28099
+ // 400 = INVALID_DOMAIN (not a registrable domain / IP / bare suffix);
28100
+ // 409 = DOMAIN_ALREADY_AUTHORIZED or PENTEST_CLOSED.
28101
+ 400: ErrorResponseSchema,
28102
+ 401: ErrorResponseSchema,
28103
+ 403: ErrorResponseSchema,
28104
+ 404: ErrorResponseSchema,
28105
+ 409: ErrorResponseSchema,
28106
+ 500: ErrorResponseSchema
28107
+ }
28108
+ },
28109
+ removePentestAuthorizedDomain: {
28110
+ method: "DELETE",
28111
+ path: "/organizations/:organizationId/pentests/:pentestId/authorized-scope/domains/:pentestAuthorizedDomainId",
28112
+ pathParams: PentestAuthorizedDomainIdParamsSchema,
28113
+ responses: {
28114
+ 204: DeleteResponseSchema,
28115
+ // 409 = DOMAIN_FROM_ENVIRONMENT (derived from a selected environment's
28116
+ // Target URL, so removing the row here would not remove it from scope) or
28117
+ // PENTEST_CLOSED.
28118
+ 401: ErrorResponseSchema,
28119
+ 403: ErrorResponseSchema,
28120
+ 404: ErrorResponseSchema,
28121
+ 409: ErrorResponseSchema,
28122
+ 500: ErrorResponseSchema
28123
+ }
28124
+ }
28125
+ });
28126
+
28029
28127
  // ../../packages/api-contracts/src/schemas/api/v1/pentest-engagement-exclusion.api.ts
28030
28128
  var PentestEngagementExclusionsParamsSchema = OrgIdParamsSchema.extend({
28031
28129
  pentestId: external_exports.string().min(1)
@@ -28051,8 +28149,8 @@ var CreatePentestEngagementExclusionRequestSchema = external_exports.object({
28051
28149
  }).strict();
28052
28150
 
28053
28151
  // ../../packages/api-contracts/src/contracts/v1/pentest-engagement-exclusion.ts
28054
- var c24 = initContract();
28055
- var pentestEngagementExclusionContract = c24.router({
28152
+ var c26 = initContract();
28153
+ var pentestEngagementExclusionContract = c26.router({
28056
28154
  listPentestEngagementExclusions: {
28057
28155
  method: "GET",
28058
28156
  path: "/organizations/:organizationId/pentests/:pentestId/engagement-exclusions",
@@ -28116,8 +28214,8 @@ var CreatePentestEnvironmentRequestSchema = external_exports.object({
28116
28214
  }).strict();
28117
28215
 
28118
28216
  // ../../packages/api-contracts/src/contracts/v1/pentest-environment.ts
28119
- var c25 = initContract();
28120
- var pentestEnvironmentContract = c25.router({
28217
+ var c27 = initContract();
28218
+ var pentestEnvironmentContract = c27.router({
28121
28219
  listPentestEnvironments: {
28122
28220
  method: "GET",
28123
28221
  path: "/organizations/:organizationId/pentests/:pentestId/environments",
@@ -29492,8 +29590,8 @@ var GetParseTaskStatusResponseSchema = external_exports.object({
29492
29590
  });
29493
29591
 
29494
29592
  // ../../packages/api-contracts/src/contracts/v1/pentest-finding.ts
29495
- var c26 = initContract();
29496
- var pentestFindingContract = c26.router({
29593
+ var c28 = initContract();
29594
+ var pentestFindingContract = c28.router({
29497
29595
  // ─── Findings ───
29498
29596
  listFindings: {
29499
29597
  method: "GET",
@@ -30082,8 +30180,8 @@ var PromotePentestHypothesisRequestSchema = external_exports.object({
30082
30180
  }).strict().optional();
30083
30181
 
30084
30182
  // ../../packages/api-contracts/src/contracts/v1/pentest-hypothesis.ts
30085
- var c27 = initContract();
30086
- var pentestHypothesisContract = c27.router({
30183
+ var c29 = initContract();
30184
+ var pentestHypothesisContract = c29.router({
30087
30185
  listHypotheses: {
30088
30186
  method: "GET",
30089
30187
  path: "/organizations/:organizationId/pentests/:pentestId/hypotheses",
@@ -30186,8 +30284,8 @@ var pentestHypothesisContract = c27.router({
30186
30284
  });
30187
30285
 
30188
30286
  // ../../packages/api-contracts/src/contracts/v1/pentest-manual-finding.ts
30189
- var c28 = initContract();
30190
- var pentestManualFindingContract = c28.router({
30287
+ var c30 = initContract();
30288
+ var pentestManualFindingContract = c30.router({
30191
30289
  listManualFindings: {
30192
30290
  method: "GET",
30193
30291
  path: "/organizations/:organizationId/pentests/:pentestId/manual-findings",
@@ -30274,8 +30372,8 @@ var pentestManualFindingContract = c28.router({
30274
30372
  });
30275
30373
 
30276
30374
  // ../../packages/api-contracts/src/contracts/v1/pentest-report-pdf.ts
30277
- var c29 = initContract();
30278
- var pentestReportPdfContract = c29.router({
30375
+ var c31 = initContract();
30376
+ var pentestReportPdfContract = c31.router({
30279
30377
  getCurrent: {
30280
30378
  method: "GET",
30281
30379
  path: "/organizations/:organizationId/pentests/:pentestId/report-pdf",
@@ -30368,7 +30466,7 @@ var pentestReportPdfContract = c29.router({
30368
30466
  // No body: the render always reads current DB state (cover derived via
30369
30467
  // deriveReportCover(), narrative/scope from the row's columns). The legacy
30370
30468
  // dialog payload was retired with the Generate dialog (report-session RS5).
30371
- body: c29.noBody(),
30469
+ body: c31.noBody(),
30372
30470
  responses: {
30373
30471
  202: StartReportPdfGenerationTaskResponseSchema,
30374
30472
  400: ErrorResponseSchema,
@@ -30559,8 +30657,8 @@ var pentestReportPdfContract = c29.router({
30559
30657
  });
30560
30658
 
30561
30659
  // ../../packages/api-contracts/src/contracts/v1/pentest-validation.ts
30562
- var c30 = initContract();
30563
- var pentestValidationContract = c30.router({
30660
+ var c32 = initContract();
30661
+ var pentestValidationContract = c32.router({
30564
30662
  listValidationRuns: {
30565
30663
  method: "GET",
30566
30664
  path: "/organizations/:organizationId/pentests/:pentestId/validation-runs",
@@ -30668,8 +30766,8 @@ var pentestValidationContract = c30.router({
30668
30766
  });
30669
30767
 
30670
30768
  // ../../packages/api-contracts/src/contracts/v1/repository.ts
30671
- var c31 = initContract();
30672
- var repositoryContract = c31.router({
30769
+ var c33 = initContract();
30770
+ var repositoryContract = c33.router({
30673
30771
  createRepository: {
30674
30772
  method: "POST",
30675
30773
  path: "/organizations/:organizationId/repositories",
@@ -30826,7 +30924,7 @@ var repositoryContract = c31.router({
30826
30924
  method: "POST",
30827
30925
  path: "/organizations/:organizationId/repositories/scanning-branch/confirm-defaults",
30828
30926
  pathParams: OrgIdParamsSchema,
30829
- body: c31.noBody(),
30927
+ body: c33.noBody(),
30830
30928
  responses: {
30831
30929
  200: ConfirmScanningBranchDefaultsResponseSchema,
30832
30930
  401: ErrorResponseSchema,
@@ -30960,8 +31058,8 @@ var ListScanLogsResponseSchema = external_exports.object({
30960
31058
  });
30961
31059
 
30962
31060
  // ../../packages/api-contracts/src/contracts/v1/scan.ts
30963
- var c32 = initContract();
30964
- var scanContract = c32.router({
31061
+ var c34 = initContract();
31062
+ var scanContract = c34.router({
30965
31063
  createScan: {
30966
31064
  method: "POST",
30967
31065
  path: "/organizations/:organizationId/scans",
@@ -31123,8 +31221,8 @@ var AttachTestIntegrationRequestSchema = external_exports.object({
31123
31221
  }).strict();
31124
31222
 
31125
31223
  // ../../packages/api-contracts/src/contracts/v1/test-integration.ts
31126
- var c33 = initContract();
31127
- var testIntegrationContract = c33.router({
31224
+ var c35 = initContract();
31225
+ var testIntegrationContract = c35.router({
31128
31226
  // -- Fixture CRUD (org-less, staff-only) ----------------------------------
31129
31227
  listTestIntegrations: {
31130
31228
  method: "GET",
@@ -31251,8 +31349,8 @@ var UpdateStaffProfileRequestSchema = external_exports.object({
31251
31349
  });
31252
31350
 
31253
31351
  // ../../packages/api-contracts/src/contracts/v1/user.ts
31254
- var c34 = initContract();
31255
- var userContract = c34.router({
31352
+ var c36 = initContract();
31353
+ var userContract = c36.router({
31256
31354
  getStaffProfile: {
31257
31355
  method: "GET",
31258
31356
  path: "/staff/profile",
@@ -31349,8 +31447,8 @@ var VantaIntegrationResponseSchema = external_exports.object({
31349
31447
  });
31350
31448
 
31351
31449
  // ../../packages/api-contracts/src/contracts/v1/vanta-integration.ts
31352
- var c35 = initContract();
31353
- var vantaIntegrationContract = c35.router({
31450
+ var c37 = initContract();
31451
+ var vantaIntegrationContract = c37.router({
31354
31452
  createVantaIntegration: {
31355
31453
  method: "POST",
31356
31454
  path: "/organizations/:organizationId/vanta-integration",
@@ -31682,8 +31780,8 @@ var VerifySharedVulnerabilityEmailCodeResponseSchema = external_exports.object({
31682
31780
  });
31683
31781
 
31684
31782
  // ../../packages/api-contracts/src/contracts/v1/vulnerability.ts
31685
- var c36 = initContract();
31686
- var vulnerabilityContract = c36.router({
31783
+ var c38 = initContract();
31784
+ var vulnerabilityContract = c38.router({
31687
31785
  filterVulnerabilities: {
31688
31786
  method: "POST",
31689
31787
  path: "/organizations/:organizationId/vulnerabilities/filter",
@@ -31891,8 +31989,8 @@ var UpdateVulnerabilityNoteRequestSchema = external_exports.object({
31891
31989
  });
31892
31990
 
31893
31991
  // ../../packages/api-contracts/src/contracts/v1/vulnerability-note.ts
31894
- var c37 = initContract();
31895
- var vulnerabilityNoteContract = c37.router({
31992
+ var c39 = initContract();
31993
+ var vulnerabilityNoteContract = c39.router({
31896
31994
  listNotes: {
31897
31995
  method: "GET",
31898
31996
  path: "/organizations/:organizationId/vulnerabilities/:vulnerabilityId/notes",
@@ -32073,8 +32171,8 @@ var ListWebhookDeliveriesResponseSchema = external_exports.object({
32073
32171
  });
32074
32172
 
32075
32173
  // ../../packages/api-contracts/src/contracts/v1/webhook-settings.ts
32076
- var c38 = initContract();
32077
- var webhookSettingsContract = c38.router({
32174
+ var c40 = initContract();
32175
+ var webhookSettingsContract = c40.router({
32078
32176
  listWebhookEndpoints: {
32079
32177
  method: "GET",
32080
32178
  path: "/organizations/:organizationId/webhook-settings/endpoints",
@@ -32212,11 +32310,12 @@ var webhookSettingsContract = c38.router({
32212
32310
  });
32213
32311
 
32214
32312
  // ../../packages/api-contracts/src/contracts/v1/index.ts
32215
- var c39 = initContract();
32216
- var v1Contract = c39.router(
32313
+ var c41 = initContract();
32314
+ var v1Contract = c41.router(
32217
32315
  {
32218
32316
  admin: adminContract,
32219
32317
  cloudIntegration: cloudIntegrationContract,
32318
+ codeSize: codeSizeContract,
32220
32319
  scan: scanContract,
32221
32320
  organization: organizationContract,
32222
32321
  user: userContract,
@@ -32243,6 +32342,7 @@ var v1Contract = c39.router(
32243
32342
  pentestAuditLog: pentestAuditLogContract,
32244
32343
  pentestEnvironment: pentestEnvironmentContract,
32245
32344
  pentestEngagementExclusion: pentestEngagementExclusionContract,
32345
+ pentestAuthorizedDomain: pentestAuthorizedDomainContract,
32246
32346
  pentestFinding: pentestFindingContract,
32247
32347
  pentestHypothesis: pentestHypothesisContract,
32248
32348
  pentestValidation: pentestValidationContract,
@@ -32261,8 +32361,8 @@ var v1Contract = c39.router(
32261
32361
  );
32262
32362
 
32263
32363
  // ../../packages/api-contracts/src/contracts/index.ts
32264
- var c40 = initContract();
32265
- var contract = c40.router({
32364
+ var c42 = initContract();
32365
+ var contract = c42.router({
32266
32366
  v1: v1Contract
32267
32367
  });
32268
32368
 
@@ -32311,7 +32411,7 @@ var ComplianceRegimeValues = [
32311
32411
  var ComplianceRegime = external_exports.enum(ComplianceRegimeValues);
32312
32412
 
32313
32413
  // ../../packages/api-contracts/src/contracts/v1/agent-session-internal.ts
32314
- var c41 = initContract();
32414
+ var c43 = initContract();
32315
32415
  var AgentSessionInternalParamsSchema = external_exports.object({
32316
32416
  agentSessionId: external_exports.uuid()
32317
32417
  });
@@ -33166,7 +33266,7 @@ var ReportUpdateScopeRequestSchema = external_exports.object({
33166
33266
  expectedUpdatedAt: reportExpectedUpdatedAt,
33167
33267
  rows: external_exports.array(ScopeRowSchema).max(100)
33168
33268
  });
33169
- var agentSessionInternalContract = c41.router({
33269
+ var agentSessionInternalContract = c43.router({
33170
33270
  postEvents: {
33171
33271
  method: "POST",
33172
33272
  path: "/internal/v1/agent-sessions/:agentSessionId/events",
@@ -33866,8 +33966,8 @@ var GitHubWebhookResponseSchema = external_exports.object({
33866
33966
  });
33867
33967
 
33868
33968
  // ../../packages/api-contracts/src/contracts/webhooks/github.ts
33869
- var c42 = initContract();
33870
- var githubWebhookContract = c42.router(
33969
+ var c44 = initContract();
33970
+ var githubWebhookContract = c44.router(
33871
33971
  {
33872
33972
  handleWebhook: {
33873
33973
  method: "POST",
@@ -33885,7 +33985,7 @@ var githubWebhookContract = c42.router(
33885
33985
  pathPrefix: "/webhooks"
33886
33986
  }
33887
33987
  );
33888
- var githubReadonlyWebhookContract = c42.router(
33988
+ var githubReadonlyWebhookContract = c44.router(
33889
33989
  {
33890
33990
  handleWebhook: {
33891
33991
  method: "POST",
@@ -33905,9 +34005,9 @@ var githubReadonlyWebhookContract = c42.router(
33905
34005
  );
33906
34006
 
33907
34007
  // ../../packages/api-contracts/src/contracts/webhooks/linear.ts
33908
- var c43 = initContract();
34008
+ var c45 = initContract();
33909
34009
  var LinearWebhookResponseSchema = external_exports.object({ ok: external_exports.boolean() });
33910
- var linearWebhookContract = c43.router(
34010
+ var linearWebhookContract = c45.router(
33911
34011
  {
33912
34012
  handleWebhook: {
33913
34013
  method: "POST",
@@ -33927,7 +34027,7 @@ var linearWebhookContract = c43.router(
33927
34027
  );
33928
34028
 
33929
34029
  // ../../packages/api-contracts/src/contracts/forge/bitbucket.ts
33930
- var c44 = initContract();
34030
+ var c46 = initContract();
33931
34031
  var InstallEventSchema = external_exports.object({
33932
34032
  eventType: external_exports.enum(["avi:forge:installed:app", "avi:forge:upgraded:app"]),
33933
34033
  context: external_exports.object({ cloudId: external_exports.string().min(1) }).loose(),
@@ -33956,7 +34056,7 @@ var ForgePairingCodeResponseSchema = external_exports.discriminatedUnion("state"
33956
34056
  expiresInSeconds: external_exports.number().int()
33957
34057
  })
33958
34058
  ]);
33959
- var forgeBitbucketContract = c44.router(
34059
+ var forgeBitbucketContract = c46.router(
33960
34060
  {
33961
34061
  lifecycle: {
33962
34062
  method: "POST",
@@ -34003,8 +34103,8 @@ var HealthResponseSchema = external_exports.object({
34003
34103
  });
34004
34104
 
34005
34105
  // ../../packages/api-contracts/src/contracts/health.ts
34006
- var c45 = initContract();
34007
- var healthContract = c45.router({
34106
+ var c47 = initContract();
34107
+ var healthContract = c47.router({
34008
34108
  getHealth: {
34009
34109
  method: "GET",
34010
34110
  path: "/health",
@@ -34016,8 +34116,8 @@ var healthContract = c45.router({
34016
34116
  });
34017
34117
 
34018
34118
  // ../../packages/api-contracts/src/contracts/v1/vulnerability-share.ts
34019
- var c46 = initContract();
34020
- var vulnerabilityShareContract = c46.router(
34119
+ var c48 = initContract();
34120
+ var vulnerabilityShareContract = c48.router(
34021
34121
  {
34022
34122
  resolveShareLink: {
34023
34123
  method: "GET",
@@ -34104,8 +34204,8 @@ var UpdatePrVulnerabilityRequestSchema = external_exports.object({
34104
34204
  });
34105
34205
 
34106
34206
  // ../../packages/api-contracts/src/contracts/v1/pr-vulnerability.ts
34107
- var c47 = initContract();
34108
- var prVulnerabilityContract = c47.router(
34207
+ var c49 = initContract();
34208
+ var prVulnerabilityContract = c49.router(
34109
34209
  {
34110
34210
  listPrVulnerabilities: {
34111
34211
  method: "GET",
@@ -36658,12 +36758,12 @@ function buildApplicationsTable(apps) {
36658
36758
  repos: String(a.repositories.length),
36659
36759
  url: a.applicationUrl ? sanitizeDisplay(a.applicationUrl) : "\u2014"
36660
36760
  }));
36661
- const idWidth = Math.max(2, ...cells.map((c49) => c49.id.length));
36662
- const nameWidth = Math.max(4, ...cells.map((c49) => c49.name.length));
36663
- const typeWidth = Math.max(4, ...cells.map((c49) => c49.type.length));
36761
+ const idWidth = Math.max(2, ...cells.map((c51) => c51.id.length));
36762
+ const nameWidth = Math.max(4, ...cells.map((c51) => c51.name.length));
36763
+ const typeWidth = Math.max(4, ...cells.map((c51) => c51.type.length));
36664
36764
  const header = `${"ID".padEnd(idWidth)} ${"NAME".padEnd(nameWidth)} ${"TYPE".padEnd(typeWidth)} REPOS URL`;
36665
36765
  const rows = cells.map(
36666
- (c49) => `${c49.id.padEnd(idWidth)} ${c49.name.padEnd(nameWidth)} ${c49.type.padEnd(typeWidth)} ${c49.repos.padStart(5)} ${c49.url}`
36766
+ (c51) => `${c51.id.padEnd(idWidth)} ${c51.name.padEnd(nameWidth)} ${c51.type.padEnd(typeWidth)} ${c51.repos.padStart(5)} ${c51.url}`
36667
36767
  );
36668
36768
  return { header, rows };
36669
36769
  }
@@ -36683,12 +36783,12 @@ function buildApplicationRepositoriesTable(links) {
36683
36783
  path: l.repositoryPath ? sanitizeDisplay(l.repositoryPath) : "\u2014",
36684
36784
  status: formatStatus(l.repositoryStatus)
36685
36785
  }));
36686
- const nameWidth = Math.max(10, ...cells.map((c49) => c49.name.length));
36687
- const roleWidth = Math.max(4, ...cells.map((c49) => c49.role.length));
36688
- const pathWidth = Math.max(4, ...cells.map((c49) => c49.path.length));
36786
+ const nameWidth = Math.max(10, ...cells.map((c51) => c51.name.length));
36787
+ const roleWidth = Math.max(4, ...cells.map((c51) => c51.role.length));
36788
+ const pathWidth = Math.max(4, ...cells.map((c51) => c51.path.length));
36689
36789
  const header = `${"REPOSITORY".padEnd(nameWidth)} SCAN ${"ROLE".padEnd(roleWidth)} ${"PATH".padEnd(pathWidth)} STATUS`;
36690
36790
  const rows = cells.map(
36691
- (c49) => `${c49.name.padEnd(nameWidth)} ${c49.scan.padEnd(4)} ${c49.role.padEnd(roleWidth)} ${c49.path.padEnd(pathWidth)} ${c49.status}`
36791
+ (c51) => `${c51.name.padEnd(nameWidth)} ${c51.scan.padEnd(4)} ${c51.role.padEnd(roleWidth)} ${c51.path.padEnd(pathWidth)} ${c51.status}`
36692
36792
  );
36693
36793
  return { header, rows };
36694
36794
  }
@@ -37800,14 +37900,14 @@ var yt = (t) => {
37800
37900
  };
37801
37901
  var ee = (t, r, s, i, u) => {
37802
37902
  let n = r, o = 0;
37803
- for (let c49 = s; c49 < i; c49++) {
37804
- const a = t[c49];
37903
+ for (let c51 = s; c51 < i; c51++) {
37904
+ const a = t[c51];
37805
37905
  if (n = n - a.length, o++, n <= u) break;
37806
37906
  }
37807
37907
  return { lineCount: n, removals: o };
37808
37908
  };
37809
37909
  var Y2 = ({ cursor: t, options: r, style: s, output: i = process.stdout, maxItems: u = Number.POSITIVE_INFINITY, columnPadding: n = 0, rowPadding: o = 4 }) => {
37810
- const c49 = A(i) - n, a = L(i), l = e("dim", "..."), d2 = Math.max(a - o, 0), y = Math.max(Math.min(u, d2), 5);
37910
+ const c51 = A(i) - n, a = L(i), l = e("dim", "..."), d2 = Math.max(a - o, 0), y = Math.max(Math.min(u, d2), 5);
37811
37911
  let p2 = 0;
37812
37912
  t >= y - 3 && (p2 = Math.max(Math.min(t - y + 3, r.length - y), 0));
37813
37913
  let m = y < r.length && p2 > 0, g = y < r.length && p2 + y < r.length;
@@ -37816,7 +37916,7 @@ var Y2 = ({ cursor: t, options: r, style: s, output: i = process.stdout, maxItem
37816
37916
  m && f++, g && f++;
37817
37917
  const v2 = p2 + (m ? 1 : 0), T = S2 - (g ? 1 : 0);
37818
37918
  for (let b2 = v2; b2 < T; b2++) {
37819
- const G2 = wrapAnsi(s(r[b2], b2 === t), c49, { hard: true, trim: false }).split(`
37919
+ const G2 = wrapAnsi(s(r[b2], b2 === t), c51, { hard: true, trim: false }).split(`
37820
37920
  `);
37821
37921
  h2.push(G2), f += G2.length;
37822
37922
  }
@@ -37833,22 +37933,22 @@ var Y2 = ({ cursor: t, options: r, style: s, output: i = process.stdout, maxItem
37833
37933
  var ue = (t) => {
37834
37934
  const r = t.active ?? "Yes", s = t.inactive ?? "No";
37835
37935
  return new X({ active: r, inactive: s, signal: t.signal, input: t.input, output: t.output, initialValue: t.initialValue ?? true, render() {
37836
- const i = t.withGuide ?? h.withGuide, u = `${M(this.state)} `, n = i ? `${e("gray", $)} ` : "", o = W(t.output, t.message, n, u), c49 = `${i ? `${e("gray", $)}
37936
+ const i = t.withGuide ?? h.withGuide, u = `${M(this.state)} `, n = i ? `${e("gray", $)} ` : "", o = W(t.output, t.message, n, u), c51 = `${i ? `${e("gray", $)}
37837
37937
  ` : ""}${o}
37838
37938
  `, a = this.value ? r : s;
37839
37939
  switch (this.state) {
37840
37940
  case "submit": {
37841
37941
  const l = i ? `${e("gray", $)} ` : "";
37842
- return `${c49}${l}${e("dim", a)}`;
37942
+ return `${c51}${l}${e("dim", a)}`;
37843
37943
  }
37844
37944
  case "cancel": {
37845
37945
  const l = i ? `${e("gray", $)} ` : "";
37846
- return `${c49}${l}${e(["strikethrough", "dim"], a)}${i ? `
37946
+ return `${c51}${l}${e(["strikethrough", "dim"], a)}${i ? `
37847
37947
  ${e("gray", $)}` : ""}`;
37848
37948
  }
37849
37949
  default: {
37850
37950
  const l = i ? `${e("cyan", $)} ` : "", d2 = i ? e("cyan", E2) : "";
37851
- return `${c49}${l}${this.value ? `${e("green", z4)} ${r}` : `${e("dim", H)} ${e("dim", r)}`}${t.vertical ? i ? `
37951
+ return `${c51}${l}${this.value ? `${e("green", z4)} ${r}` : `${e("dim", H)} ${e("dim", r)}`}${t.vertical ? i ? `
37852
37952
  ${e("cyan", $)} ` : `
37853
37953
  ` : ` ${e("dim", "/")} `}${this.value ? `${e("dim", H)} ${e("dim", s)}` : `${e("green", z4)} ${s}`}
37854
37954
  ${d2}
@@ -37870,21 +37970,21 @@ var fe = (t) => new rt({ validate: t.validate, placeholder: t.placeholder, defau
37870
37970
  ${e(this.focused === "submit" ? "cyan" : "dim", "[ submit ]")}` : "";
37871
37971
  switch (this.state) {
37872
37972
  case "error": {
37873
- const c49 = `${e("yellow", $)} `, a = r ? W(t.output, u, c49, void 0) : u, l = e("yellow", E2);
37973
+ const c51 = `${e("yellow", $)} `, a = r ? W(t.output, u, c51, void 0) : u, l = e("yellow", E2);
37874
37974
  return `${s}${a}
37875
37975
  ${l} ${e("yellow", this.error)}${o}
37876
37976
  `;
37877
37977
  }
37878
37978
  case "submit": {
37879
- const c49 = `${e("gray", $)} `, a = r ? W(t.output, n, c49, void 0, (l) => e("dim", l)) : n ? e("dim", n) : "";
37979
+ const c51 = `${e("gray", $)} `, a = r ? W(t.output, n, c51, void 0, (l) => e("dim", l)) : n ? e("dim", n) : "";
37880
37980
  return `${s}${a}`;
37881
37981
  }
37882
37982
  case "cancel": {
37883
- const c49 = `${e("gray", $)} `, a = r ? W(t.output, n, c49, void 0, (l) => e(["strikethrough", "dim"], l)) : n ? e(["strikethrough", "dim"], n) : "";
37983
+ const c51 = `${e("gray", $)} `, a = r ? W(t.output, n, c51, void 0, (l) => e(["strikethrough", "dim"], l)) : n ? e(["strikethrough", "dim"], n) : "";
37884
37984
  return `${s}${a}`;
37885
37985
  }
37886
37986
  default: {
37887
- const c49 = r ? `${e("cyan", $)} ` : "", a = r ? e("cyan", E2) : "", l = r ? W(t.output, u, c49) : u;
37987
+ const c51 = r ? `${e("cyan", $)} ` : "", a = r ? e("cyan", E2) : "", l = r ? W(t.output, u, c51) : u;
37888
37988
  return `${s}${l}
37889
37989
  ${a}${o}
37890
37990
  `;
@@ -37905,7 +38005,7 @@ ${e("reset", e("dim", `Press ${e(["gray", "bgWhite", "inverse"], " space ")} to
37905
38005
  }, render() {
37906
38006
  const i = t.withGuide ?? h.withGuide, u = W(t.output, t.message, i ? `${yt(this.state)} ` : "", `${M(this.state)} `), n = `${i ? `${e("gray", $)}
37907
38007
  ` : ""}${u}
37908
- `, o = this.value ?? [], c49 = (a, l) => {
38008
+ `, o = this.value ?? [], c51 = (a, l) => {
37909
38009
  if (a.disabled) return r(a, "disabled");
37910
38010
  const d2 = o.includes(a.value);
37911
38011
  return l && d2 ? r(a, "active-selected") : d2 ? r(a, "selected") : r(a, l ? "active" : "inactive");
@@ -37928,7 +38028,7 @@ ${e("gray", $)}` : ""}`;
37928
38028
  `), d2 = n.split(`
37929
38029
  `).length, y = l.split(`
37930
38030
  `).length + 1;
37931
- return `${n}${a}${Y2({ output: t.output, options: this.options, cursor: this.cursor, maxItems: t.maxItems, columnPadding: a.length, rowPadding: d2 + y, style: c49 }).join(`
38031
+ return `${n}${a}${Y2({ output: t.output, options: this.options, cursor: this.cursor, maxItems: t.maxItems, columnPadding: a.length, rowPadding: d2 + y, style: c51 }).join(`
37932
38032
  ${a}`)}
37933
38033
  ${l}
37934
38034
  `;
@@ -37936,7 +38036,7 @@ ${l}
37936
38036
  default: {
37937
38037
  const a = i ? `${e("cyan", $)} ` : "", l = n.split(`
37938
38038
  `).length, d2 = i ? 2 : 1;
37939
- return `${n}${a}${Y2({ output: t.output, options: this.options, cursor: this.cursor, maxItems: t.maxItems, columnPadding: a.length, rowPadding: l + d2, style: c49 }).join(`
38039
+ return `${n}${a}${Y2({ output: t.output, options: this.options, cursor: this.cursor, maxItems: t.maxItems, columnPadding: a.length, rowPadding: l + d2, style: c51 }).join(`
37940
38040
  ${a}`)}
37941
38041
  ${i ? e("cyan", E2) : ""}
37942
38042
  `;
@@ -37950,9 +38050,9 @@ var Ce = (t) => new ot({ validate: t.validate, mask: t.mask ?? Gt, signal: t.sig
37950
38050
  `, i = this.userInputWithCursor, u = this.masked;
37951
38051
  switch (this.state) {
37952
38052
  case "error": {
37953
- const n = r ? `${e("yellow", $)} ` : "", o = r ? `${e("yellow", E2)} ` : "", c49 = u ?? "";
38053
+ const n = r ? `${e("yellow", $)} ` : "", o = r ? `${e("yellow", E2)} ` : "", c51 = u ?? "";
37954
38054
  return t.clearOnError && this.clear(), `${s.trim()}
37955
- ${n}${c49}
38055
+ ${n}${c51}
37956
38056
  ${o}${e("yellow", this.error)}
37957
38057
  `;
37958
38058
  }
@@ -38000,19 +38100,19 @@ var Ee = (t) => {
38000
38100
  `;
38001
38101
  switch (this.state) {
38002
38102
  case "submit": {
38003
- const c49 = s ? `${e("gray", $)} ` : "", a = W(t.output, r(this.options[this.cursor], "selected"), c49);
38103
+ const c51 = s ? `${e("gray", $)} ` : "", a = W(t.output, r(this.options[this.cursor], "selected"), c51);
38004
38104
  return `${o}${a}`;
38005
38105
  }
38006
38106
  case "cancel": {
38007
- const c49 = s ? `${e("gray", $)} ` : "", a = W(t.output, r(this.options[this.cursor], "cancelled"), c49);
38107
+ const c51 = s ? `${e("gray", $)} ` : "", a = W(t.output, r(this.options[this.cursor], "cancelled"), c51);
38008
38108
  return `${o}${a}${s ? `
38009
38109
  ${e("gray", $)}` : ""}`;
38010
38110
  }
38011
38111
  default: {
38012
- const c49 = s ? `${e("cyan", $)} ` : "", a = s ? e("cyan", E2) : "", l = o.split(`
38112
+ const c51 = s ? `${e("cyan", $)} ` : "", a = s ? e("cyan", E2) : "", l = o.split(`
38013
38113
  `).length, d2 = s ? 2 : 1;
38014
- return `${o}${c49}${Y2({ output: t.output, cursor: this.cursor, options: this.options, maxItems: t.maxItems, columnPadding: c49.length, rowPadding: l + d2, style: (y, p2) => r(y, y.disabled ? "disabled" : p2 ? "active" : "inactive") }).join(`
38015
- ${c49}`)}
38114
+ return `${o}${c51}${Y2({ output: t.output, cursor: this.cursor, options: this.options, maxItems: t.maxItems, columnPadding: c51.length, rowPadding: l + d2, style: (y, p2) => r(y, y.disabled ? "disabled" : p2 ? "active" : "inactive") }).join(`
38115
+ ${c51}`)}
38016
38116
  ${a}
38017
38117
  `;
38018
38118
  }
@@ -38770,7 +38870,7 @@ function extractCommandTree(cmd) {
38770
38870
  description: o.description,
38771
38871
  takesValue: o.required || o.optional
38772
38872
  }));
38773
- const subcommands = cmd.commands.filter((c49) => !c49._hidden).map((c49) => extractCommandTree(c49));
38873
+ const subcommands = cmd.commands.filter((c51) => !c51._hidden).map((c51) => extractCommandTree(c51));
38774
38874
  return {
38775
38875
  name: cmd.name(),
38776
38876
  description: cmd.description(),
@@ -38836,7 +38936,7 @@ function generateBashCompletion(tree, binName) {
38836
38936
  }
38837
38937
  function collectBashCases(tree, prefix) {
38838
38938
  const cases = /* @__PURE__ */ new Map();
38839
- const subcommandNames = tree.subcommands.map((c49) => c49.name);
38939
+ const subcommandNames = tree.subcommands.map((c51) => c51.name);
38840
38940
  const optionNames = tree.options.flatMap((o) => o.short ? [o.long, o.short] : [o.long]);
38841
38941
  const extraOptions = prefix === "" ? ["--help", "--version"] : ["--help"];
38842
38942
  const allOptions = [.../* @__PURE__ */ new Set([...optionNames, ...extraOptions])];
@@ -39519,16 +39619,16 @@ function printCredentialsTsv(creds) {
39519
39619
  }
39520
39620
  }
39521
39621
  function buildCredentialsTable(creds) {
39522
- const cells = creds.map((c49) => ({
39523
- id: c49.credentialId,
39524
- label: sanitizeDisplay(c49.label),
39525
- type: c49.credentialType
39622
+ const cells = creds.map((c51) => ({
39623
+ id: c51.credentialId,
39624
+ label: sanitizeDisplay(c51.label),
39625
+ type: c51.credentialType
39526
39626
  }));
39527
- const idWidth = Math.max(2, ...cells.map((c49) => c49.id.length));
39528
- const labelWidth = Math.max(5, ...cells.map((c49) => c49.label.length));
39627
+ const idWidth = Math.max(2, ...cells.map((c51) => c51.id.length));
39628
+ const labelWidth = Math.max(5, ...cells.map((c51) => c51.label.length));
39529
39629
  const header = `${"ID".padEnd(idWidth)} ${"LABEL".padEnd(labelWidth)} TYPE`;
39530
39630
  const rows = cells.map(
39531
- (c49) => `${c49.id.padEnd(idWidth)} ${c49.label.padEnd(labelWidth)} ${c49.type}`
39631
+ (c51) => `${c51.id.padEnd(idWidth)} ${c51.label.padEnd(labelWidth)} ${c51.type}`
39532
39632
  );
39533
39633
  return { header, rows };
39534
39634
  }
@@ -40017,7 +40117,7 @@ function renderEnvironmentDetail(env2) {
40017
40117
  return [
40018
40118
  `${"ID:".padEnd(pad)} ${env2.environmentId}`,
40019
40119
  `${"Name:".padEnd(pad)} ${sanitizeDisplay(env2.name)}`,
40020
- `${"URL:".padEnd(pad)} ${sanitizeDisplay(env2.primaryUrl)}`,
40120
+ `${"URL:".padEnd(pad)} ${env2.primaryUrl != null ? sanitizeDisplay(env2.primaryUrl) : "\u2014"}`,
40021
40121
  `${"Production:".padEnd(pad)} ${env2.isProduction ? "yes" : "no"}`,
40022
40122
  `${"Description:".padEnd(pad)} ${env2.description ? sanitizeDisplay(env2.description) : "\u2014"}`,
40023
40123
  `${"Application:".padEnd(pad)} ${env2.applicationId}`,
@@ -40033,7 +40133,7 @@ function printEnvironmentsTsv(envs) {
40033
40133
  [
40034
40134
  tsvSafe(env2.environmentId),
40035
40135
  tsvSafe(sanitizeDisplay(env2.name)),
40036
- tsvSafe(sanitizeDisplay(env2.primaryUrl)),
40136
+ tsvSafe(sanitizeDisplay(env2.primaryUrl ?? "")),
40037
40137
  String(env2.isProduction),
40038
40138
  tsvSafe(sanitizeDisplay(env2.description ?? "")),
40039
40139
  tsvSafe(toIso(env2.createdAt))
@@ -40065,7 +40165,7 @@ function printOrgEnvironmentsTsv(envs) {
40065
40165
  tsvSafe(env2.applicationId),
40066
40166
  tsvSafe(sanitizeDisplay(env2.applicationName)),
40067
40167
  tsvSafe(sanitizeDisplay(env2.name)),
40068
- tsvSafe(sanitizeDisplay(env2.primaryUrl)),
40168
+ tsvSafe(sanitizeDisplay(env2.primaryUrl ?? "")),
40069
40169
  String(env2.isProduction),
40070
40170
  tsvSafe(toIso(env2.createdAt))
40071
40171
  ].join(" ")
@@ -40077,17 +40177,17 @@ function buildEnvironmentTable(envs, leading) {
40077
40177
  leading: leading.map((column) => sanitizeDisplay(column.value(e2))),
40078
40178
  name: sanitizeDisplay(e2.name),
40079
40179
  prod: e2.isProduction ? "yes" : "no",
40080
- url: sanitizeDisplay(e2.primaryUrl)
40180
+ url: e2.primaryUrl != null ? sanitizeDisplay(e2.primaryUrl) : "\u2014"
40081
40181
  }));
40082
40182
  const leadingWidths = leading.map(
40083
- (column, i) => Math.max(column.header.length, ...cells.map((c49) => c49.leading[i]?.length ?? 0))
40183
+ (column, i) => Math.max(column.header.length, ...cells.map((c51) => c51.leading[i]?.length ?? 0))
40084
40184
  );
40085
- const nameWidth = Math.max(4, ...cells.map((c49) => c49.name.length));
40185
+ const nameWidth = Math.max(4, ...cells.map((c51) => c51.name.length));
40086
40186
  const padLeading = (values) => values.map((v2, i) => v2.padEnd(leadingWidths[i] ?? 0)).join(" ");
40087
40187
  return {
40088
- header: `${padLeading(leading.map((c49) => c49.header))} ${"NAME".padEnd(nameWidth)} PROD URL`,
40188
+ header: `${padLeading(leading.map((c51) => c51.header))} ${"NAME".padEnd(nameWidth)} PROD URL`,
40089
40189
  rows: cells.map(
40090
- (c49) => `${padLeading(c49.leading)} ${c49.name.padEnd(nameWidth)} ${c49.prod.padEnd(4)} ${c49.url}`
40190
+ (c51) => `${padLeading(c51.leading)} ${c51.name.padEnd(nameWidth)} ${c51.prod.padEnd(4)} ${c51.url}`
40091
40191
  )
40092
40192
  };
40093
40193
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "securewithtrace",
3
- "version": "0.32.0",
3
+ "version": "0.33.0",
4
4
  "description": "Official Trace CLI for vulnerability intelligence in your terminal",
5
5
  "type": "module",
6
6
  "bin": {