diff --git a/package.json b/package.json index 2492249..9a05f36 100644 --- a/package.json +++ b/package.json @@ -35,17 +35,17 @@ "dev": "node --watch -r ts-node/register index.ts", "run": "npm run build && node index.js", "test": "vitest", - "test:package:dev": "npm run build && pulumi env run npm-test node ./test-package.js", + "test:package:dev": "npm run build && pulumi env run cortexclick/default/npm-test node ./test-package.js", "test:package:ci": "npm run build && node ./test-package.js", "test:fast": "vitest run --exclude src/content.test.ts", - "test:dev": "CORTEX_API_URL=http://localhost:3001 pulumi env run npm-test npm run test", + "test:dev": "CORTEX_API_URL=http://localhost:3001 pulumi env run cortexclick/default/npm-test npm run test", "test:ci": "vitest run", "test:prod": "pulumi env run npm-test npm run test", - "test:fast:dev": "CORTEX_API_URL=http://localhost:3001 pulumi env run npm-test npm run test:fast", - "test:fast:prod": "pulumi env run npm-test npm run test:fast", - "test:indexers:dev": "CORTEX_API_URL=http://localhost:3001 pulumi env run npm-test vitest indexers.test.ts", - "test:scraping:dev": "RUN_SCRAPER_TESTS=true CORTEX_API_URL=https://api-dev.cortexclick.com pulumi env run npm-test vitest scraping.test.ts", - "test:scraping:prod": "RUN_SCRAPER_TESTS=true CORTEX_API_URL=https://api.cortexclick.com pulumi env run npm-test vitest scraping.test.ts" + "test:fast:dev": "CORTEX_API_URL=http://localhost:3001 pulumi env run cortexclick/default/npm-test npm run test:fast", + "test:fast:prod": "pulumi env run cortexclick/default/npm-test npm run test:fast", + "test:indexers:dev": "CORTEX_API_URL=http://localhost:3001 pulumi env run cortexclick/default/npm-test vitest indexers.test.ts", + "test:scraping:dev": "RUN_SCRAPER_TESTS=true CORTEX_API_URL=https://api-dev.cortexclick.com pulumi env run cortexclick/default/npm-test vitest scraping.test.ts", + "test:scraping:prod": "RUN_SCRAPER_TESTS=true CORTEX_API_URL=https://api.cortexclick.com pulumi env run cortexclick/default/npm-test vitest scraping.test.ts" }, "keywords": [], "author": "", diff --git a/src/catalog.ts b/src/catalog.ts index 36328e6..8955103 100644 --- a/src/catalog.ts +++ b/src/catalog.ts @@ -76,14 +76,19 @@ export class Catalog { }; const getRes = await apiClient.GET(`/catalogs/${name}`); let res: Response; - if (getRes.status !== 200) { + if (getRes.status === 200) { + res = await apiClient.PUT(`/catalogs/${name}`, config); + } else if (getRes.status === 404) { res = await apiClient.POST("/catalogs", createConfig); } else { - res = await apiClient.PUT(`/catalogs/${name}`, config); + const message = + getRes.status === 400 ? await getRes.text() : getRes.statusText; + throw new Error(`Failed to configure catalog: ${message}`); } if (res.status > 201) { - throw new Error(`Failed to configure catalog: ${res.statusText}`); + const message = res.status === 400 ? await res.text() : res.statusText; + throw new Error(`Failed to configure catalog: ${message}`); } return new Catalog(config, apiClient, name); } @@ -197,7 +202,8 @@ export class Catalog { } if (res.status > 202) { - throw new Error(`Failed to upsert documents: ${res.statusText}`); + const message = res.status === 400 ? await res.text() : res.statusText; + throw new Error(`Failed to upsert documents: ${message}`); } const body = await res.json(); diff --git a/src/client.ts b/src/client.ts index 78484c5..5902844 100644 --- a/src/client.ts +++ b/src/client.ts @@ -146,6 +146,10 @@ export class CortexClient { return Cortex.get(this.apiClient, name); } + async listCortexes(): Promise { + return Cortex.list(this.apiClient); + } + async configureCortex(name: string, opts: CortexConfig): Promise { return Cortex.configure(this.apiClient, name, opts); } diff --git a/src/content.test.ts b/src/content.test.ts index a52f74a..5beecc2 100644 --- a/src/content.test.ts +++ b/src/content.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest"; -import { ContentStatus, TextDocument } from "./index"; +import { ContentStatus, TextDocument, Cortex } from "./index"; import { CatalogConfig } from "./catalog"; import { testClient } from "./vitest-test-client"; import { Readable } from "stream"; @@ -8,7 +8,8 @@ test( "e2e catalog, cortex, and sync content generation workflow", { timeout: 180000 }, async () => { - const catalogName = `catalog-${Math.floor(Math.random() * 10000)}`; + const suffix = Date.now(); + const catalogName = `catalog-sdk-content-test-${suffix}`; const config: CatalogConfig = { description: @@ -19,7 +20,155 @@ test( }; // create - const catalog = await testClient.configureCatalog(catalogName, config); + let catalog; + let cortex: Cortex | undefined = undefined; + try { + catalog = await testClient.configureCatalog(catalogName, config); + + const documents: TextDocument[] = [ + { + documentId: "a", + content: + "cortex click solutions: customer support, blog and content writing, technical documentation generation, SEO, sales process automation, AI email marketing", + contentType: "markdown", + }, + { + documentId: "b", + content: "cortex click customers: reds fly shop, pyxos, ", + contentType: "markdown", + }, + { + documentId: "c", + content: + "cortex click customer verticals and industries: developer tools, e-commerce, SaaS, network security, compliance, and more.", + contentType: "markdown", + }, + ]; + + await catalog.upsertDocuments(documents); + + cortex = await testClient.configureCortex( + `cortex-sdk-content-test-${suffix}`, + { + catalogs: [catalog.name], + friendlyName: "Cortex AI", + instructions: [ + "answer questions about the cortex click AI GTM platform", + ], + public: true, + }, + ); + + // create content + const title = "Overview of the Cortex Click AI GTM Platform"; + const prompt = + "Write a blog post about the Cortex Click AI GTM Platform. Elaborate on scenarios, customers, and appropriate verticals. Make sure to mention the impact that AI can have on sales and marketing teams."; + const content = await cortex.generateContent({ title, prompt }); + const originalContent = content.content; + const originalTitle = content.title; + expect(content.content.length).toBeGreaterThan(1); + expect(content.title).toBe(title); + expect(content.version).toBe(0); + expect(content.commands.length).toBe(1); + expect(content.status).toBe(ContentStatus.Draft); + expect(content.publishedVersion).toBe(undefined); + + // check that prompt that is too large will fail gracefully without hitting the service + const hugePrompt = "p".repeat(32 * 1000 * 1000); + await expect(() => + cortex!.generateContent({ title, prompt: hugePrompt }), + ).rejects.toThrow("Request body too large"); + + // get content + const getContent = await testClient.getContent(content.id); + expect(getContent.content.length).toBe(content.content.length); + expect(getContent.title).toBe(title); + expect(getContent.version).toBe(0); + expect(getContent.commands.length).toBe(1); + expect(getContent.status).toBe(ContentStatus.Draft); + expect(getContent.publishedVersion).toBe(undefined); + + // edit content + const editedContent = await content.edit({ + title: "foo", + content: "bar", + }); + expect(editedContent.content).toBe("bar"); + expect(editedContent.title).toBe("foo"); + expect(editedContent.version).toBe(1); + expect(editedContent.commands.length).toBe(2); + expect(editedContent.status).toBe(ContentStatus.Draft); + expect(editedContent.publishedVersion).toBe(undefined); + + // get content version + const contentV0 = await testClient.getContent(content.id, 0); + expect(contentV0.content).toEqual(originalContent); + expect(contentV0.title).toBe(originalTitle); + expect(contentV0.version).toBe(0); + expect(contentV0.commands.length).toBe(1); + expect(contentV0.status).toBe(ContentStatus.Draft); + expect(contentV0.publishedVersion).toBe(undefined); + + // revert to earlier version + const revertedContent = await contentV0.revert(0); + expect(revertedContent.content).toEqual(originalContent); + expect(revertedContent.title).toBe(originalTitle); + expect(revertedContent.version).toBe(2); + expect(revertedContent.commands.length).toBe(3); + expect(revertedContent.status).toBe(ContentStatus.Draft); + expect(revertedContent.publishedVersion).toBe(undefined); + + const refinePrompt = + "add a final paragraph with a joke or pun about cortex click an AI."; + + const refinedContent = await revertedContent.refine({ + prompt: refinePrompt, + }); + expect(refinedContent.content.length).toBeGreaterThan(1); + expect(refinedContent.title).toBe(originalTitle); + expect(refinedContent.version).toBe(3); + expect(refinedContent.commands.length).toBe(4); + expect(refinedContent.status).toBe(ContentStatus.Draft); + expect(refinedContent.publishedVersion).toBe(undefined); + + // list content - putting test here to save overhead of generating more content + + const contentList = await testClient.listContent({ pageSize: 1 }); + expect(contentList.content.length).toBe(1); + + const nextPage = await contentList.nextPage(); + expect(nextPage.content.length).toBe(1); + + const contentList2 = await testClient.listContent(); + expect(contentList2.content.length).toBeGreaterThan(1); + } finally { + if (catalog) { + await catalog.delete(); + } + if (cortex) { + await cortex.delete(); + } + } + }, +); + +test("test streaming content", { timeout: 180000 }, async () => { + const suffix = Date.now(); + const catalogName = `catalog-sdk-streaming-content-test-${suffix}`; + + const config: CatalogConfig = { + description: + "this catalog contains documentation from the cortex click marketing website", + instructions: [ + "user this data set to answer user questions about the cortex click platform", + ], + }; + + // create + let catalog; + let cortex; + try { + catalog = await testClient.configureCatalog(catalogName, config); const documents: TextDocument[] = [ { @@ -43,8 +192,8 @@ test( await catalog.upsertDocuments(documents); - const cortex = await testClient.configureCortex( - `cortex-${Math.floor(Math.random() * 10000)}`, + cortex = await testClient.configureCortex( + `cortex-sdk-streaming-content-test-${suffix}`, { catalogs: [catalog.name], friendlyName: "Cortex AI", @@ -59,288 +208,170 @@ test( const title = "Overview of the Cortex Click AI GTM Platform"; const prompt = "Write a blog post about the Cortex Click AI GTM Platform. Elaborate on scenarios, customers, and appropriate verticals. Make sure to mention the impact that AI can have on sales and marketing teams."; - const content = await cortex.generateContent({ title, prompt }); - const originalContent = content.content; - const originalTitle = content.title; - expect(content.content.length).toBeGreaterThan(1); - expect(content.title).toBe(title); - expect(content.version).toBe(0); - expect(content.commands.length).toBe(1); - expect(content.status).toBe(ContentStatus.Draft); - expect(content.publishedVersion).toBe(undefined); + const statusStream = new Readable({ + read() {}, + }); + const { content, contentStream } = await testClient.generateContent({ + cortex, + prompt, + title, + stream: true, + statusStream, + }); + let fullContent = ""; + contentStream.on("data", (data) => { + fullContent += data.toString(); + }); + + let sawPlan = false; + let sawWriteSection = false; + let sawEditorial = false; + + statusStream.on("data", (data) => { + const message = JSON.parse(data); + expect(message.messageType).toBe("status"); + switch (message.step) { + case "plan": + sawPlan = true; + break; + case "write-section": + sawWriteSection = true; + break; + case "editorial": + sawEditorial = true; + break; + default: + break; + } + }); - // check that prompt that is too large will fail gracefully without hitting the service - const hugePrompt = "p".repeat(32 * 1000 * 1000); - await expect(() => - cortex.generateContent({ title, prompt: hugePrompt }), - ).rejects.toThrow("Request body too large"); - - // get content - const getContent = await testClient.getContent(content.id); - expect(getContent.content.length).toBe(content.content.length); - expect(getContent.title).toBe(title); - expect(getContent.version).toBe(0); - expect(getContent.commands.length).toBe(1); - expect(getContent.status).toBe(ContentStatus.Draft); - expect(getContent.publishedVersion).toBe(undefined); - - // edit content - const editedContent = await content.edit({ title: "foo", content: "bar" }); - expect(editedContent.content).toBe("bar"); - expect(editedContent.title).toBe("foo"); - expect(editedContent.version).toBe(1); - expect(editedContent.commands.length).toBe(2); - expect(editedContent.status).toBe(ContentStatus.Draft); - expect(editedContent.publishedVersion).toBe(undefined); - - // get content version - const contentV0 = await testClient.getContent(content.id, 0); - expect(contentV0.content).toEqual(originalContent); - expect(contentV0.title).toBe(originalTitle); - expect(contentV0.version).toBe(0); - expect(contentV0.commands.length).toBe(1); - expect(contentV0.status).toBe(ContentStatus.Draft); - expect(contentV0.publishedVersion).toBe(undefined); - - // revert to earlier version - const revertedContent = await contentV0.revert(0); - expect(revertedContent.content).toEqual(originalContent); - expect(revertedContent.title).toBe(originalTitle); - expect(revertedContent.version).toBe(2); - expect(revertedContent.commands.length).toBe(3); - expect(revertedContent.status).toBe(ContentStatus.Draft); - expect(revertedContent.publishedVersion).toBe(undefined); + const contentResult = await content; + expect(fullContent).toBe(contentResult.content); + expect(contentResult.title).toBe(title); + expect(contentResult.version).toBe(0); + expect(contentResult.commands.length).toBe(1); + expect(sawPlan).toBe(true); + expect(sawWriteSection).toBe(true); + expect(sawEditorial).toBe(true); + expect(contentResult.status).toBe(ContentStatus.Draft); + expect(contentResult.publishedVersion).toBe(undefined); const refinePrompt = "add a final paragraph with a joke or pun about cortex click an AI."; - const refinedContent = await revertedContent.refine({ + const refinedContentPromise = await contentResult.refine({ prompt: refinePrompt, + stream: true, }); - expect(refinedContent.content.length).toBeGreaterThan(1); - expect(refinedContent.title).toBe(originalTitle); - expect(refinedContent.version).toBe(3); - expect(refinedContent.commands.length).toBe(4); + let fullRefinedContent = ""; + refinedContentPromise.contentStream.on("data", (data) => { + fullRefinedContent += data.toString(); + }); + + const refinedContent = await refinedContentPromise.content; + + expect(fullRefinedContent).toBe(refinedContent.content); + expect(refinedContent.title).toBe(title); + expect(refinedContent.version).toBe(1); + expect(refinedContent.commands.length).toBe(2); expect(refinedContent.status).toBe(ContentStatus.Draft); expect(refinedContent.publishedVersion).toBe(undefined); + } finally { + if (catalog) { + await catalog.delete(); + } + if (cortex) { + await cortex.delete(); + } + } +}); + +test(`test content status and publishing`, { timeout: 180000 }, async () => { + let cortex; + try { + cortex = await testClient.configureCortex( + `cortex-sdk-content-status-test-${Date.now()}`, + { + friendlyName: "Cortex AI", + instructions: [ + "answer questions about the cortex click AI GTM platform", + ], + public: true, + }, + ); - // list content - putting test here to save overhead of generating more content + // create content + const title = "Overview of the Cortex Click AI GTM Platform"; + const prompt = + "Write a blog post about the Cortex Click AI GTM Platform. Elaborate on scenarios, customers, and appropriate verticals. Make sure to mention the impact that AI can have on sales and marketing teams."; + const content = await cortex.generateContent({ title, prompt }); - const contentList = await testClient.listContent({ pageSize: 1 }); - expect(contentList.content.length).toBe(1); + expect(content.status).toBe(ContentStatus.Draft); - const nextPage = await contentList.nextPage(); - expect(nextPage.content.length).toBe(1); + const draftContent = await testClient.listContent({ + cortexName: cortex.name, + status: ContentStatus.Draft, + }); + expect(draftContent.content.length).toBe(1); - const contentList2 = await testClient.listContent(); - expect(contentList2.content.length).toBeGreaterThan(1); + // next page should be empty. This tests that filters are passed through + const nextPage = await draftContent.nextPage(); + expect(nextPage.content.length).toBe(0); - // delete - await catalog.delete(); - }, -); + await content.setStatus(ContentStatus.InReview); -test("test streaming content", { timeout: 180000 }, async () => { - const catalogName = `catalog-${Math.floor(Math.random() * 10000)}`; + expect(content.status).toBe(ContentStatus.InReview); - const config: CatalogConfig = { - description: - "this catalog contains documentation from the cortex click marketing website", - instructions: [ - "user this data set to answer user questions about the cortex click platform", - ], - }; + const inReviewContent = await testClient.listContent({ + cortexName: cortex.name, + status: ContentStatus.InReview, + }); + expect(inReviewContent.content.length).toBe(1); - // create - const catalog = await testClient.configureCatalog(catalogName, config); - - const documents: TextDocument[] = [ - { - documentId: "a", - content: - "cortex click solutions: customer support, blog and content writing, technical documentation generation, SEO, sales process automation, AI email marketing", - contentType: "markdown", - }, - { - documentId: "b", - content: "cortex click customers: reds fly shop, pyxos, ", - contentType: "markdown", - }, - { - documentId: "c", - content: - "cortex click customer verticals and industries: developer tools, e-commerce, SaaS, network security, compliance, and more.", - contentType: "markdown", - }, - ]; - - await catalog.upsertDocuments(documents); - - const cortex = await testClient.configureCortex( - `cortex-${Math.floor(Math.random() * 10000)}`, - { - catalogs: [catalog.name], - friendlyName: "Cortex AI", - instructions: ["answer questions about the cortex click AI GTM platform"], - public: true, - }, - ); - - // create content - const title = "Overview of the Cortex Click AI GTM Platform"; - const prompt = - "Write a blog post about the Cortex Click AI GTM Platform. Elaborate on scenarios, customers, and appropriate verticals. Make sure to mention the impact that AI can have on sales and marketing teams."; - const statusStream = new Readable({ - read() {}, - }); - const { content, contentStream } = await testClient.generateContent({ - cortex, - prompt, - title, - stream: true, - statusStream, - }); - let fullContent = ""; - contentStream.on("data", (data) => { - fullContent += data.toString(); - }); - - let sawPlan = false; - let sawWriteSection = false; - let sawEditorial = false; - - statusStream.on("data", (data) => { - const message = JSON.parse(data); - expect(message.messageType).toBe("status"); - switch (message.step) { - case "plan": - sawPlan = true; - break; - case "write-section": - sawWriteSection = true; - break; - case "editorial": - sawEditorial = true; - break; - default: - break; - } - }); - - const contentResult = await content; - expect(fullContent).toBe(contentResult.content); - expect(contentResult.title).toBe(title); - expect(contentResult.version).toBe(0); - expect(contentResult.commands.length).toBe(1); - expect(sawPlan).toBe(true); - expect(sawWriteSection).toBe(true); - expect(sawEditorial).toBe(true); - expect(contentResult.status).toBe(ContentStatus.Draft); - expect(contentResult.publishedVersion).toBe(undefined); - - const refinePrompt = - "add a final paragraph with a joke or pun about cortex click an AI."; - - const refinedContentPromise = await contentResult.refine({ - prompt: refinePrompt, - stream: true, - }); - let fullRefinedContent = ""; - refinedContentPromise.contentStream.on("data", (data) => { - fullRefinedContent += data.toString(); - }); - - const refinedContent = await refinedContentPromise.content; - - expect(fullRefinedContent).toBe(refinedContent.content); - expect(refinedContent.title).toBe(title); - expect(refinedContent.version).toBe(1); - expect(refinedContent.commands.length).toBe(2); - expect(refinedContent.status).toBe(ContentStatus.Draft); - expect(refinedContent.publishedVersion).toBe(undefined); - - await catalog.delete(); -}); + await content.setStatus(ContentStatus.Approved); -test(`test content status and publishing`, { timeout: 180000 }, async () => { - const cortex = await testClient.configureCortex( - `cortex-${Math.floor(Math.random() * 10000)}`, - { - friendlyName: "Cortex AI", - instructions: ["answer questions about the cortex click AI GTM platform"], - public: true, - }, - ); - - // create content - const title = "Overview of the Cortex Click AI GTM Platform"; - const prompt = - "Write a blog post about the Cortex Click AI GTM Platform. Elaborate on scenarios, customers, and appropriate verticals. Make sure to mention the impact that AI can have on sales and marketing teams."; - const content = await cortex.generateContent({ title, prompt }); - - expect(content.status).toBe(ContentStatus.Draft); - - const draftContent = await testClient.listContent({ - cortexName: cortex.name, - status: ContentStatus.Draft, - }); - expect(draftContent.content.length).toBe(1); - - // next page should be empty. This tests that filters are passed through - const nextPage = await draftContent.nextPage(); - expect(nextPage.content.length).toBe(0); - - await content.setStatus(ContentStatus.InReview); - - expect(content.status).toBe(ContentStatus.InReview); - - const inReviewContent = await testClient.listContent({ - cortexName: cortex.name, - status: ContentStatus.InReview, - }); - expect(inReviewContent.content.length).toBe(1); - - await content.setStatus(ContentStatus.Approved); - - expect(content.status).toBe(ContentStatus.Approved); - - const approvedContent = await testClient.listContent({ - cortexName: cortex.name, - status: ContentStatus.Approved, - }); - expect(approvedContent.content.length).toBe(1); - - await content.publish(); - - expect(content.status).toBe(ContentStatus.Published); - expect(content.publishedVersion).toBe(0); - - const publishedContent = await testClient.listContent({ - cortexName: cortex.name, - status: ContentStatus.Published, - }); - expect(publishedContent.content.length).toBe(1); - - await content.unpublish(); - expect(content.status).toBe(ContentStatus.Draft); - expect(content.publishedVersion).toBe(undefined); - - const publishedContent2 = await testClient.listContent({ - cortexName: cortex.name, - status: ContentStatus.Published, - }); - expect(publishedContent2.content.length).toBe(0); - - const publishTargets = await content.getPublishTargets(); - expect(publishTargets.length).toBe(0); - - await content.publish({ id: "none", type: "none" }); - expect(content.status).toBe(ContentStatus.Published); - expect(content.publishedVersion).toBe(0); - - await content.unpublish(); - expect(content.status).toBe(ContentStatus.Draft); - expect(content.publishedVersion).toBe(undefined); - - await cortex.delete(); + expect(content.status).toBe(ContentStatus.Approved); + + const approvedContent = await testClient.listContent({ + cortexName: cortex.name, + status: ContentStatus.Approved, + }); + expect(approvedContent.content.length).toBe(1); + + await content.publish(); + + expect(content.status).toBe(ContentStatus.Published); + expect(content.publishedVersion).toBe(0); + + const publishedContent = await testClient.listContent({ + cortexName: cortex.name, + status: ContentStatus.Published, + }); + expect(publishedContent.content.length).toBe(1); + + await content.unpublish(); + expect(content.status).toBe(ContentStatus.Draft); + expect(content.publishedVersion).toBe(undefined); + + const publishedContent2 = await testClient.listContent({ + cortexName: cortex.name, + status: ContentStatus.Published, + }); + expect(publishedContent2.content.length).toBe(0); + + const publishTargets = await content.getPublishTargets(); + expect(publishTargets.length).toBe(0); + + await content.publish({ id: "none", type: "none" }); + expect(content.status).toBe(ContentStatus.Published); + expect(content.publishedVersion).toBe(0); + + await content.unpublish(); + expect(content.status).toBe(ContentStatus.Draft); + expect(content.publishedVersion).toBe(undefined); + } finally { + if (cortex) { + await cortex.delete(); + } + } }); diff --git a/src/cortex.test.ts b/src/cortex.test.ts index cef5951..fd3faad 100644 --- a/src/cortex.test.ts +++ b/src/cortex.test.ts @@ -47,8 +47,8 @@ test( async () => { const cortexName = `cortex-sdk-test-${Date.now()}`; - const catalogName = `catalog-sdk-test-${Date.now()}`; - const catalogName2 = `catalog-sdk-test-${Date.now() + 1}`; + const catalogName = `cortex-sdk-test-${Date.now()}`; + const catalogName2 = `cortex-sdk-test-${Date.now() + 1}`; const config: CatalogConfig = { description: "foo bar", diff --git a/src/cortex.ts b/src/cortex.ts index 0a9c5d1..adef1ea 100644 --- a/src/cortex.ts +++ b/src/cortex.ts @@ -140,6 +140,17 @@ export class Cortex { return new Cortex(config, apiClient, name); } + static async list(apiClient: CortexApiClient): Promise { + const res = await apiClient.GET(`/cortexes`); + if (res.status !== 200) { + throw new Error(`Failed to list cortexes: ${res.statusText}`); + } + + const cortexes: (CortexConfig & { name: string })[] = (await res.json()) + .cortexes; + return cortexes.map((cortex) => new Cortex(cortex, apiClient, cortex.name)); + } + static async configure( apiClient: CortexApiClient, name: string, diff --git a/src/document.test.ts b/src/document.test.ts index ca3f14e..f667e1b 100644 --- a/src/document.test.ts +++ b/src/document.test.ts @@ -7,7 +7,7 @@ import { Catalog } from "./catalog"; let catalog: Catalog; beforeEach(async () => { - const catalogName = `catalog-sdk-test-${Date.now()}`; + const catalogName = `document-sdk-test-${Date.now()}`; const config: CatalogConfig = { description: "foo bar", diff --git a/src/indexers/hosted/hosted-indexers.test.ts b/src/indexers/hosted/hosted-indexers.test.ts index f7f04e0..a60e63a 100644 --- a/src/indexers/hosted/hosted-indexers.test.ts +++ b/src/indexers/hosted/hosted-indexers.test.ts @@ -16,7 +16,7 @@ beforeEach(async () => { instructions: ["a", "b"], }; - const catalogName = `catalog-${Date.now()}`; + const catalogName = `catalog-hosted-indexers-test-${Date.now()}`; catalog = await testClient.configureCatalog(catalogName, config); }, 30000); diff --git a/src/indexers/local/indexers.test.ts b/src/indexers/local/indexers.test.ts index 05fd1d7..50487cb 100644 --- a/src/indexers/local/indexers.test.ts +++ b/src/indexers/local/indexers.test.ts @@ -11,7 +11,7 @@ beforeEach(async () => { instructions: ["a", "b"], }; - const catalogName = `catalog-${Date.now()}`; + const catalogName = `catalog-local-indexers-test-${Date.now()}`; catalog = await testClient.configureCatalog(catalogName, config); }, 30000);