@loopstack/github-module 0.2.4 → 0.3.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/github-oauth.provider.js +9 -12
- package/dist/github-oauth.provider.js.map +1 -1
- package/dist/github.module.js +59 -62
- package/dist/github.module.js.map +1 -1
- package/dist/index.d.ts +27 -27
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -43
- package/dist/index.js.map +1 -1
- package/dist/tools/actions/github-get-workflow-run.tool.js +15 -18
- package/dist/tools/actions/github-get-workflow-run.tool.js.map +1 -1
- package/dist/tools/actions/github-list-workflow-runs.tool.js +18 -21
- package/dist/tools/actions/github-list-workflow-runs.tool.js.map +1 -1
- package/dist/tools/actions/github-trigger-workflow.tool.js +17 -20
- package/dist/tools/actions/github-trigger-workflow.tool.js.map +1 -1
- package/dist/tools/content/github-create-or-update-file.tool.js +19 -22
- package/dist/tools/content/github-create-or-update-file.tool.js.map +1 -1
- package/dist/tools/content/github-get-commit.tool.js +15 -18
- package/dist/tools/content/github-get-commit.tool.js.map +1 -1
- package/dist/tools/content/github-get-file-content.tool.js +16 -19
- package/dist/tools/content/github-get-file-content.tool.js.map +1 -1
- package/dist/tools/content/github-list-directory.tool.js +16 -19
- package/dist/tools/content/github-list-directory.tool.js.map +1 -1
- package/dist/tools/issues/github-create-issue-comment.tool.js +16 -19
- package/dist/tools/issues/github-create-issue-comment.tool.js.map +1 -1
- package/dist/tools/issues/github-create-issue.tool.js +18 -21
- package/dist/tools/issues/github-create-issue.tool.js.map +1 -1
- package/dist/tools/issues/github-get-issue.tool.js +15 -18
- package/dist/tools/issues/github-get-issue.tool.js.map +1 -1
- package/dist/tools/issues/github-list-issues.tool.js +19 -22
- package/dist/tools/issues/github-list-issues.tool.js.map +1 -1
- package/dist/tools/pull-requests/github-create-pull-request.tool.js +19 -22
- package/dist/tools/pull-requests/github-create-pull-request.tool.js.map +1 -1
- package/dist/tools/pull-requests/github-get-pull-request.tool.js +15 -18
- package/dist/tools/pull-requests/github-get-pull-request.tool.js.map +1 -1
- package/dist/tools/pull-requests/github-list-pr-reviews.tool.js +15 -18
- package/dist/tools/pull-requests/github-list-pr-reviews.tool.js.map +1 -1
- package/dist/tools/pull-requests/github-list-pull-requests.tool.js +18 -21
- package/dist/tools/pull-requests/github-list-pull-requests.tool.js.map +1 -1
- package/dist/tools/pull-requests/github-merge-pull-request.tool.js +18 -21
- package/dist/tools/pull-requests/github-merge-pull-request.tool.js.map +1 -1
- package/dist/tools/repos/github-create-repo.tool.js +16 -19
- package/dist/tools/repos/github-create-repo.tool.js.map +1 -1
- package/dist/tools/repos/github-get-repo.tool.js +14 -17
- package/dist/tools/repos/github-get-repo.tool.js.map +1 -1
- package/dist/tools/repos/github-list-branches.tool.js +15 -18
- package/dist/tools/repos/github-list-branches.tool.js.map +1 -1
- package/dist/tools/repos/github-list-repos.tool.js +16 -19
- package/dist/tools/repos/github-list-repos.tool.js.map +1 -1
- package/dist/tools/search/github-search-code.tool.js +15 -18
- package/dist/tools/search/github-search-code.tool.js.map +1 -1
- package/dist/tools/search/github-search-issues.tool.js +16 -19
- package/dist/tools/search/github-search-issues.tool.js.map +1 -1
- package/dist/tools/search/github-search-repos.tool.js +16 -19
- package/dist/tools/search/github-search-repos.tool.js.map +1 -1
- package/dist/tools/users/github-get-authenticated-user.tool.d.ts +1 -1
- package/dist/tools/users/github-get-authenticated-user.tool.d.ts.map +1 -1
- package/dist/tools/users/github-get-authenticated-user.tool.js +12 -15
- package/dist/tools/users/github-get-authenticated-user.tool.js.map +1 -1
- package/dist/tools/users/github-list-user-orgs.tool.js +13 -16
- package/dist/tools/users/github-list-user-orgs.tool.js.map +1 -1
- package/package.json +8 -26
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -9,20 +8,18 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
10
|
var GitHubGetRepoTool_1;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const oauth_module_1 = require("@loopstack/oauth-module");
|
|
18
|
-
const inputSchema = zod_1.z
|
|
11
|
+
import { Inject, Logger } from '@nestjs/common';
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
import { BaseTool, Tool } from '@loopstack/common';
|
|
14
|
+
import { OAuthTokenStore } from '@loopstack/oauth-module';
|
|
15
|
+
const inputSchema = z
|
|
19
16
|
.object({
|
|
20
|
-
owner:
|
|
21
|
-
repo:
|
|
17
|
+
owner: z.string(),
|
|
18
|
+
repo: z.string(),
|
|
22
19
|
})
|
|
23
20
|
.strict();
|
|
24
|
-
let GitHubGetRepoTool = GitHubGetRepoTool_1 = class GitHubGetRepoTool extends
|
|
25
|
-
logger = new
|
|
21
|
+
let GitHubGetRepoTool = GitHubGetRepoTool_1 = class GitHubGetRepoTool extends BaseTool {
|
|
22
|
+
logger = new Logger(GitHubGetRepoTool_1.name);
|
|
26
23
|
tokenStore;
|
|
27
24
|
async call(args) {
|
|
28
25
|
const accessToken = await this.tokenStore.getValidAccessToken(this.ctx.context.userId, 'github');
|
|
@@ -86,17 +83,17 @@ let GitHubGetRepoTool = GitHubGetRepoTool_1 = class GitHubGetRepoTool extends co
|
|
|
86
83
|
};
|
|
87
84
|
}
|
|
88
85
|
};
|
|
89
|
-
exports.GitHubGetRepoTool = GitHubGetRepoTool;
|
|
90
86
|
__decorate([
|
|
91
|
-
|
|
92
|
-
__metadata("design:type",
|
|
87
|
+
Inject(),
|
|
88
|
+
__metadata("design:type", OAuthTokenStore)
|
|
93
89
|
], GitHubGetRepoTool.prototype, "tokenStore", void 0);
|
|
94
|
-
|
|
95
|
-
|
|
90
|
+
GitHubGetRepoTool = GitHubGetRepoTool_1 = __decorate([
|
|
91
|
+
Tool({
|
|
96
92
|
uiConfig: {
|
|
97
93
|
description: 'Gets detailed information about a specific GitHub repository. Returns { error: "unauthorized" } if no valid token is available.',
|
|
98
94
|
},
|
|
99
95
|
schema: inputSchema,
|
|
100
96
|
})
|
|
101
97
|
], GitHubGetRepoTool);
|
|
98
|
+
export { GitHubGetRepoTool };
|
|
102
99
|
//# sourceMappingURL=github-get-repo.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-get-repo.tool.js","sourceRoot":"","sources":["../../../src/tools/repos/github-get-repo.tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"github-get-repo.tool.js","sourceRoot":"","sources":["../../../src/tools/repos/github-get-repo.tool.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAc,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,WAAW,GAAG,CAAC;KAClB,MAAM,CAAC;IACN,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC;KACD,MAAM,EAAE,CAAC;AAWL,IAAM,iBAAiB,yBAAvB,MAAM,iBAAkB,SAAQ,QAAQ;IAC5B,MAAM,GAAG,IAAI,MAAM,CAAC,mBAAiB,CAAC,IAAI,CAAC,CAAC;IAGrD,UAAU,CAAkB;IAEpC,KAAK,CAAC,IAAI,CAAC,IAAuB;QAChC,MA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C;QACJ,CAAC;QAED,MAAM,IAAI,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAiBlC,CAAC;QAEF,OAAO;YACL,IAAI,EAAE;gBACJ,IAAI,EAAE;oBACJ,EAAE,EAAE,IAAI,CAAC,EAAE;oBACX,QAAQ,EAAE,IAAI,CAAC,SAAS;oBACxB,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;oBACvB,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU;oBAClC,OAAO,EAAE,IAAI,CAAC,OAAO;oBACrB,OAAO,EAAE,IAAI,CAAC,QAAQ;oBACtB,WAAW,EAAE,IAAI,CAAC,WAAW;oBAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ;oBACvB,aAAa,EAAE,IAAI,CAAC,cAAc;oBAClC,KAAK,EAAE,IAAI,CAAC,gBAAgB;oBAC5B,KAAK,EAAE,IAAI,CAAC,WAAW;oBACvB,UAAU,EAAE,IAAI,CAAC,iBAAiB;oBAClC,SAAS,EAAE,IAAI,CAAC,UAAU;oBAC1B,SAAS,EAAE,IAAI,CAAC,UAAU;oBAC1B,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,IAAI,IAAI;iBACvC;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AAzFS;IADP,MAAM,EAAE;8BACW,eAAe;qDAAC;AAJzB,iBAAiB;IAP7B,IAAI,CAAC;QACJ,QAAQ,EAAE;YACR,WAAW,EACT,iIAAiI;SACpI;QACD,MAAM,EAAE,WAAW;KACpB,CAAC;GACW,iBAAiB,CA6F7B"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -9,21 +8,19 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
10
|
var GitHubListBranchesTool_1;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const oauth_module_1 = require("@loopstack/oauth-module");
|
|
18
|
-
const inputSchema = zod_1.z
|
|
11
|
+
import { Inject, Logger } from '@nestjs/common';
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
import { BaseTool, Tool } from '@loopstack/common';
|
|
14
|
+
import { OAuthTokenStore } from '@loopstack/oauth-module';
|
|
15
|
+
const inputSchema = z
|
|
19
16
|
.object({
|
|
20
|
-
owner:
|
|
21
|
-
repo:
|
|
22
|
-
perPage:
|
|
17
|
+
owner: z.string(),
|
|
18
|
+
repo: z.string(),
|
|
19
|
+
perPage: z.number().default(30),
|
|
23
20
|
})
|
|
24
21
|
.strict();
|
|
25
|
-
let GitHubListBranchesTool = GitHubListBranchesTool_1 = class GitHubListBranchesTool extends
|
|
26
|
-
logger = new
|
|
22
|
+
let GitHubListBranchesTool = GitHubListBranchesTool_1 = class GitHubListBranchesTool extends BaseTool {
|
|
23
|
+
logger = new Logger(GitHubListBranchesTool_1.name);
|
|
27
24
|
tokenStore;
|
|
28
25
|
async call(args) {
|
|
29
26
|
const accessToken = await this.tokenStore.getValidAccessToken(this.ctx.context.userId, 'github');
|
|
@@ -76,17 +73,17 @@ let GitHubListBranchesTool = GitHubListBranchesTool_1 = class GitHubListBranches
|
|
|
76
73
|
};
|
|
77
74
|
}
|
|
78
75
|
};
|
|
79
|
-
exports.GitHubListBranchesTool = GitHubListBranchesTool;
|
|
80
76
|
__decorate([
|
|
81
|
-
|
|
82
|
-
__metadata("design:type",
|
|
77
|
+
Inject(),
|
|
78
|
+
__metadata("design:type", OAuthTokenStore)
|
|
83
79
|
], GitHubListBranchesTool.prototype, "tokenStore", void 0);
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
GitHubListBranchesTool = GitHubListBranchesTool_1 = __decorate([
|
|
81
|
+
Tool({
|
|
86
82
|
uiConfig: {
|
|
87
83
|
description: 'Lists branches for a GitHub repository. Returns { error: "unauthorized" } if no valid token is available.',
|
|
88
84
|
},
|
|
89
85
|
schema: inputSchema,
|
|
90
86
|
})
|
|
91
87
|
], GitHubListBranchesTool);
|
|
88
|
+
export { GitHubListBranchesTool };
|
|
92
89
|
//# sourceMappingURL=github-list-branches.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-list-branches.tool.js","sourceRoot":"","sources":["../../../src/tools/repos/github-list-branches.tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"github-list-branches.tool.js","sourceRoot":"","sources":["../../../src/tools/repos/github-list-branches.tool.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAc,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,WAAW,GAAG,CAAC;KAClB,MAAM,CAAC;IACN,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;CAChC,CAAC;KACD,MAAM,EAAE,CAAC;AAWL,IAAM,sBAAsB,8BAA5B,MAAM,sBAAuB,SAAQ,QAAQ;IACjC,MAAM,GAAG,IAAI,MAAM,CAAC,w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AAE,CAAC;YACjB,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YACnC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,qBAAqB,QAAQ,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC,CAAC;YAClE,OAAO;gBACL,IAAI,EAAE;oBACJ,KAAK,EAAE,WAAW;oBAClB,OAAO,EAAE,qBAAqB,QAAQ,CAAC,UAAU,EAAE;iBACpD;aACF,CAAC;QACJ,CAAC;QAED,MAAM,IAAI,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAIjC,CAAC;QAEH,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YACrC,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG;YAC5B,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC;SAC/B,CAAC,CAAC,CAAC;QAEJ,OAAO;YACL,IAAI,EAAE,EAAE,QAAQ,EAAE;SACnB,CAAC;IACJ,CAAC;CACF,CAAA;AAhES;IADP,MAAM,EAAE;8BACW,eAAe;0DAAC;AAJzB,sBAAsB;IAPlC,IAAI,CAAC;QACJ,QAAQ,EAAE;YACR,WAAW,EACT,2GAA2G;SAC9G;QACD,MAAM,EAAE,WAAW;KACpB,CAAC;GACW,sBAAsB,CAoElC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -9,22 +8,20 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
10
|
var GitHubListReposTool_1;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const oauth_module_1 = require("@loopstack/oauth-module");
|
|
18
|
-
const inputSchema = zod_1.z
|
|
11
|
+
import { Inject, Logger } from '@nestjs/common';
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
import { BaseTool, Tool } from '@loopstack/common';
|
|
14
|
+
import { OAuthTokenStore } from '@loopstack/oauth-module';
|
|
15
|
+
const inputSchema = z
|
|
19
16
|
.object({
|
|
20
|
-
visibility:
|
|
21
|
-
sort:
|
|
22
|
-
perPage:
|
|
23
|
-
page:
|
|
17
|
+
visibility: z.enum(['all', 'public', 'private']).default('all'),
|
|
18
|
+
sort: z.enum(['created', 'updated', 'pushed', 'full_name']).default('updated'),
|
|
19
|
+
perPage: z.number().default(30),
|
|
20
|
+
page: z.number().default(1),
|
|
24
21
|
})
|
|
25
22
|
.strict();
|
|
26
|
-
let GitHubListReposTool = GitHubListReposTool_1 = class GitHubListReposTool extends
|
|
27
|
-
logger = new
|
|
23
|
+
let GitHubListReposTool = GitHubListReposTool_1 = class GitHubListReposTool extends BaseTool {
|
|
24
|
+
logger = new Logger(GitHubListReposTool_1.name);
|
|
28
25
|
tokenStore;
|
|
29
26
|
async call(args) {
|
|
30
27
|
const accessToken = await this.tokenStore.getValidAccessToken(this.ctx.context.userId, 'github');
|
|
@@ -86,17 +83,17 @@ let GitHubListReposTool = GitHubListReposTool_1 = class GitHubListReposTool exte
|
|
|
86
83
|
};
|
|
87
84
|
}
|
|
88
85
|
};
|
|
89
|
-
exports.GitHubListReposTool = GitHubListReposTool;
|
|
90
86
|
__decorate([
|
|
91
|
-
|
|
92
|
-
__metadata("design:type",
|
|
87
|
+
Inject(),
|
|
88
|
+
__metadata("design:type", OAuthTokenStore)
|
|
93
89
|
], GitHubListReposTool.prototype, "tokenStore", void 0);
|
|
94
|
-
|
|
95
|
-
|
|
90
|
+
GitHubListReposTool = GitHubListReposTool_1 = __decorate([
|
|
91
|
+
Tool({
|
|
96
92
|
uiConfig: {
|
|
97
93
|
description: 'Lists repositories for the authenticated GitHub user. Returns { error: "unauthorized" } if no valid token is available.',
|
|
98
94
|
},
|
|
99
95
|
schema: inputSchema,
|
|
100
96
|
})
|
|
101
97
|
], GitHubListReposTool);
|
|
98
|
+
export { GitHubListReposTool };
|
|
102
99
|
//# sourceMappingURL=github-list-repos.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-list-repos.tool.js","sourceRoot":"","sources":["../../../src/tools/repos/github-list-repos.tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"github-list-repos.tool.js","sourceRoot":"","sources":["../../../src/tools/repos/github-list-repos.tool.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAc,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,WAAW,GAAG,CAAC;KAClB,MAAM,CAAC;IACN,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IAC/D,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IAC9E,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAC/B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,CAA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R,WAAW,EACT,yHAAyH;SAC5H;QACD,MAAM,EAAE,WAAW;KACpB,CAAC;GACW,mBAAmB,CAoF/B"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -9,21 +8,19 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
10
|
var GitHubSearchCodeTool_1;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const oauth_module_1 = require("@loopstack/oauth-module");
|
|
18
|
-
const inputSchema = zod_1.z
|
|
11
|
+
import { Inject, Logger } from '@nestjs/common';
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
import { BaseTool, Tool } from '@loopstack/common';
|
|
14
|
+
import { OAuthTokenStore } from '@loopstack/oauth-module';
|
|
15
|
+
const inputSchema = z
|
|
19
16
|
.object({
|
|
20
|
-
query:
|
|
21
|
-
perPage:
|
|
22
|
-
page:
|
|
17
|
+
query: z.string(),
|
|
18
|
+
perPage: z.number().default(30),
|
|
19
|
+
page: z.number().default(1),
|
|
23
20
|
})
|
|
24
21
|
.strict();
|
|
25
|
-
let GitHubSearchCodeTool = GitHubSearchCodeTool_1 = class GitHubSearchCodeTool extends
|
|
26
|
-
logger = new
|
|
22
|
+
let GitHubSearchCodeTool = GitHubSearchCodeTool_1 = class GitHubSearchCodeTool extends BaseTool {
|
|
23
|
+
logger = new Logger(GitHubSearchCodeTool_1.name);
|
|
27
24
|
tokenStore;
|
|
28
25
|
async call(args) {
|
|
29
26
|
const accessToken = await this.tokenStore.getValidAccessToken(this.ctx.context.userId, 'github');
|
|
@@ -79,17 +76,17 @@ let GitHubSearchCodeTool = GitHubSearchCodeTool_1 = class GitHubSearchCodeTool e
|
|
|
79
76
|
};
|
|
80
77
|
}
|
|
81
78
|
};
|
|
82
|
-
exports.GitHubSearchCodeTool = GitHubSearchCodeTool;
|
|
83
79
|
__decorate([
|
|
84
|
-
|
|
85
|
-
__metadata("design:type",
|
|
80
|
+
Inject(),
|
|
81
|
+
__metadata("design:type", OAuthTokenStore)
|
|
86
82
|
], GitHubSearchCodeTool.prototype, "tokenStore", void 0);
|
|
87
|
-
|
|
88
|
-
|
|
83
|
+
GitHubSearchCodeTool = GitHubSearchCodeTool_1 = __decorate([
|
|
84
|
+
Tool({
|
|
89
85
|
uiConfig: {
|
|
90
86
|
description: 'Searches for code across GitHub repositories using the GitHub search syntax. Returns { error: "unauthorized" } if no valid token is available.',
|
|
91
87
|
},
|
|
92
88
|
schema: inputSchema,
|
|
93
89
|
})
|
|
94
90
|
], GitHubSearchCodeTool);
|
|
91
|
+
export { GitHubSearchCodeTool };
|
|
95
92
|
//# sourceMappingURL=github-search-code.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-search-code.tool.js","sourceRoot":"","sources":["../../../src/tools/search/github-search-code.tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"github-search-code.tool.js","sourceRoot":"","sources":["../../../src/tools/search/github-search-code.tool.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAc,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,WAAW,GAAG,CAAC;KAClB,MAAM,CAAC;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J;QACD,MAAM,EAAE,WAAW;KACpB,CAAC;GACW,oBAAoB,CA4EhC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -9,24 +8,22 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
10
|
var GitHubSearchIssuesTool_1;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const oauth_module_1 = require("@loopstack/oauth-module");
|
|
18
|
-
const inputSchema = zod_1.z
|
|
11
|
+
import { Inject, Logger } from '@nestjs/common';
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
import { BaseTool, Tool } from '@loopstack/common';
|
|
14
|
+
import { OAuthTokenStore } from '@loopstack/oauth-module';
|
|
15
|
+
const inputSchema = z
|
|
19
16
|
.object({
|
|
20
|
-
query:
|
|
21
|
-
sort:
|
|
17
|
+
query: z.string(),
|
|
18
|
+
sort: z
|
|
22
19
|
.enum(['comments', 'reactions', 'reactions-+1', 'reactions--1', 'interactions', 'created', 'updated'])
|
|
23
20
|
.optional(),
|
|
24
|
-
perPage:
|
|
25
|
-
page:
|
|
21
|
+
perPage: z.number().default(30),
|
|
22
|
+
page: z.number().default(1),
|
|
26
23
|
})
|
|
27
24
|
.strict();
|
|
28
|
-
let GitHubSearchIssuesTool = GitHubSearchIssuesTool_1 = class GitHubSearchIssuesTool extends
|
|
29
|
-
logger = new
|
|
25
|
+
let GitHubSearchIssuesTool = GitHubSearchIssuesTool_1 = class GitHubSearchIssuesTool extends BaseTool {
|
|
26
|
+
logger = new Logger(GitHubSearchIssuesTool_1.name);
|
|
30
27
|
tokenStore;
|
|
31
28
|
async call(args) {
|
|
32
29
|
const accessToken = await this.tokenStore.getValidAccessToken(this.ctx.context.userId, 'github');
|
|
@@ -88,17 +85,17 @@ let GitHubSearchIssuesTool = GitHubSearchIssuesTool_1 = class GitHubSearchIssues
|
|
|
88
85
|
};
|
|
89
86
|
}
|
|
90
87
|
};
|
|
91
|
-
exports.GitHubSearchIssuesTool = GitHubSearchIssuesTool;
|
|
92
88
|
__decorate([
|
|
93
|
-
|
|
94
|
-
__metadata("design:type",
|
|
89
|
+
Inject(),
|
|
90
|
+
__metadata("design:type", OAuthTokenStore)
|
|
95
91
|
], GitHubSearchIssuesTool.prototype, "tokenStore", void 0);
|
|
96
|
-
|
|
97
|
-
|
|
92
|
+
GitHubSearchIssuesTool = GitHubSearchIssuesTool_1 = __decorate([
|
|
93
|
+
Tool({
|
|
98
94
|
uiConfig: {
|
|
99
95
|
description: 'Searches for issues and pull requests across GitHub using the GitHub search syntax. Returns { error: "unauthorized" } if no valid token is available.',
|
|
100
96
|
},
|
|
101
97
|
schema: inputSchema,
|
|
102
98
|
})
|
|
103
99
|
], GitHubSearchIssuesTool);
|
|
100
|
+
export { GitHubSearchIssuesTool };
|
|
104
101
|
//# sourceMappingURL=github-search-issues.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-search-issues.tool.js","sourceRoot":"","sources":["../../../src/tools/search/github-search-issues.tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"github-search-issues.tool.js","sourceRoot":"","sources":["../../../src/tools/search/github-search-issues.tool.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,IAAI,EA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B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK;YACrB,OAAO,EAAE,IAAI,CAAC,QAAQ;YACtB,SAAS,EAAE,IAAI,CAAC,UAAU;YAC1B,SAAS,EAAE,IAAI,CAAC,UAAU;YAC1B,aAAa,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY;SACnC,CAAC,CAAC,CAAC;QAEJ,OAAO;YACL,IAAI,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE;SAChD,CAAC;IACJ,CAAC;CACF,CAAA;AAnFS;IADP,MAAM,EAAE;8BACW,eAAe;0DAAC;AAJzB,sBAAsB;IAPlC,IAAI,CAAC;QACJ,QAAQ,EAAE;YACR,WAAW,EACT,uJAAuJ;SAC1J;QACD,MAAM,EAAE,WAAW;KACpB,CAAC;GACW,sBAAsB,CAuFlC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -9,22 +8,20 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
10
|
var GitHubSearchReposTool_1;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const oauth_module_1 = require("@loopstack/oauth-module");
|
|
18
|
-
const inputSchema = zod_1.z
|
|
11
|
+
import { Inject, Logger } from '@nestjs/common';
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
import { BaseTool, Tool } from '@loopstack/common';
|
|
14
|
+
import { OAuthTokenStore } from '@loopstack/oauth-module';
|
|
15
|
+
const inputSchema = z
|
|
19
16
|
.object({
|
|
20
|
-
query:
|
|
21
|
-
sort:
|
|
22
|
-
perPage:
|
|
23
|
-
page:
|
|
17
|
+
query: z.string(),
|
|
18
|
+
sort: z.enum(['stars', 'forks', 'help-wanted-issues', 'updated']).optional(),
|
|
19
|
+
perPage: z.number().default(30),
|
|
20
|
+
page: z.number().default(1),
|
|
24
21
|
})
|
|
25
22
|
.strict();
|
|
26
|
-
let GitHubSearchReposTool = GitHubSearchReposTool_1 = class GitHubSearchReposTool extends
|
|
27
|
-
logger = new
|
|
23
|
+
let GitHubSearchReposTool = GitHubSearchReposTool_1 = class GitHubSearchReposTool extends BaseTool {
|
|
24
|
+
logger = new Logger(GitHubSearchReposTool_1.name);
|
|
28
25
|
tokenStore;
|
|
29
26
|
async call(args) {
|
|
30
27
|
const accessToken = await this.tokenStore.getValidAccessToken(this.ctx.context.userId, 'github');
|
|
@@ -85,17 +82,17 @@ let GitHubSearchReposTool = GitHubSearchReposTool_1 = class GitHubSearchReposToo
|
|
|
85
82
|
};
|
|
86
83
|
}
|
|
87
84
|
};
|
|
88
|
-
exports.GitHubSearchReposTool = GitHubSearchReposTool;
|
|
89
85
|
__decorate([
|
|
90
|
-
|
|
91
|
-
__metadata("design:type",
|
|
86
|
+
Inject(),
|
|
87
|
+
__metadata("design:type", OAuthTokenStore)
|
|
92
88
|
], GitHubSearchReposTool.prototype, "tokenStore", void 0);
|
|
93
|
-
|
|
94
|
-
|
|
89
|
+
GitHubSearchReposTool = GitHubSearchReposTool_1 = __decorate([
|
|
90
|
+
Tool({
|
|
95
91
|
uiConfig: {
|
|
96
92
|
description: 'Searches for repositories on GitHub using the GitHub search syntax. Returns { error: "unauthorized" } if no valid token is available.',
|
|
97
93
|
},
|
|
98
94
|
schema: inputSchema,
|
|
99
95
|
})
|
|
100
96
|
], GitHubSearchReposTool);
|
|
97
|
+
export { GitHubSearchReposTool };
|
|
101
98
|
//# sourceMappingURL=github-search-repos.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-search-repos.tool.js","sourceRoot":"","sources":["../../../src/tools/search/github-search-repos.tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"github-search-repos.tool.js","sourceRoot":"","sources":["../../../src/tools/search/github-search-repos.tool.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAc,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,WAAW,GAAG,CAAC;KAClB,MAAM,CAAC;IACN,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC5E,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAC/B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;CAC5B,CAAC;KACD,MAAM,EAAE,CAAC;AAWL,IAAM,qBAAqB,6BAA3B,MAAM,qBAAsB,SAAQ,QAAQ;IAChC,MAAM,GAAG,IAAI,MAAM,CAAC,uBAAqB,CAAC,IAAI,CAAC,CAAC;IAGzD,UAAU,CAAkB;IAEpC,KAAK,CAAC,IAAI,CAAC,IAA2B;QACpC,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,QAA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CAAC,MAAM,IAAI,IAAI,EAAE,CAAC,CAAC;YAClE,OAAO;gBACL,IAAI,EAAE;oBACJ,KAAK,EAAE,WAAW;oBAClB,OAAO,EAAE,qBAAqB,QAAQ,CAAC,UAAU,EAAE;iBACpD;aACF,CAAC;QACJ,CAAC;QAED,MAAM,IAAI,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAYlC,CAAC;QAEF,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACxC,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,QAAQ,EAAE,IAAI,CAAC,SAAS;YACxB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,OAAO,EAAE,IAAI,CAAC,QAAQ;YACtB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,KAAK,EAAE,IAAI,CAAC,gBAAgB;YAC5B,KAAK,EAAE,IAAI,CAAC,WAAW;YACvB,SAAS,EAAE,IAAI,CAAC,UAAU;SAC3B,CAAC,CAAC,CAAC;QAEJ,OAAO;YACL,IAAI,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE;SAChD,CAAC;IACJ,CAAC;CACF,CAAA;AAhFS;IADP,MAAM,EAAE;8BACW,eAAe;yDAAC;AAJzB,qBAAqB;IAPjC,IAAI,CAAC;QACJ,QAAQ,EAAE;YACR,WAAW,EACT,uIAAuI;SAC1I;QACD,MAAM,EAAE,WAAW;KACpB,CAAC;GACW,qBAAqB,CAoFjC"}
|
|
@@ -5,7 +5,7 @@ export type GitHubGetAuthenticatedUserArgs = z.infer<typeof inputSchema>;
|
|
|
5
5
|
export declare class GitHubGetAuthenticatedUserTool extends BaseTool {
|
|
6
6
|
private readonly logger;
|
|
7
7
|
private tokenStore;
|
|
8
|
-
call(_args
|
|
8
|
+
call(_args?: GitHubGetAuthenticatedUserArgs): Promise<ToolResult>;
|
|
9
9
|
}
|
|
10
10
|
export {};
|
|
11
11
|
//# sourceMappingURL=github-get-authenticated-user.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-get-authenticated-user.tool.d.ts","sourceRoot":"","sources":["../../../src/tools/users/github-get-authenticated-user.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAQ,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/D,QAAA,MAAM,WAAW,iCAAwB,CAAC;AAE1C,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEzE,qBAOa,8BAA+B,SAAQ,QAAQ;IAC1D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmD;IAG1E,OAAO,CAAC,UAAU,CAAkB;IAE9B,IAAI,CAAC,KAAK,EAAE,8BAA8B,GAAG,OAAO,CAAC,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"github-get-authenticated-user.tool.d.ts","sourceRoot":"","sources":["../../../src/tools/users/github-get-authenticated-user.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAQ,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/D,QAAA,MAAM,WAAW,iCAAwB,CAAC;AAE1C,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEzE,qBAOa,8BAA+B,SAAQ,QAAQ;IAC1D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmD;IAG1E,OAAO,CAAC,UAAU,CAAkB;IAE9B,IAAI,CAAC,KAAK,CAAC,EAAE,8BAA8B,GAAG,OAAO,CAAC,UAAU,CAAC;CAyExE"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -9,15 +8,13 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
10
|
var GitHubGetAuthenticatedUserTool_1;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
let GitHubGetAuthenticatedUserTool = GitHubGetAuthenticatedUserTool_1 = class GitHubGetAuthenticatedUserTool extends common_2.BaseTool {
|
|
20
|
-
logger = new common_1.Logger(GitHubGetAuthenticatedUserTool_1.name);
|
|
11
|
+
import { Inject, Logger } from '@nestjs/common';
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
import { BaseTool, Tool } from '@loopstack/common';
|
|
14
|
+
import { OAuthTokenStore } from '@loopstack/oauth-module';
|
|
15
|
+
const inputSchema = z.object({}).strict();
|
|
16
|
+
let GitHubGetAuthenticatedUserTool = GitHubGetAuthenticatedUserTool_1 = class GitHubGetAuthenticatedUserTool extends BaseTool {
|
|
17
|
+
logger = new Logger(GitHubGetAuthenticatedUserTool_1.name);
|
|
21
18
|
tokenStore;
|
|
22
19
|
async call(_args) {
|
|
23
20
|
const accessToken = await this.tokenStore.getValidAccessToken(this.ctx.context.userId, 'github');
|
|
@@ -75,17 +72,17 @@ let GitHubGetAuthenticatedUserTool = GitHubGetAuthenticatedUserTool_1 = class Gi
|
|
|
75
72
|
};
|
|
76
73
|
}
|
|
77
74
|
};
|
|
78
|
-
exports.GitHubGetAuthenticatedUserTool = GitHubGetAuthenticatedUserTool;
|
|
79
75
|
__decorate([
|
|
80
|
-
|
|
81
|
-
__metadata("design:type",
|
|
76
|
+
Inject(),
|
|
77
|
+
__metadata("design:type", OAuthTokenStore)
|
|
82
78
|
], GitHubGetAuthenticatedUserTool.prototype, "tokenStore", void 0);
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
GitHubGetAuthenticatedUserTool = GitHubGetAuthenticatedUserTool_1 = __decorate([
|
|
80
|
+
Tool({
|
|
85
81
|
uiConfig: {
|
|
86
82
|
description: 'Gets the profile of the currently authenticated GitHub user. Returns { error: "unauthorized" } if no valid token is available.',
|
|
87
83
|
},
|
|
88
84
|
schema: inputSchema,
|
|
89
85
|
})
|
|
90
86
|
], GitHubGetAuthenticatedUserTool);
|
|
87
|
+
export { GitHubGetAuthenticatedUserTool };
|
|
91
88
|
//# sourceMappingURL=github-get-authenticated-user.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-get-authenticated-user.tool.js","sourceRoot":"","sources":["../../../src/tools/users/github-get-authenticated-user.tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"github-get-authenticated-user.tool.js","sourceRoot":"","sources":["../../../src/tools/users/github-get-authenticated-user.tool.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAc,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAWnC,IAAM,8BAA8B,sCAApC,MAAM,8BAA+B,SAAQ,QAAQ;IACzC,MAAM,GAAG,IAAI,MAAM,CAAC,gCAA8B,CAAC,IAAI,CAAC,CAAC;IAGlE,UAAU,CAAkB;IAEpC,KAAK,CAAC,IA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C,IAAI,EAAE,CAYlC,CAAC;QAEF,OAAO;YACL,IAAI,EAAE;gBACJ,IAAI,EAAE;oBACJ,EAAE,EAAE,IAAI,CAAC,EAAE;oBACX,KAAK,EAAE,IAAI,CAAC,KAAK;oBACjB,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,KAAK,EAAE,IAAI,CAAC,KAAK;oBACjB,SAAS,EAAE,IAAI,CAAC,UAAU;oBAC1B,OAAO,EAAE,IAAI,CAAC,QAAQ;oBACtB,GAAG,EAAE,IAAI,CAAC,GAAG;oBACb,WAAW,EAAE,IAAI,CAAC,YAAY;oBAC9B,SAAS,EAAE,IAAI,CAAC,SAAS;oBACzB,SAAS,EAAE,IAAI,CAAC,SAAS;oBACzB,SAAS,EAAE,IAAI,CAAC,UAAU;iBAC3B;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AA3ES;IADP,MAAM,EAAE;8BACW,eAAe;kEAAC;AAJzB,8BAA8B;IAP1C,IAAI,CAAC;QACJ,QAAQ,EAAE;YACR,WAAW,EACT,gIAAgI;SACnI;QACD,MAAM,EAAE,WAAW;KACpB,CAAC;GACW,8BAA8B,CA+E1C"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -9,19 +8,17 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
10
|
var GitHubListUserOrgsTool_1;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const oauth_module_1 = require("@loopstack/oauth-module");
|
|
18
|
-
const inputSchema = zod_1.z
|
|
11
|
+
import { Inject, Logger } from '@nestjs/common';
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
import { BaseTool, Tool } from '@loopstack/common';
|
|
14
|
+
import { OAuthTokenStore } from '@loopstack/oauth-module';
|
|
15
|
+
const inputSchema = z
|
|
19
16
|
.object({
|
|
20
|
-
perPage:
|
|
17
|
+
perPage: z.number().default(30),
|
|
21
18
|
})
|
|
22
19
|
.strict();
|
|
23
|
-
let GitHubListUserOrgsTool = GitHubListUserOrgsTool_1 = class GitHubListUserOrgsTool extends
|
|
24
|
-
logger = new
|
|
20
|
+
let GitHubListUserOrgsTool = GitHubListUserOrgsTool_1 = class GitHubListUserOrgsTool extends BaseTool {
|
|
21
|
+
logger = new Logger(GitHubListUserOrgsTool_1.name);
|
|
25
22
|
tokenStore;
|
|
26
23
|
async call(args) {
|
|
27
24
|
const accessToken = await this.tokenStore.getValidAccessToken(this.ctx.context.userId, 'github');
|
|
@@ -74,17 +71,17 @@ let GitHubListUserOrgsTool = GitHubListUserOrgsTool_1 = class GitHubListUserOrgs
|
|
|
74
71
|
};
|
|
75
72
|
}
|
|
76
73
|
};
|
|
77
|
-
exports.GitHubListUserOrgsTool = GitHubListUserOrgsTool;
|
|
78
74
|
__decorate([
|
|
79
|
-
|
|
80
|
-
__metadata("design:type",
|
|
75
|
+
Inject(),
|
|
76
|
+
__metadata("design:type", OAuthTokenStore)
|
|
81
77
|
], GitHubListUserOrgsTool.prototype, "tokenStore", void 0);
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
GitHubListUserOrgsTool = GitHubListUserOrgsTool_1 = __decorate([
|
|
79
|
+
Tool({
|
|
84
80
|
uiConfig: {
|
|
85
81
|
description: 'Lists organizations for the authenticated GitHub user. Returns { error: "unauthorized" } if no valid token is available.',
|
|
86
82
|
},
|
|
87
83
|
schema: inputSchema,
|
|
88
84
|
})
|
|
89
85
|
], GitHubListUserOrgsTool);
|
|
86
|
+
export { GitHubListUserOrgsTool };
|
|
90
87
|
//# sourceMappingURL=github-list-user-orgs.tool.js.map
|