@knpkv/jira-cli 1.3.1 → 1.4.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 (66) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +5 -5
  3. package/dist/JiraAuth.d.ts +2 -2
  4. package/dist/JiraAuth.d.ts.map +1 -1
  5. package/dist/JiraAuth.js +13 -13
  6. package/dist/JiraAuth.js.map +1 -1
  7. package/dist/bin.js +1 -1
  8. package/dist/bin.js.map +1 -1
  9. package/dist/commands/auth.d.ts +12 -2
  10. package/dist/commands/auth.d.ts.map +1 -1
  11. package/dist/commands/auth.js +7 -7
  12. package/dist/commands/auth.js.map +1 -1
  13. package/dist/commands/edit.d.ts +10 -1
  14. package/dist/commands/edit.d.ts.map +1 -1
  15. package/dist/commands/edit.js +9 -9
  16. package/dist/commands/edit.js.map +1 -1
  17. package/dist/commands/get.d.ts +6 -1
  18. package/dist/commands/get.d.ts.map +1 -1
  19. package/dist/commands/get.js +3 -3
  20. package/dist/commands/get.js.map +1 -1
  21. package/dist/commands/issue.d.ts +1 -1
  22. package/dist/commands/issue.d.ts.map +1 -1
  23. package/dist/commands/issue.js +1 -1
  24. package/dist/commands/issue.js.map +1 -1
  25. package/dist/commands/issueAttachment.d.ts +1 -1
  26. package/dist/commands/issueAttachment.d.ts.map +1 -1
  27. package/dist/commands/issueAttachment.js +13 -11
  28. package/dist/commands/issueAttachment.js.map +1 -1
  29. package/dist/commands/layers.d.ts +2 -2
  30. package/dist/commands/layers.d.ts.map +1 -1
  31. package/dist/commands/search.d.ts +6 -1
  32. package/dist/commands/search.d.ts.map +1 -1
  33. package/dist/commands/search.js +7 -7
  34. package/dist/commands/search.js.map +1 -1
  35. package/dist/commands/version.d.ts +9 -1
  36. package/dist/commands/version.d.ts.map +1 -1
  37. package/dist/commands/version.js +23 -23
  38. package/dist/commands/version.js.map +1 -1
  39. package/dist/internal/oauthServer.d.ts +2 -2
  40. package/dist/internal/oauthServer.d.ts.map +1 -1
  41. package/dist/internal/oauthServer.js +3 -2
  42. package/dist/internal/oauthServer.js.map +1 -1
  43. package/dist/internal/openBrowser.d.ts +1 -1
  44. package/dist/internal/openBrowser.d.ts.map +1 -1
  45. package/dist/internal/openBrowser.js +1 -1
  46. package/dist/internal/openBrowser.js.map +1 -1
  47. package/package.json +10 -10
  48. package/skills/jira/SKILL.md +4 -4
  49. package/src/JiraAuth.ts +23 -31
  50. package/src/bin.ts +1 -1
  51. package/src/commands/auth.ts +7 -7
  52. package/src/commands/edit.ts +9 -9
  53. package/src/commands/get.ts +3 -3
  54. package/src/commands/issue.ts +1 -1
  55. package/src/commands/issueAttachment.ts +21 -20
  56. package/src/commands/search.ts +7 -7
  57. package/src/commands/version.ts +26 -29
  58. package/src/internal/oauthServer.ts +4 -3
  59. package/src/internal/openBrowser.ts +1 -1
  60. package/test/IssueService.test.ts +2 -2
  61. package/test/JiraAuthRefresh.test.ts +1 -1
  62. package/test/VersionService.test.ts +2 -2
  63. package/test/commandTree.test.ts +1 -1
  64. package/test/integration.test.ts +7 -7
  65. package/test/oauthServer.test.ts +4 -3
  66. package/test/remoteWrites.test.ts +3 -3
@@ -1,9 +1,9 @@
1
1
  import { describe, expect, it } from "@effect/vitest"
2
+ import { Command } from "effect/cli"
2
3
  import * as Effect from "effect/Effect"
3
4
  import * as Layer from "effect/Layer"
4
5
  import * as Ref from "effect/Ref"
5
6
  import * as Terminal from "effect/Terminal"
6
- import { Command } from "effect/unstable/cli"
7
7
  import { AttachmentService } from "../src/AttachmentService.js"
8
8
  import { issueCommand } from "../src/commands/issue.js"
9
9
  import { versionCommand } from "../src/commands/version.js"
