
Research
/Security News
jscrambler npm Package Compromised in Supply Chain Attack
A compromised jscrambler npm release added a malicious preinstall hook that runs hidden native binaries on Linux, macOS, and Windows.
@infomaximum/integration-debugger
Advanced tools
Библиотека для отладки и тестирования интеграций, построенных на базе [@infomaximum/integration-sdk](https://github.com/Infomaximum/integration-sdk).
Библиотека для отладки и тестирования интеграций, построенных на базе @infomaximum/integration-sdk.
npm install @infomaximum/integration-debugger
или
yarn add @infomaximum/integration-debugger
import { IntegrationExecutor } from "@infomaximum/integration-debugger";
import type { DebuggingConfig } from "@infomaximum/integration-debugger";
import myIntegration from "./my-integration";
const config: DebuggingConfig = {
blocks: {
"my-block-key": {
inputData: {
userId: "12345",
action: "fetch",
},
authData: {
apiKey: "test-api-key",
apiSecret: "test-secret",
},
},
},
};
const executor = new IntegrationExecutor(myIntegration, {
entityKey: "my-block-key",
debuggingConfig: config,
});
executor.execute();
const config: DebuggingConfig = {
blocks: {
"my-block-key": {
inputData: { query: "test" },
// Использовать authData из подключения
connectionKey: "my-connection-key",
},
},
connections: {
"my-connection-key": {
authData: {
apiKey: "real-api-key",
token: "bearer-token",
},
},
},
};
const executor = new IntegrationExecutor(myIntegration, {
entityKey: "my-block-key",
debuggingConfig: config,
});
executor.execute();
Полезно для тестирования пагинации и обработки больших объемов данных:
const config: DebuggingConfig = {
seriesIterations: 10, // Выполнить 10 раз
blocks: {
"pagination-block": {
inputData: { limit: 100 },
},
},
};
const executor = new IntegrationExecutor(myIntegration, {
entityKey: "pagination-block",
debuggingConfig: config,
series: true, // Включить режим серии
});
executor.execute();
Автоматически генерирует схему OutputBlockVariables[] на основе выходных данных блока:
const executor = new IntegrationExecutor(myIntegration, {
entityKey: "my-block-key",
debuggingConfig: config,
isGenerateSchema: true, // Включить генерацию схемы
});
executor.execute();
// Схема будет выведена в консоль после первого выполнения
Или использовать функцию напрямую:
import { generateSchemaFromOutputData } from "@infomaximum/integration-debugger";
const outputData = [
{ id: 1, name: "Test", active: true },
{ id: 2, name: "Demo", active: false },
];
const schema = generateSchemaFromOutputData(outputData);
console.log(schema);
// [
// { key: "id", label: "id", type: "long" },
// { key: "name", label: "name", type: "string" },
// { key: "active", label: "active", type: "boolean" }
// ]
Для передачи общих данных авторизации (например, integrationId, userId) используйте commonAuthData:
const config: DebuggingConfig = {
commonAuthData: {
integrationId: "integration-123",
userId: "user-456",
},
blocks: {
"my-block-key": {
inputData: { query: "test" },
authData: {
apiKey: "block-specific-key",
},
},
},
};
// Итоговые authData для блока будут объединены:
// { apiKey: "block-specific-key", integrationId: "integration-123", userId: "user-456" }
const config: DebuggingConfig = {
connections: {
"oauth-connection": {
authData: {
clientId: "test-client-id",
clientSecret: "test-client-secret",
},
},
},
};
const executor = new IntegrationExecutor(myIntegration, {
entityKey: "oauth-connection",
debuggingConfig: config,
});
executor.execute();
Основной класс для выполнения отладки интеграций.
new IntegrationExecutor(
integration: Integration,
params: {
entityKey: string;
debuggingConfig: DebuggingConfig;
series?: boolean;
isGenerateSchema?: boolean;
}
)
integration - объект интеграции из integration-sdkentityKey - ключ блока или подключения для отладкиdebuggingConfig - конфигурация мок-данныхseries - режим серийного выполнения (по умолчанию false)isGenerateSchema - автоматическая генерация схемы выходных данных (по умолчанию false)execute() - запускает отладку указанной сущностиКонфигурация для отладки интеграций.
type DebuggingConfig = {
seriesIterations?: number; // 1-100,000, по умолчанию 3
commonAuthData?: Record<string, any>; // Общие данные авторизации для всех блоков и подключений
blocks: {
[blockKey: string]: {
inputData: Record<string, string | number>;
authData?: Record<string, string | number>;
connectionKey?: string;
};
};
connections?: {
[connectionKey: string]: {
authData?: Record<string, string | number>;
};
};
};
Функция для генерации схемы выходных данных блока.
function generateSchemaFromOutputData(outputData: any[]): OutputBlockVariables[];
outputData - массив объектов с выходными данными блокаOutputBlockVariables[] с автоматически определенными типами полейПоддерживаемые типы:
string - строковые значенияlong - целые числаdouble - числа с плавающей точкойboolean - логические значенияdateTime - даты (ISO 8601)bigInteger - большие целые числаbigDecimal - большие числа с плавающей точкойarray - массивыobject - объектыfile - файлы (base64)typeOptions (redirect, saveFields, message)stringError, hook, base64Encode/DecodeПри серийном выполнении:
hasNext === false# Установка зависимостей
yarn install
# Сборка
yarn build
# Сборка в режиме разработки (watch mode)
yarn dev
# Проверка типов
yarn lint
# Запуск тестов
yarn test
# Запуск тестов в watch режиме
yarn test:watch
# Запуск тестов с покрытием
yarn test:coverage
# Создание релиза
yarn release
Apache-2.0
FAQs
Библиотека для отладки и тестирования интеграций, построенных на базе [@infomaximum/integration-sdk](https://github.com/Infomaximum/integration-sdk).
The npm package @infomaximum/integration-debugger receives a total of 9 weekly downloads. As such, @infomaximum/integration-debugger popularity was classified as not popular.
We found that @infomaximum/integration-debugger demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
A compromised jscrambler npm release added a malicious preinstall hook that runs hidden native binaries on Linux, macOS, and Windows.

Research
/Security News
A malicious .NET package is typosquatting the Braintree SDK to steal live payment card data, merchant API keys, and host secrets from production apps.

Security News
/Research
Compromised Injective SDK npm version 1.20.21 exfiltrates wallet private keys and mnemonics through fake telemetry functionality.