ff-automationv2 2.2.29 → 2.2.30
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/ai/llmcalls/llmAction.js +49 -13
- package/dist/ai/llmcalls/parseLlmOputput.js +5 -5
- package/dist/ai/llmprompts/promptRegistry.js +4 -0
- package/dist/ai/llmprompts/systemPrompts/actionExtractorPrompt.js +39 -11
- package/dist/ai/llmprompts/systemPrompts/fireflinkElementIndexExtactors.js +6 -6
- package/dist/ai/llmprompts/systemPrompts/fireflinkElementIndexExtractor_Mob.js +32 -0
- package/dist/ai/llmprompts/systemPrompts/mobileKeywordExtractor.js +17 -8
- package/dist/ai/llmprompts/systemPrompts/otpExtractorPrompt.d.ts +1 -0
- package/dist/ai/llmprompts/systemPrompts/otpExtractorPrompt.js +22 -0
- package/dist/ai/llmprompts/systemPrompts/verifyActionExtractorPrompt.js +3 -1
- package/dist/ai/llmprompts/systemPrompts/visionPrompt.js +14 -6
- package/dist/ai/llmprompts/systemPrompts/visionPromptMobile.js +3 -0
- package/dist/ai/llmprompts/userPrompts/userPrompt.js +1 -0
- package/dist/automation/actions/executor.d.ts +4 -0
- package/dist/automation/actions/executor.js +20 -0
- package/dist/automation/actions/interaction/clear/clear.js +1 -1
- package/dist/automation/actions/interaction/clear/clearAndEnter.js +1 -1
- package/dist/automation/actions/interaction/click/click.js +10 -3
- package/dist/automation/actions/interaction/click/clickNtimes.js +1 -1
- package/dist/automation/actions/interaction/click/doubleClick.js +1 -1
- package/dist/automation/actions/interaction/click/rightClick.js +1 -1
- package/dist/automation/actions/interaction/elementlessActions/getOtp.d.ts +2 -0
- package/dist/automation/actions/interaction/elementlessActions/getOtp.js +101 -0
- package/dist/automation/actions/interaction/enterActions/enterInput.js +11 -6
- package/dist/automation/actions/interaction/enterActions/enterInputAndPress.js +2 -2
- package/dist/automation/actions/interaction/enterActions/enterusingJs.js +2 -2
- package/dist/automation/actions/interaction/enterActions/waitAndEnter.js +1 -1
- package/dist/automation/actions/interaction/upload/uploadfile.js +1 -1
- package/dist/automation/actions/interaction/verify/VerifyNavigateURL.js +38 -11
- package/dist/automation/actions/interface/FireFlinkResponseSchema.d.ts +12 -0
- package/dist/automation/actions/interface/FireFlinkResponseSchema.js +19 -3
- package/dist/automation/actions/interface/getOtpInterface.d.ts +15 -0
- package/dist/automation/actions/interface/getOtpInterface.js +2 -0
- package/dist/automation/browserSession/initiateBrowserSession.d.ts +1 -1
- package/dist/automation/browserSession/initiateBrowserSession.js +15 -7
- package/dist/automation/driverState.d.ts +2 -0
- package/dist/automation/driverState.js +4 -0
- package/dist/automation/mobileSession/initiateMobileSession.d.ts +4 -5
- package/dist/automation/mobileSession/initiateMobileSession.js +83 -19
- package/dist/core/constants/allAction.js +5 -1
- package/dist/core/constants/supportedActions.js +5 -2
- package/dist/core/interfaces/actionInterface.d.ts +4 -0
- package/dist/core/interfaces/browserConfigurationInterface.d.ts +0 -4
- package/dist/core/interfaces/browserConfigurationInterface.js +0 -1
- package/dist/core/interfaces/executionDetails.d.ts +6 -3
- package/dist/core/interfaces/fireflinkScriptPayloadInterface.d.ts +22 -16
- package/dist/core/interfaces/llmResponseInterface.d.ts +1 -0
- package/dist/core/interfaces/promptInterface.d.ts +1 -0
- package/dist/core/main/SessionManager.d.ts +9 -0
- package/dist/core/main/SessionManager.js +23 -0
- package/dist/core/main/actionHandlerFactory.js +261 -64
- package/dist/core/main/executionContext.d.ts +7 -1
- package/dist/core/main/executionContext.js +93 -3
- package/dist/core/main/runAutomationScript.d.ts +1 -0
- package/dist/core/main/runAutomationScript.js +912 -304
- package/dist/core/main/stepProcessor.js +7 -2
- package/dist/core/types/browserType.d.ts +3 -3
- package/dist/core/types/browserType.js +2 -2
- package/dist/core/types/messageType.d.ts +13 -0
- package/dist/core/types/messageType.js +15 -0
- package/dist/core/types/promptType.d.ts +2 -1
- package/dist/core/types/promptType.js +1 -0
- package/dist/domAnalysis/searchBest.js +15 -16
- package/dist/domAnalysis/simplifyAndFlatten.js +6 -4
- package/dist/fireflinkData/fireflinkLocators/getListOfLocators.d.ts +3 -0
- package/dist/fireflinkData/fireflinkLocators/getListOfLocators.js +23 -15
- package/dist/fireflinkData/fireflinkLocators/parser/getElementsFromHTML.d.ts +3 -3
- package/dist/fireflinkData/fireflinkLocators/parser/getElementsFromHTML.js +134 -118
- package/dist/fireflinkData/fireflinkLocators/types/locator.d.ts +11 -1
- package/dist/fireflinkData/fireflinkLocators/utils/androidSelector.d.ts +1 -1
- package/dist/fireflinkData/fireflinkLocators/utils/androidSelector.js +35 -9
- package/dist/fireflinkData/fireflinkLocators/utils/cssSelector.d.ts +10 -10
- package/dist/fireflinkData/fireflinkLocators/utils/cssSelector.js +56 -59
- package/dist/fireflinkData/fireflinkLocators/utils/iosSelector.d.ts +1 -1
- package/dist/fireflinkData/fireflinkLocators/utils/iosSelector.js +53 -29
- package/dist/fireflinkData/fireflinkLocators/utils/referenceXpath.d.ts +8 -8
- package/dist/fireflinkData/fireflinkLocators/utils/referenceXpath.js +113 -190
- package/dist/fireflinkData/fireflinkLocators/utils/xpath.d.ts +17 -26
- package/dist/fireflinkData/fireflinkLocators/utils/xpath.js +314 -786
- package/dist/fireflinkData/fireflinkLocators/utils/xpathHelpers.d.ts +68 -70
- package/dist/fireflinkData/fireflinkLocators/utils/xpathHelpers.js +498 -517
- package/dist/fireflinkData/fireflinkScript/appendScriptData.d.ts +1 -1
- package/dist/fireflinkData/fireflinkScript/appendScriptData.js +5 -8
- package/dist/fireflinkData/fireflinkScript/scriptGenrationData.d.ts +2 -2
- package/dist/fireflinkData/fireflinkScript/scriptGenrationData.js +17 -27
- package/dist/llmConfig/llmConfiguration.js +13 -6
- package/dist/service/api/fireflinkApi.service.d.ts +1 -1
- package/dist/service/api/fireflinkApi.service.js +1 -2
- package/dist/service/fireflink.service.d.ts +3 -3
- package/dist/service/fireflink.service.js +23 -21
- package/dist/service/kafka/fireflinkKafka.service.d.ts +1 -2
- package/dist/service/kafka/fireflinkKafka.service.js +6 -4
- package/dist/tests/test12.d.ts +0 -1
- package/dist/tests/test12.js +65 -78
- package/dist/tests/testkaf.d.ts +0 -1
- package/dist/tests/testkaf.js +51 -55
- package/dist/utils/InstancesDetails/getInstancesInfo.js +1 -1
- package/dist/utils/browserCap/capability.d.ts +5 -1
- package/dist/utils/browserCap/capability.js +91 -15
- package/dist/utils/helpers/domSanitizer.d.ts +1 -0
- package/dist/utils/helpers/domSanitizer.js +9 -0
- package/dist/utils/helpers/enterActionHelper.js +23 -4
- package/dist/utils/helpers/xpathcreation.js +2 -2
- package/dist/utils/javascript/jsFindElement.d.ts +1 -1
- package/dist/utils/javascript/jsFindElement.js +2 -2
- package/dist/utils/newTab/newTabTracker.js +18 -6
- package/dist/utils/workers/LocatorWorkerInterface.d.ts +22 -0
- package/dist/utils/workers/LocatorWorkerInterface.js +2 -0
- package/dist/utils/workers/LocatorWorkerPool.d.ts +13 -0
- package/dist/utils/workers/LocatorWorkerPool.js +89 -0
- package/dist/utils/workers/locatorWorker.d.ts +1 -0
- package/dist/utils/workers/locatorWorker.js +44 -0
- package/package.json +3 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { AppendScriptDataArgs } from "../../core/interfaces/scriptGenrationDataInterface.js";
|
|
2
|
-
export declare function appendScriptData(args: AppendScriptDataArgs):
|
|
2
|
+
export declare function appendScriptData(args: AppendScriptDataArgs): Promise<any>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.appendScriptData = appendScriptData;
|
|
4
4
|
const logData_js_1 = require("../../utils/logger/logData.js");
|
|
5
|
-
function appendScriptData(args) {
|
|
5
|
+
async function appendScriptData(args) {
|
|
6
6
|
args.scriptDataAppender.add(async () => {
|
|
7
7
|
const searchAttribute = args.platform === "web"
|
|
8
8
|
? `[ff-inspect="${args.ffNumber}"]`
|
|
@@ -18,17 +18,14 @@ function appendScriptData(args) {
|
|
|
18
18
|
}
|
|
19
19
|
if (args.elementName) {
|
|
20
20
|
let locators;
|
|
21
|
-
const locator = [{ name: "xpath", value: args.selector }];
|
|
22
21
|
try {
|
|
23
22
|
const ffElement = await args.elementGetter.getFireFlinkElement(args.pageDOM, searchAttribute);
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
// locators = [{ name: "xpath", value: args.selector }];
|
|
24
|
+
if (ffElement?.locators?.length === 0) {
|
|
25
|
+
throw new Error("locators is not found");
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
|
-
locators =
|
|
29
|
-
...locator,
|
|
30
|
-
...ffElement.locators.flat(Infinity)
|
|
31
|
-
];
|
|
28
|
+
locators = ffElement.locators;
|
|
32
29
|
}
|
|
33
30
|
}
|
|
34
31
|
catch (error) {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { IScriptGenerationData } from "../../core/interfaces/scriptGenrationDataInterface.js";
|
|
2
2
|
export declare class ScriptDataAppender {
|
|
3
3
|
private data;
|
|
4
|
-
private
|
|
4
|
+
private pending;
|
|
5
5
|
private errorNLP;
|
|
6
6
|
private taskIndex;
|
|
7
|
-
private concurrencyLimit;
|
|
8
7
|
add(task: () => Promise<IScriptGenerationData>): void;
|
|
9
8
|
private process;
|
|
10
9
|
private retry;
|
|
@@ -12,4 +11,5 @@ export declare class ScriptDataAppender {
|
|
|
12
11
|
getData(): IScriptGenerationData[];
|
|
13
12
|
setErrorNLP(nlp: string): void;
|
|
14
13
|
getErrorNLP(): string;
|
|
14
|
+
reset(): void;
|
|
15
15
|
}
|
|
@@ -5,23 +5,20 @@ const platformSyntax_js_1 = require("../../utils/helpers/platformSyntax.js");
|
|
|
5
5
|
class ScriptDataAppender {
|
|
6
6
|
constructor() {
|
|
7
7
|
this.data = [];
|
|
8
|
-
this.
|
|
8
|
+
this.pending = [];
|
|
9
9
|
this.errorNLP = "";
|
|
10
10
|
this.taskIndex = 0;
|
|
11
|
-
this.concurrencyLimit = 5;
|
|
12
11
|
}
|
|
13
12
|
add(task) {
|
|
14
13
|
const index = this.taskIndex++;
|
|
15
|
-
const job = async () => {
|
|
16
|
-
await
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
this.queue.push(job);
|
|
14
|
+
const job = this.retry(async () => {
|
|
15
|
+
const item = await task();
|
|
16
|
+
item.elementsData?.forEach(element => {
|
|
17
|
+
element.platform = (0, platformSyntax_js_1.getPlatformSyntax)(element.platform);
|
|
18
|
+
});
|
|
19
|
+
this.process(item, index);
|
|
20
|
+
}, 3);
|
|
21
|
+
this.pending.push(job);
|
|
25
22
|
}
|
|
26
23
|
process(item, index) {
|
|
27
24
|
this.data[index] = item;
|
|
@@ -41,21 +38,8 @@ class ScriptDataAppender {
|
|
|
41
38
|
}
|
|
42
39
|
}
|
|
43
40
|
async waitForAllSteps() {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
while (workers.length < this.concurrencyLimit && this.queue.length > 0) {
|
|
47
|
-
const job = this.queue.shift();
|
|
48
|
-
const worker = job().finally(() => {
|
|
49
|
-
const index = workers.indexOf(worker);
|
|
50
|
-
if (index > -1)
|
|
51
|
-
workers.splice(index, 1);
|
|
52
|
-
});
|
|
53
|
-
workers.push(worker);
|
|
54
|
-
}
|
|
55
|
-
if (workers.length > 0) {
|
|
56
|
-
await Promise.race(workers);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
41
|
+
// Settle everything, don't let one failure abort the rest
|
|
42
|
+
await Promise.allSettled(this.pending);
|
|
59
43
|
}
|
|
60
44
|
getData() {
|
|
61
45
|
return this.data;
|
|
@@ -66,5 +50,11 @@ class ScriptDataAppender {
|
|
|
66
50
|
getErrorNLP() {
|
|
67
51
|
return this.errorNLP;
|
|
68
52
|
}
|
|
53
|
+
reset() {
|
|
54
|
+
this.data = [];
|
|
55
|
+
this.taskIndex = 0;
|
|
56
|
+
this.pending = [];
|
|
57
|
+
this.errorNLP = "";
|
|
58
|
+
}
|
|
69
59
|
}
|
|
70
60
|
exports.ScriptDataAppender = ScriptDataAppender;
|
|
@@ -3,13 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ServiceProviderProviderConfiguration = void 0;
|
|
4
4
|
const openai_1 = require("@ai-sdk/openai");
|
|
5
5
|
const anthropic_1 = require("@ai-sdk/anthropic");
|
|
6
|
-
const groq_1 = require("@ai-sdk/groq");
|
|
7
6
|
const google_1 = require("@ai-sdk/google");
|
|
8
7
|
const google_vertex_1 = require("@ai-sdk/google-vertex");
|
|
9
8
|
const azure_1 = require("@ai-sdk/azure");
|
|
10
9
|
const PROVIDERS = {
|
|
11
|
-
Groq:
|
|
12
|
-
DefaultFireFlink:
|
|
10
|
+
Groq: openai_1.createOpenAI,
|
|
11
|
+
DefaultFireFlink: openai_1.createOpenAI,
|
|
13
12
|
OpenAi: openai_1.createOpenAI,
|
|
14
13
|
Anthropic: anthropic_1.createAnthropic,
|
|
15
14
|
};
|
|
@@ -39,9 +38,17 @@ class ServiceProviderProviderConfiguration {
|
|
|
39
38
|
if (!providerFactory) {
|
|
40
39
|
throw new Error(`Unsupported provider: ${aiInfo.serviceProvider}`);
|
|
41
40
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
if (aiInfo.serviceProvider === "Groq" || aiInfo.serviceProvider === "DefaultFireFlink") {
|
|
42
|
+
return providerFactory({
|
|
43
|
+
baseURL: "https://api.groq.com/openai/v1",
|
|
44
|
+
apiKey: aiInfo.apiKey
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
return providerFactory({
|
|
49
|
+
apiKey: aiInfo.apiKey,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
45
52
|
}
|
|
46
53
|
}
|
|
47
54
|
exports.ServiceProviderProviderConfiguration = ServiceProviderProviderConfiguration;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IFireFlinkApiService } from "../../core/interfaces/fireflinkScriptPayloadInterface.js";
|
|
2
2
|
export declare class FireFlinkApiService implements IFireFlinkApiService {
|
|
3
|
-
getInstancesDetailsApi(
|
|
3
|
+
getInstancesDetailsApi(url: string): Promise<any>;
|
|
4
4
|
}
|
|
@@ -6,10 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.FireFlinkApiService = void 0;
|
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
|
8
8
|
class FireFlinkApiService {
|
|
9
|
-
async getInstancesDetailsApi(
|
|
9
|
+
async getInstancesDetailsApi(url) {
|
|
10
10
|
try {
|
|
11
11
|
const response = await axios_1.default.get(url, {
|
|
12
|
-
headers,
|
|
13
12
|
timeout: 30000,
|
|
14
13
|
});
|
|
15
14
|
return response.data;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IFireflinkService, IFireFlinkApiService
|
|
1
|
+
import { IFireflinkService, IFireFlinkApiService } from "../core/interfaces/fireflinkScriptPayloadInterface.js";
|
|
2
2
|
export declare class fireflinkService implements IFireflinkService {
|
|
3
3
|
private apiService;
|
|
4
4
|
private kafkaProducer;
|
|
5
5
|
constructor(apiService: IFireFlinkApiService, broker: string[], sslConfig: any);
|
|
6
|
-
runGetInstancesDetails(projectId: string,
|
|
7
|
-
produceMessageToKafka(kafkaArgs:
|
|
6
|
+
runGetInstancesDetails(projectId: string, _token: string, serverHost: string, licenseId: string): Promise<any>;
|
|
7
|
+
produceMessageToKafka(key: string, kafkaArgs: any): Promise<void>;
|
|
8
8
|
}
|
|
@@ -8,32 +8,34 @@ class fireflinkService {
|
|
|
8
8
|
this.apiService = apiService;
|
|
9
9
|
this.kafkaProducer = new fireflinkKafka_service_js_1.KafkaProducerService(broker, sslConfig);
|
|
10
10
|
}
|
|
11
|
-
async runGetInstancesDetails(projectId,
|
|
12
|
-
const headers = {
|
|
13
|
-
Accept: "*/*",
|
|
14
|
-
"Accept-Language": "en-US,en;q=0.9",
|
|
15
|
-
"Content-Type": "application/json",
|
|
16
|
-
projectId: projectId || "",
|
|
17
|
-
// Authorization: `Bearer ${token}`,
|
|
18
|
-
};
|
|
11
|
+
async runGetInstancesDetails(projectId, _token, serverHost, licenseId) {
|
|
19
12
|
const url = `${serverHost}/project/optimize/v3/ai-service-provider/internal/selected-instance?projectId=${projectId}&licenseId=${licenseId}`;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
const maxRetries = 5;
|
|
14
|
+
let lastError;
|
|
15
|
+
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
|
16
|
+
try {
|
|
17
|
+
const finalResult = await this.apiService.getInstancesDetailsApi(url);
|
|
18
|
+
if (finalResult) {
|
|
19
|
+
logData_js_1.logger.info("Instance API Responded Successfully");
|
|
20
|
+
return finalResult;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
throw new Error("Instance API responded with an error: " + JSON.stringify(finalResult));
|
|
24
|
+
}
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
catch (error) {
|
|
27
|
+
lastError = error;
|
|
28
|
+
logData_js_1.logger.info(`Attempt ${attempt} of ${maxRetries} failed to fetch instance details from FireFlink API: ${error?.message || error}`);
|
|
29
|
+
if (attempt < maxRetries) {
|
|
30
|
+
await new Promise((resolve) => setTimeout(resolve, 1000 * attempt));
|
|
31
|
+
}
|
|
27
32
|
}
|
|
28
|
-
return finalResult;
|
|
29
|
-
}
|
|
30
|
-
catch (error) {
|
|
31
|
-
logData_js_1.logger.error(`Failed to submit automation script, ${error}`);
|
|
32
|
-
throw new Error("Failed to submit automation script", { cause: error });
|
|
33
33
|
}
|
|
34
|
+
logData_js_1.logger.error(`Failed to get instance details after ${maxRetries} attempts, ${lastError}`);
|
|
35
|
+
throw new Error("Failed to get instance details", { cause: lastError });
|
|
34
36
|
}
|
|
35
|
-
async produceMessageToKafka(kafkaArgs) {
|
|
36
|
-
await this.kafkaProducer.produceMessage(kafkaArgs);
|
|
37
|
+
async produceMessageToKafka(key, kafkaArgs) {
|
|
38
|
+
await this.kafkaProducer.produceMessage(key, kafkaArgs);
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
41
|
exports.fireflinkService = fireflinkService;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { IKafkaPayload } from "../../core/interfaces/fireflinkScriptPayloadInterface.js";
|
|
2
1
|
export declare class KafkaProducerService {
|
|
3
2
|
private kafka;
|
|
4
3
|
private kafkaProducer;
|
|
5
4
|
constructor(brokers: string[], sslConfig: any);
|
|
6
|
-
produceMessage(kafkaArgs:
|
|
5
|
+
produceMessage(key: string, kafkaArgs: any): Promise<void>;
|
|
7
6
|
}
|
|
@@ -7,7 +7,7 @@ class KafkaProducerService {
|
|
|
7
7
|
constructor(brokers, sslConfig) {
|
|
8
8
|
this.kafka = new kafkajs_1.Kafka({
|
|
9
9
|
clientId: "FireFlinK-AI-Automation",
|
|
10
|
-
brokers
|
|
10
|
+
brokers,
|
|
11
11
|
ssl: sslConfig,
|
|
12
12
|
logLevel: kafkajs_1.logLevel.ERROR,
|
|
13
13
|
connectionTimeout: 10000,
|
|
@@ -19,15 +19,17 @@ class KafkaProducerService {
|
|
|
19
19
|
});
|
|
20
20
|
this.kafkaProducer = this.kafka.producer();
|
|
21
21
|
}
|
|
22
|
-
async produceMessage(kafkaArgs) {
|
|
22
|
+
async produceMessage(key, kafkaArgs) {
|
|
23
23
|
try {
|
|
24
24
|
await this.kafkaProducer.connect();
|
|
25
25
|
logData_js_1.logger.info("Kafka connected successfully");
|
|
26
26
|
await this.kafkaProducer.send({
|
|
27
27
|
topic: kafkaArgs.topic,
|
|
28
|
-
messages: [{ value: JSON.stringify(kafkaArgs.message)
|
|
28
|
+
messages: [{ value: JSON.stringify(kafkaArgs.message), key: key, headers: {
|
|
29
|
+
type: "logs"
|
|
30
|
+
}
|
|
31
|
+
}],
|
|
29
32
|
});
|
|
30
|
-
await this.kafkaProducer.disconnect();
|
|
31
33
|
logData_js_1.logger.info("Kafka produced message successfully and Kafka producer disconnected successfully");
|
|
32
34
|
}
|
|
33
35
|
catch (error) {
|
package/dist/tests/test12.d.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/tests/test12.js
CHANGED
|
@@ -1,79 +1,66 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
runner.run({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
hostname: "devicefarm.fireflink.com",
|
|
68
|
-
licenseId: "LIC1026612",
|
|
69
|
-
projectName: "demo",
|
|
70
|
-
protocol: "https",
|
|
71
|
-
path: "backend/fireflinkcloud/wd/hub"
|
|
72
|
-
},
|
|
73
|
-
capabilities: {
|
|
74
|
-
browserName: "chrome",
|
|
75
|
-
platformName: "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rLmNvbSIsImJpbGxpbmdDeWNsZSI6IlllYXJseSIsImlkIjoiVVNSMTAxNTAzMTQiLCJsaWNlbnNlSWQiOiJMSUMyNjExMCIsImVtYWlsIjoicmFzaG1pLnRAZmlyZWZsaW5rLmNvbSJ9.RcOhUQMtDAd6LibDR0Iws5WWK4EwfgXiTWxn1GP-bHz3W4CFd1ap_LIzAFX2RLe2dbKpbhiVfDAdU7MmYt10wQdz3PArWVXolpBQWNJecJhibYZCp9dQwMvBiDBQ_5i6AS4K_PhDlpwXkh2o0vuBfrYu4jVl1vOPfbLodxq3Tj8SfngD8_1q0_CXKbmBTXmsVESs43f4XXT2T7wa6t2ErbIwW38FLur2UmLab3UnVYJdqv7fjkrBrGqQBMzLDeQZwAWmtAWpWFGf9dMWhJyBxu-Al88VOIVZVxDwVnXLMg-DeIv_H1lk8x2AlyG_WVxlFVRkWNTztKMvXtc2GXB5ug"
|
|
79
|
-
});
|
|
2
|
+
// import { AutomationRunner } from "../index.js"
|
|
3
|
+
// import express from "express";
|
|
4
|
+
// const runner = new AutomationRunner();
|
|
5
|
+
// const app = express();
|
|
6
|
+
// app.use(express.json())
|
|
7
|
+
// app.post("/user-story", (req, res) => {
|
|
8
|
+
// const userStory = req.body.userStory;
|
|
9
|
+
// const kafkaMessageKey = req.body.kafkaMessageKey
|
|
10
|
+
// runner.run({
|
|
11
|
+
// userStory: userStory,
|
|
12
|
+
// platform: "web",
|
|
13
|
+
// pageDetails: {
|
|
14
|
+
// Web: {
|
|
15
|
+
// pageId: "PAG73a7a0ad-c092-4351-8a93-68647f60e343",
|
|
16
|
+
// pageName: "ai-Page"
|
|
17
|
+
// }
|
|
18
|
+
// },
|
|
19
|
+
// sessionPath: "./session",
|
|
20
|
+
// env: "",
|
|
21
|
+
// broker: ["localhost:9092"],
|
|
22
|
+
// sslConfig: "",
|
|
23
|
+
// serverHost: "https://us-app.fireflink.com",
|
|
24
|
+
// webSocketId: "",
|
|
25
|
+
// generatedBy: "",
|
|
26
|
+
// licenseType: "C-Professional",
|
|
27
|
+
// licenseId: "LIC1026612",
|
|
28
|
+
// userId: "USR10150300",
|
|
29
|
+
// projectType: "Web",
|
|
30
|
+
// browserName: "Microsoft Edge",
|
|
31
|
+
// kafkaMessageKey: kafkaMessageKey,
|
|
32
|
+
// serverData: {},
|
|
33
|
+
// type: "sdfg",
|
|
34
|
+
// scriptName: "url",
|
|
35
|
+
// scriptType: "android",
|
|
36
|
+
// projectId: "PJT1001",
|
|
37
|
+
// testCaseId: "SCR1208",
|
|
38
|
+
// promptId: "3f6e123c-8ec6-47c1-90e1-1a2f53b49251",
|
|
39
|
+
// userName: "default-user",
|
|
40
|
+
// appiumPort: 0,
|
|
41
|
+
// platformVersion: "",
|
|
42
|
+
// realDeviceId: "",
|
|
43
|
+
// isTerminate: false,
|
|
44
|
+
// isCloud: false,
|
|
45
|
+
// cloudConfig: {
|
|
46
|
+
// accessKey: "yfAa_w199cJge2Gezsgb2Jnu7hKdqER1tExY5kKvgSvXfi1lRUelFsbTFI5pMq7zQuwwNXXnsLTkjKhvWcKDWsUoGLi9KjUV6gbUNDhqj0jWYFyW9h_0LIDEg5qXigwZdqzQqAvWwHin3gBhzGndeROtixv_VFhnseGSWRAHTajZzE-Zl0d8BP6gl0TEBUfoNgqBtAQVDLP6wAQzPfcyjjGFsdHkXWeHFkKmA78D7rKlnNuN2WgjIUlhYheDRDeqZ98Ig_PyS1GbUvjwJ73L38sr_cD4Y9lrKyWJV-m5RmtKhmkqRM8uk5gEfjzgwy30",
|
|
47
|
+
// hostname: "devicefarm.fireflink.com",
|
|
48
|
+
// licenseId: "LIC1026612",
|
|
49
|
+
// projectName: "demo",
|
|
50
|
+
// protocol: "https",
|
|
51
|
+
// path: "backend/fireflinkcloud/wd/hub"
|
|
52
|
+
// },
|
|
53
|
+
// capabilities: {
|
|
54
|
+
// browserName: "chrome",
|
|
55
|
+
// platformName: "Windows 11",
|
|
56
|
+
// browserVersion: "146"
|
|
57
|
+
// },
|
|
58
|
+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VNSMTAxNTAzMTQiLCJsaWNlbnNlSWQiOiJMSUMyNjExMCIsImVtYWlsIjoicmFzaG1pLnRAZmlyZWZsaW5rLmNvbSJ9.RcOhUQMtDAd6LibDR0Iws5WWK4EwfgXiTWxn1GP-bHz3W4CFd1ap_LIzAFX2RLe2dbKpbhiVfDAdU7MmYt10wQdz3PArWVXolpBQWNJecJhibYZCp9dQwMvBiDBQ_5i6AS4K_PhDlpwXkh2o0vuBfrYu4jVl1vOPfbLodxq3Tj8SfngD8_1q0_CXKbmBTXmsVESs43f4XXT2T7wa6t2ErbIwW38FLur2UmLab3UnVYJdqv7fjkrBrGqQBMzLDeQZwAWmtAWpWFGf9dMWhJyBxu-Al88VOIVZVxDwVnXLMg-DeIv_H1lk8x2AlyG_WVxlFVRkWNTztKMvXtc2GXB5ug"
|
|
59
|
+
// })
|
|
60
|
+
// res.json({
|
|
61
|
+
// message: "User story received successfully",
|
|
62
|
+
// });
|
|
63
|
+
// });
|
|
64
|
+
// app.listen(3000, () => {
|
|
65
|
+
// console.log("Server running on port 3000");
|
|
66
|
+
// });
|
package/dist/tests/testkaf.d.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/tests/testkaf.js
CHANGED
|
@@ -1,56 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"tokensConsumed": 1234,
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
inst.produceMessage(payload);
|
|
2
|
+
// import { KafkaProducerService } from "../service/kafka/fireflinkKafka.service.js"
|
|
3
|
+
// import path from "path";
|
|
4
|
+
// import fs from "fs";
|
|
5
|
+
// const certPath = path.join("D:", "Bitbucket", "automationV2", "Certificates", "certificate.crt");
|
|
6
|
+
// const ssl = {
|
|
7
|
+
// ca: [fs.readFileSync(certPath, "utf-8")],
|
|
8
|
+
// rejectUnauthorized: false,
|
|
9
|
+
// }
|
|
10
|
+
// const inst = new KafkaProducerService(["test.fireflink.com:9222"], ssl);
|
|
11
|
+
// let payload = {
|
|
12
|
+
// topic: `Topic-FIREFLINK-api-requests-test3`,
|
|
13
|
+
// message: {
|
|
14
|
+
// "stepData": [{
|
|
15
|
+
// "nlpName": "OpenBrowser",
|
|
16
|
+
// "elementsData": [],
|
|
17
|
+
// "stepInputs": []
|
|
18
|
+
// }
|
|
19
|
+
// ],
|
|
20
|
+
// "type": "web",
|
|
21
|
+
// "scriptName": "NLPList6",
|
|
22
|
+
// "version": "",
|
|
23
|
+
// "scriptType": "Web & Mobile (Android & iOS)",
|
|
24
|
+
// "projectId": "PJT1041",
|
|
25
|
+
// "testCaseId": "SCR1930",
|
|
26
|
+
// "promptId": "1f348fb3-b0f6-4eb4-b9a0-6c6cc33fea68",
|
|
27
|
+
// "pageDetails": {
|
|
28
|
+
// "Web": {
|
|
29
|
+
// "pageId": "PAG025b6c68-9a55-46da-b353-0894f29c7f27",
|
|
30
|
+
// "pageName": "ai-Page"
|
|
31
|
+
// },
|
|
32
|
+
// "Android": {
|
|
33
|
+
// "pageId": "PAGb830f55d-077a-4d09-ae71-91fece6b0011",
|
|
34
|
+
// "pageName": "ai-Android-Page"
|
|
35
|
+
// },
|
|
36
|
+
// "iOS": {
|
|
37
|
+
// "pageId": "PAGcbb751fe-f056-4a09-a2ba-64c1092b5f89",
|
|
38
|
+
// "pageName": "ai-Ios-Page"
|
|
39
|
+
// }
|
|
40
|
+
// },
|
|
41
|
+
// "generatedBy": "",
|
|
42
|
+
// "webSocketId": "",
|
|
43
|
+
// "licenseType": "C-Professional",
|
|
44
|
+
// "licenseId": "LIC3916",
|
|
45
|
+
// "userId": "USR26696",
|
|
46
|
+
// "projectType": "Web & Mobile",
|
|
47
|
+
// "topic": "Topic-FIREFLINK-api-requests-performances",
|
|
48
|
+
// "serverHost": "https://performances.fireflink.com",
|
|
49
|
+
// "tokensConsumed": 1234,
|
|
50
|
+
// }
|
|
51
|
+
// }
|
|
52
|
+
// inst.produceMessage(payload)
|
|
@@ -6,7 +6,7 @@ function getAiInstanceInfo(responseObject) {
|
|
|
6
6
|
serviceProvider: responseObject.serviceProvider,
|
|
7
7
|
apiKey: responseObject.instanceDetails?.apiKey,
|
|
8
8
|
apiUrl: responseObject.instanceDetails?.apiUrl,
|
|
9
|
-
visionApiKey: responseObject
|
|
9
|
+
visionApiKey: responseObject.serviceProvider === "DefaultFireFlink" ? responseObject.visionKey : "",
|
|
10
10
|
model: responseObject.serviceProvider === "DefaultFireFlink"
|
|
11
11
|
? "openai/gpt-oss-20b"
|
|
12
12
|
: responseObject.model,
|
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
import { BrowserId } from "../../core/types/browserType.js";
|
|
2
|
-
export declare function getCapabilities(browserName: BrowserId, path?: string, profile?: string): {
|
|
2
|
+
export declare function getCapabilities(browserName: BrowserId, path?: string, profile?: string, customCaps?: string[]): {
|
|
3
3
|
browserName: string;
|
|
4
4
|
"wdio:enforceWebDriverClassic": boolean;
|
|
5
5
|
"goog:chromeOptions": {
|
|
6
6
|
args: string[];
|
|
7
|
+
prefs: Record<string, any>;
|
|
7
8
|
};
|
|
8
9
|
} | {
|
|
9
10
|
browserName: string;
|
|
10
11
|
"wdio:enforceWebDriverClassic": boolean;
|
|
12
|
+
acceptInsecureCerts: boolean;
|
|
11
13
|
"moz:firefoxOptions": {
|
|
12
14
|
args: string[];
|
|
15
|
+
prefs: Record<string, any>;
|
|
13
16
|
};
|
|
14
17
|
} | {
|
|
15
18
|
browserName: string;
|
|
16
19
|
"wdio:enforceWebDriverClassic": boolean;
|
|
17
20
|
"ms:edgeOptions": {
|
|
18
21
|
args: string[];
|
|
22
|
+
prefs: Record<string, any>;
|
|
19
23
|
};
|
|
20
24
|
} | {
|
|
21
25
|
browserName: string;
|