@credal/actions 0.1.36 → 0.1.37

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.
@@ -9,8 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const rest_1 = require("@octokit/rest");
13
- const request_error_1 = require("@octokit/request-error");
12
+ const octokit_1 = require("octokit");
14
13
  /**
15
14
  * Creates a new branch in a GitHub repository
16
15
  */
@@ -19,7 +18,7 @@ const createBranch = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params
19
18
  return { success: false, error: "authToken is required for GitHub API" };
20
19
  }
21
20
  const { repositoryOwner, repositoryName, branchName, baseRefOrHash } = params;
22
- const octokit = new rest_1.Octokit({ auth: authParams.authToken });
21
+ const octokit = new octokit_1.Octokit({ auth: authParams.authToken });
23
22
  try {
24
23
  // Get the reference or commit SHA for the base branch or tag
25
24
  const { data: baseRefData } = yield octokit.git
@@ -57,7 +56,7 @@ const createBranch = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params
57
56
  return { success: true };
58
57
  }
59
58
  catch (error) {
60
- if (error instanceof request_error_1.RequestError) {
59
+ if (error instanceof octokit_1.RequestError) {
61
60
  console.error("GitHub API error:", error.message);
62
61
  return { success: false, error: error.message };
63
62
  }
@@ -9,8 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const rest_1 = require("@octokit/rest");
13
- const request_error_1 = require("@octokit/request-error");
12
+ const octokit_1 = require("octokit");
14
13
  const zod_1 = require("zod");
15
14
  /**
16
15
  * Creates or updates a file in a GitHub repository
@@ -20,7 +19,7 @@ const createOrUpdateFile = (_a) => __awaiter(void 0, [_a], void 0, function* ({
20
19
  return { success: false, error: "authToken is required for GitHub API" };
21
20
  }
22
21
  const { repositoryOwner, repositoryName, filePath, branch, fileContent, commitMessage } = params;
23
- const octokit = new rest_1.Octokit({ auth: authParams.authToken });
22
+ const octokit = new octokit_1.Octokit({ auth: authParams.authToken });
24
23
  let fileSha = undefined;
25
24
  let operationPreformed = undefined;
26
25
  try {
@@ -41,7 +40,7 @@ const createOrUpdateFile = (_a) => __awaiter(void 0, [_a], void 0, function* ({
41
40
  operationPreformed = "updated";
42
41
  }
43
42
  catch (error) {
44
- if (error instanceof request_error_1.RequestError && error.status === 404) {
43
+ if (error instanceof octokit_1.RequestError && error.status === 404) {
45
44
  console.log(`File not found, creating new file.`);
46
45
  operationPreformed = "created";
47
46
  }
@@ -9,8 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const rest_1 = require("@octokit/rest");
13
- const request_error_1 = require("@octokit/request-error");
12
+ const octokit_1 = require("octokit");
14
13
  /**
15
14
  * Creates a pull request in a GitHub repository
16
15
  */
@@ -19,7 +18,7 @@ const createPullRequest = (_a) => __awaiter(void 0, [_a], void 0, function* ({ p
19
18
  return { success: false, error: "authToken is required for GitHub API" };
20
19
  }
21
20
  const { repositoryOwner, repositoryName, head, base, title, description } = params;
22
- const octokit = new rest_1.Octokit({ auth: authParams.authToken });
21
+ const octokit = new octokit_1.Octokit({ auth: authParams.authToken });
23
22
  try {
24
23
  // Create the pull request
25
24
  const { data: pullRequestData } = yield octokit.pulls.create({
@@ -37,7 +36,7 @@ const createPullRequest = (_a) => __awaiter(void 0, [_a], void 0, function* ({ p
37
36
  };
38
37
  }
39
38
  catch (error) {
40
- if (error instanceof request_error_1.RequestError) {
39
+ if (error instanceof octokit_1.RequestError) {
41
40
  console.error("GitHub API error:", error.message);
42
41
  return { success: false, error: error.message };
43
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@credal/actions",
3
- "version": "0.1.36",
3
+ "version": "0.1.37",
4
4
  "description": "AI Actions by Credal AI",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -42,7 +42,6 @@
42
42
  "@credal/sdk": "^0.0.21",
43
43
  "@mendable/firecrawl-js": "^1.19.0",
44
44
  "@microsoft/microsoft-graph-client": "^3.0.7",
45
- "@octokit/rest": "^21.1.1",
46
45
  "@slack/web-api": "^7.8.0",
47
46
  "@types/snowflake-sdk": "^1.6.24",
48
47
  "ajv": "^8.17.1",
@@ -52,6 +51,7 @@
52
51
  "json-schema-to-zod": "^2.5.0",
53
52
  "jsonwebtoken": "^9.0.2",
54
53
  "mongodb": "^6.13.1",
54
+ "octokit": "^4.1.2",
55
55
  "resend": "^4.1.2",
56
56
  "snowflake-sdk": "^2.0.2",
57
57
  "ts-node": "^10.9.2",