Skip to content

Commit df5f0d7

Browse files
committed
Updated TS tests to work with latest spec.
1 parent 38b2cbb commit df5f0d7

File tree

4 files changed

+46
-24
lines changed

4 files changed

+46
-24
lines changed

src/ts/package-lock.json

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"preinstall": "npm install typescript"
1717
},
1818
"devDependencies": {
19-
"typescript": "^4.0 || ^5.0"
19+
"typescript": "^5.8.3"
2020
},
2121
"publishConfig": {
2222
"registry": "https://registry.npmjs.org",

tests/ts/tests/connectors.test.ts

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import {
77
PipelinesApi,
88
ResponseError,
99
SourceConnectorType,
10-
AIPlatformType,
11-
DestinationConnectorType
10+
AIPlatformTypeForPipeline,
11+
DestinationConnectorTypeForPipeline
1212
} from "@vectorize-io/vectorize-client";
1313
import {pipeline} from "stream";
1414
import * as os from "node:os";
@@ -64,12 +64,12 @@ async function deployPipeline(pipelinesApi: PipelinesApi, sourceConnectorId: str
6464
sourceConnectors: [{id: sourceConnectorId, type: SourceConnectorType.WebCrawler, config: {}}],
6565
destinationConnector: {
6666
id: destinationConnectorId,
67-
type: DestinationConnectorType.Vectorize,
67+
type: DestinationConnectorTypeForPipeline.Vectorize,
6868
config: {}
6969
},
70-
aiPlatform: {
70+
aiPlatformConnector: {
7171
id: aiPlatformId,
72-
type: AIPlatformType.Vectorize,
72+
type: AIPlatformTypeForPipeline.Vectorize,
7373
config: {}
7474
},
7575
schedule: {type: "manual"}
@@ -93,18 +93,14 @@ describe("connector", () => {
9393
const sourceConnectorId = sourceResponse.connector.id;
9494

9595
// Update source connector
96-
/* ENG-2651
9796
await sourceConnectorsApi.updateSourceConnector({
9897
organizationId: testContext.orgId,
9998
sourceConnectorId,
10099
updateSourceConnectorRequest: {
101100
config: {
102-
"max-urls": 100,
103-
"max-depth": 5
104-
}
101+
"seed-urls": ["https://docs.vectorize.io", "https://vectorize.io/pricing"]}
105102
}
106103
});
107-
*/
108104

109105
// Get all source connectors
110106
let connectors = await sourceConnectorsApi.getSourceConnectors({
@@ -159,15 +155,13 @@ describe("connector", () => {
159155
});
160156
const connectorId = sourceResponse.connector.id;
161157

162-
/* ENG-2651
163158
await aiPlatformConnectorsApi.updateAIPlatformConnector({
164159
organizationId: testContext.orgId,
165-
aiplatformId: connectorId,
160+
aiPlatformConnectorId: connectorId,
166161
updateAIPlatformConnectorRequest: {
167162
config: {"key": "sk"}
168163
}
169164
});
170-
*/
171165

172166
// Get all AI platform connectors
173167
let connectors = await aiPlatformConnectorsApi.getAIPlatformConnectors({
@@ -220,15 +214,13 @@ describe("connector", () => {
220214
});
221215
const connectorId = sourceResponse.connector.id;
222216

223-
/* ENG-2651
224217
await destinationConnectorsApi.updateDestinationConnector({
225218
organizationId: testContext.orgId,
226219
destinationConnectorId: connectorId,
227220
updateDestinationConnectorRequest: {
228-
config: {"api-key": "sk"}
221+
config: {"apiKey": "sk"}
229222
}
230223
});
231-
*/
232224

233225
// Get all destination connectors
234226
let connectors = await destinationConnectorsApi.getDestinationConnectors({

tests/ts/tests/pipelines.test.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
import {pipeline} from "stream";
1313
import * as os from "node:os";
1414
import exp from "node:constants";
15-
import {AIPlatformType, DestinationConnectorType} from "@vectorize-io/vectorize-client/src";
15+
import {AIPlatformConnectorType, DestinationConnectorType} from "@vectorize-io/vectorize-client/src";
1616

1717
export let testContext: TestContext;
1818

@@ -46,16 +46,15 @@ async function createWebCrawlerSource(sourceConnectorsApi: SourceConnectorsApi)
4646
}
4747
});
4848
const sourceConnectorId = sourceResponse.connector.id;
49-
/* ENG-2651
5049
await sourceConnectorsApi.updateSourceConnector({
51-
organization: testContext.orgId,
50+
organizationId: testContext.orgId,
5251
sourceConnectorId,
5352
updateSourceConnectorRequest: {
5453
config: {"seed-urls": ["https://docs.vectorize.io", "https://vectorize.io"]}
5554
}
5655
}
5756
);
58-
*/
57+
5958
return sourceConnectorId;
6059
}
6160

@@ -67,12 +66,12 @@ async function deployPipeline(pipelinesApi: PipelinesApi, sourceConnectorId: str
6766
sourceConnectors: [{id: sourceConnectorId, type: SourceConnectorType.WebCrawler, config: {}}],
6867
destinationConnector: {
6968
id: destinationConnectorId,
70-
type: DestinationConnectorType.VECTORIZE,
69+
type: "VECTORIZE" as any,
7170
config: {}
7271
},
73-
aiPlatform: {
72+
aiPlatformConnector: {
7473
id: aiPlatformId,
75-
type: AIPlatformType.VECTORIZE,
74+
type: "VECTORIZE" as any,
7675
config: {}
7776
},
7877
schedule: {type: "manual"}

0 commit comments

Comments
 (0)