@unveil/vk 0.5.1 → 1.0.0-beta.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/dist/index.d.mts CHANGED
@@ -1,4 +1,5 @@
1
- import { GitHubEvent, IdentifyResult } from "@unveil/identity";
1
+ import { IdentifyResult } from "@unveil/identity";
2
+ import { GitHubEvent } from "@unveil/identity/providers/github";
2
3
  //#region src/index.d.ts
3
4
  type AnalyzeOptions = {
4
5
  token?: string;
@@ -8,7 +9,7 @@ type AnalyzeReturn = {
8
9
  analysis: IdentifyResult;
9
10
  events: GitHubEvent[];
10
11
  eventsCount: number;
11
- userId: number;
12
+ userId?: number;
12
13
  };
13
14
  declare class GitHubError extends Error {
14
15
  readonly status: number;
@@ -17,4 +18,4 @@ declare class GitHubError extends Error {
17
18
  }
18
19
  declare function analyze(username: string, options?: AnalyzeOptions): Promise<AnalyzeReturn>;
19
20
  //#endregion
20
- export { AnalyzeOptions, AnalyzeReturn, GitHubError, analyze };
21
+ export { AnalyzeOptions, AnalyzeReturn, GitHubError, type GitHubEvent, type IdentifyResult, analyze };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{identify as e}from"@unveil/identity";var t=class extends Error{status;url;constructor(e,t,n){super(e),this.name=`GitHubError`,this.status=t,this.url=n}};async function n(e){try{let t=await e.json();if(t?.message)return t.message}catch{}return`${e.status} ${e.statusText}`}async function r(e,r){let i=`https://api.github.com${e}`,a={Accept:`application/vnd.github+json`,"X-GitHub-Api-Version":`2022-11-28`,"User-Agent":`unveil-vk`};r&&(a.Authorization=`Bearer ${r}`);let o=await fetch(i,{headers:a});if(!o.ok)throw new t(await n(o),o.status,i);return await o.json()}async function i(t,n){let i=n?.token,a=encodeURIComponent(t),o=await r(`/users/${a}`,i),s=Array.from({length:3},(e,t)=>r(`/users/${a}/events/public?per_page=100&page=${t+1}`,i)),c=(await Promise.all(s)).flat();return{analysis:e({user:o,events:c}),userId:o.id,events:n?.showEvents?c:[],eventsCount:c.length}}export{t as GitHubError,i as analyze};
1
+ import{identify as e}from"@unveil/identity";import{fromGitHub as t}from"@unveil/identity/providers/github";var n=class extends Error{status;url;constructor(e,t,n){super(e),this.name=`GitHubError`,this.status=t,this.url=n}};async function r(e){try{let t=await e.json();if(t?.message)return t.message}catch{}return`${e.status} ${e.statusText}`}async function i(e,t){let i=`https://api.github.com${e}`,a={Accept:`application/vnd.github+json`,"X-GitHub-Api-Version":`2022-11-28`,"User-Agent":`unveil-vk`};t&&(a.Authorization=`Bearer ${t}`);let o=await fetch(i,{headers:a});if(!o.ok)throw new n(await r(o),o.status,i);return await o.json()}async function a(n,r){let a=r?.token,o=encodeURIComponent(n),s=await i(`/users/${o}`,a),c=Array.from({length:3},(e,t)=>i(`/users/${o}/events/public?per_page=100&page=${t+1}`,a)),l=(await Promise.all(c)).flat();return{analysis:e(t({user:s,events:l})),userId:s.id,events:r?.showEvents?l:[],eventsCount:l.length}}export{n as GitHubError,a as analyze};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unveil/vk",
3
- "version": "0.5.1",
3
+ "version": "1.0.0-beta.0",
4
4
  "description": "Fetch GitHub account activity and analyze it for automation patterns",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@11.22.0",
@@ -37,12 +37,13 @@
37
37
  "devDependencies": {
38
38
  "@biomejs/biome": "^2.5.6",
39
39
  "@types/node": "^26.1.2",
40
+ "@unveil/identity": "3.0.0-beta.1",
40
41
  "publint": "^0.3.22",
41
42
  "tsdown": "^0.22.14",
42
43
  "typescript": "^6.0.3",
43
44
  "vitest": "^4.1.10"
44
45
  },
45
- "dependencies": {
46
- "@unveil/identity": "^2.0.4"
46
+ "peerDependencies": {
47
+ "@unveil/identity": "^3.0.0-beta.1"
47
48
  }
48
49
  }