@@ -55,15 +55,15 @@ const requireNonEmptyRedacted = (
55
55
  Redacted.value(value).trim().length > 0 ? Effect.succeed(value) : Effect.fail(new Error(`${name} must be set`))
56
56
 
57
57
  const SHOULD_RUN_INTEGRATION = Effect.runSync(
58
- Config.option(Config.string("JIRA_INTEGRATION")).pipe(
58
+ Config.option(Config.String("JIRA_INTEGRATION")).pipe(
59
59
  Effect.map((enabled) => Option.isSome(enabled) && envFlagEnabled(enabled.value))
60
60
  )
61
61
  )
62
62
 
63
63
  const SHOULD_RUN_ATTACHMENT_INTEGRATION = Effect.runSync(
64
64
  Effect.all([
65
- Config.option(Config.string("JIRA_INTEGRATION")),
66
- Config.option(Config.string("JIRA_ATTACHMENT_INTEGRATION"))
65
+ Config.option(Config.String("JIRA_INTEGRATION")),
66
+ Config.option(Config.String("JIRA_ATTACHMENT_INTEGRATION"))
67
67
  ]).pipe(
68
68
  Effect.map(([integration, attachment]) =>
69
69
  Option.isSome(integration) &&
@@ -75,10 +75,10 @@ const SHOULD_RUN_ATTACHMENT_INTEGRATION = Effect.runSync(
75
75
  )
76
76
 
77
77
  const readIntegrationConfig = Effect.gen(function*() {
78
- const baseUrl = yield* Config.option(Config.string("JIRA_BASE_URL"))
79
- const issueKey = yield* Config.option(Config.string("JIRA_ISSUE_KEY"))
80
- const email = yield* Config.string("JIRA_EMAIL")
81
- const apiKey = yield* Config.redacted("JIRA_API_KEY")
78
+ const baseUrl = yield* Config.option(Config.String("JIRA_BASE_URL"))
79
+ const issueKey = yield* Config.option(Config.String("JIRA_ISSUE_KEY"))
80
+ const email = yield* Config.String("JIRA_EMAIL")
81
+ const apiKey = yield* Config.Redacted("JIRA_API_KEY")
82
82
 
83
83
  return {
84
84
  baseUrl: nonEmptyOrDefault(baseUrl, DEFAULT_BASE_URL).replace(/\/+$/, ""),
@@ -3,9 +3,10 @@ import * as NodeHttpServer from "@effect/platform-node/NodeHttpServer"
3
3
  import { describe, expect, it } from "@effect/vitest"
4
4
  import * as Effect from "effect/Effect"
5
5
  import * as Fiber from "effect/Fiber"
6
+ import { HttpClient, HttpClientRequest, HttpServer, HttpServerError } from "effect/http"
6
7
  import * as Layer from "effect/Layer"
8
+ import { NetAddress } from "effect/net"
7
9
  import * as Ref from "effect/Ref"
8
- import { HttpClient, HttpClientRequest, HttpServer, HttpServerError } from "effect/unstable/http"
9
10
  import { createServer } from "node:http"
10
11
  import { HttpServerFactoryLive } from "../src/internal/NodeLayers.js"
11
12
  import {
@@ -22,7 +23,7 @@ const EphemeralHttpServerFactoryLive = makeHttpServerFactory(
22
23
  const HttpClientLive = NodeHttpClient.layerUndici
23
24
  const fakeHttpServer = (port: number): HttpServer.HttpServer["Service"] =>
24
25
  HttpServer.make({
25
- address: { _tag: "TcpAddress", hostname: "127.0.0.1", port },
26
+ address: NetAddress.inetAddressFromIpStringUnsafe("127.0.0.1", port),
26
27
  serve: () => Effect.void
27
28
  })
28
29
 
@@ -37,7 +38,7 @@ describe("oauth callback server lifecycle", () => {
37
38
  )
38
39
  const advertisedUrl = new URL(callbackUrl(8585))
39
40
  const ipv6OnlyLocalhost = (hostname: string) => (hostname === "localhost" ? "::1" : undefined)
40
- expect(server.address._tag).toBe("TcpAddress")
41
+ expect(NetAddress.isInetAddress(server.address)).toBe(true)
41
42
  expect(listenOptions.host).toBe(advertisedUrl.hostname)
42
43
  expect(ipv6OnlyLocalhost(listenOptions.host)).toBe("::1")
43
44
  expect(ipv6OnlyLocalhost(advertisedUrl.hostname)).toBe("::1")
@@ -1,12 +1,12 @@
1
1
  import { describe, expect, it } from "@effect/vitest"
2
2
  import { JiraApiClient, make } from "@knpkv/jira-api-client"
3
3
  import * as Effect from "effect/Effect"
4
+ import * as HttpClient from "effect/http/HttpClient"
5
+ import type * as HttpClientRequest from "effect/http/HttpClientRequest"
6
+ import * as HttpClientResponse from "effect/http/HttpClientResponse"
4
7
  import * as Layer from "effect/Layer"
5
8
  import * as Redacted from "effect/Redacted"
6
9
  import * as Schema from "effect/Schema"
7
- import * as HttpClient from "effect/unstable/http/HttpClient"
8
- import type * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"
9
- import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"
10
10
  import { IssueService, layer as IssueServiceLayer, SiteUrl } from "../src/IssueService.js"
11
11
  import { layer as VersionServiceLayer, VersionService } from "../src/VersionService.js"
12
12