@airtop/sdk 1.0.0-alpha2.21 → 1.0.0-alpha2.23

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.21",
12
+ version: "1.0.0-alpha2.23",
13
13
  type: "module",
14
14
  main: "./dist/index.cjs",
15
15
  module: "./dist/index.js",
@@ -48,19 +48,19 @@ var require_package = __commonJS({
48
48
  },
49
49
  dependencies: {
50
50
  "@airtop/json-schema-adapter": "workspace:*",
51
- "@airtop/core": "0.1.0-alpha.37",
51
+ "@airtop/core": "0.1.0-alpha.39",
52
52
  "date-fns": "4.1.0",
53
53
  loglayer: "6.6.0",
54
54
  "serialize-error": "12.0.0",
55
55
  uuid: "11.1.0"
56
56
  },
57
57
  devDependencies: {
58
- "@biomejs/biome": "2.1.3",
58
+ "@biomejs/biome": "2.2.0",
59
59
  "@dotenvx/dotenvx": "1.48.4",
60
60
  "@internal/tsconfig": "workspace:*",
61
61
  "deep-utility-types": "1.3.1",
62
62
  "env-var": "7.5.0",
63
- "hash-runner": "3.1.0",
63
+ "hash-runner": "4.0.0",
64
64
  nanoid: "5.1.5",
65
65
  tsup: "8.5.0",
66
66
  typescript: "5.9.2",
@@ -80,7 +80,7 @@ var require_package = __commonJS({
80
80
  optionalDependencies: {
81
81
  "@airtop/json-schema-adapter-zod": "workspace:*"
82
82
  },
83
- packageManager: "pnpm@10.12.4"
83
+ packageManager: "pnpm@10.14.0"
84
84
  };
85
85
  }
86
86
  });
