@cesar-richard/git-connector-sdk 1.23.0 → 1.24.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/README.md CHANGED
@@ -64,7 +64,7 @@ Tokens with the `gck_` prefix are immutable once minted; revoke and reissue via
64
64
 
65
65
  ## API surface
66
66
 
67
- The `/v1/*` API exposes three resources:
67
+ The `/v1/*` API exposes four resources: work items, iterations, work-item details, and the unified events stream.
68
68
 
69
69
  ### `GET /v1/work-items` — list aggregated work items
70
70
 
package/dist/index.js CHANGED
@@ -3,7 +3,10 @@ export function createGitConnectorClient(opts) {
3
3
  if (!opts.baseUrl) {
4
4
  throw new Error("createGitConnectorClient: baseUrl is required");
5
5
  }
6
- if (!opts.token) {
6
+ // Trim whitespace + strip an accidental "Bearer " prefix that users sometimes
7
+ // paste in along with the token value.
8
+ const token = opts.token?.trim().replace(/^Bearer\s+/i, "") ?? "";
9
+ if (!token) {
7
10
  throw new Error("createGitConnectorClient: token is required (mint via POST /admin/api-keys)");
8
11
  }
9
12
  const client = createClient({
@@ -12,7 +15,7 @@ export function createGitConnectorClient(opts) {
12
15
  });
13
16
  const auth = {
14
17
  onRequest({ request }) {
15
- request.headers.set("Authorization", `Bearer ${opts.token}`);
18
+ request.headers.set("Authorization", `Bearer ${token}`);
16
19
  return request;
17
20
  },
18
21
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cesar-richard/git-connector-sdk",
3
- "version": "1.23.0",
3
+ "version": "1.24.0",
4
4
  "description": "TypeScript SDK for the git-connector v1 API (work items + iterations aggregated from GitHub/GitLab). Version published on npm tracks server releases.",
5
5
  "license": "MIT",
6
6
  "repository": {