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.
Files changed (113) hide show
  1. package/dist/ai/llmcalls/llmAction.js +49 -13
  2. package/dist/ai/llmcalls/parseLlmOputput.js +5 -5
  3. package/dist/ai/llmprompts/promptRegistry.js +4 -0
  4. package/dist/ai/llmprompts/systemPrompts/actionExtractorPrompt.js +39 -11
  5. package/dist/ai/llmprompts/systemPrompts/fireflinkElementIndexExtactors.js +6 -6
  6. package/dist/ai/llmprompts/systemPrompts/fireflinkElementIndexExtractor_Mob.js +32 -0
  7. package/dist/ai/llmprompts/systemPrompts/mobileKeywordExtractor.js +17 -8
  8. package/dist/ai/llmprompts/systemPrompts/otpExtractorPrompt.d.ts +1 -0
  9. package/dist/ai/llmprompts/systemPrompts/otpExtractorPrompt.js +22 -0
  10. package/dist/ai/llmprompts/systemPrompts/verifyActionExtractorPrompt.js +3 -1
  11. package/dist/ai/llmprompts/systemPrompts/visionPrompt.js +14 -6
  12. package/dist/ai/llmprompts/systemPrompts/visionPromptMobile.js +3 -0
  13. package/dist/ai/llmprompts/userPrompts/userPrompt.js +1 -0
  14. package/dist/automation/actions/executor.d.ts +4 -0
  15. package/dist/automation/actions/executor.js +20 -0
  16. package/dist/automation/actions/interaction/clear/clear.js +1 -1
  17. package/dist/automation/actions/interaction/clear/clearAndEnter.js +1 -1
  18. package/dist/automation/actions/interaction/click/click.js +10 -3
  19. package/dist/automation/actions/interaction/click/clickNtimes.js +1 -1
  20. package/dist/automation/actions/interaction/click/doubleClick.js +1 -1
  21. package/dist/automation/actions/interaction/click/rightClick.js +1 -1
  22. package/dist/automation/actions/interaction/elementlessActions/getOtp.d.ts +2 -0
  23. package/dist/automation/actions/interaction/elementlessActions/getOtp.js +101 -0
  24. package/dist/automation/actions/interaction/enterActions/enterInput.js +11 -6
  25. package/dist/automation/actions/interaction/enterActions/enterInputAndPress.js +2 -2
  26. package/dist/automation/actions/interaction/enterActions/enterusingJs.js +2 -2
  27. package/dist/automation/actions/interaction/enterActions/waitAndEnter.js +1 -1
  28. package/dist/automation/actions/interaction/upload/uploadfile.js +1 -1
  29. package/dist/automation/actions/interaction/verify/VerifyNavigateURL.js +38 -11
  30. package/dist/automation/actions/interface/FireFlinkResponseSchema.d.ts +12 -0
  31. package/dist/automation/actions/interface/FireFlinkResponseSchema.js +19 -3
  32. package/dist/automation/actions/interface/getOtpInterface.d.ts +15 -0
  33. package/dist/automation/actions/interface/getOtpInterface.js +2 -0
  34. package/dist/automation/browserSession/initiateBrowserSession.d.ts +1 -1
  35. package/dist/automation/browserSession/initiateBrowserSession.js +15 -7
  36. package/dist/automation/driverState.d.ts +2 -0
  37. package/dist/automation/driverState.js +4 -0
  38. package/dist/automation/mobileSession/initiateMobileSession.d.ts +4 -5
  39. package/dist/automation/mobileSession/initiateMobileSession.js +83 -19
  40. package/dist/core/constants/allAction.js +5 -1
  41. package/dist/core/constants/supportedActions.js +5 -2
  42. package/dist/core/interfaces/actionInterface.d.ts +4 -0
  43. package/dist/core/interfaces/browserConfigurationInterface.d.ts +0 -4
  44. package/dist/core/interfaces/browserConfigurationInterface.js +0 -1
  45. package/dist/core/interfaces/executionDetails.d.ts +6 -3
  46. package/dist/core/interfaces/fireflinkScriptPayloadInterface.d.ts +22 -16
  47. package/dist/core/interfaces/llmResponseInterface.d.ts +1 -0
  48. package/dist/core/interfaces/promptInterface.d.ts +1 -0
  49. package/dist/core/main/SessionManager.d.ts +9 -0
  50. package/dist/core/main/SessionManager.js +23 -0
  51. package/dist/core/main/actionHandlerFactory.js +261 -64
  52. package/dist/core/main/executionContext.d.ts +7 -1
  53. package/dist/core/main/executionContext.js +93 -3
  54. package/dist/core/main/runAutomationScript.d.ts +1 -0
  55. package/dist/core/main/runAutomationScript.js +912 -304
  56. package/dist/core/main/stepProcessor.js +7 -2
  57. package/dist/core/types/browserType.d.ts +3 -3
  58. package/dist/core/types/browserType.js +2 -2
  59. package/dist/core/types/messageType.d.ts +13 -0
  60. package/dist/core/types/messageType.js +15 -0
  61. package/dist/core/types/promptType.d.ts +2 -1
  62. package/dist/core/types/promptType.js +1 -0
  63. package/dist/domAnalysis/searchBest.js +15 -16
  64. package/dist/domAnalysis/simplifyAndFlatten.js +6 -4
  65. package/dist/fireflinkData/fireflinkLocators/getListOfLocators.d.ts +3 -0
  66. package/dist/fireflinkData/fireflinkLocators/getListOfLocators.js +23 -15
  67. package/dist/fireflinkData/fireflinkLocators/parser/getElementsFromHTML.d.ts +3 -3
  68. package/dist/fireflinkData/fireflinkLocators/parser/getElementsFromHTML.js +134 -118
  69. package/dist/fireflinkData/fireflinkLocators/types/locator.d.ts +11 -1
  70. package/dist/fireflinkData/fireflinkLocators/utils/androidSelector.d.ts +1 -1
  71. package/dist/fireflinkData/fireflinkLocators/utils/androidSelector.js +35 -9
  72. package/dist/fireflinkData/fireflinkLocators/utils/cssSelector.d.ts +10 -10
  73. package/dist/fireflinkData/fireflinkLocators/utils/cssSelector.js +56 -59
  74. package/dist/fireflinkData/fireflinkLocators/utils/iosSelector.d.ts +1 -1
  75. package/dist/fireflinkData/fireflinkLocators/utils/iosSelector.js +53 -29
  76. package/dist/fireflinkData/fireflinkLocators/utils/referenceXpath.d.ts +8 -8
  77. package/dist/fireflinkData/fireflinkLocators/utils/referenceXpath.js +113 -190
  78. package/dist/fireflinkData/fireflinkLocators/utils/xpath.d.ts +17 -26
  79. package/dist/fireflinkData/fireflinkLocators/utils/xpath.js +314 -786
  80. package/dist/fireflinkData/fireflinkLocators/utils/xpathHelpers.d.ts +68 -70
  81. package/dist/fireflinkData/fireflinkLocators/utils/xpathHelpers.js +498 -517
  82. package/dist/fireflinkData/fireflinkScript/appendScriptData.d.ts +1 -1
  83. package/dist/fireflinkData/fireflinkScript/appendScriptData.js +5 -8
  84. package/dist/fireflinkData/fireflinkScript/scriptGenrationData.d.ts +2 -2
  85. package/dist/fireflinkData/fireflinkScript/scriptGenrationData.js +17 -27
  86. package/dist/llmConfig/llmConfiguration.js +13 -6
  87. package/dist/service/api/fireflinkApi.service.d.ts +1 -1
  88. package/dist/service/api/fireflinkApi.service.js +1 -2
  89. package/dist/service/fireflink.service.d.ts +3 -3
  90. package/dist/service/fireflink.service.js +23 -21
  91. package/dist/service/kafka/fireflinkKafka.service.d.ts +1 -2
  92. package/dist/service/kafka/fireflinkKafka.service.js +6 -4
  93. package/dist/tests/test12.d.ts +0 -1
  94. package/dist/tests/test12.js +65 -78
  95. package/dist/tests/testkaf.d.ts +0 -1
  96. package/dist/tests/testkaf.js +51 -55
  97. package/dist/utils/InstancesDetails/getInstancesInfo.js +1 -1
  98. package/dist/utils/browserCap/capability.d.ts +5 -1
  99. package/dist/utils/browserCap/capability.js +91 -15
  100. package/dist/utils/helpers/domSanitizer.d.ts +1 -0
  101. package/dist/utils/helpers/domSanitizer.js +9 -0
  102. package/dist/utils/helpers/enterActionHelper.js +23 -4
  103. package/dist/utils/helpers/xpathcreation.js +2 -2
  104. package/dist/utils/javascript/jsFindElement.d.ts +1 -1
  105. package/dist/utils/javascript/jsFindElement.js +2 -2
  106. package/dist/utils/newTab/newTabTracker.js +18 -6
  107. package/dist/utils/workers/LocatorWorkerInterface.d.ts +22 -0
  108. package/dist/utils/workers/LocatorWorkerInterface.js +2 -0
  109. package/dist/utils/workers/LocatorWorkerPool.d.ts +13 -0
  110. package/dist/utils/workers/LocatorWorkerPool.js +89 -0
  111. package/dist/utils/workers/locatorWorker.d.ts +1 -0
  112. package/dist/utils/workers/locatorWorker.js +44 -0
  113. 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): void;
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
- if (ffElement?.locators?.length >= 1) {
25
- locators = ffElement.locators;
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 queue;
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.queue = [];
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 this.retry(async () => {
17
- const item = await task();
18
- item.elementsData?.forEach(element => {
19
- element.platform = (0, platformSyntax_js_1.getPlatformSyntax)(element.platform);
20
- });
21
- this.process(item, index);
22
- }, 3);
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
- const workers = [];
45
- while (this.queue.length > 0 || workers.length > 0) {
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: groq_1.createGroq,
12
- DefaultFireFlink: groq_1.createGroq,
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
- return providerFactory({
43
- apiKey: aiInfo.apiKey,
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(headers: Record<string, string>, url: string): Promise<any>;
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(headers, url) {
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, IKafkaPayload } from "../core/interfaces/fireflinkScriptPayloadInterface.js";
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, token: string, serverHost: string, licenseId: string): Promise<any>;
7
- produceMessageToKafka(kafkaArgs: IKafkaPayload): Promise<void>;
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, token, serverHost, licenseId) {
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
- try {
21
- const finalResult = await this.apiService.getInstancesDetailsApi(headers, url);
22
- if (finalResult) {
23
- logData_js_1.logger.info("Successfully submitted automation script to FireFlink API.");
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
- else {
26
- throw new Error("FireFlink API responded with an error: " + JSON.stringify(finalResult));
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: IKafkaPayload): Promise<void>;
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: 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) {
@@ -1 +0,0 @@
1
- export {};
@@ -1,79 +1,66 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const index_js_1 = require("../index.js");
4
- const kafkajs_1 = require("kafkajs");
5
- const kafka = new kafkajs_1.Kafka({
6
- clientId: "automation-service",
7
- brokers: ["127.0.0.1:9092"],
8
- });
9
- const runner = new index_js_1.AutomationRunner();
10
- runner.run({
11
- userStory: [
12
- ["Open browser"],
13
- ["Navigate to https://www.saucedemo.com/"],
14
- ["Maximize the browser"],
15
- ["Enter Username", "standard_user"],
16
- ["Enter Password", "secret_sauce"],
17
- ["Click on Login"],
18
- ["Click on Add to cart button of Sauce Labs Bike Light"],
19
- ["Click on Shopping cart icon"],
20
- ["Click on Checkout"],
21
- ["Enter First Name", "Jai"],
22
- ["Enter Last Name", "Akash"],
23
- ["Enter Zip/Postal Code", "560004"],
24
- ["Scroll until Continue button is displayed"],
25
- ["Click on Continue"],
26
- ["Click on Finish"],
27
- ["Click on Back Home"],
28
- ["Close browser"]
29
- ],
30
- platform: "web",
31
- pageDetails: {
32
- Web: {
33
- pageId: "PAG73a7a0ad-c092-4351-8a93-68647f60e343",
34
- pageName: "ai-Page"
35
- }
36
- },
37
- sessionPath: "./session",
38
- env: "",
39
- broker: ["app.v3.fireflink.com:9092"],
40
- sslConfig: "",
41
- serverHost: "https://app.v3.fireflink.com",
42
- webSocketId: "",
43
- generatedBy: "",
44
- licenseType: "C-Professional",
45
- licenseId: "LIC1026612",
46
- userId: "USR10150300",
47
- projectType: "Web",
48
- browser: {
49
- browserName: "Microsoft Edge",
50
- },
51
- serverData: {},
52
- version: "asdfg",
53
- type: "sdfg",
54
- scriptName: "url",
55
- scriptType: "android",
56
- projectId: "PJT1001",
57
- testCaseId: "SCR1208",
58
- promptId: "3f6e123c-8ec6-47c1-90e1-1a2f53b49251",
59
- userName: "default-user",
60
- appiumPort: 0,
61
- platformVersion: "",
62
- realDeviceId: "",
63
- isTerminate: false,
64
- isCloud: false,
65
- cloudConfig: {
66
- accessKey: "yfAa_w199cJge2Gezsgb2Jnu7hKdqER1tExY5kKvgSvXfi1lRUelFsbTFI5pMq7zQuwwNXXnsLTkjKhvWcKDWsUoGLi9KjUV6gbUNDhqj0jWYFyW9h_0LIDEg5qXigwZdqzQqAvWwHin3gBhzGndeROtixv_VFhnseGSWRAHTajZzE-Zl0d8BP6gl0TEBUfoNgqBtAQVDLP6wAQzPfcyjjGFsdHkXWeHFkKmA78D7rKlnNuN2WgjIUlhYheDRDeqZ98Ig_PyS1GbUvjwJ73L38sr_cD4Y9lrKyWJV-m5RmtKhmkqRM8uk5gEfjzgwy30",
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: "Windows 11",
76
- browserVersion: "146"
77
- },
78
- token: "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJNTnNvS1VYQkxLS3BPblpWUUxaZWhwcGhobHdJSldCYUF4dDRkaXMwNlcwIn0.eyJleHAiOjE3ODA0Njk3OTEsImlhdCI6MTc4MDM4MzM5MSwianRpIjoib25ydHJvOjc3YjJjZDNmLWQwOTMtNDA3Yy04ODk1LTVmMWQ3NTIyMjE3NSIsImlzcyI6Imh0dHBzOi8vYXBwLnYzLmZpcmVmbGluay5jb206MzAxMDEvcmVhbG1zL0ZpcmVGbGluayIsImF1ZCI6InRhcmdldC1jbGllbnQiLCJzdWIiOiJmOjg4OTI5YjAwLTczYjgtNDc0Zi1iYmJjLWRiMmUxYTNlMDc5ODpyYXNobWkudEBmaXJlZmxpbmsuY29tIiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiZmxpbmstc2VydmljZSIsInNpZCI6ImUzNjE2MzFiLWJkMjItNGZiMS1hOWY1LTQ4YzU3MjQ0NWNhNCIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiIl0sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJzY29wZSI6InByb2ZpbGUgZW1haWwiLCJjdXJyZW50TGljZW5zZUlkIjoiTElDMjYxMTAiLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsImN1cnJlbnRQcml2aWxlZ2UiOiJBZG1pbiIsImZ1bGxOYW1lIjoiUmFzaG1pIiwiYWN0aXZhdGlvblN0YXR1cyI6IkFDVElWRSIsInByaXZpbGVnZSI6IkFkbWluIiwibGljZW5zZU5hbWUiOiJGaXJlZmxpbmtfQnVsay1MSUMyNjExMCIsInByZWZlcnJlZF91c2VybmFtZSI6IlJhc2htaSIsInVzZXJOYW1lIjoicmFzaG1pLnRAZmlyZWZsaW5rLmNvbSIsImJpbGxpbmdDeWNsZSI6IlllYXJseSIsImlkIjoiVVNSMTAxNTAzMTQiLCJsaWNlbnNlSWQiOiJMSUMyNjExMCIsImVtYWlsIjoicmFzaG1pLnRAZmlyZWZsaW5rLmNvbSJ9.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
+ // token: "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJNTnNvS1VYQkxLS3BPblpWUUxaZWhwcGhobHdJSldCYUF4dDRkaXMwNlcwIn0.eyJleHAiOjE3ODA0Njk3OTEsImlhdCI6MTc4MDM4MzM5MSwianRpIjoib25ydHJvOjc3YjJjZDNmLWQwOTMtNDA3Yy04ODk1LTVmMWQ3NTIyMjE3NSIsImlzcyI6Imh0dHBzOi8vYXBwLnYzLmZpcmVmbGluay5jb206MzAxMDEvcmVhbG1zL0ZpcmVGbGluayIsImF1ZCI6InRhcmdldC1jbGllbnQiLCJzdWIiOiJmOjg4OTI5YjAwLTczYjgtNDc0Zi1iYmJjLWRiMmUxYTNlMDc5ODpyYXNobWkudEBmaXJlZmxpbmsuY29tIiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiZmxpbmstc2VydmljZSIsInNpZCI6ImUzNjE2MzFiLWJkMjItNGZiMS1hOWY1LTQ4YzU3MjQ0NWNhNCIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiIl0sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJzY29wZSI6InByb2ZpbGUgZW1haWwiLCJjdXJyZW50TGljZW5zZUlkIjoiTElDMjYxMTAiLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsImN1cnJlbnRQcml2aWxlZ2UiOiJBZG1pbiIsImZ1bGxOYW1lIjoiUmFzaG1pIiwiYWN0aXZhdGlvblN0YXR1cyI6IkFDVElWRSIsInByaXZpbGVnZSI6IkFkbWluIiwibGljZW5zZU5hbWUiOiJGaXJlZmxpbmtfQnVsay1MSUMyNjExMCIsInByZWZlcnJlZF91c2VybmFtZSI6IlJhc2htaSIsInVzZXJOYW1lIjoicmFzaG1pLnRAZmlyZWZsaW5rLmNvbSIsImJpbGxpbmdDeWNsZSI6IlllYXJseSIsImlkIjoiVVNSMTAxNTAzMTQiLCJsaWNlbnNlSWQiOiJMSUMyNjExMCIsImVtYWlsIjoicmFzaG1pLnRAZmlyZWZsaW5rLmNvbSJ9.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
+ // });
@@ -1 +0,0 @@
1
- export {};
@@ -1,56 +1,52 @@
1
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
- const fireflinkKafka_service_js_1 = require("../service/kafka/fireflinkKafka.service.js");
7
- const path_1 = __importDefault(require("path"));
8
- const fs_1 = __importDefault(require("fs"));
9
- const certPath = path_1.default.join("D:", "Bitbucket", "automationV2", "Certificates", "certificate.crt");
10
- const ssl = {
11
- ca: [fs_1.default.readFileSync(certPath, "utf-8")],
12
- rejectUnauthorized: false,
13
- };
14
- const inst = new fireflinkKafka_service_js_1.KafkaProducerService(["test.fireflink.com:9222"], ssl);
15
- let payload = {
16
- topic: `Topic-FIREFLINK-api-requests-test3`,
17
- message: {
18
- "stepData": [{
19
- "nlpName": "OpenBrowser",
20
- "elementsData": [],
21
- "stepInputs": []
22
- }
23
- ],
24
- "type": "web",
25
- "scriptName": "NLPList6",
26
- "version": "",
27
- "scriptType": "Web & Mobile (Android & iOS)",
28
- "projectId": "PJT1041",
29
- "testCaseId": "SCR1930",
30
- "promptId": "1f348fb3-b0f6-4eb4-b9a0-6c6cc33fea68",
31
- "pageDetails": {
32
- "Web": {
33
- "pageId": "PAG025b6c68-9a55-46da-b353-0894f29c7f27",
34
- "pageName": "ai-Page"
35
- },
36
- "Android": {
37
- "pageId": "PAGb830f55d-077a-4d09-ae71-91fece6b0011",
38
- "pageName": "ai-Android-Page"
39
- },
40
- "iOS": {
41
- "pageId": "PAGcbb751fe-f056-4a09-a2ba-64c1092b5f89",
42
- "pageName": "ai-Ios-Page"
43
- }
44
- },
45
- "generatedBy": "",
46
- "webSocketId": "",
47
- "licenseType": "C-Professional",
48
- "licenseId": "LIC3916",
49
- "userId": "USR26696",
50
- "projectType": "Web & Mobile",
51
- "topic": "Topic-FIREFLINK-api-requests-performances",
52
- "serverHost": "https://performances.fireflink.com",
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?.visionKey,
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;