@airtop/sdk 1.0.0-alpha2.19 → 1.0.0-alpha2.20

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/index.cjs CHANGED
@@ -9,7 +9,7 @@ var require_package = __commonJS({
9
9
  module.exports = {
10
10
  name: "@airtop/sdk",
11
11
  description: "Airtop SDK for TypeScript",
12
- version: "1.0.0-alpha2.19",
12
+ version: "1.0.0-alpha2.20",
13
13
  type: "module",
14
14
  main: "./dist/index.cjs",
15
15
  module: "./dist/index.js",
@@ -38,34 +38,35 @@ var require_package = __commonJS({
38
38
  "agentic"
39
39
  ],
40
40
  scripts: {
41
- "build:second-stage": "tsup src/index.ts",
42
41
  "test:e2e": "vitest --run",
43
42
  "build:dev": "node_modules/.bin/hash-runner",
43
+ build: "tsup src/index.ts",
44
44
  clean: "rm -rf .turbo node_modules dist",
45
- lint: "biome check --write --unsafe src && biome format src --write && biome lint src --fix",
45
+ lint: "biome check --no-errors-on-unmatched --write --unsafe src",
46
+ "lint:staged": "biome check --no-errors-on-unmatched --write --unsafe --staged src",
46
47
  "verify-types": "tsc --noEmit"
47
48
  },
48
49
  dependencies: {
49
50
  "@airtop/json-schema-adapter": "workspace:*",
50
- "@airtop/core": "0.1.0-alpha.34",
51
+ "@airtop/core": "0.1.0-alpha.36",
51
52
  "date-fns": "4.1.0",
52
- loglayer: "6.3.3",
53
+ loglayer: "6.6.0",
53
54
  "serialize-error": "12.0.0",
54
55
  uuid: "11.1.0"
55
56
  },
56
57
  devDependencies: {
57
- "@biomejs/biome": "1.9.4",
58
- "@dotenvx/dotenvx": "1.39.0",
58
+ "@biomejs/biome": "2.1.2",
59
+ "@dotenvx/dotenvx": "1.48.0",
59
60
  "@internal/tsconfig": "workspace:*",
60
61
  "deep-utility-types": "1.3.1",
61
62
  "env-var": "7.5.0",
62
63
  "hash-runner": "2.0.1",
63
64
  nanoid: "5.1.5",
64
- tsup: "8.4.0",
65
- typescript: "5.8.2",
65
+ tsup: "8.5.0",
66
+ typescript: "5.8.3",
66
67
  "utility-types": "3.11.0",
67
68
  uuid: "11.1.0",
68
- vitest: "3.1.1",
69
+ vitest: "3.2.4",
69
70
  zod: "*"
70
71
  },
71
72
  bugs: "https://github.com/airtop-ai/airtop-sdk/issues",
@@ -79,7 +80,7 @@ var require_package = __commonJS({
79
80
  optionalDependencies: {
80
81
  "@airtop/json-schema-adapter-zod": "workspace:*"
81
82
  },
82
- packageManager: "pnpm@10.5.0"
83
+ packageManager: "pnpm@10.12.4"
83
84
  };
84
85
  }
85
86
  });
@@ -1532,49 +1533,96 @@ var AirtopClient = class extends AirtopBase {
1532
1533
  }
1533
1534
  };
1534
1535
 
1535
- // src/window/AirtopWindowClient.types.ts
1536
- var WindowNavigateDirection = /* @__PURE__ */ ((WindowNavigateDirection2) => {
1537
- WindowNavigateDirection2["BACK"] = "backward";
1538
- WindowNavigateDirection2["FORWARD"] = "forward";
1539
- return WindowNavigateDirection2;
1540
- })(WindowNavigateDirection || {});
1536
+ // src/AirtopMocks.ts
1541
1537
 
1542
- // src/plugin/AirtopPlugin.types.ts
1543
- var AirtopPluginAugmentationType = /* @__PURE__ */ ((AirtopPluginAugmentationType2) => {
1544
- AirtopPluginAugmentationType2["AirtopClient"] = "AirtopClient";
1545
- AirtopPluginAugmentationType2["AirtopWindowClient"] = "AirtopWindowClient";
1546
- AirtopPluginAugmentationType2["AirtopWindow"] = "AirtopWindow";
1547
- AirtopPluginAugmentationType2["AirtopSessionClient"] = "AirtopSessionClient";
1548
- AirtopPluginAugmentationType2["AirtopSession"] = "AirtopSession";
1549
- AirtopPluginAugmentationType2["AirtopWindowScreenshot"] = "AirtopWindowScreenshot";
1550
- return AirtopPluginAugmentationType2;
1551
- })(AirtopPluginAugmentationType || {});
1552
1538
 
1553
- // src/plugin/AirtopPlugin.ts
1554
- function registerAirtopPlugin(plugin) {
1555
- for (const pluginToAdd of plugin.pluginsToAdd) {
1556
- switch (pluginToAdd.augmentationType) {
1557
- case "AirtopClient" /* AirtopClient */:
1558
- pluginToAdd.augment(AirtopClient.prototype);
1559
- break;
1560
- case "AirtopSessionClient" /* AirtopSessionClient */:
1561
- pluginToAdd.augment(AirtopSessionClient.prototype);
1562
- break;
1563
- case "AirtopSession" /* AirtopSession */:
1564
- pluginToAdd.augment(AirtopSession.prototype);
1565
- break;
1566
- case "AirtopWindowClient" /* AirtopWindowClient */:
1567
- pluginToAdd.augment(AirtopWindowClient.prototype);
1568
- break;
1569
- case "AirtopWindow" /* AirtopWindow */:
1570
- pluginToAdd.augment(AirtopWindow.prototype);
1571
- break;
1572
- case "AirtopWindowScreenshot" /* AirtopWindowScreenshot */:
1573
- pluginToAdd.augment(AirtopWindowScreenshot.prototype);
1574
- break;
1539
+ var _uuid = require('uuid');
1540
+ function createNoOpClient(client) {
1541
+ return new Proxy(client, {
1542
+ get(target, prop) {
1543
+ const value = Reflect.get(target, prop);
1544
+ if (typeof value === "function") {
1545
+ return async () => ({
1546
+ data: {},
1547
+ meta: {},
1548
+ warnings: [],
1549
+ errors: []
1550
+ });
1551
+ }
1552
+ if (value && typeof value === "object" && !Array.isArray(value)) {
1553
+ return createNoOpClient(value);
1554
+ }
1555
+ return value;
1575
1556
  }
1576
- }
1557
+ });
1558
+ }
1559
+ function generateCommonAirtopConfigMock() {
1560
+ const client = new (0, _core.Airtop)({
1561
+ apiKey: "test-api-key"
1562
+ });
1563
+ return {
1564
+ log: new (0, _loglayer.MockLogLayer)(),
1565
+ client: createNoOpClient(client)
1566
+ };
1577
1567
  }
1568
+ var AirtopMocks = class {
1569
+ /**
1570
+ * Creates an AirtopBase instance (the class used as the base for other Airtop classes) with a mock client and logger.
1571
+ */
1572
+ static getAirtopBaseMock(config = {}) {
1573
+ return new AirtopBase({
1574
+ ...generateCommonAirtopConfigMock(),
1575
+ ...config
1576
+ });
1577
+ }
1578
+ /**
1579
+ * Creates an Airtop instance with a mock client and data.
1580
+ */
1581
+ static getAirtopClientMock(config = {}) {
1582
+ const client = new AirtopClient({
1583
+ apiKey: "test-api-key",
1584
+ ...config
1585
+ });
1586
+ const mocks = generateCommonAirtopConfigMock();
1587
+ client["log"] = mocks.log;
1588
+ client["client"] = mocks.client;
1589
+ return client;
1590
+ }
1591
+ /**
1592
+ * Creates an AirtopSession instance with a mock client and data.
1593
+ */
1594
+ static getAirtopSessionMock(responseData = {}) {
1595
+ return new AirtopSession(generateCommonAirtopConfigMock(), {
1596
+ data: {
1597
+ id: _uuid.v4.call(void 0, ),
1598
+ configuration: {},
1599
+ chromedriverUrl: "http://localhost:9515",
1600
+ status: "active"
1601
+ },
1602
+ meta: {},
1603
+ warnings: [],
1604
+ ...responseData
1605
+ });
1606
+ }
1607
+ /**
1608
+ * Creates an AirtopWindow instance with a mock client and data.
1609
+ */
1610
+ static getAirtopWindowMock({
1611
+ sessionId,
1612
+ windowData
1613
+ } = {}) {
1614
+ return new AirtopWindow(generateCommonAirtopConfigMock(), sessionId || _uuid.v4.call(void 0, ), {
1615
+ data: {
1616
+ targetId: _uuid.v4.call(void 0, ),
1617
+ windowId: _uuid.v4.call(void 0, ),
1618
+ liveViewUrl: "http://localhost:4567"
1619
+ },
1620
+ meta: {},
1621
+ warnings: [],
1622
+ ...windowData || {}
1623
+ });
1624
+ }
1625
+ };
1578
1626
 
1579
1627
  // src/agent/AirtopAgentClient.ts
1580
1628
  var _process = require('process');
@@ -1582,7 +1630,6 @@ var _process = require('process');
1582
1630
 
1583
1631
 
1584
1632
 
1585
-
1586
1633
  var AirtopAgentClient = class extends AirtopBase {
1587
1634
  /**
1588
1635
  * Creates a new instance of the Airtop SDK.
@@ -1759,96 +1806,49 @@ var AirtopAgentClient = class extends AirtopBase {
1759
1806
  }
1760
1807
  };
1761
1808
 
1762
- // src/AirtopMocks.ts
1809
+ // src/window/AirtopWindowClient.types.ts
1810
+ var WindowNavigateDirection = /* @__PURE__ */ ((WindowNavigateDirection2) => {
1811
+ WindowNavigateDirection2["BACK"] = "backward";
1812
+ WindowNavigateDirection2["FORWARD"] = "forward";
1813
+ return WindowNavigateDirection2;
1814
+ })(WindowNavigateDirection || {});
1763
1815
 
1816
+ // src/plugin/AirtopPlugin.types.ts
1817
+ var AirtopPluginAugmentationType = /* @__PURE__ */ ((AirtopPluginAugmentationType2) => {
1818
+ AirtopPluginAugmentationType2["AirtopClient"] = "AirtopClient";
1819
+ AirtopPluginAugmentationType2["AirtopWindowClient"] = "AirtopWindowClient";
1820
+ AirtopPluginAugmentationType2["AirtopWindow"] = "AirtopWindow";
1821
+ AirtopPluginAugmentationType2["AirtopSessionClient"] = "AirtopSessionClient";
1822
+ AirtopPluginAugmentationType2["AirtopSession"] = "AirtopSession";
1823
+ AirtopPluginAugmentationType2["AirtopWindowScreenshot"] = "AirtopWindowScreenshot";
1824
+ return AirtopPluginAugmentationType2;
1825
+ })(AirtopPluginAugmentationType || {});
1764
1826
 
1765
- var _uuid = require('uuid');
1766
- function createNoOpClient(client) {
1767
- return new Proxy(client, {
1768
- get(target, prop) {
1769
- const value = Reflect.get(target, prop);
1770
- if (typeof value === "function") {
1771
- return async () => ({
1772
- data: {},
1773
- meta: {},
1774
- warnings: [],
1775
- errors: []
1776
- });
1777
- }
1778
- if (value && typeof value === "object" && !Array.isArray(value)) {
1779
- return createNoOpClient(value);
1780
- }
1781
- return value;
1827
+ // src/plugin/AirtopPlugin.ts
1828
+ function registerAirtopPlugin(plugin) {
1829
+ for (const pluginToAdd of plugin.pluginsToAdd) {
1830
+ switch (pluginToAdd.augmentationType) {
1831
+ case "AirtopClient" /* AirtopClient */:
1832
+ pluginToAdd.augment(AirtopClient.prototype);
1833
+ break;
1834
+ case "AirtopSessionClient" /* AirtopSessionClient */:
1835
+ pluginToAdd.augment(AirtopSessionClient.prototype);
1836
+ break;
1837
+ case "AirtopSession" /* AirtopSession */:
1838
+ pluginToAdd.augment(AirtopSession.prototype);
1839
+ break;
1840
+ case "AirtopWindowClient" /* AirtopWindowClient */:
1841
+ pluginToAdd.augment(AirtopWindowClient.prototype);
1842
+ break;
1843
+ case "AirtopWindow" /* AirtopWindow */:
1844
+ pluginToAdd.augment(AirtopWindow.prototype);
1845
+ break;
1846
+ case "AirtopWindowScreenshot" /* AirtopWindowScreenshot */:
1847
+ pluginToAdd.augment(AirtopWindowScreenshot.prototype);
1848
+ break;
1782
1849
  }
1783
- });
1784
- }
1785
- function generateCommonAirtopConfigMock() {
1786
- const client = new (0, _core.Airtop)({
1787
- apiKey: "test-api-key"
1788
- });
1789
- return {
1790
- log: new (0, _loglayer.MockLogLayer)(),
1791
- client: createNoOpClient(client)
1792
- };
1793
- }
1794
- var AirtopMocks = class {
1795
- /**
1796
- * Creates an AirtopBase instance (the class used as the base for other Airtop classes) with a mock client and logger.
1797
- */
1798
- static getAirtopBaseMock(config = {}) {
1799
- return new AirtopBase({
1800
- ...generateCommonAirtopConfigMock(),
1801
- ...config
1802
- });
1803
- }
1804
- /**
1805
- * Creates an Airtop instance with a mock client and data.
1806
- */
1807
- static getAirtopClientMock(config = {}) {
1808
- const client = new AirtopClient({
1809
- apiKey: "test-api-key",
1810
- ...config
1811
- });
1812
- const mocks = generateCommonAirtopConfigMock();
1813
- client["log"] = mocks.log;
1814
- client["client"] = mocks.client;
1815
- return client;
1816
- }
1817
- /**
1818
- * Creates an AirtopSession instance with a mock client and data.
1819
- */
1820
- static getAirtopSessionMock(responseData = {}) {
1821
- return new AirtopSession(generateCommonAirtopConfigMock(), {
1822
- data: {
1823
- id: _uuid.v4.call(void 0, ),
1824
- configuration: {},
1825
- chromedriverUrl: "http://localhost:9515",
1826
- status: "active"
1827
- },
1828
- meta: {},
1829
- warnings: [],
1830
- ...responseData
1831
- });
1832
1850
  }
1833
- /**
1834
- * Creates an AirtopWindow instance with a mock client and data.
1835
- */
1836
- static getAirtopWindowMock({
1837
- sessionId,
1838
- windowData
1839
- } = {}) {
1840
- return new AirtopWindow(generateCommonAirtopConfigMock(), sessionId || _uuid.v4.call(void 0, ), {
1841
- data: {
1842
- targetId: _uuid.v4.call(void 0, ),
1843
- windowId: _uuid.v4.call(void 0, ),
1844
- liveViewUrl: "http://localhost:4567"
1845
- },
1846
- meta: {},
1847
- warnings: [],
1848
- ...windowData || {}
1849
- });
1850
- }
1851
- };
1851
+ }
1852
1852
 
1853
1853
 
1854
1854