@airtop/sdk 1.0.0-alpha2.22 → 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.22",
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",
@@ -1694,10 +1694,10 @@ var AirtopAgentClient = class extends AirtopBase {
1694
1694
  };
1695
1695
  }
1696
1696
  /**
1697
- * Creates a new agent.
1698
- * @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.
1699
1699
  * @param requestOptions - Request options.
1700
- * @returns The created agent data, `AirtopCreateAgentResponse`.
1700
+ * @returns The created agent data.
1701
1701
  */
1702
1702
  async createAgent(params, requestOptions = {}) {
1703
1703
  this.log.info("Creating agent");
@@ -1707,7 +1707,7 @@ var AirtopAgentClient = class extends AirtopBase {
1707
1707
  * Retrieves a specific agent by its ID.
1708
1708
  * @param agentId - The ID of the agent to retrieve.
1709
1709
  * @param requestOptions - Request options.
1710
- * @returns The agent data, `AirtopGetAgentResponse`.
1710
+ * @returns The agent data.
1711
1711
  */
1712
1712
  async getAgent(agentId, requestOptions = {}) {
1713
1713
  this.log.withMetadata({ agentId }).info("Retrieving agent");
@@ -1715,74 +1715,99 @@ var AirtopAgentClient = class extends AirtopBase {
1715
1715
  }
1716
1716
  /**
1717
1717
  * Lists agents.
1718
- * @param params - Optional parameters for listing agents (e.g., pagination). Corresponds to `AirtopAgentGetAgentsParams`.
1718
+ * @param params - Optional parameters for listing agents (e.g., pagination).
1719
1719
  * @param requestOptions - Request options.
1720
- * @returns A list of agents, `AirtopGetAgentsResponse`.
1720
+ * @returns A list of agents.
1721
1721
  */
1722
1722
  async listAgents(params, requestOptions = {}) {
1723
1723
  this.log.info("Listing agents");
1724
1724
  return this.client.agents.getAgents(params, this.resolveRequestOptions(requestOptions));
1725
1725
  }
1726
1726
  /**
1727
- * Updates an existing agent.
1728
- * @param agentId - The ID of the agent to update.
1729
- * @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.
1730
1729
  * @param requestOptions - Request options.
1731
- * @returns The updated agent data, `AirtopUpdateAgentResponse`.
1730
+ * @returns The draft version data.
1732
1731
  */
1733
- async updateAgent(agentId, params, requestOptions = {}) {
1734
- this.log.withMetadata({ agentId }).info("Updating agent");
1735
- 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));
1736
1735
  }
1737
1736
  /**
1738
- * Deletes one or more agents.
1739
- * @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.
1740
1749
  * @param requestOptions - Request options.
1741
- * @returns A response confirming the deletion, `AirtopDeleteAgentsResponse`.
1750
+ * @returns The agent version data.
1742
1751
  */
1743
- async deleteAgents(params, requestOptions = {}) {
1744
- this.log.info("Deleting agent(s)");
1745
- 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
+ );
1746
1772
  }
1747
1773
  /**
1748
- * Duplicates an agent.
1749
- * @param agentId - The ID of the agent to duplicate.
1750
- * @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.
1751
1777
  * @param requestOptions - Request options.
1752
- * @returns The duplicated agent data, `AirtopDuplicateAgentResponse`.
1778
+ * @returns The current agent version data
1753
1779
  */
1754
- async duplicateAgent(agentId, params, requestOptions = {}) {
1755
- this.log.withMetadata({ agentId }).info("Duplicating agent");
1756
- 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));
1757
1783
  }
1758
1784
  /**
1759
- * Creates a new version for an agent.
1760
- * @param agentId - The ID of the agent for which to create a version.
1761
- * @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.
1762
1788
  * @param requestOptions - Request options.
1763
- * @returns The created agent version data, `AirtopCreateAgentVersionResponse`.
1789
+ * @returns The updated agent data.
1764
1790
  */
1765
- async createAgentVersion(agentId, params, requestOptions = {}) {
1766
- this.log.withMetadata({ agentId }).info("Creating agent version");
1767
- 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));
1768
1794
  }
1769
1795
  /**
1770
- * Lists versions of an agent.
1771
- * @param agentId - The ID of the agent whose versions to list.
1772
- * @param params - Optional parameters for listing agent versions. Corresponds to `AirtopAgentGetVersionsParams`.
1796
+ * Deletes one or more agents.
1797
+ * @param params - Parameters for deleting agents.
1773
1798
  * @param requestOptions - Request options.
1774
- * @returns A list of agent versions, `AirtopGetAgentVersionsResponse`.
1799
+ * @returns A response confirming the deletion.
1775
1800
  */
1776
- async listAgentVersions(agentId, params, requestOptions = {}) {
1777
- this.log.withMetadata({ agentId }).info("Listing agent versions");
1778
- 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));
1779
1804
  }
1780
1805
  /**
1781
1806
  * Creates an invocation for an agent.
1782
1807
  * @param agentId - The ID of the agent for which to create an invocation.
1783
- * @param params - Parameters for creating the agent invocation. Corresponds to `AirtopAgentCreateInvocationParams`.
1808
+ * @param params - Parameters for creating the agent invocation.
1784
1809
  * @param requestOptions - Request options.
1785
- * @returns The created agent invocation data, `AirtopCreateAgentInvocationResponse`.
1810
+ * @returns The created agent invocation data.
1786
1811
  */
1787
1812
  async createAgentInvocation(agentId, params, requestOptions = {}) {
1788
1813
  this.log.withMetadata({ agentId }).info("Creating agent invocation");
@@ -1791,19 +1816,19 @@ var AirtopAgentClient = class extends AirtopBase {
1791
1816
  /**
1792
1817
  * Lists invocations of an agent.
1793
1818
  * @param agentIds - The ID of the agent whose invocations to list.
1794
- * @param params - Optional parameters for listing agent invocations. Corresponds to `AirtopAgentGetInvocationsParams`.
1819
+ * @param params - Optional parameters for listing agent invocations.
1795
1820
  * @param requestOptions - Request options.
1796
- * @returns A list of agent invocations, `AirtopGetAgentInvocationsResponse`.
1821
+ * @returns A list of agent invocations.
1797
1822
  */
1798
1823
  async listAgentInvocations(agentIds, params, requestOptions = {}) {
1799
- this.log.withMetadata({ agentId: agentIds }).info("Listing agent invocations");
1824
+ this.log.withMetadata({ agentIds }).info("Listing agent invocations");
1800
1825
  return this.client.agents.getInvocations(agentIds, params, this.resolveRequestOptions(requestOptions));
1801
1826
  }
1802
1827
  /**
1803
1828
  * Cancels a specific invocation of an agent.
1804
1829
  * @param agentId - The ID of the agent.
1805
1830
  * @param invocationId - The ID of the invocation to cancel.
1806
- * @param paramsBody - Optional body parameters for cancelling the invocation. Corresponds to `AirtopAgentCancelInvocationParams`.
1831
+ * @param paramsBody - Optional body parameters for cancelling the invocation.
1807
1832
  * @param requestOptions - Request options.
1808
1833
  * @returns A promise that resolves when the operation is complete.
1809
1834
  */