@kosha-ai/integration-github 0.0.4 → 0.0.6

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.
@@ -1 +1 @@
1
- {"version":3,"file":"integration-github.d.ts","sourceRoot":"","sources":["../../src/lib/integration-github.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE,MAAM,WAAW,wBAAwB;IACvC,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAOD,wBAAgB,MAAM,CACpB,OAAO,GAAE,wBAA6B,GACrC,gBAAgB,CA2ClB;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"integration-github.d.ts","sourceRoot":"","sources":["../../src/lib/integration-github.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAQlE,MAAM,WAAW,wBAAwB;IACvC,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAOD,wBAAgB,MAAM,CACpB,OAAO,GAAE,wBAA6B,GACrC,gBAAgB,CA4ClB;AAED,eAAe,MAAM,CAAC"}
@@ -1,4 +1,8 @@
1
1
  import { defineIntegration, oauth2 } from '@kosha-ai/integration-sdk';
2
+ import path from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ const currentDir = path.dirname(fileURLToPath(import.meta.url));
5
+ const docsDirectory = path.join(currentDir, '../../docs');
2
6
  export function github(options = {}) {
3
7
  const apiBaseUrl = options.baseUrl ?? 'https://api.github.com';
4
8
  const webBaseUrl = options.webBaseUrl ?? 'https://github.com';
@@ -6,6 +10,7 @@ export function github(options = {}) {
6
10
  key: 'github',
7
11
  name: 'GitHub',
8
12
  docsUrl: 'https://docs.github.com/rest',
13
+ docsPath: docsDirectory,
9
14
  auth: oauth2({
10
15
  authorizationUrl: `${webBaseUrl}/login/oauth/authorize`,
11
16
  tokenUrl: `${webBaseUrl}/login/oauth/access_token`,
package/docs/setup.md ADDED
@@ -0,0 +1,29 @@
1
+ # GitHub Setup
2
+
3
+ To connect to GitHub, you need to create a GitHub OAuth App. This allows Kosha to act on behalf of your users.
4
+
5
+ ### 1. Register a new OAuth application
6
+
7
+ 1. Go to your GitHub account settings.
8
+ 2. In the left sidebar, scroll down to **Developer settings**.
9
+ 3. Select **OAuth Apps** and click **New OAuth App**.
10
+
11
+ ![GitHub OAuth Apps](./images/github-oauth-apps.png)
12
+
13
+ 4. Fill in the application details:
14
+ - **Application name**: The name of your application.
15
+ - **Homepage URL**: Your website URL.
16
+ - **Authorization callback URL**: Your Kosha redirect URI (e.g. `https://your-app.com/api/connect/github/callback`).
17
+
18
+ ![GitHub Application Registration Form](./images/github-register-app.png)
19
+
20
+ ### 2. Generate Client Secret
21
+
22
+ 1. Once created, you will see your **Client ID**.
23
+ 2. Click on **Generate a new client secret**.
24
+
25
+ ![GitHub Client Secret Generation](./images/github-client-secret.png)
26
+
27
+ 3. Copy both the **Client ID** and **Client Secret** and paste them into the Kosha configuration form.
28
+
29
+ > **Note:** GitHub OAuth Apps do not require you to define scopes upfront. Scopes are requested dynamically when the user initiates the connection.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kosha-ai/integration-github",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "GitHub integration for Kosha",
5
5
  "keywords": [
6
6
  "kosha",
@@ -36,6 +36,7 @@
36
36
  },
37
37
  "files": [
38
38
  "dist",
39
+ "docs",
39
40
  "!**/*.tsbuildinfo"
40
41
  ],
41
42
  "dependencies": {
@@ -46,9 +47,9 @@
46
47
  "key": "github"
47
48
  },
48
49
  "peerDependencies": {
49
- "@kosha-ai/integration-sdk": "0.0.4"
50
+ "@kosha-ai/integration-sdk": "0.0.6"
50
51
  },
51
52
  "devDependencies": {
52
- "@kosha-ai/integration-sdk": "0.0.4"
53
+ "@kosha-ai/integration-sdk": "0.0.6"
53
54
  }
54
55
  }