n8n-nodes-nvk-browser 1.0.71 → 1.0.73

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.
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CreateProfile = void 0;
4
- const ProfileManager_1 = require("../../../utils/ProfileManager");
4
+ const GoLoginApiHelper_1 = require("../../../utils/GoLoginApiHelper");
5
5
  const CreateProfile_description_1 = require("./CreateProfile.description");
6
6
  class CreateProfile {
7
7
  constructor() {
@@ -28,7 +28,7 @@ class CreateProfile {
28
28
  async execute() {
29
29
  const items = this.getInputData();
30
30
  const returnData = [];
31
- // Xử lý test step (items.length === 0) - chạy 1 lần với i = 0
31
+ // Xử lý test step: nếu items.length === 0, chạy 1 lần với i = 0
32
32
  const itemCount = items.length > 0 ? items.length : 1;
33
33
  for (let i = 0; i < itemCount; i++) {
34
34
  try {
@@ -66,8 +66,8 @@ class CreateProfile {
66
66
  payload.proxy = proxy;
67
67
  }
68
68
  // ===== Create profile =====
69
- const profileManager = new ProfileManager_1.ProfileManager(this);
70
- const profile = await profileManager.createProfile(payload);
69
+ const apiHelper = new GoLoginApiHelper_1.GoLoginApiHelper(this);
70
+ const profile = await apiHelper.createProfile(payload);
71
71
  returnData.push({
72
72
  json: {
73
73
  success: true,
@@ -0,0 +1,13 @@
1
+ import type { IExecuteFunctions } from 'n8n-workflow';
2
+ /**
3
+ * Helper class for GoLogin API operations
4
+ * Chỉ dùng cho CreateProfile node - không phụ thuộc vào ProfileManager
5
+ */
6
+ export declare class GoLoginApiHelper {
7
+ private executeFunctions;
8
+ constructor(executeFunctions: IExecuteFunctions);
9
+ /**
10
+ * Create profile via GoLogin API
11
+ */
12
+ createProfile(payload: any): Promise<any>;
13
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GoLoginApiHelper = void 0;
4
+ /**
5
+ * Helper class for GoLogin API operations
6
+ * Chỉ dùng cho CreateProfile node - không phụ thuộc vào ProfileManager
7
+ */
8
+ class GoLoginApiHelper {
9
+ constructor(executeFunctions) {
10
+ this.executeFunctions = executeFunctions;
11
+ }
12
+ /**
13
+ * Create profile via GoLogin API
14
+ */
15
+ async createProfile(payload) {
16
+ try {
17
+ const credentials = await this.executeFunctions.getCredentials('goLoginApi');
18
+ const response = await this.executeFunctions.helpers.request({
19
+ method: 'POST',
20
+ url: 'https://api.gologin.com/browser_profiles',
21
+ headers: {
22
+ Authorization: `Bearer ${credentials.apiToken}`,
23
+ 'Content-Type': 'application/json',
24
+ },
25
+ body: payload,
26
+ json: true,
27
+ });
28
+ return response;
29
+ }
30
+ catch (error) {
31
+ throw new Error(`Failed to create profile via GoLogin API: ${error instanceof Error ? error.message : String(error)}`);
32
+ }
33
+ }
34
+ }
35
+ exports.GoLoginApiHelper = GoLoginApiHelper;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-nvk-browser",
3
- "version": "1.0.71",
3
+ "version": "1.0.73",
4
4
  "description": "n8n nodes for managing Chrome browser profiles and page interactions with Puppeteer automation",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",