ardent-cli-beta 0.0.15 → 0.0.17

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.
@@ -3,7 +3,10 @@ import { request } from '../api/client.js';
3
3
  export async function listConnectors(token, organizationID, projectID) {
4
4
  const query = new URLSearchParams({ organization_id: organizationID, project_id: projectID });
5
5
  const connectors = await request(token, `/connectors?${query}`);
6
- if (!Array.isArray(connectors) || connectors.some((connector) => !isConnector(connector, projectID))) {
6
+ if (!Array.isArray(connectors) ||
7
+ connectors.some((connector) => !isConnector(connector, projectID)) ||
8
+ new Set(connectors.map(({ id }) => id)).size !== connectors.length ||
9
+ new Set(connectors.map(({ name }) => name)).size !== connectors.length) {
7
10
  throw new Error('Ardent API returned an invalid connectors response.');
8
11
  }
9
12
  return connectors;
@@ -50,6 +53,7 @@ function isConnector(value, projectID) {
50
53
  typeof connector.environment_id === 'string' &&
51
54
  connector.environment_id.length > 0 &&
52
55
  typeof connector.name === 'string' &&
56
+ connector.name.length > 0 &&
53
57
  typeof connector.status === 'string' &&
54
58
  connector.status.length > 0 &&
55
59
  typeof source === 'object' &&
@@ -2,7 +2,10 @@ import { randomUUID } from 'node:crypto';
2
2
  import { request } from '../api/client.js';
3
3
  export async function listProjects(token, organizationID) {
4
4
  const projects = await request(token, `/projects?organization_id=${encodeURIComponent(organizationID)}`);
5
- if (!Array.isArray(projects) || projects.some((project) => !isProject(project, organizationID))) {
5
+ if (!Array.isArray(projects) ||
6
+ projects.some((project) => !isProject(project, organizationID)) ||
7
+ new Set(projects.map(({ id }) => id)).size !== projects.length ||
8
+ new Set(projects.map(({ name }) => name)).size !== projects.length) {
6
9
  throw new Error('Ardent API returned an invalid projects response.');
7
10
  }
8
11
  return projects;
@@ -31,6 +34,7 @@ function isProject(value, organizationID) {
31
34
  project.id.length > 0 &&
32
35
  project.organization_id === organizationID &&
33
36
  typeof project.name === 'string' &&
37
+ project.name.length > 0 &&
34
38
  typeof project.created_at === 'string' &&
35
39
  typeof project.updated_at === 'string');
36
40
  }
@@ -574,5 +574,5 @@
574
574
  ]
575
575
  }
576
576
  },
577
- "version": "0.0.15"
577
+ "version": "0.0.17"
578
578
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ardent-cli-beta",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "description": "The Ardent command-line interface",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",