Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update file utilities for windows processing #1483

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: pretty
abhishekpatil4 committed Mar 24, 2025
commit 9be75f36eb6e800b3249e803df0b53bd4dd8de20
4 changes: 2 additions & 2 deletions js/src/sdk/utils/processor/fileUtils.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { Client } from "@hey-api/client-axios";
import axios, { AxiosError } from "axios";
import crypto from "crypto";
import pa from "path";
import apiClient from "../../client/client";
import { saveFile } from "../fileUtils";
import pa from 'path';

const readFileContent = async (
path: string
): Promise<{ content: string; mimeType: string }> => {
try {
const content = require("fs").readFileSync(path);

Check warning on line 12 in js/src/sdk/utils/processor/fileUtils.ts

GitHub Actions / lint-and-prettify

A `require()` style import is forbidden

Check warning on line 12 in js/src/sdk/utils/processor/fileUtils.ts

GitHub Actions / lint-and-prettify

A `require()` style import is forbidden
return {
content: content.toString("base64"),
mimeType: "application/octet-stream",
@@ -103,7 +103,7 @@
fileData.mimeType,
client
);

return {
name: pa.basename(path) || `${actionName}_${Date.now()}`,
mimetype: fileData.mimeType,

Unchanged files with check annotations Beta

try {
const connection = await entity2.getConnection({ app: "gmail" });
expect(connection?.appUniqueId).toBe("gmail");
} catch (error) {

Check warning on line 55 in js/src/sdk/models/Entity.spec.ts

GitHub Actions / lint-and-prettify

'error' is defined but never used. Allowed unused caught errors must match /^_/u

Check warning on line 55 in js/src/sdk/models/Entity.spec.ts

GitHub Actions / lint-and-prettify

'error' is defined but never used. Allowed unused caught errors must match /^_/u
hasError = true;
}
expect(hasError).toBe(true);
});
it("should have an Id of a connected account with label - primary", async () => {
const entityW2Connection = new Entity(backendClient, "ckemvy");

Check warning on line 80 in js/src/sdk/models/Entity.spec.ts

GitHub Actions / lint-and-prettify

'entityW2Connection' is assigned a value but never used. Allowed unused vars must match /^_/u

Check warning on line 80 in js/src/sdk/models/Entity.spec.ts

GitHub Actions / lint-and-prettify

'entityW2Connection' is assigned a value but never used. Allowed unused vars must match /^_/u
const entity = new Entity(backendClient, "ckemvy");

Check warning on line 82 in js/src/sdk/models/Entity.spec.ts

GitHub Actions / lint-and-prettify

'entity' is assigned a value but never used. Allowed unused vars must match /^_/u

Check warning on line 82 in js/src/sdk/models/Entity.spec.ts

GitHub Actions / lint-and-prettify

'entity' is assigned a value but never used. Allowed unused vars must match /^_/u
// Remove test with normal app where reinitiate connection is not needed
// await entity.initiateConnection({
});
it("should have an Id of a connected account with default - primary", async () => {
const entityW2Connection = new Entity(backendClient, "default");

Check warning on line 96 in js/src/sdk/models/Entity.spec.ts

GitHub Actions / lint-and-prettify

'entityW2Connection' is assigned a value but never used. Allowed unused vars must match /^_/u

Check warning on line 96 in js/src/sdk/models/Entity.spec.ts

GitHub Actions / lint-and-prettify

'entityW2Connection' is assigned a value but never used. Allowed unused vars must match /^_/u
const entity = new Entity(backendClient, "default");
it("should retrieve a specific connection", async () => {
// @ts-ignore
const connectionsData: TConnectionData = {

Check warning on line 36 in js/src/sdk/models/connectedAccounts.spec.ts

GitHub Actions / lint-and-prettify

'connectionsData' is assigned a value but never used. Allowed unused vars must match /^_/u

Check warning on line 36 in js/src/sdk/models/connectedAccounts.spec.ts

GitHub Actions / lint-and-prettify

'connectionsData' is assigned a value but never used. Allowed unused vars must match /^_/u
appNames: "github",
};
const connectionsList = await connectedAccounts.list({
});
try {
ZSingleConnectionParams.parse(data);
const res = await apiClient.connections.disableConnection({

Check warning on line 158 in js/src/sdk/models/connectedAccounts.ts

GitHub Actions / lint-and-prettify

'res' is assigned a value but never used. Allowed unused vars must match /^_/u

Check warning on line 158 in js/src/sdk/models/connectedAccounts.ts

GitHub Actions / lint-and-prettify

'res' is assigned a value but never used. Allowed unused vars must match /^_/u
client: this.client,
path: data,
throwOnError: true,
isTempFile: boolean = false
) => {
try {
const path = require("path");

Check warning on line 68 in js/src/sdk/utils/fileUtils.ts

GitHub Actions / lint-and-prettify

A `require()` style import is forbidden

Check warning on line 68 in js/src/sdk/utils/fileUtils.ts

GitHub Actions / lint-and-prettify

A `require()` style import is forbidden
// eslint-disable-next-line @typescript-eslint/no-require-imports
const fs = require("fs");
const composioFilesDir = isTempFile