open-azdo 0.2.0 → 0.2.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/open-azdo.js CHANGED
@@ -46645,32 +46645,42 @@ class AzureDevOpsDecodeError extends exports_Schema.TaggedErrorClass()("AzureDev
46645
46645
  }
46646
46646
 
46647
46647
  // ../../packages/azdo/src/Schemas.ts
46648
- var PullRequestMetadataSchema = exports_Schema.Struct({
46648
+ var PullRequestMetadataResponseSchema = exports_Schema.Struct({
46649
46649
  title: exports_Schema.String,
46650
- description: exports_Schema.String,
46651
- url: exports_Schema.optionalKey(exports_Schema.String)
46652
- });
46650
+ description: exports_Schema.optionalKey(exports_Schema.Union([exports_Schema.String, exports_Schema.Null])),
46651
+ url: exports_Schema.optionalKey(exports_Schema.Union([exports_Schema.String, exports_Schema.Null]))
46652
+ });
46653
+ var ExistingThreadStatusSchema = exports_Schema.Union([
46654
+ exports_Schema.Int,
46655
+ exports_Schema.Literal("active"),
46656
+ exports_Schema.Literal("fixed"),
46657
+ exports_Schema.Literal("wontFix"),
46658
+ exports_Schema.Literal("closed"),
46659
+ exports_Schema.Literal("byDesign"),
46660
+ exports_Schema.Literal("pending")
46661
+ ]);
46662
+ var NullableIntSchema = exports_Schema.Union([exports_Schema.Int, exports_Schema.Null]);
46653
46663
  var ExistingThreadSchema = exports_Schema.Struct({
46654
46664
  id: exports_Schema.Int,
46655
- status: exports_Schema.Int,
46665
+ status: ExistingThreadStatusSchema,
46656
46666
  comments: exports_Schema.Array(exports_Schema.Struct({
46657
46667
  id: exports_Schema.Int,
46658
- content: exports_Schema.optionalKey(exports_Schema.String)
46668
+ content: exports_Schema.optionalKey(exports_Schema.Union([exports_Schema.String, exports_Schema.Null]))
46659
46669
  })),
46660
46670
  threadContext: exports_Schema.optionalKey(exports_Schema.Struct({
46661
46671
  filePath: exports_Schema.optionalKey(exports_Schema.String),
46662
46672
  rightFileStart: exports_Schema.optionalKey(exports_Schema.Struct({
46663
- line: exports_Schema.optionalKey(exports_Schema.Int),
46664
- offset: exports_Schema.optionalKey(exports_Schema.Int)
46673
+ line: exports_Schema.optionalKey(NullableIntSchema),
46674
+ offset: exports_Schema.optionalKey(NullableIntSchema)
46665
46675
  })),
46666
46676
  rightFileEnd: exports_Schema.optionalKey(exports_Schema.Struct({
46667
- line: exports_Schema.optionalKey(exports_Schema.Int),
46668
- offset: exports_Schema.optionalKey(exports_Schema.Int)
46677
+ line: exports_Schema.optionalKey(NullableIntSchema),
46678
+ offset: exports_Schema.optionalKey(NullableIntSchema)
46669
46679
  }))
46670
46680
  }))
46671
46681
  });
46672
46682
  var ExistingThreadsResponseSchema = exports_Schema.Struct({
46673
- value: exports_Schema.Array(ExistingThreadSchema)
46683
+ value: exports_Schema.optionalKey(exports_Schema.Array(ExistingThreadSchema))
46674
46684
  });
46675
46685
 
46676
46686
  // ../../packages/azdo/src/Layers/AzureDevOpsClient.ts
@@ -46719,7 +46729,12 @@ var getPullRequestMetadata = ({
46719
46729
  token
46720
46730
  }) => requestJson(buildPullRequestUrl(context2), { method: "GET", headers: createHeaders(token) }, (input) => {
46721
46731
  try {
46722
- return exports_Schema.decodeUnknownSync(PullRequestMetadataSchema)(input);
46732
+ const metadata = exports_Schema.decodeUnknownSync(PullRequestMetadataResponseSchema)(input);
46733
+ return {
46734
+ title: metadata.title,
46735
+ description: metadata.description ?? "",
46736
+ url: metadata.url ?? undefined
46737
+ };
46723
46738
  } catch (error2) {
46724
46739
  throw new AzureDevOpsDecodeError({
46725
46740
  message: "Azure DevOps response did not match the expected schema.",
@@ -47478,6 +47493,7 @@ var ManagedReviewStateSchema = exports_Schema.Struct({
47478
47493
  inlineFindingsCount: exports_Schema.Int,
47479
47494
  unmappedNotesCount: exports_Schema.Int
47480
47495
  });
47496
+ var isActiveThreadStatus = (status) => status === 1 || status === "active" || status === "pending";
47481
47497
  var STATE_SCHEMA_VERSION = 1;
47482
47498
  var FINDING_MARKER_PREFIX = "<!-- open-azdo:";
47483
47499
  var SUMMARY_STATE_PREFIX = "<!-- open-azdo-review:";
@@ -47631,7 +47647,7 @@ var mergeFollowUpReviewResult = ({
47631
47647
  scopedDeletedLinesByFile,
47632
47648
  reviewResult
47633
47649
  }) => {
47634
- const carriedForwardFindings = listManagedFindingThreads(existingThreads).filter((existingThread) => existingThread.thread.status === 1).filter((existingThread) => !findingTouchesScopedDiff(existingThread.finding, scopedChangedLinesByFile, scopedDeletedLinesByFile)).map((existingThread) => existingThread.finding);
47650
+ const carriedForwardFindings = listManagedFindingThreads(existingThreads).filter((existingThread) => isActiveThreadStatus(existingThread.thread.status)).filter((existingThread) => !findingTouchesScopedDiff(existingThread.finding, scopedChangedLinesByFile, scopedDeletedLinesByFile)).map((existingThread) => existingThread.finding);
47635
47651
  if (carriedForwardFindings.length === 0) {
47636
47652
  return reviewResult;
47637
47653
  }
@@ -48426,7 +48442,7 @@ var reviewCommandConfig = {
48426
48442
  var reviewCommand = make33("review", reviewCommandConfig).pipe(withDescription3("Review an Azure DevOps pull request with OpenCode."), withHandler((input) => runReviewCommand(input)));
48427
48443
  var openAzdoCli = make33("open-azdo").pipe(withDescription3("Secure Azure DevOps pull-request review CLI powered by OpenCode."), withSubcommands([reviewCommand]));
48428
48444
  // package.json
48429
- var version2 = "0.2.0";
48445
+ var version2 = "0.2.2";
48430
48446
 
48431
48447
  // src/Main.ts
48432
48448
  var cliProgram = run3(openAzdoCli, { version: version2 }).pipe(exports_Effect.scoped, exports_Effect.provide(BaseRuntimeLayer));
@@ -48435,4 +48451,4 @@ var main = () => runMain2(cliProgram, { disableErrorReporting: true });
48435
48451
  // bin/open-azdo.ts
48436
48452
  main();
48437
48453
 
48438
- //# debugId=E606AA050323D0E964756E2164756E21
48454
+ //# debugId=B6C049DBA5403ADC64756E2164756E21