@unveil/vk 1.0.0-beta.2 → 1.0.0-beta.4

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,4 @@
1
- import { IdentifyResult } from "@unveil/identity";
1
+ import { IdentityReport } from "@unveil/identity/report";
2
2
  import { GitHubEvent } from "@unveil/identity/providers/github";
3
3
  //#region src/http.d.ts
4
4
  declare class ProviderError extends Error {
@@ -16,11 +16,11 @@ type AnalyzeOptions = {
16
16
  provider?: Provider;
17
17
  };
18
18
  type AnalyzeReturn = {
19
- analysis: IdentifyResult;
19
+ report: IdentityReport;
20
20
  events: ProviderEvent[];
21
21
  eventsCount: number;
22
22
  userId?: number | string;
23
23
  };
24
24
  declare function analyze(username: string, options?: AnalyzeOptions): Promise<AnalyzeReturn>;
25
25
  //#endregion
26
- export { AnalyzeOptions, AnalyzeReturn, type GitHubEvent, type IdentifyResult, Provider, ProviderError, ProviderEvent, analyze };
26
+ export { AnalyzeOptions, AnalyzeReturn, type GitHubEvent, type IdentityReport, Provider, ProviderError, ProviderEvent, analyze };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{identify as e}from"@unveil/identity";import{fromGitHub as t}from"@unveil/identity/providers/github";function n(e,t){let n=new URLSearchParams;for(let[e,r]of Object.entries(t))n.set(e,String(r));return`${e}?${n}`}var r=class extends Error{status;url;constructor(e,t,n){super(e),this.name=`ProviderError`,this.status=t,this.url=n}};async function i(e){try{let t=await e.json();if(t?.message)return t.message}catch{}return`${e.status} ${e.statusText}`}async function a(e,t={}){let n=await fetch(e,{headers:t});if(!n.ok)throw new r(await i(n),n.status,e);return n}async function o(e,t){return await(await a(e,t)).json()}async function s(e,t,n){let r=Array.from({length:e},(e,r)=>o(t(r+1),n));return(await Promise.all(r)).flat()}function c(e,t={}){return e?{...t,Authorization:`Bearer ${e}`}:t}const l=`https://api.github.com`;async function u(e,r){let i=encodeURIComponent(e),a=c(r,{Accept:`application/vnd.github+json`,"X-GitHub-Api-Version":`2022-11-28`,"User-Agent":`unveil-vk`}),u=await o(`${l}/users/${i}`,a),d=await s(3,e=>n(`${l}/users/${i}/events/public`,{per_page:100,page:e}),a);return{input:t({user:u,events:d}),events:d,userId:u.id}}const d={github:u};async function f(t,n){let r=n?.provider??`github`,i=d[r],{input:a,events:o,userId:s}=await i(t,n?.token);return{analysis:e(a),userId:s,events:n?.showEvents?o:[],eventsCount:o.length}}export{r as ProviderError,f as analyze};
1
+ import{report as e}from"@unveil/identity/report";import{fromGitHub as t}from"@unveil/identity/providers/github";function n(e,t){let n=new URLSearchParams;for(let[e,r]of Object.entries(t))n.set(e,String(r));return`${e}?${n}`}var r=class extends Error{status;url;constructor(e,t,n){super(e),this.name=`ProviderError`,this.status=t,this.url=n}};async function i(e){try{let t=await e.json();if(t?.message)return t.message}catch{}return`${e.status} ${e.statusText}`}async function a(e,t={}){let n=await fetch(e,{headers:t});if(!n.ok)throw new r(await i(n),n.status,e);return n}async function o(e,t){return await(await a(e,t)).json()}async function s(e,t,n){let r=Array.from({length:e},(e,r)=>o(t(r+1),n));return(await Promise.all(r)).flat()}function c(e,t={}){return e?{...t,Authorization:`Bearer ${e}`}:t}const l=`https://api.github.com`;async function u(e,r){let i=encodeURIComponent(e),a=c(r,{Accept:`application/vnd.github+json`,"X-GitHub-Api-Version":`2022-11-28`,"User-Agent":`unveil-vk`}),u=await o(`${l}/users/${i}`,a),d=await s(3,e=>n(`${l}/users/${i}/events/public`,{per_page:100,page:e}),a);return{input:t({user:u,events:d}),events:d,userId:u.id}}const d={github:u};async function f(t,n){let r=n?.provider??`github`,i=d[r],{input:a,events:o,userId:s}=await i(t,n?.token);return{report:e(a),userId:s,events:n?.showEvents?o:[],eventsCount:o.length}}export{r as ProviderError,f as analyze};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unveil/vk",
3
- "version": "1.0.0-beta.2",
3
+ "version": "1.0.0-beta.4",
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,13 +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.3",
40
+ "@unveil/identity": "3.0.0-beta.4",
41
41
  "publint": "^0.3.22",
42
42
  "tsdown": "^0.22.14",
43
43
  "typescript": "^6.0.3",
44
44
  "vitest": "^4.1.10"
45
45
  },
46
46
  "peerDependencies": {
47
- "@unveil/identity": "^3.0.0-beta.3"
47
+ "@unveil/identity": "^3.0.0-beta.4"
48
48
  }
49
49
  }