@testsmith/testblocks 0.9.4 → 0.9.7
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/cli/index.js +4 -1
- package/dist/client/assets/index-B8OSvcUg.css +1 -0
- package/dist/client/assets/index-CMMJHs_d.js +2197 -0
- package/dist/client/assets/index-CMMJHs_d.js.map +1 -0
- package/dist/client/index.html +2 -2
- package/dist/core/blocks/api/ApiAssertBodyContainsBlock.d.ts +13 -0
- package/dist/core/blocks/api/ApiAssertBodyContainsBlock.js +40 -0
- package/dist/core/blocks/api/ApiAssertStatusBlock.d.ts +13 -0
- package/dist/core/blocks/api/ApiAssertStatusBlock.js +35 -0
- package/dist/core/blocks/api/ApiClearHeadersBlock.d.ts +13 -0
- package/dist/core/blocks/api/ApiClearHeadersBlock.js +25 -0
- package/dist/core/blocks/api/ApiDeleteBlock.d.ts +13 -0
- package/dist/core/blocks/api/ApiDeleteBlock.js +37 -0
- package/dist/core/blocks/api/ApiExtractBlock.d.ts +14 -0
- package/dist/core/blocks/api/ApiExtractBlock.js +40 -0
- package/dist/core/blocks/api/ApiExtractJsonPathBlock.d.ts +13 -0
- package/dist/core/blocks/api/ApiExtractJsonPathBlock.js +47 -0
- package/dist/core/blocks/api/ApiExtractXPathBlock.d.ts +13 -0
- package/dist/core/blocks/api/ApiExtractXPathBlock.js +70 -0
- package/dist/core/blocks/api/ApiGetBlock.d.ts +13 -0
- package/dist/core/blocks/api/ApiGetBlock.js +36 -0
- package/dist/core/blocks/api/ApiHeadersBlock.d.ts +14 -0
- package/dist/core/blocks/api/ApiHeadersBlock.js +44 -0
- package/dist/core/blocks/api/ApiJsonBodyBlock.d.ts +14 -0
- package/dist/core/blocks/api/ApiJsonBodyBlock.js +28 -0
- package/dist/core/blocks/api/ApiPatchBlock.d.ts +13 -0
- package/dist/core/blocks/api/ApiPatchBlock.js +47 -0
- package/dist/core/blocks/api/ApiPostBlock.d.ts +13 -0
- package/dist/core/blocks/api/ApiPostBlock.js +47 -0
- package/dist/core/blocks/api/ApiPutBlock.d.ts +13 -0
- package/dist/core/blocks/api/ApiPutBlock.js +47 -0
- package/dist/core/blocks/api/ApiSetHeaderBlock.d.ts +13 -0
- package/dist/core/blocks/api/ApiSetHeaderBlock.js +37 -0
- package/dist/core/blocks/api/ApiSetHeadersBlock.d.ts +13 -0
- package/dist/core/blocks/api/ApiSetHeadersBlock.js +41 -0
- package/dist/core/blocks/api/index.d.ts +25 -0
- package/dist/core/blocks/api/index.js +83 -0
- package/dist/core/blocks/base/Block.d.ts +59 -0
- package/dist/core/blocks/base/Block.js +151 -0
- package/dist/core/blocks/base/ContainerBlock.d.ts +14 -0
- package/dist/core/blocks/base/ContainerBlock.js +16 -0
- package/dist/core/blocks/base/ControlFlowBlock.d.ts +13 -0
- package/dist/core/blocks/base/ControlFlowBlock.js +17 -0
- package/dist/core/blocks/base/StatementBlock.d.ts +9 -0
- package/dist/core/blocks/base/StatementBlock.js +16 -0
- package/dist/core/blocks/base/ValueBlock.d.ts +12 -0
- package/dist/core/blocks/base/ValueBlock.js +16 -0
- package/dist/core/blocks/base/index.d.ts +5 -0
- package/dist/core/blocks/base/index.js +13 -0
- package/dist/core/blocks/data/DataCsvBlock.d.ts +14 -0
- package/dist/core/blocks/data/DataCsvBlock.js +51 -0
- package/dist/core/blocks/data/DataDefineBlock.d.ts +14 -0
- package/dist/core/blocks/data/DataDefineBlock.js +28 -0
- package/dist/core/blocks/data/DataForeachBlock.d.ts +13 -0
- package/dist/core/blocks/data/DataForeachBlock.js +37 -0
- package/dist/core/blocks/data/DataFromVariableBlock.d.ts +14 -0
- package/dist/core/blocks/data/DataFromVariableBlock.js +27 -0
- package/dist/core/blocks/data/DataGetCurrentBlock.d.ts +14 -0
- package/dist/core/blocks/data/DataGetCurrentBlock.js +34 -0
- package/dist/core/blocks/data/DataGetIndexBlock.d.ts +14 -0
- package/dist/core/blocks/data/DataGetIndexBlock.js +24 -0
- package/dist/core/blocks/data/DataGetNameBlock.d.ts +14 -0
- package/dist/core/blocks/data/DataGetNameBlock.js +24 -0
- package/dist/core/blocks/data/DataRangeBlock.d.ts +14 -0
- package/dist/core/blocks/data/DataRangeBlock.js +40 -0
- package/dist/core/blocks/data/DataRowBlock.d.ts +14 -0
- package/dist/core/blocks/data/DataRowBlock.js +33 -0
- package/dist/core/blocks/data/DataTableBlock.d.ts +14 -0
- package/dist/core/blocks/data/DataTableBlock.js +51 -0
- package/dist/core/blocks/data/index.d.ts +20 -0
- package/dist/core/blocks/data/index.js +57 -0
- package/dist/core/blocks/index.d.ts +66 -5
- package/dist/core/blocks/index.js +134 -35
- package/dist/core/blocks/lifecycle/LifecycleAfterAllBlock.d.ts +15 -0
- package/dist/core/blocks/lifecycle/LifecycleAfterAllBlock.js +27 -0
- package/dist/core/blocks/lifecycle/LifecycleAfterEachBlock.d.ts +15 -0
- package/dist/core/blocks/lifecycle/LifecycleAfterEachBlock.js +27 -0
- package/dist/core/blocks/lifecycle/LifecycleBeforeAllBlock.d.ts +15 -0
- package/dist/core/blocks/lifecycle/LifecycleBeforeAllBlock.js +28 -0
- package/dist/core/blocks/lifecycle/LifecycleBeforeEachBlock.d.ts +15 -0
- package/dist/core/blocks/lifecycle/LifecycleBeforeEachBlock.js +27 -0
- package/dist/core/blocks/lifecycle/LifecycleOnFailureBlock.d.ts +13 -0
- package/dist/core/blocks/lifecycle/LifecycleOnFailureBlock.js +25 -0
- package/dist/core/blocks/lifecycle/LifecycleRetryBlock.d.ts +13 -0
- package/dist/core/blocks/lifecycle/LifecycleRetryBlock.js +29 -0
- package/dist/core/blocks/lifecycle/LifecycleSetupBlock.d.ts +13 -0
- package/dist/core/blocks/lifecycle/LifecycleSetupBlock.js +27 -0
- package/dist/core/blocks/lifecycle/LifecycleSkipIfBlock.d.ts +13 -0
- package/dist/core/blocks/lifecycle/LifecycleSkipIfBlock.js +31 -0
- package/dist/core/blocks/lifecycle/LifecycleTeardownBlock.d.ts +13 -0
- package/dist/core/blocks/lifecycle/LifecycleTeardownBlock.js +27 -0
- package/dist/core/blocks/lifecycle/TestCaseBlock.d.ts +21 -0
- package/dist/core/blocks/lifecycle/TestCaseBlock.js +72 -0
- package/dist/core/blocks/lifecycle/TestCaseDataDrivenBlock.d.ts +21 -0
- package/dist/core/blocks/lifecycle/TestCaseDataDrivenBlock.js +102 -0
- package/dist/core/blocks/lifecycle/index.d.ts +21 -0
- package/dist/core/blocks/lifecycle/index.js +63 -0
- package/dist/core/blocks/logic/LogicArrayBlock.d.ts +14 -0
- package/dist/core/blocks/logic/LogicArrayBlock.js +28 -0
- package/dist/core/blocks/logic/LogicAssertBlock.d.ts +13 -0
- package/dist/core/blocks/logic/LogicAssertBlock.js +32 -0
- package/dist/core/blocks/logic/LogicBooleanBlock.d.ts +14 -0
- package/dist/core/blocks/logic/LogicBooleanBlock.js +26 -0
- package/dist/core/blocks/logic/LogicBooleanOpBlock.d.ts +14 -0
- package/dist/core/blocks/logic/LogicBooleanOpBlock.js +31 -0
- package/dist/core/blocks/logic/LogicCommentBlock.d.ts +13 -0
- package/dist/core/blocks/logic/LogicCommentBlock.js +26 -0
- package/dist/core/blocks/logic/LogicCompareBlock.d.ts +14 -0
- package/dist/core/blocks/logic/LogicCompareBlock.js +52 -0
- package/dist/core/blocks/logic/LogicFailBlock.d.ts +16 -0
- package/dist/core/blocks/logic/LogicFailBlock.js +30 -0
- package/dist/core/blocks/logic/LogicForeachBlock.d.ts +13 -0
- package/dist/core/blocks/logic/LogicForeachBlock.js +29 -0
- package/dist/core/blocks/logic/LogicGetVariableBlock.d.ts +14 -0
- package/dist/core/blocks/logic/LogicGetVariableBlock.js +27 -0
- package/dist/core/blocks/logic/LogicIfBlock.d.ts +13 -0
- package/dist/core/blocks/logic/LogicIfBlock.js +36 -0
- package/dist/core/blocks/logic/LogicLogBlock.d.ts +13 -0
- package/dist/core/blocks/logic/LogicLogBlock.js +30 -0
- package/dist/core/blocks/logic/LogicNotBlock.d.ts +14 -0
- package/dist/core/blocks/logic/LogicNotBlock.js +26 -0
- package/dist/core/blocks/logic/LogicNumberBlock.d.ts +14 -0
- package/dist/core/blocks/logic/LogicNumberBlock.js +26 -0
- package/dist/core/blocks/logic/LogicObjectBlock.d.ts +14 -0
- package/dist/core/blocks/logic/LogicObjectBlock.js +28 -0
- package/dist/core/blocks/logic/LogicRepeatBlock.d.ts +13 -0
- package/dist/core/blocks/logic/LogicRepeatBlock.js +27 -0
- package/dist/core/blocks/logic/LogicSetVariableBlock.d.ts +13 -0
- package/dist/core/blocks/logic/LogicSetVariableBlock.js +34 -0
- package/dist/core/blocks/logic/LogicTextBlock.d.ts +14 -0
- package/dist/core/blocks/logic/LogicTextBlock.js +27 -0
- package/dist/core/blocks/logic/LogicTryCatchBlock.d.ts +13 -0
- package/dist/core/blocks/logic/LogicTryCatchBlock.js +26 -0
- package/dist/core/blocks/logic/index.d.ts +28 -0
- package/dist/core/blocks/logic/index.js +95 -0
- package/dist/core/blocks/playwright/assertions/WebAssertAccessibleDescriptionBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertAccessibleDescriptionBlock.js +41 -0
- package/dist/core/blocks/playwright/assertions/WebAssertAccessibleNameBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertAccessibleNameBlock.js +41 -0
- package/dist/core/blocks/playwright/assertions/WebAssertAttachedBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertAttachedBlock.js +39 -0
- package/dist/core/blocks/playwright/assertions/WebAssertAttributeBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertAttributeBlock.js +44 -0
- package/dist/core/blocks/playwright/assertions/WebAssertCheckedBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertCheckedBlock.js +48 -0
- package/dist/core/blocks/playwright/assertions/WebAssertClassBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertClassBlock.js +43 -0
- package/dist/core/blocks/playwright/assertions/WebAssertCountBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertCountBlock.js +41 -0
- package/dist/core/blocks/playwright/assertions/WebAssertCssBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertCssBlock.js +44 -0
- package/dist/core/blocks/playwright/assertions/WebAssertDisabledBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertDisabledBlock.js +39 -0
- package/dist/core/blocks/playwright/assertions/WebAssertEditableBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertEditableBlock.js +39 -0
- package/dist/core/blocks/playwright/assertions/WebAssertEmptyBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertEmptyBlock.js +39 -0
- package/dist/core/blocks/playwright/assertions/WebAssertEnabledBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertEnabledBlock.js +39 -0
- package/dist/core/blocks/playwright/assertions/WebAssertFocusedBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertFocusedBlock.js +39 -0
- package/dist/core/blocks/playwright/assertions/WebAssertIdBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertIdBlock.js +41 -0
- package/dist/core/blocks/playwright/assertions/WebAssertInViewportBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertInViewportBlock.js +39 -0
- package/dist/core/blocks/playwright/assertions/WebAssertNotVisibleBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertNotVisibleBlock.js +39 -0
- package/dist/core/blocks/playwright/assertions/WebAssertRoleBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertRoleBlock.js +69 -0
- package/dist/core/blocks/playwright/assertions/WebAssertTextContainsBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertTextContainsBlock.js +41 -0
- package/dist/core/blocks/playwright/assertions/WebAssertTextEqualsBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertTextEqualsBlock.js +41 -0
- package/dist/core/blocks/playwright/assertions/WebAssertTitleContainsBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertTitleContainsBlock.js +39 -0
- package/dist/core/blocks/playwright/assertions/WebAssertTitleEqualsBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertTitleEqualsBlock.js +36 -0
- package/dist/core/blocks/playwright/assertions/WebAssertUrlContainsBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertUrlContainsBlock.js +40 -0
- package/dist/core/blocks/playwright/assertions/WebAssertUrlEqualsBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertUrlEqualsBlock.js +37 -0
- package/dist/core/blocks/playwright/assertions/WebAssertValueBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertValueBlock.js +43 -0
- package/dist/core/blocks/playwright/assertions/WebAssertValueContainsBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertValueContainsBlock.js +43 -0
- package/dist/core/blocks/playwright/assertions/WebAssertVisibleBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertVisibleBlock.js +39 -0
- package/dist/core/blocks/playwright/assertions/index.d.ts +36 -0
- package/dist/core/blocks/playwright/assertions/index.js +127 -0
- package/dist/core/blocks/playwright/index.d.ts +16 -0
- package/dist/core/blocks/playwright/index.js +28 -3
- package/dist/core/blocks/playwright/interactions/WebCheckboxBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/interactions/WebCheckboxBlock.js +43 -0
- package/dist/core/blocks/playwright/interactions/WebClickBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/interactions/WebClickBlock.js +34 -0
- package/dist/core/blocks/playwright/interactions/WebDragAndDropBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/interactions/WebDragAndDropBlock.js +37 -0
- package/dist/core/blocks/playwright/interactions/WebFillBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/interactions/WebFillBlock.js +38 -0
- package/dist/core/blocks/playwright/interactions/WebFocusBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/interactions/WebFocusBlock.js +34 -0
- package/dist/core/blocks/playwright/interactions/WebHoverBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/interactions/WebHoverBlock.js +34 -0
- package/dist/core/blocks/playwright/interactions/WebPressKeyBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/interactions/WebPressKeyBlock.js +37 -0
- package/dist/core/blocks/playwright/interactions/WebScrollIntoViewBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/interactions/WebScrollIntoViewBlock.js +34 -0
- package/dist/core/blocks/playwright/interactions/WebSelectBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/interactions/WebSelectBlock.js +37 -0
- package/dist/core/blocks/playwright/interactions/WebTypeBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/interactions/WebTypeBlock.js +41 -0
- package/dist/core/blocks/playwright/interactions/WebUploadFileBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/interactions/WebUploadFileBlock.js +39 -0
- package/dist/core/blocks/playwright/interactions/index.d.ts +21 -0
- package/dist/core/blocks/playwright/interactions/index.js +56 -0
- package/dist/core/blocks/playwright/navigation/WebNavigateBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/navigation/WebNavigateBlock.js +36 -0
- package/dist/core/blocks/playwright/navigation/WebScreenshotBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/navigation/WebScreenshotBlock.js +36 -0
- package/dist/core/blocks/playwright/navigation/WebWaitBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/navigation/WebWaitBlock.js +32 -0
- package/dist/core/blocks/playwright/navigation/WebWaitForElementBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/navigation/WebWaitForElementBlock.js +37 -0
- package/dist/core/blocks/playwright/navigation/WebWaitForUrlBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/navigation/WebWaitForUrlBlock.js +34 -0
- package/dist/core/blocks/playwright/navigation/index.d.ts +15 -0
- package/dist/core/blocks/playwright/navigation/index.js +32 -0
- package/dist/core/blocks/playwright/retrieval/WebCountElementsBlock.d.ts +16 -0
- package/dist/core/blocks/playwright/retrieval/WebCountElementsBlock.js +36 -0
- package/dist/core/blocks/playwright/retrieval/WebGetAttributeBlock.d.ts +16 -0
- package/dist/core/blocks/playwright/retrieval/WebGetAttributeBlock.js +42 -0
- package/dist/core/blocks/playwright/retrieval/WebGetInputValueBlock.d.ts +16 -0
- package/dist/core/blocks/playwright/retrieval/WebGetInputValueBlock.js +40 -0
- package/dist/core/blocks/playwright/retrieval/WebGetTextBlock.d.ts +16 -0
- package/dist/core/blocks/playwright/retrieval/WebGetTextBlock.js +40 -0
- package/dist/core/blocks/playwright/retrieval/WebGetTitleBlock.d.ts +16 -0
- package/dist/core/blocks/playwright/retrieval/WebGetTitleBlock.js +31 -0
- package/dist/core/blocks/playwright/retrieval/WebGetUrlBlock.d.ts +16 -0
- package/dist/core/blocks/playwright/retrieval/WebGetUrlBlock.js +31 -0
- package/dist/core/blocks/playwright/retrieval/index.d.ts +16 -0
- package/dist/core/blocks/playwright/retrieval/index.js +36 -0
- package/dist/core/blocks/playwright/types.d.ts +14 -0
- package/dist/core/blocks/procedures/ProcedureCallBlock.d.ts +13 -0
- package/dist/core/blocks/procedures/ProcedureCallBlock.js +66 -0
- package/dist/core/blocks/procedures/ProcedureCallWithReturnBlock.d.ts +14 -0
- package/dist/core/blocks/procedures/ProcedureCallWithReturnBlock.js +51 -0
- package/dist/core/blocks/procedures/ProcedureDefineBlock.d.ts +15 -0
- package/dist/core/blocks/procedures/ProcedureDefineBlock.js +59 -0
- package/dist/core/blocks/procedures/ProcedureFillFormBlock.d.ts +13 -0
- package/dist/core/blocks/procedures/ProcedureFillFormBlock.js +30 -0
- package/dist/core/blocks/procedures/ProcedureGetParamBlock.d.ts +14 -0
- package/dist/core/blocks/procedures/ProcedureGetParamBlock.js +33 -0
- package/dist/core/blocks/procedures/ProcedureInlineBlock.d.ts +14 -0
- package/dist/core/blocks/procedures/ProcedureInlineBlock.js +31 -0
- package/dist/core/blocks/procedures/ProcedureLoginBlock.d.ts +13 -0
- package/dist/core/blocks/procedures/ProcedureLoginBlock.js +37 -0
- package/dist/core/blocks/procedures/ProcedureMapBlock.d.ts +14 -0
- package/dist/core/blocks/procedures/ProcedureMapBlock.js +36 -0
- package/dist/core/blocks/procedures/ProcedureReturnBlock.d.ts +15 -0
- package/dist/core/blocks/procedures/ProcedureReturnBlock.js +28 -0
- package/dist/core/blocks/procedures/ProcedureWaitAndClickBlock.d.ts +13 -0
- package/dist/core/blocks/procedures/ProcedureWaitAndClickBlock.js +32 -0
- package/dist/core/blocks/procedures/index.d.ts +21 -0
- package/dist/core/blocks/procedures/index.js +62 -0
- package/dist/core/blocks/{procedures.d.ts → procedures/procedureRegistry.d.ts} +10 -2
- package/dist/core/blocks/procedures/procedureRegistry.js +27 -0
- package/dist/core/blocks/utils/apiUtils.d.ts +81 -0
- package/dist/core/blocks/utils/apiUtils.js +176 -0
- package/dist/core/blocks/utils/index.d.ts +2 -0
- package/dist/core/blocks/utils/index.js +16 -0
- package/dist/core/blocks/utils/variableUtils.d.ts +19 -0
- package/dist/core/blocks/utils/variableUtils.js +69 -0
- package/dist/server/index.js +117 -11
- package/dist/server/openApiParser.d.ts +82 -0
- package/dist/server/openApiParser.js +495 -0
- package/dist/server/startServer.d.ts +1 -0
- package/dist/server/startServer.js +164 -0
- package/package.json +4 -2
- package/dist/client/assets/index-BLBBQ6Rn.js +0 -2195
- package/dist/client/assets/index-BLBBQ6Rn.js.map +0 -1
- package/dist/client/assets/index-qjoPPl9y.css +0 -1
- package/dist/core/blocks/api.d.ts +0 -2
- package/dist/core/blocks/api.js +0 -607
- package/dist/core/blocks/data-driven.d.ts +0 -2
- package/dist/core/blocks/data-driven.js +0 -245
- package/dist/core/blocks/lifecycle.d.ts +0 -2
- package/dist/core/blocks/lifecycle.js +0 -201
- package/dist/core/blocks/logic.d.ts +0 -2
- package/dist/core/blocks/logic.js +0 -360
- package/dist/core/blocks/playwright/assertions.d.ts +0 -5
- package/dist/core/blocks/playwright/assertions.js +0 -311
- package/dist/core/blocks/playwright/interactions.d.ts +0 -5
- package/dist/core/blocks/playwright/interactions.js +0 -208
- package/dist/core/blocks/playwright/navigation.d.ts +0 -5
- package/dist/core/blocks/playwright/navigation.js +0 -131
- package/dist/core/blocks/playwright/retrieval.d.ts +0 -5
- package/dist/core/blocks/playwright/retrieval.js +0 -153
- package/dist/core/blocks/playwright.d.ts +0 -13
- package/dist/core/blocks/playwright.js +0 -17
- package/dist/core/blocks/procedures.js +0 -321
package/dist/client/index.html
CHANGED
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
overflow: hidden;
|
|
17
17
|
}
|
|
18
18
|
</style>
|
|
19
|
-
<script type="module" crossorigin src="/assets/index-
|
|
20
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
19
|
+
<script type="module" crossorigin src="/assets/index-CMMJHs_d.js"></script>
|
|
20
|
+
<link rel="stylesheet" crossorigin href="/assets/index-B8OSvcUg.css">
|
|
21
21
|
</head>
|
|
22
22
|
<body>
|
|
23
23
|
<div id="root"></div>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StatementBlock } from '../base';
|
|
2
|
+
import { BlockInput, ExecutionContext } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Assert that response body contains expected value.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ApiAssertBodyContainsBlock extends StatementBlock {
|
|
7
|
+
readonly type = "api_assert_body_contains";
|
|
8
|
+
readonly category = "API";
|
|
9
|
+
readonly color = "#FF9800";
|
|
10
|
+
readonly tooltip = "Assert that response body contains expected value";
|
|
11
|
+
getInputs(): BlockInput[];
|
|
12
|
+
execute(params: Record<string, unknown>, context: ExecutionContext): Promise<unknown>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApiAssertBodyContainsBlock = void 0;
|
|
4
|
+
const base_1 = require("../base");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
const assertions_1 = require("../assertions");
|
|
7
|
+
/**
|
|
8
|
+
* Assert that response body contains expected value.
|
|
9
|
+
*/
|
|
10
|
+
class ApiAssertBodyContainsBlock extends base_1.StatementBlock {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.type = 'api_assert_body_contains';
|
|
14
|
+
this.category = 'API';
|
|
15
|
+
this.color = '#FF9800';
|
|
16
|
+
this.tooltip = 'Assert that response body contains expected value';
|
|
17
|
+
}
|
|
18
|
+
getInputs() {
|
|
19
|
+
return [
|
|
20
|
+
{ name: 'PATH', type: 'field', fieldType: 'text', default: '' },
|
|
21
|
+
{ name: 'VALUE', type: 'field', fieldType: 'text', required: true },
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
async execute(params, context) {
|
|
25
|
+
const response = (0, utils_1.getLastResponse)(context);
|
|
26
|
+
const path = params.PATH;
|
|
27
|
+
const expectedValue = (0, utils_1.resolveVariables)(params.VALUE, context);
|
|
28
|
+
const actualValue = path ? (0, utils_1.getValueByPath)(response.body, path) : response.body;
|
|
29
|
+
const actualStr = typeof actualValue === 'string' ? actualValue : JSON.stringify(actualValue);
|
|
30
|
+
(0, assertions_1.handleAssertion)(context, actualStr.includes(expectedValue), `Expected ${path || 'body'} to contain "${expectedValue}" but got "${actualStr}"`, { stepType: 'api_assert_body_contains', expected: expectedValue, actual: actualStr });
|
|
31
|
+
context.logger.info(`✓ ${path || 'body'} contains "${expectedValue}"`);
|
|
32
|
+
return {
|
|
33
|
+
_summary: `✓ ${path || 'body'} contains "${expectedValue}"`,
|
|
34
|
+
path: path || 'body',
|
|
35
|
+
expected: expectedValue,
|
|
36
|
+
actual: actualStr.substring(0, 100) + (actualStr.length > 100 ? '...' : ''),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.ApiAssertBodyContainsBlock = ApiAssertBodyContainsBlock;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StatementBlock } from '../base';
|
|
2
|
+
import { BlockInput, ExecutionContext } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Assert that response has expected status code.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ApiAssertStatusBlock extends StatementBlock {
|
|
7
|
+
readonly type = "api_assert_status";
|
|
8
|
+
readonly category = "API";
|
|
9
|
+
readonly color = "#FF9800";
|
|
10
|
+
readonly tooltip = "Assert that response has expected status code";
|
|
11
|
+
getInputs(): BlockInput[];
|
|
12
|
+
execute(params: Record<string, unknown>, context: ExecutionContext): Promise<unknown>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApiAssertStatusBlock = void 0;
|
|
4
|
+
const base_1 = require("../base");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
const assertions_1 = require("../assertions");
|
|
7
|
+
/**
|
|
8
|
+
* Assert that response has expected status code.
|
|
9
|
+
*/
|
|
10
|
+
class ApiAssertStatusBlock extends base_1.StatementBlock {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.type = 'api_assert_status';
|
|
14
|
+
this.category = 'API';
|
|
15
|
+
this.color = '#FF9800';
|
|
16
|
+
this.tooltip = 'Assert that response has expected status code';
|
|
17
|
+
}
|
|
18
|
+
getInputs() {
|
|
19
|
+
return [
|
|
20
|
+
{ name: 'STATUS', type: 'field', fieldType: 'number', default: 200, required: true },
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
async execute(params, context) {
|
|
24
|
+
const response = (0, utils_1.getLastResponse)(context);
|
|
25
|
+
const expectedStatus = params.STATUS;
|
|
26
|
+
(0, assertions_1.handleAssertion)(context, response.status === expectedStatus, `Expected status ${expectedStatus} but got ${response.status}`, { stepType: 'api_assert_status', expected: expectedStatus, actual: response.status });
|
|
27
|
+
context.logger.info(`✓ Status is ${expectedStatus}`);
|
|
28
|
+
return {
|
|
29
|
+
_summary: `✓ Status ${response.status} === ${expectedStatus}`,
|
|
30
|
+
expected: expectedStatus,
|
|
31
|
+
actual: response.status,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.ApiAssertStatusBlock = ApiAssertStatusBlock;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StatementBlock } from '../base';
|
|
2
|
+
import { BlockInput, ExecutionContext } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Clear all request headers.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ApiClearHeadersBlock extends StatementBlock {
|
|
7
|
+
readonly type = "api_clear_headers";
|
|
8
|
+
readonly category = "API";
|
|
9
|
+
readonly color = "#7B1FA2";
|
|
10
|
+
readonly tooltip = "Clear all request headers";
|
|
11
|
+
getInputs(): BlockInput[];
|
|
12
|
+
execute(_params: Record<string, unknown>, context: ExecutionContext): Promise<unknown>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApiClearHeadersBlock = void 0;
|
|
4
|
+
const base_1 = require("../base");
|
|
5
|
+
/**
|
|
6
|
+
* Clear all request headers.
|
|
7
|
+
*/
|
|
8
|
+
class ApiClearHeadersBlock extends base_1.StatementBlock {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.type = 'api_clear_headers';
|
|
12
|
+
this.category = 'API';
|
|
13
|
+
this.color = '#7B1FA2';
|
|
14
|
+
this.tooltip = 'Clear all request headers';
|
|
15
|
+
}
|
|
16
|
+
getInputs() {
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
async execute(_params, context) {
|
|
20
|
+
context.variables.delete('__requestHeaders');
|
|
21
|
+
context.logger.info('Cleared all request headers');
|
|
22
|
+
return { _summary: 'Headers cleared' };
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.ApiClearHeadersBlock = ApiClearHeadersBlock;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StatementBlock } from '../base';
|
|
2
|
+
import { BlockInput, ExecutionContext } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Perform HTTP DELETE request and store response.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ApiDeleteBlock extends StatementBlock {
|
|
7
|
+
readonly type = "api_delete";
|
|
8
|
+
readonly category = "API";
|
|
9
|
+
readonly color = "#4CAF50";
|
|
10
|
+
readonly tooltip = "Perform HTTP DELETE request and store response";
|
|
11
|
+
getInputs(): BlockInput[];
|
|
12
|
+
execute(params: Record<string, unknown>, context: ExecutionContext): Promise<unknown>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApiDeleteBlock = void 0;
|
|
4
|
+
const base_1 = require("../base");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
/**
|
|
7
|
+
* Perform HTTP DELETE request and store response.
|
|
8
|
+
*/
|
|
9
|
+
class ApiDeleteBlock extends base_1.StatementBlock {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.type = 'api_delete';
|
|
13
|
+
this.category = 'API';
|
|
14
|
+
this.color = '#4CAF50';
|
|
15
|
+
this.tooltip = 'Perform HTTP DELETE request and store response';
|
|
16
|
+
}
|
|
17
|
+
getInputs() {
|
|
18
|
+
return [
|
|
19
|
+
{ name: 'URL', type: 'field', fieldType: 'text', required: true },
|
|
20
|
+
{ name: 'HEADERS', type: 'field', fieldType: 'text', default: '' },
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
async execute(params, context) {
|
|
24
|
+
const url = (0, utils_1.resolveVariables)(params.URL, context);
|
|
25
|
+
const headers = (0, utils_1.mergeHeaders)(context, params.HEADERS);
|
|
26
|
+
context.logger.info(`DELETE ${url}`);
|
|
27
|
+
const response = await fetch(url, {
|
|
28
|
+
method: 'DELETE',
|
|
29
|
+
headers,
|
|
30
|
+
signal: context.abortSignal,
|
|
31
|
+
});
|
|
32
|
+
const parsed = await (0, utils_1.parseResponse)(response);
|
|
33
|
+
(0, utils_1.storeResponse)(context, parsed);
|
|
34
|
+
return parsed;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.ApiDeleteBlock = ApiDeleteBlock;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StatementBlock } from '../base';
|
|
2
|
+
import { BlockInput, ExecutionContext } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Extract a value from response using dot notation (e.g., data.user.name).
|
|
5
|
+
* Legacy block kept for backwards compatibility.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ApiExtractBlock extends StatementBlock {
|
|
8
|
+
readonly type = "api_extract";
|
|
9
|
+
readonly category = "API";
|
|
10
|
+
readonly color = "#2196F3";
|
|
11
|
+
readonly tooltip = "Extract a value from response using dot notation (e.g., data.user.name)";
|
|
12
|
+
getInputs(): BlockInput[];
|
|
13
|
+
execute(params: Record<string, unknown>, context: ExecutionContext): Promise<unknown>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApiExtractBlock = void 0;
|
|
4
|
+
const base_1 = require("../base");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
/**
|
|
7
|
+
* Extract a value from response using dot notation (e.g., data.user.name).
|
|
8
|
+
* Legacy block kept for backwards compatibility.
|
|
9
|
+
*/
|
|
10
|
+
class ApiExtractBlock extends base_1.StatementBlock {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.type = 'api_extract';
|
|
14
|
+
this.category = 'API';
|
|
15
|
+
this.color = '#2196F3';
|
|
16
|
+
this.tooltip = 'Extract a value from response using dot notation (e.g., data.user.name)';
|
|
17
|
+
}
|
|
18
|
+
getInputs() {
|
|
19
|
+
return [
|
|
20
|
+
{ name: 'PATH', type: 'field', fieldType: 'text', required: true },
|
|
21
|
+
{ name: 'VARIABLE', type: 'field', fieldType: 'text', required: true },
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
async execute(params, context) {
|
|
25
|
+
const response = (0, utils_1.getLastResponse)(context);
|
|
26
|
+
const path = params.PATH;
|
|
27
|
+
const varName = params.VARIABLE;
|
|
28
|
+
const value = (0, utils_1.getValueByPath)(response.body, path);
|
|
29
|
+
context.variables.set(varName, value);
|
|
30
|
+
const valueStr = JSON.stringify(value);
|
|
31
|
+
context.logger.info(`Extracted ${path} → ${varName} = ${valueStr}`);
|
|
32
|
+
return {
|
|
33
|
+
_summary: `${varName} = ${valueStr.substring(0, 50)}${valueStr.length > 50 ? '...' : ''}`,
|
|
34
|
+
variable: varName,
|
|
35
|
+
path,
|
|
36
|
+
value,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.ApiExtractBlock = ApiExtractBlock;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StatementBlock } from '../base';
|
|
2
|
+
import { BlockInput, ExecutionContext } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Extract a value from JSON response using JSONPath expression.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ApiExtractJsonPathBlock extends StatementBlock {
|
|
7
|
+
readonly type = "api_extract_jsonpath";
|
|
8
|
+
readonly category = "API";
|
|
9
|
+
readonly color = "#2196F3";
|
|
10
|
+
readonly tooltip = "Extract a value from JSON response using JSONPath expression";
|
|
11
|
+
getInputs(): BlockInput[];
|
|
12
|
+
execute(params: Record<string, unknown>, context: ExecutionContext): Promise<unknown>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApiExtractJsonPathBlock = void 0;
|
|
4
|
+
const base_1 = require("../base");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
const jsonpath_plus_1 = require("jsonpath-plus");
|
|
7
|
+
/**
|
|
8
|
+
* Extract a value from JSON response using JSONPath expression.
|
|
9
|
+
*/
|
|
10
|
+
class ApiExtractJsonPathBlock extends base_1.StatementBlock {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.type = 'api_extract_jsonpath';
|
|
14
|
+
this.category = 'API';
|
|
15
|
+
this.color = '#2196F3';
|
|
16
|
+
this.tooltip = 'Extract a value from JSON response using JSONPath expression';
|
|
17
|
+
}
|
|
18
|
+
getInputs() {
|
|
19
|
+
return [
|
|
20
|
+
{ name: 'JSONPATH', type: 'field', fieldType: 'text', required: true, default: '$.data.id' },
|
|
21
|
+
{ name: 'VARIABLE', type: 'field', fieldType: 'text', required: true },
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
async execute(params, context) {
|
|
25
|
+
const response = (0, utils_1.getLastResponse)(context);
|
|
26
|
+
const jsonPath = params.JSONPATH;
|
|
27
|
+
const varName = params.VARIABLE;
|
|
28
|
+
try {
|
|
29
|
+
const results = (0, jsonpath_plus_1.JSONPath)({ path: jsonPath, json: response.body });
|
|
30
|
+
// If single result, unwrap from array
|
|
31
|
+
const value = results.length === 1 ? results[0] : results;
|
|
32
|
+
context.variables.set(varName, value);
|
|
33
|
+
const valueStr = JSON.stringify(value);
|
|
34
|
+
context.logger.info(`Extracted (JSONPath) ${jsonPath} → ${varName} = ${valueStr}`);
|
|
35
|
+
return {
|
|
36
|
+
_summary: `${varName} = ${valueStr.substring(0, 50)}${valueStr.length > 50 ? '...' : ''}`,
|
|
37
|
+
variable: varName,
|
|
38
|
+
jsonPath,
|
|
39
|
+
value,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
catch (e) {
|
|
43
|
+
throw new Error(`Invalid JSONPath expression: ${jsonPath}. Error: ${e.message}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.ApiExtractJsonPathBlock = ApiExtractJsonPathBlock;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StatementBlock } from '../base';
|
|
2
|
+
import { BlockInput, ExecutionContext } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Extract a value from XML/HTML response using XPath expression.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ApiExtractXPathBlock extends StatementBlock {
|
|
7
|
+
readonly type = "api_extract_xpath";
|
|
8
|
+
readonly category = "API";
|
|
9
|
+
readonly color = "#2196F3";
|
|
10
|
+
readonly tooltip = "Extract a value from XML/HTML response using XPath expression";
|
|
11
|
+
getInputs(): BlockInput[];
|
|
12
|
+
execute(params: Record<string, unknown>, context: ExecutionContext): Promise<unknown>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ApiExtractXPathBlock = void 0;
|
|
7
|
+
const base_1 = require("../base");
|
|
8
|
+
const utils_1 = require("../utils");
|
|
9
|
+
const xpath_1 = __importDefault(require("xpath"));
|
|
10
|
+
const xmldom_1 = require("xmldom");
|
|
11
|
+
/**
|
|
12
|
+
* Extract a value from XML/HTML response using XPath expression.
|
|
13
|
+
*/
|
|
14
|
+
class ApiExtractXPathBlock extends base_1.StatementBlock {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.type = 'api_extract_xpath';
|
|
18
|
+
this.category = 'API';
|
|
19
|
+
this.color = '#2196F3';
|
|
20
|
+
this.tooltip = 'Extract a value from XML/HTML response using XPath expression';
|
|
21
|
+
}
|
|
22
|
+
getInputs() {
|
|
23
|
+
return [
|
|
24
|
+
{ name: 'XPATH', type: 'field', fieldType: 'text', required: true, default: '//title/text()' },
|
|
25
|
+
{ name: 'VARIABLE', type: 'field', fieldType: 'text', required: true },
|
|
26
|
+
];
|
|
27
|
+
}
|
|
28
|
+
async execute(params, context) {
|
|
29
|
+
const response = (0, utils_1.getLastResponse)(context);
|
|
30
|
+
const xpathExpr = params.XPATH;
|
|
31
|
+
const varName = params.VARIABLE;
|
|
32
|
+
try {
|
|
33
|
+
// Ensure body is a string for XML parsing
|
|
34
|
+
const xmlString = typeof response.body === 'string'
|
|
35
|
+
? response.body
|
|
36
|
+
: JSON.stringify(response.body);
|
|
37
|
+
const doc = new xmldom_1.DOMParser().parseFromString(xmlString, 'text/xml');
|
|
38
|
+
const nodes = xpath_1.default.select(xpathExpr, doc);
|
|
39
|
+
// Convert nodes to values
|
|
40
|
+
let value;
|
|
41
|
+
if (Array.isArray(nodes)) {
|
|
42
|
+
if (nodes.length === 0) {
|
|
43
|
+
value = null;
|
|
44
|
+
}
|
|
45
|
+
else if (nodes.length === 1) {
|
|
46
|
+
value = (0, utils_1.getNodeValue)(nodes[0]);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
value = nodes.map(utils_1.getNodeValue);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
value = nodes;
|
|
54
|
+
}
|
|
55
|
+
context.variables.set(varName, value);
|
|
56
|
+
const valueStr = JSON.stringify(value);
|
|
57
|
+
context.logger.info(`Extracted (XPath) ${xpathExpr} → ${varName} = ${valueStr}`);
|
|
58
|
+
return {
|
|
59
|
+
_summary: `${varName} = ${valueStr.substring(0, 50)}${valueStr.length > 50 ? '...' : ''}`,
|
|
60
|
+
variable: varName,
|
|
61
|
+
xpath: xpathExpr,
|
|
62
|
+
value,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
catch (e) {
|
|
66
|
+
throw new Error(`XPath extraction failed: ${xpathExpr}. Error: ${e.message}`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.ApiExtractXPathBlock = ApiExtractXPathBlock;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StatementBlock } from '../base';
|
|
2
|
+
import { BlockInput, ExecutionContext } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Perform HTTP GET request and store response.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ApiGetBlock extends StatementBlock {
|
|
7
|
+
readonly type = "api_get";
|
|
8
|
+
readonly category = "API";
|
|
9
|
+
readonly color = "#4CAF50";
|
|
10
|
+
readonly tooltip = "Perform HTTP GET request and store response";
|
|
11
|
+
getInputs(): BlockInput[];
|
|
12
|
+
execute(params: Record<string, unknown>, context: ExecutionContext): Promise<unknown>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApiGetBlock = void 0;
|
|
4
|
+
const base_1 = require("../base");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
/**
|
|
7
|
+
* Perform HTTP GET request and store response.
|
|
8
|
+
*/
|
|
9
|
+
class ApiGetBlock extends base_1.StatementBlock {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.type = 'api_get';
|
|
13
|
+
this.category = 'API';
|
|
14
|
+
this.color = '#4CAF50';
|
|
15
|
+
this.tooltip = 'Perform HTTP GET request and store response';
|
|
16
|
+
}
|
|
17
|
+
getInputs() {
|
|
18
|
+
return [
|
|
19
|
+
{ name: 'URL', type: 'field', fieldType: 'text', required: true },
|
|
20
|
+
{ name: 'HEADERS', type: 'field', fieldType: 'text', default: '' },
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
async execute(params, context) {
|
|
24
|
+
const url = (0, utils_1.resolveVariables)(params.URL, context);
|
|
25
|
+
const headers = (0, utils_1.mergeHeaders)(context, params.HEADERS);
|
|
26
|
+
context.logger.info(`GET ${url}`);
|
|
27
|
+
const response = await fetch(url, {
|
|
28
|
+
headers,
|
|
29
|
+
signal: context.abortSignal,
|
|
30
|
+
});
|
|
31
|
+
const parsed = await (0, utils_1.parseResponse)(response);
|
|
32
|
+
(0, utils_1.storeResponse)(context, parsed);
|
|
33
|
+
return parsed;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.ApiGetBlock = ApiGetBlock;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ValueBlock } from '../base';
|
|
2
|
+
import { BlockInput, BlockOutput, ExecutionContext } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Create a headers object.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ApiHeadersBlock extends ValueBlock {
|
|
7
|
+
readonly type = "api_headers";
|
|
8
|
+
readonly category = "API";
|
|
9
|
+
readonly color = "#9C27B0";
|
|
10
|
+
readonly tooltip = "Create a headers object";
|
|
11
|
+
readonly output: BlockOutput;
|
|
12
|
+
getInputs(): BlockInput[];
|
|
13
|
+
execute(params: Record<string, unknown>, context: ExecutionContext): Promise<unknown>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApiHeadersBlock = void 0;
|
|
4
|
+
const base_1 = require("../base");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
/**
|
|
7
|
+
* Create a headers object.
|
|
8
|
+
*/
|
|
9
|
+
class ApiHeadersBlock extends base_1.ValueBlock {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.type = 'api_headers';
|
|
13
|
+
this.category = 'API';
|
|
14
|
+
this.color = '#9C27B0';
|
|
15
|
+
this.tooltip = 'Create a headers object';
|
|
16
|
+
this.output = { type: 'Object' };
|
|
17
|
+
}
|
|
18
|
+
getInputs() {
|
|
19
|
+
return [
|
|
20
|
+
{ name: 'AUTH_TYPE', type: 'field', fieldType: 'dropdown', options: [['None', 'none'], ['Bearer Token', 'bearer'], ['Basic Auth', 'basic'], ['API Key', 'apikey']] },
|
|
21
|
+
{ name: 'AUTH_VALUE', type: 'field', fieldType: 'text' },
|
|
22
|
+
{ name: 'CUSTOM', type: 'value', check: 'Object' },
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
async execute(params, context) {
|
|
26
|
+
const authType = params.AUTH_TYPE;
|
|
27
|
+
const authValue = (0, utils_1.resolveVariables)(params.AUTH_VALUE || '', context);
|
|
28
|
+
const custom = params.CUSTOM || {};
|
|
29
|
+
const headers = { ...custom };
|
|
30
|
+
switch (authType) {
|
|
31
|
+
case 'bearer':
|
|
32
|
+
headers['Authorization'] = `Bearer ${authValue}`;
|
|
33
|
+
break;
|
|
34
|
+
case 'basic':
|
|
35
|
+
headers['Authorization'] = `Basic ${Buffer.from(authValue).toString('base64')}`;
|
|
36
|
+
break;
|
|
37
|
+
case 'apikey':
|
|
38
|
+
headers['X-API-Key'] = authValue;
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
return headers;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.ApiHeadersBlock = ApiHeadersBlock;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ValueBlock } from '../base';
|
|
2
|
+
import { BlockInput, BlockOutput, ExecutionContext } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Create a JSON body from key-value pairs or raw JSON.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ApiJsonBodyBlock extends ValueBlock {
|
|
7
|
+
readonly type = "api_json_body";
|
|
8
|
+
readonly category = "API";
|
|
9
|
+
readonly color = "#9C27B0";
|
|
10
|
+
readonly tooltip = "Create a JSON body from key-value pairs or raw JSON";
|
|
11
|
+
readonly output: BlockOutput;
|
|
12
|
+
getInputs(): BlockInput[];
|
|
13
|
+
execute(params: Record<string, unknown>, context: ExecutionContext): Promise<unknown>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApiJsonBodyBlock = void 0;
|
|
4
|
+
const base_1 = require("../base");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
/**
|
|
7
|
+
* Create a JSON body from key-value pairs or raw JSON.
|
|
8
|
+
*/
|
|
9
|
+
class ApiJsonBodyBlock extends base_1.ValueBlock {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.type = 'api_json_body';
|
|
13
|
+
this.category = 'API';
|
|
14
|
+
this.color = '#9C27B0';
|
|
15
|
+
this.tooltip = 'Create a JSON body from key-value pairs or raw JSON';
|
|
16
|
+
this.output = { type: 'Object' };
|
|
17
|
+
}
|
|
18
|
+
getInputs() {
|
|
19
|
+
return [
|
|
20
|
+
{ name: 'JSON', type: 'field', fieldType: 'text', default: '{}' },
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
async execute(params, context) {
|
|
24
|
+
const json = (0, utils_1.resolveVariables)(params.JSON, context);
|
|
25
|
+
return JSON.parse(json);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.ApiJsonBodyBlock = ApiJsonBodyBlock;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StatementBlock } from '../base';
|
|
2
|
+
import { BlockInput, ExecutionContext } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Perform HTTP PATCH request and store response.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ApiPatchBlock extends StatementBlock {
|
|
7
|
+
readonly type = "api_patch";
|
|
8
|
+
readonly category = "API";
|
|
9
|
+
readonly color = "#4CAF50";
|
|
10
|
+
readonly tooltip = "Perform HTTP PATCH request and store response";
|
|
11
|
+
getInputs(): BlockInput[];
|
|
12
|
+
execute(params: Record<string, unknown>, context: ExecutionContext): Promise<unknown>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApiPatchBlock = void 0;
|
|
4
|
+
const base_1 = require("../base");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
/**
|
|
7
|
+
* Perform HTTP PATCH request and store response.
|
|
8
|
+
*/
|
|
9
|
+
class ApiPatchBlock extends base_1.StatementBlock {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.type = 'api_patch';
|
|
13
|
+
this.category = 'API';
|
|
14
|
+
this.color = '#4CAF50';
|
|
15
|
+
this.tooltip = 'Perform HTTP PATCH request and store response';
|
|
16
|
+
}
|
|
17
|
+
getInputs() {
|
|
18
|
+
return [
|
|
19
|
+
{ name: 'URL', type: 'field', fieldType: 'text', required: true },
|
|
20
|
+
{ name: 'BODY', type: 'field', fieldType: 'text', default: '{}' },
|
|
21
|
+
{ name: 'HEADERS', type: 'field', fieldType: 'text', default: '' },
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
async execute(params, context) {
|
|
25
|
+
const url = (0, utils_1.resolveVariables)(params.URL, context);
|
|
26
|
+
const bodyStr = (0, utils_1.resolveVariables)(params.BODY || '{}', context);
|
|
27
|
+
const inlineHeaders = (0, utils_1.mergeHeaders)(context, params.HEADERS);
|
|
28
|
+
let body;
|
|
29
|
+
try {
|
|
30
|
+
body = JSON.parse(bodyStr);
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
body = bodyStr;
|
|
34
|
+
}
|
|
35
|
+
context.logger.info(`PATCH ${url}`);
|
|
36
|
+
const response = await fetch(url, {
|
|
37
|
+
method: 'PATCH',
|
|
38
|
+
headers: { 'Content-Type': 'application/json', ...inlineHeaders },
|
|
39
|
+
body: typeof body === 'string' ? body : JSON.stringify(body),
|
|
40
|
+
signal: context.abortSignal,
|
|
41
|
+
});
|
|
42
|
+
const parsed = await (0, utils_1.parseResponse)(response);
|
|
43
|
+
(0, utils_1.storeResponse)(context, parsed);
|
|
44
|
+
return parsed;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.ApiPatchBlock = ApiPatchBlock;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StatementBlock } from '../base';
|
|
2
|
+
import { BlockInput, ExecutionContext } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Perform HTTP POST request and store response.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ApiPostBlock extends StatementBlock {
|
|
7
|
+
readonly type = "api_post";
|
|
8
|
+
readonly category = "API";
|
|
9
|
+
readonly color = "#4CAF50";
|
|
10
|
+
readonly tooltip = "Perform HTTP POST request and store response";
|
|
11
|
+
getInputs(): BlockInput[];
|
|
12
|
+
execute(params: Record<string, unknown>, context: ExecutionContext): Promise<unknown>;
|
|
13
|
+
}
|