@knpkv/jira-cli 1.5.0 → 1.5.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @knpkv/jira-cli
2
2
 
3
+ ## 1.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#477](https://github.com/knpkv/npm/pull/477) [`b4a69a0`](https://github.com/knpkv/npm/commit/b4a69a056ce3e2575df70d7aaea1a202f49b6a56) Thanks [@konopkov](https://github.com/konopkov)! - `JiraAuthService` and `ConfluenceAuthService` are now derived from atlassian-common's `AtlassianCliAuth` instead of re-spelling it, and `LoginOptions` / `AccessibleSite` are re-exported from there. The types are unchanged: a type-equality check against the previous hand-written interfaces passed before the switch. `ConfluenceAuthService` keeps its one real difference, a string access token and no `getSiteUrl`.
8
+
9
+ - [#475](https://github.com/knpkv/npm/pull/475) [`08c62b7`](https://github.com/knpkv/npm/commit/08c62b787c649d8f78753515be6faf317791d62b) Thanks [@konopkov](https://github.com/konopkov)! - `auth use <profile>` and `auth remove <profile>` now fail with a typed `ProfileNotFoundError` (exported from `@knpkv/atlassian-common/cli-auth`) and exit non-zero when no stored profile matches. The failure names the profile (`Profile not found: <profile>`, on stderr through each CLI's error handler); previously the line went to stdout and the command exited 0, so a script could not tell a typo from a switch.
10
+ - Updated dependencies [[`08c62b7`](https://github.com/knpkv/npm/commit/08c62b787c649d8f78753515be6faf317791d62b)]:
11
+ - @knpkv/atlassian-common@1.8.0
12
+
3
13
  ## 1.5.0
4
14
 
5
15
  ### Minor Changes
@@ -16,66 +16,18 @@
16
16
  *
17
17
  * @module
18
18
  */
19
- import type { OAuthError } from "@knpkv/atlassian-common/auth";
20
- import { type AtlassianCliDescriptor } from "@knpkv/atlassian-common/cli-auth";
21
- import type { AuthProfile, FileSystemError, HomeDirectoryError, OAuthConfig, OAuthUser } from "@knpkv/atlassian-common/config";
19
+ import { type AtlassianCliAuth, type AtlassianCliDescriptor } from "@knpkv/atlassian-common/cli-auth";
22
20
  import * as Context from "effect/Context";
23
- import type * as Effect from "effect/Effect";
24
21
  import * as Layer from "effect/Layer";
25
- import type * as PlatformError from "effect/PlatformError";
26
- import type * as Redacted from "effect/Redacted";
27
22
  import type { AuthMissingError } from "./JiraCliError.js";
23
+ export type { AccessibleSite, LoginOptions } from "@knpkv/atlassian-common/cli-auth";
28
24
  /**
29
- * Options for the login method.
30
- *
31
- * @category Types
32
- */
33
- export interface LoginOptions {
34
- /** Site URL to select (for accounts with multiple sites) */
35
- readonly siteUrl?: string;
36
- }
37
- /**
38
- * Information about an accessible Jira site.
39
- *
40
- * @category Types
41
- */
42
- export interface AccessibleSite {
43
- readonly id: string;
44
- readonly name: string;
45
- readonly url: string;
46
- }
47
- /**
48
- * JiraAuth service interface.
25
+ * JiraAuth service interface: the shared Atlassian CLI auth, failing with Jira's own
26
+ * {@link AuthMissingError} when nobody is logged in.
49
27
  *
50
28
  * @category Services
51
29
  */
52
- export interface JiraAuthService {
53
- /** Configure OAuth client credentials */
54
- readonly configure: (config: OAuthConfig) => Effect.Effect<void, FileSystemError | HomeDirectoryError | PlatformError.PlatformError>;
55
- /** Check if OAuth is configured */
56
- readonly isConfigured: () => Effect.Effect<boolean, FileSystemError | HomeDirectoryError | PlatformError.PlatformError>;
57
- /** Start OAuth login flow. Returns list of sites if multiple are available. */
58
- readonly login: (options?: LoginOptions) => Effect.Effect<ReadonlyArray<AccessibleSite> | void, OAuthError | FileSystemError | HomeDirectoryError | PlatformError.PlatformError>;
59
- /** Remove stored authentication */
60
- readonly logout: () => Effect.Effect<void, OAuthError | FileSystemError | HomeDirectoryError | PlatformError.PlatformError>;
61
- /** Get access token, refreshing if needed */
62
- readonly getAccessToken: () => Effect.Effect<Redacted.Redacted<string>, AuthMissingError | OAuthError | FileSystemError | HomeDirectoryError | PlatformError.PlatformError>;
63
- /** Get cloud ID from stored token */
64
- readonly getCloudId: () => Effect.Effect<string, AuthMissingError | FileSystemError | HomeDirectoryError | PlatformError.PlatformError>;
65
- /** Get site URL from stored token */
66
- readonly getSiteUrl: () => Effect.Effect<string, AuthMissingError | FileSystemError | HomeDirectoryError | PlatformError.PlatformError>;
67
- /** Get current user info from stored token */
68
- readonly getCurrentUser: () => Effect.Effect<OAuthUser | null, FileSystemError | HomeDirectoryError | PlatformError.PlatformError>;
69
- /** Get active auth profile */
70
- readonly getActiveProfile: () => Effect.Effect<AuthProfile | null, FileSystemError | HomeDirectoryError | PlatformError.PlatformError>;
71
- /** List stored auth profiles */
72
- readonly listProfiles: () => Effect.Effect<ReadonlyArray<AuthProfile>, FileSystemError | HomeDirectoryError | PlatformError.PlatformError>;
73
- /** Switch active profile by ID, name, site URL, cloud ID, or account ID */
74
- readonly switchProfile: (selector: string) => Effect.Effect<AuthProfile | null, FileSystemError | HomeDirectoryError | PlatformError.PlatformError>;
75
- /** Remove stored profile by ID, name, site URL, cloud ID, or account ID */
76
- readonly removeProfile: (selector: string) => Effect.Effect<AuthProfile | null, FileSystemError | HomeDirectoryError | PlatformError.PlatformError>;
77
- /** Check if user is logged in */
78
- readonly isLoggedIn: () => Effect.Effect<boolean, FileSystemError | HomeDirectoryError | PlatformError.PlatformError>;
30
+ export interface JiraAuthService extends AtlassianCliAuth<AuthMissingError> {
79
31
  }
80
32
  declare const JiraAuth_base: Context.ServiceClass<JiraAuth, "@knpkv/jira-cli/JiraAuth", JiraAuthService>;
81
33
  /**
@@ -107,5 +59,4 @@ export declare const jiraCliDescriptor: AtlassianCliDescriptor;
107
59
  * @category Layers
108
60
  */
109
61
  export declare const layer: Layer.Layer<JiraAuth, never, import("effect/process/ChildProcessSpawner").ChildProcessSpawner | import("effect/Crypto").Crypto | import("effect/http/HttpClient").HttpClient>;
110
- export {};
111
62
  //# sourceMappingURL=JiraAuth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"JiraAuth.d.ts","sourceRoot":"","sources":["../src/JiraAuth.ts"],"names":[],"mappings":"AAAA;;;;;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BAAgB,CAAC,gBAAgB,CAAC;CAAG;;AAE9E;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,QAAS,SAAQ,aAGC;CAAG;AAElC,qGAAqG;AACrG,eAAO,MAAM,iBAAiB,EAAE,sBAI/B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,KAAK,+KAOoB,CAAA"}
package/dist/JiraAuth.js CHANGED
@@ -1,3 +1,21 @@
1
+ /**
2
+ * OAuth2 authentication service for Jira CLI with token refresh and concurrency locking.
3
+ *
4
+ * **Mental model**
5
+ *
6
+ * - **Service pattern**: {@link JiraAuth} is a `Context.Tag` whose layer requires `HttpClient`,
7
+ * `ChildProcessSpawner` and `Crypto`. The flow — refresh lock, rotating-token persistence,
8
+ * browser login, profiles — is `@knpkv/atlassian-common/cli-auth`'s, bound to the
9
+ * `"jira-cli"` storage namespace, Jira's scopes and Jira's names.
10
+ *
11
+ * **Common tasks**
12
+ *
13
+ * - Get a valid access token: `auth.getAccessToken()` (auto-refreshes if expired)
14
+ * - Full login flow: `auth.login()`
15
+ * - Check auth state: `auth.isLoggedIn()`
16
+ *
17
+ * @module
18
+ */
1
19
  import { makeAtlassianCliAuth, NodeCliAuthLive } from "@knpkv/atlassian-common/cli-auth";
2
20
  import * as Context from "effect/Context";
3
21
  import * as Layer from "effect/Layer";
@@ -1 +1 @@
1
- {"version":3,"file":"JiraAuth.js","sourceRoot":"","sources":["../src/JiraAuth.ts"],"names":[],"mappings":"AAmBA,OAAO,EAA+B,oBAAoB,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAQrH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AAEzC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAIrC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,+GAA+G;AAC/G,MAAM,eAAe,GAAG;IACtB,0CAA0C;IAC1C,gBAAgB;IAChB,kCAAkC;IAClC,iBAAiB;IACjB,oEAAoE;IACp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H,MAAM,OAAO,QAAS,SAAQ,OAAO,CAAC,OAAO,EAG1C,CAAC,0BAA0B,CAAC;CAAG;AAElC,qGAAqG;AACrG,MAAM,CAAC,MAAM,iBAAiB,GAA2B;IACvD,WAAW,EAAE,MAAM;IACnB,WAAW,EAAE,MAAM;IACnB,MAAM,EAAE,eAAe;CACxB,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAC/B,QAAQ,EACR,oBAAoB,CAAC;IACnB,GAAG,iBAAiB;IACpB,QAAQ,EAAE,UAAU;IACpB,WAAW;CACZ,CAAC,CACH,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAA"}
@@ -1,3 +1,3 @@
1
1
  import { JiraAuth } from "../JiraAuth.js";
2
- export declare const authCommand: import("effect/cli/Command").Command<"auth", {}, {}, import("@knpkv/atlassian-common/cli-auth").BrowserOpenError | import("@knpkv/atlassian-common").FileSystemError | import("@knpkv/atlassian-common").HomeDirectoryError | import("@knpkv/atlassian-common").OAuthError | import("effect/PlatformError").PlatformError | import("effect/Terminal").QuitError, import("effect/process/ChildProcessSpawner").ChildProcessSpawner | JiraAuth | import("effect/cli/Prompt").Environment>;
2
+ export declare const authCommand: import("effect/cli/Command").Command<"auth", {}, {}, import("@knpkv/atlassian-common/cli-auth").BrowserOpenError | import("@knpkv/atlassian-common").FileSystemError | import("@knpkv/atlassian-common").HomeDirectoryError | import("@knpkv/atlassian-common").OAuthError | import("effect/PlatformError").PlatformError | import("@knpkv/atlassian-common/cli-auth").ProfileNotFoundError | import("effect/Terminal").QuitError, import("effect/process/ChildProcessSpawner").ChildProcessSpawner | JiraAuth | import("effect/cli/Prompt").Environment>;
3
3
  //# sourceMappingURL=auth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,QAAQ,EAAqB,MAAM,gBAAgB,CAAA;AAE5D,eAAO,MAAM,WAAW,ydAA2E,CAAA"}
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,QAAQ,EAAqB,MAAM,gBAAgB,CAAA;AAE5D,eAAO,MAAM,WAAW,2hBAA2E,CAAA"}
@@ -11,7 +11,7 @@ import { VersionService } from "../VersionService.js";
11
11
  *
12
12
  * @category Layers
13
13
  */
14
- export declare const AppLayer: Layer.Layer<AttachmentService | import("effect/http/HttpClient").HttpClient | IssueService | JiraApiClient | JiraAuth | MarkdownWriter | SiteUrl | VersionService | NodeServices.NodeServices, import("../JiraCliError.js").AuthMissingError | import("@knpkv/atlassian-common").FileSystemError | import("@knpkv/atlassian-common").HomeDirectoryError | import("@knpkv/atlassian-common").OAuthError | import("effect/PlatformError").PlatformError, never>;
14
+ export declare const AppLayer: Layer.Layer<AttachmentService | import("effect/http/HttpClient").HttpClient | IssueService | JiraApiClient | JiraAuth | MarkdownWriter | SiteUrl | VersionService | NodeServices.NodeServices, import("../JiraCliError.js").AuthMissingError | import("@knpkv/atlassian-common").OAuthError | (import("@knpkv/atlassian-common").FileSystemError | import("@knpkv/atlassian-common").HomeDirectoryError | import("effect/PlatformError").PlatformError), never>;
15
15
  /**
16
16
  * Auth-only layer for auth commands.
17
17
  *
@@ -1 +1 @@
1
- {"version":3,"file":"layers.d.ts","sourceRoot":"","sources":["../../src/commands/layers.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,YAAY,MAAM,oCAAoC,CAAA;AAClE,OAAO,EAAE,aAAa,EAAiB,MAAM,wBAAwB,CAAA;AAErE,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,iBAAiB,EAAmC,MAAM,yBAAyB,CAAA;AAC5F,OAAO,EAAE,YAAY,EAA8B,OAAO,EAAE,MAAM,oBAAoB,CAAA;AACtF,OAAO,EAAE,QAAQ,EAA0B,MAAM,gBAAgB,CAAA;AACjE,OAAO,EAAgC,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACnF,OAAO,EAAgC,cAAc,EAAE,MAAM,sBAAsB,CAAA;AA+FnF;;;;GAIG;AACH,eAAO,MAAM,QAAQ,+bASpB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,oLAOzB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,sIAMxB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,SAAU,aAAa,CAAC,MAAM,CAAC,KAAG,MAAM,GAAG,MAAM,GAAG,SAkB5E,CAAA"}
1
+ {"version":3,"file":"layers.d.ts","sourceRoot":"","sources":["../../src/commands/layers.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,YAAY,MAAM,oCAAoC,CAAA;AAClE,OAAO,EAAE,aAAa,EAAiB,MAAM,wBAAwB,CAAA;AAErE,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,iBAAiB,EAAmC,MAAM,yBAAyB,CAAA;AAC5F,OAAO,EAAE,YAAY,EAA8B,OAAO,EAAE,MAAM,oBAAoB,CAAA;AACtF,OAAO,EAAE,QAAQ,EAA0B,MAAM,gBAAgB,CAAA;AACjE,OAAO,EAAgC,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACnF,OAAO,EAAgC,cAAc,EAAE,MAAM,sBAAsB,CAAA;AA+FnF;;;;GAIG;AACH,eAAO,MAAM,QAAQ,icASpB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,oLAOzB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,sIAMxB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,SAAU,aAAa,CAAC,MAAM,CAAC,KAAG,MAAM,GAAG,MAAM,GAAG,SAkB5E,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knpkv/jira-cli",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "CLI tool to fetch Jira tickets and export to markdown",
5
5
  "license": "MIT",
6
6
  "author": "knpkv",
@@ -61,7 +61,7 @@
61
61
  "gray-matter": "^4.0.3",
62
62
  "js-yaml": "5.4.2",
63
63
  "@knpkv/agent-skills": "^0.3.3",
64
- "@knpkv/atlassian-common": "1.7.0",
64
+ "@knpkv/atlassian-common": "1.8.0",
65
65
  "@knpkv/jira-api-client": "2.0.0"
66
66
  },
67
67
  "devDependencies": {
package/src/JiraAuth.ts CHANGED
@@ -16,20 +16,14 @@
16
16
  *
17
17
  * @module
18
18
  */
19
- import type { OAuthError } from "@knpkv/atlassian-common/auth"
20
- import { type AtlassianCliDescriptor, makeAtlassianCliAuth, NodeCliAuthLive } from "@knpkv/atlassian-common/cli-auth"
21
- import type {
22
- AuthProfile,
23
- FileSystemError,
24
- HomeDirectoryError,
25
- OAuthConfig,
26
- OAuthUser
27
- } from "@knpkv/atlassian-common/config"
19
+ import {
20
+ type AtlassianCliAuth,
21
+ type AtlassianCliDescriptor,
22
+ makeAtlassianCliAuth,
23
+ NodeCliAuthLive
24
+ } from "@knpkv/atlassian-common/cli-auth"
28
25
  import * as Context from "effect/Context"
29
- import type * as Effect from "effect/Effect"
30
26
  import * as Layer from "effect/Layer"
31
- import type * as PlatformError from "effect/PlatformError"
32
- import type * as Redacted from "effect/Redacted"
33
27
  import type { AuthMissingError } from "./JiraCliError.js"
34
28
  import { authMissing } from "./JiraCliError.js"
35
29
 
@@ -51,95 +45,15 @@ const JIRA_CLI_SCOPES = [
51
45
  "offline_access"
52
46
  ]
53
47
 
54
- /**
55
- * Options for the login method.
56
- *
57
- * @category Types
58
- */
59
- export interface LoginOptions {
60
- /** Site URL to select (for accounts with multiple sites) */
61
- readonly siteUrl?: string
62
- }
63
-
64
- /**
65
- * Information about an accessible Jira site.
66
- *
67
- * @category Types
68
- */
69
- export interface AccessibleSite {
70
- readonly id: string
71
- readonly name: string
72
- readonly url: string
73
- }
48
+ export type { AccessibleSite, LoginOptions } from "@knpkv/atlassian-common/cli-auth"
74
49
 
75
50
  /**
76
- * JiraAuth service interface.
51
+ * JiraAuth service interface: the shared Atlassian CLI auth, failing with Jira's own
52
+ * {@link AuthMissingError} when nobody is logged in.
77
53
  *
78
54
  * @category Services
79
55
  */
80
- export interface JiraAuthService {
81
- /** Configure OAuth client credentials */
82
- readonly configure: (
83
- config: OAuthConfig
84
- ) => Effect.Effect<void, FileSystemError | HomeDirectoryError | PlatformError.PlatformError>
85
- /** Check if OAuth is configured */
86
- readonly isConfigured: () => Effect.Effect<
87
- boolean,
88
- FileSystemError | HomeDirectoryError | PlatformError.PlatformError
89
- >
90
- /** Start OAuth login flow. Returns list of sites if multiple are available. */
91
- readonly login: (
92
- options?: LoginOptions
93
- ) => Effect.Effect<
94
- ReadonlyArray<AccessibleSite> | void,
95
- OAuthError | FileSystemError | HomeDirectoryError | PlatformError.PlatformError
96
- >
97
- /** Remove stored authentication */
98
- readonly logout: () => Effect.Effect<
99
- void,
100
- OAuthError | FileSystemError | HomeDirectoryError | PlatformError.PlatformError
101
- >
102
- /** Get access token, refreshing if needed */
103
- readonly getAccessToken: () => Effect.Effect<
104
- Redacted.Redacted<string>,
105
- AuthMissingError | OAuthError | FileSystemError | HomeDirectoryError | PlatformError.PlatformError
106
- >
107
- /** Get cloud ID from stored token */
108
- readonly getCloudId: () => Effect.Effect<
109
- string,
110
- AuthMissingError | FileSystemError | HomeDirectoryError | PlatformError.PlatformError
111
- >
112
- /** Get site URL from stored token */
113
- readonly getSiteUrl: () => Effect.Effect<
114
- string,
115
- AuthMissingError | FileSystemError | HomeDirectoryError | PlatformError.PlatformError
116
- >
117
- /** Get current user info from stored token */
118
- readonly getCurrentUser: () => Effect.Effect<
119
- OAuthUser | null,
120
- FileSystemError | HomeDirectoryError | PlatformError.PlatformError
121
- >
122
- /** Get active auth profile */
123
- readonly getActiveProfile: () => Effect.Effect<
124
- AuthProfile | null,
125
- FileSystemError | HomeDirectoryError | PlatformError.PlatformError
126
- >
127
- /** List stored auth profiles */
128
- readonly listProfiles: () => Effect.Effect<
129
- ReadonlyArray<AuthProfile>,
130
- FileSystemError | HomeDirectoryError | PlatformError.PlatformError
131
- >
132
- /** Switch active profile by ID, name, site URL, cloud ID, or account ID */
133
- readonly switchProfile: (
134
- selector: string
135
- ) => Effect.Effect<AuthProfile | null, FileSystemError | HomeDirectoryError | PlatformError.PlatformError>
136
- /** Remove stored profile by ID, name, site URL, cloud ID, or account ID */
137
- readonly removeProfile: (
138
- selector: string
139
- ) => Effect.Effect<AuthProfile | null, FileSystemError | HomeDirectoryError | PlatformError.PlatformError>
140
- /** Check if user is logged in */
141
- readonly isLoggedIn: () => Effect.Effect<boolean, FileSystemError | HomeDirectoryError | PlatformError.PlatformError>
142
- }
56
+ export interface JiraAuthService extends AtlassianCliAuth<AuthMissingError> {}
143
57
 
144
58
  /**
145
59
  * JiraAuth service tag.