@@ -1180,12 +1180,13 @@ var AirtopSessionClient = class extends AirtopBase {
1180
1180
  * @param requestOptions - Request options
1181
1181
  * @returns A new AirtopWindow<AirtopWindowCreateResponse> instance
1182
1182
  */
1183
- async createWindow(url, requestOptions = {}) {
1183
+ async createWindow(url, createOptions = {}, requestOptions = {}) {
1184
1184
  this.log.info("Creating window");
1185
1185
  const results = await this.client.windows.create(
1186
1186
  this.sessionId,
1187
1187
  {
1188
- url
1188
+ url,
1189
+ ...createOptions
1189
1190
  },
1190
1191
  this.resolveRequestOptions(requestOptions)
1191
1192
  );
@@ -1693,10 +1694,10 @@ var AirtopAgentClient = class extends AirtopBase {
1693
1694
  };
1694
1695
  }
1695
1696
  /**
1696
- * Creates a new agent.
1697
- * @param params - Parameters for creating the agent. Corresponds to `AirtopAgentCreateAgentParams`.
1697
+ * Creates a new agent. A new draft version is created by default.
1698
+ * @param params - Parameters for creating the agent.
1698
1699
  * @param requestOptions - Request options.
1699
- * @returns The created agent data, `AirtopCreateAgentResponse`.
1700
+ * @returns The created agent data.
1700
1701
  */
1701
1702
  async createAgent(params, requestOptions = {}) {
1702
1703
  this.log.info("Creating agent");
@@ -1706,7 +1707,7 @@ var AirtopAgentClient = class extends AirtopBase {
1706
1707
  * Retrieves a specific agent by its ID.
1707
1708
  * @param agentId - The ID of the agent to retrieve.
1708
1709
  * @param requestOptions - Request options.
1709
- * @returns The agent data, `AirtopGetAgentResponse`.
1710
+ * @returns The agent data.
1710
1711
  */
1711
1712
  async getAgent(agentId, requestOptions = {}) {
1712
1713
  this.log.withMetadata({ agentId }).info("Retrieving agent");
@@ -1714,74 +1715,99 @@ var AirtopAgentClient = class extends AirtopBase {
1714
1715
  }
1715
1716
  /**
1716
1717
  * Lists agents.
1717
- * @param params - Optional parameters for listing agents (e.g., pagination). Corresponds to `AirtopAgentGetAgentsParams`.
1718
+ * @param params - Optional parameters for listing agents (e.g., pagination).
1718
1719
  * @param requestOptions - Request options.
1719
- * @returns A list of agents, `AirtopGetAgentsResponse`.
1720
+ * @returns A list of agents.
1720
1721
  */
1721
1722
  async listAgents(params, requestOptions = {}) {
1722
1723
  this.log.info("Listing agents");
1723
1724
  return this.client.agents.getAgents(params, this.resolveRequestOptions(requestOptions));
1724
1725
  }
1725
1726
  /**
1726
- * Updates an existing agent.
1727
- * @param agentId - The ID of the agent to update.
1728
- * @param params - The new data for the agent. Corresponds to `AirtopAgentUpdateAgentParams`.
1727
+ * Creates a new draft version of an agent. If one already exists, does nothing.
1728
+ * @param agentId - The ID of the agent for which to create a new draft version.
1729
1729
  * @param requestOptions - Request options.
1730
- * @returns The updated agent data, `AirtopUpdateAgentResponse`.
1730
+ * @returns The draft version data.
1731
1731
  */
1732
- async updateAgent(agentId, params, requestOptions = {}) {
1733
- this.log.withMetadata({ agentId }).info("Updating agent");
1734
- return this.client.agents.updateAgent(agentId, params, this.resolveRequestOptions(requestOptions));
1732
+ async createNewAgentDraftVersion(agentId, requestOptions = {}) {
1733
+ this.log.withMetadata({ agentId }).info("Creating new draft version of agent");
1734
+ return this.client.agents.createAgentDraft(agentId, this.resolveRequestOptions(requestOptions));
1735
1735
  }
1736
1736
  /**
1737
- * Deletes one or more agents.
1738
- * @param params - Parameters for deleting agents. Corresponds to `AirtopAgentDeleteAgentsParams`.
1737
+ * Publishes a new version of an agent from the current draft.
1738
+ * @param agentId - The ID of the agent to publish.
1739
+ * @returns The published version data
1740
+ */
1741
+ async publishNewAgentVersion(agentId) {
1742
+ this.log.withMetadata({ agentId }).info("Publishing new version of agent");
1743
+ return this.client.agents.publishAgent(agentId, this.resolveRequestOptions());
1744
+ }
1745
+ /**
1746
+ * Retrieves the data for a specific version of an agent.
1747
+ * @param agentId - The ID of the agent.
1748
+ * @param version - The version number of the agent to retrieve.
1739
1749
  * @param requestOptions - Request options.
1740
- * @returns A response confirming the deletion, `AirtopDeleteAgentsResponse`.
1750
+ * @returns The agent version data.
1741
1751
  */
1742
- async deleteAgents(params, requestOptions = {}) {
1743
- this.log.info("Deleting agent(s)");
1744
- return this.client.agents.deleteAgents(params, this.resolveRequestOptions(requestOptions));
1752
+ async getAgentVersionData(agentId, version3, requestOptions = {}) {
1753
+ this.log.withMetadata({ agentId }).info("Retrieving agent version data");
1754
+ return this.client.agents.getAgentVersion(
1755
+ version3,
1756
+ {
1757
+ id: agentId
1758
+ },
1759
+ this.resolveRequestOptions(requestOptions)
1760
+ );
1761
+ }
1762
+ async updateAgentVersionData(agentId, version3, params, requestOptions = {}) {
1763
+ this.log.withMetadata({ agentId }).info("Updating agent");
1764
+ return this.client.agents.updateAgentVersionData(
1765
+ version3,
1766
+ {
1767
+ id: agentId,
1768
+ ...params
1769
+ },
1770
+ this.resolveRequestOptions(requestOptions)
1771
+ );
1745
1772
  }
1746
1773
  /**
1747
- * Duplicates an agent.
1748
- * @param agentId - The ID of the agent to duplicate.
1749
- * @param params - Parameters for duplicating the agent (e.g., new name). Corresponds to `AirtopAgentDuplicateAgentParams`.
1774
+ * Retrieves the current version data of an agent. This is the version that is currently active or in draft state.
1775
+ * @param agentId - The ID of the agent.
1776
+ * @param params - Optional parameters for retrieving the version data.
1750
1777
  * @param requestOptions - Request options.
1751
- * @returns The duplicated agent data, `AirtopDuplicateAgentResponse`.
1778
+ * @returns The current agent version data
1752
1779
  */
1753
- async duplicateAgent(agentId, params, requestOptions = {}) {
1754
- this.log.withMetadata({ agentId }).info("Duplicating agent");
1755
- return this.client.agents.duplicateAgent(agentId, params, this.resolveRequestOptions(requestOptions));
1780
+ async getCurrentAgentVersionData(agentId, params, requestOptions = {}) {
1781
+ this.log.withMetadata({ agentId }).info("Retrieving current agent version data");
1782
+ return this.client.agents.getCurrentAgentVersion(agentId, params, this.resolveRequestOptions(requestOptions));
1756
1783
  }
1757
1784
  /**
1758
- * Creates a new version for an agent.
1759
- * @param agentId - The ID of the agent for which to create a version.
1760
- * @param params - Parameters for creating the agent version. Corresponds to `AirtopAgentCreateVersionParams`.
1785
+ * Updates an existing agent.
1786
+ * @param agentId - The ID of the agent to update.
1787
+ * @param params - The new data for the agent.
1761
1788
  * @param requestOptions - Request options.
1762
- * @returns The created agent version data, `AirtopCreateAgentVersionResponse`.
1789
+ * @returns The updated agent data.
1763
1790
  */
1764
- async createAgentVersion(agentId, params, requestOptions = {}) {
1765
- this.log.withMetadata({ agentId }).info("Creating agent version");
1766
- return this.client.agents.createVersion(agentId, params, this.resolveRequestOptions(requestOptions));
1791
+ async updateAgent(agentId, params, requestOptions = {}) {
1792
+ this.log.withMetadata({ agentId }).info("Updating agent");
1793
+ return this.client.agents.updateAgent(agentId, params, this.resolveRequestOptions(requestOptions));
1767
1794
  }
1768
1795
  /**
1769
- * Lists versions of an agent.
1770
- * @param agentId - The ID of the agent whose versions to list.
1771
- * @param params - Optional parameters for listing agent versions. Corresponds to `AirtopAgentGetVersionsParams`.
1796
+ * Deletes one or more agents.
1797
+ * @param params - Parameters for deleting agents.
1772
1798
  * @param requestOptions - Request options.
1773
- * @returns A list of agent versions, `AirtopGetAgentVersionsResponse`.
1799
+ * @returns A response confirming the deletion.
1774
1800
  */
1775
- async listAgentVersions(agentId, params, requestOptions = {}) {
1776
- this.log.withMetadata({ agentId }).info("Listing agent versions");
1777
- return this.client.agents.getVersions(agentId, params, this.resolveRequestOptions(requestOptions));
1801
+ async deleteAgents(params, requestOptions = {}) {
1802
+ this.log.info("Deleting agent(s)");
1803
+ return this.client.agents.deleteAgents(params, this.resolveRequestOptions(requestOptions));
1778
1804
  }
1779
1805
  /**
1780
1806
  * Creates an invocation for an agent.
1781
1807
  * @param agentId - The ID of the agent for which to create an invocation.
1782
- * @param params - Parameters for creating the agent invocation. Corresponds to `AirtopAgentCreateInvocationParams`.
1808
+ * @param params - Parameters for creating the agent invocation.
1783
1809
  * @param requestOptions - Request options.
1784
- * @returns The created agent invocation data, `AirtopCreateAgentInvocationResponse`.
1810
+ * @returns The created agent invocation data.
1785
1811
  */
1786
1812
  async createAgentInvocation(agentId, params, requestOptions = {}) {
1787
1813
  this.log.withMetadata({ agentId }).info("Creating agent invocation");
@@ -1790,19 +1816,19 @@ var AirtopAgentClient = class extends AirtopBase {
1790
1816
  /**
1791
1817
  * Lists invocations of an agent.
1792
1818
  * @param agentIds - The ID of the agent whose invocations to list.
1793
- * @param params - Optional parameters for listing agent invocations. Corresponds to `AirtopAgentGetInvocationsParams`.
1819
+ * @param params - Optional parameters for listing agent invocations.
1794
1820
  * @param requestOptions - Request options.
1795
- * @returns A list of agent invocations, `AirtopGetAgentInvocationsResponse`.
1821
+ * @returns A list of agent invocations.
1796
1822
  */
1797
1823
  async listAgentInvocations(agentIds, params, requestOptions = {}) {
1798
- this.log.withMetadata({ agentId: agentIds }).info("Listing agent invocations");
1824
+ this.log.withMetadata({ agentIds }).info("Listing agent invocations");
1799
1825
  return this.client.agents.getInvocations(agentIds, params, this.resolveRequestOptions(requestOptions));
1800
1826
  }
1801
1827
  /**
1802
1828
  * Cancels a specific invocation of an agent.
1803
1829
  * @param agentId - The ID of the agent.
1804
1830
  * @param invocationId - The ID of the invocation to cancel.
1805
- * @param paramsBody - Optional body parameters for cancelling the invocation. Corresponds to `AirtopAgentCancelInvocationParams`.
1831
+ * @param paramsBody - Optional body parameters for cancelling the invocation.
1806
1832
  * @param requestOptions - Request options.
1807
1833
  * @returns A promise that resolves when the operation is complete.
1808
1834
  */