diff --git a/.changeset/update-forge-995446172c0e.md b/.changeset/update-forge-995446172c0e.md new file mode 100644 index 000000000..5c7df0e7f --- /dev/null +++ b/.changeset/update-forge-995446172c0e.md @@ -0,0 +1,6 @@ +--- +"cf": minor +--- + +Update the generated command surface and vendored Forge packages for +Forge OpenAPI release `995446172c0e88607283d1aae00f3c1f41294d4b`. diff --git a/packages/cli/generate.ts b/packages/cli/generate.ts index 1d81c965b..4d3a6d3ba 100644 --- a/packages/cli/generate.ts +++ b/packages/cli/generate.ts @@ -21,7 +21,7 @@ const sdkDir = fileURLToPath(new URL("./src/sdk", import.meta.url)); const sdkEntrypointPath = join(sdkDir, "sdk/index.ts"); const sdkVersionPath = join(sdkDir, "openapi-version"); // The SDK is committed. Bump this SHA to regenerate it from a new release. -const FORGE_OPENAPI_VERSION = "af1cbe5ccd4d92c232d8cd9c10a42a49e276238c"; +const FORGE_OPENAPI_VERSION = "995446172c0e88607283d1aae00f3c1f41294d4b"; const FORGE_OPENAPI_RELEASE = `openapi@${FORGE_OPENAPI_VERSION}`; const FORGE_OPENAPI_ASSET = "openapi.forge.json"; const FORGE_OPENAPI_ASSET_URL = `https://github.com/cloudflare/forge/releases/download/${FORGE_OPENAPI_RELEASE}/${FORGE_OPENAPI_ASSET}`; diff --git a/packages/cli/src/commands/_generated/_meta/commands.json b/packages/cli/src/commands/_generated/_meta/commands.json index ee4879447..e14916117 100644 --- a/packages/cli/src/commands/_generated/_meta/commands.json +++ b/packages/cli/src/commands/_generated/_meta/commands.json @@ -127639,20 +127639,20 @@ "arguments": [], "options": [ { - "name": "config-dimensions", + "name": "index-config-dimensions", "type": "number", "required": false, "description": "Specifies the number of dimensions for the index" }, { - "name": "config-metric", + "name": "index-config-metric", "type": "string", "required": false, "description": "Specifies the type of metric to use calculating distance.", "enum": ["cosine", "euclidean", "dot-product"] }, { - "name": "config-preset", + "name": "index-config-preset", "type": "string", "required": false, "description": "Specifies the preset to use for the index.", @@ -142954,6 +142954,7 @@ "type": "string", "required": false, "description": "Action for runtime Rego errors. Omit to use BLOCK.", + "default": "BLOCK", "enum": ["BLOCK", "SKIP"] }, { @@ -142966,7 +142967,8 @@ "name": "rego-raise-error", "type": "boolean", "required": false, - "description": "Whether OPA builtin failures are raised as runtime evaluation errors. Omit to use the default true value." + "description": "Whether OPA builtin failures are raised as runtime evaluation errors. Omit to use the default true value.", + "default": true }, { "name": "dry-run", @@ -143217,7 +143219,7 @@ "name": "entries", "type": "string", "required": true, - "description": "Domain entries for this ACL. Provide as a JSON array of objects or @path/to/file.json." + "description": "Domain entries for this ACL. Each domain must appear at most once. Provide as a JSON array of objects or @path/to/file.json." }, { "name": "name", @@ -143400,7 +143402,7 @@ "name": "entries", "type": "string", "required": true, - "description": "Replacement set of domain entries. Provide as a JSON array of objects or @path/to/file.json." + "description": "Replacement set of domain entries. Each domain must appear at most once. Provide as a JSON array of objects or @path/to/file.json." }, { "name": "name", @@ -161391,14 +161393,6 @@ "user tokens permission-groups": "Operations for tokens.permission-groups", "values": "values", "vectorize": "Globally distributed vector database for building semantic search, recommendations, and RAG applications on Workers", - "vectorize deprecated-indexes": "Deprecated v1 Vectorize index operations", - "vectorize deprecated-indexes delete-by": "Operations for deprecated-indexes.delete-by", - "vectorize deprecated-indexes delete-by ids": "Operations for deprecated-indexes.delete-by.ids", - "vectorize deprecated-indexes get-by": "Operations for deprecated-indexes.get-by", - "vectorize deprecated-indexes get-by ids": "Operations for deprecated-indexes.get-by.ids", - "vectorize deprecated-indexes insert": "Operations for deprecated-indexes.insert", - "vectorize deprecated-indexes query": "Operations for deprecated-indexes.query", - "vectorize deprecated-indexes upsert": "Operations for deprecated-indexes.upsert", "vectorize metadata-index": "Metadata indexes for filtered vector search", "verify": "verify", "waiting-rooms": "Virtual queues that throttle traffic to your site during peak demand with customizable waiting pages", diff --git a/packages/cli/src/commands/_generated/_meta/schemas.json b/packages/cli/src/commands/_generated/_meta/schemas.json index ddfec674c..390edb3e1 100644 --- a/packages/cli/src/commands/_generated/_meta/schemas.json +++ b/packages/cli/src/commands/_generated/_meta/schemas.json @@ -88769,19 +88769,19 @@ "hasRequestBody": true, "requestBodyFields": [ { - "name": "config-dimensions", + "name": "index-config-dimensions", "type": "number", "required": false, "description": "Specifies the number of dimensions for the index" }, { - "name": "config-metric", + "name": "index-config-metric", "type": "string", "required": false, "description": "Specifies the type of metric to use calculating distance." }, { - "name": "config-preset", + "name": "index-config-preset", "type": "string", "required": false, "description": "Specifies the preset to use for the index." @@ -99250,7 +99250,7 @@ "name": "entries", "type": "string", "required": true, - "description": "Domain entries for this ACL. Provide as a JSON array of objects or @path/to/file.json." + "description": "Domain entries for this ACL. Each domain must appear at most once. Provide as a JSON array of objects or @path/to/file.json." }, { "name": "name", @@ -99375,7 +99375,7 @@ "name": "entries", "type": "string", "required": true, - "description": "Replacement set of domain entries. Provide as a JSON array of objects or @path/to/file.json." + "description": "Replacement set of domain entries. Each domain must appear at most once. Provide as a JSON array of objects or @path/to/file.json." }, { "name": "name", diff --git a/packages/cli/src/commands/_generated/vectorize/create.ts b/packages/cli/src/commands/_generated/vectorize/create.ts index a119faeb6..c83b8828d 100644 --- a/packages/cli/src/commands/_generated/vectorize/create.ts +++ b/packages/cli/src/commands/_generated/vectorize/create.ts @@ -23,19 +23,19 @@ import { runWithTelemetry } from "#lib/telemetry/index.js"; function builder(yargs: Argv) { return yargs .usage("$0 vectorize create\n\nCreates and returns a new Vectorize Index.") - .option("config-dimensions", { + .option("index-config-dimensions", { type: "number", description: "Specifies the number of dimensions for the index", }) - .option("config-metric", { + .option("index-config-metric", { type: "string", description: "Specifies the type of metric to use calculating distance.", choices: ["cosine", "euclidean", "dot-product"], }) - .coerce("config-metric", (value) => - resolveFileToken(value, "config-metric", "text") + .coerce("index-config-metric", (value) => + resolveFileToken(value, "index-config-metric", "text") ) - .option("config-preset", { + .option("index-config-preset", { type: "string", description: "Specifies the preset to use for the index.", choices: [ @@ -46,8 +46,8 @@ function builder(yargs: Argv) { "cohere/embed-multilingual-v2.0", ], }) - .coerce("config-preset", (value) => - resolveFileToken(value, "config-preset", "text") + .coerce("index-config-preset", (value) => + resolveFileToken(value, "index-config-preset", "text") ) .option("description", { type: "string", @@ -63,17 +63,20 @@ function builder(yargs: Argv) { type: "string", description: "Raw JSON request body (bypasses individual flags)", }) - .conflicts("config-dimensions", ["config-preset"]) - .implies("config-dimensions", ["config-metric"]) - .conflicts("config-metric", ["config-preset"]) - .implies("config-metric", ["config-dimensions"]) - .conflicts("config-preset", ["config-dimensions", "config-metric"]); + .conflicts("index-config-dimensions", ["index-config-preset"]) + .implies("index-config-dimensions", ["index-config-metric"]) + .conflicts("index-config-metric", ["index-config-preset"]) + .implies("index-config-metric", ["index-config-dimensions"]) + .conflicts("index-config-preset", [ + "index-config-dimensions", + "index-config-metric", + ]); } type Args = InferArgs; type Request = SdkRequest<"vectorize-create-vectorize-index">; -type Body = Request["body"]; +type Body = Request; const command: CommandModule = { command: "create", @@ -84,7 +87,7 @@ const command: CommandModule = { { command: "vectorize create", classification: { - safeFlags: ["config-metric", "config-preset", "dry-run"], + safeFlags: ["index-config-metric", "index-config-preset", "dry-run"], } satisfies ArgClassification, }, argv as Record, @@ -102,9 +105,9 @@ const command: CommandModule = { ? parseBody(argv.body) : compactBody({ config: { - dimensions: argv["config-dimensions"], - metric: argv["config-metric"], - preset: argv["config-preset"], + dimensions: argv["index-config-dimensions"], + metric: argv["index-config-metric"], + preset: argv["index-config-preset"], }, description: resolveFileToken( argv["description"] as string | undefined, @@ -125,10 +128,10 @@ const command: CommandModule = { argv.accountId = accountId; if (argv.body) { - const bodyData = parseBody(argv.body); + const bodyData = parseBody(argv.body); const result = await withProgress(`Creating`, async () => client.vectorize.create({ - body: bodyData, + ...bodyData, account_id: accountId, } satisfies Request) ); @@ -142,9 +145,9 @@ const command: CommandModule = { // Assemble request body from individual flags const bodyData = compactBody({ config: { - dimensions: argv["config-dimensions"], - metric: argv["config-metric"], - preset: argv["config-preset"], + dimensions: argv["index-config-dimensions"], + metric: argv["index-config-metric"], + preset: argv["index-config-preset"], }, description: resolveFileToken( argv["description"] as string | undefined, @@ -159,7 +162,7 @@ const command: CommandModule = { }); const result = await withProgress(`Creating`, async () => client.vectorize.create({ - body: bodyData, + ...bodyData, account_id: accountId, } satisfies Request) ); diff --git a/packages/cli/src/commands/_generated/vectorize/delete-by-ids.ts b/packages/cli/src/commands/_generated/vectorize/delete-by-ids.ts index 1ecf91375..cef656e05 100644 --- a/packages/cli/src/commands/_generated/vectorize/delete-by-ids.ts +++ b/packages/cli/src/commands/_generated/vectorize/delete-by-ids.ts @@ -48,7 +48,7 @@ function builder(yargs: Argv) { type Args = InferArgs; type Request = SdkRequest<"vectorize-delete-vectors-by-id">; -type Body = Request["body"]; +type Body = Request; const command: CommandModule = { command: "delete-by-ids ", @@ -86,10 +86,10 @@ const command: CommandModule = { argv.accountId = accountId; if (argv.body) { - const bodyData = parseBody(argv.body); + const bodyData = parseBody(argv.body); const result = await withProgress(`Creating`, async () => client.vectorize.deleteByIds({ - body: bodyData, + ...bodyData, account_id: accountId, index_name: argv["index-name"], } satisfies Request) @@ -104,7 +104,7 @@ const command: CommandModule = { }); const result = await withProgress(`Creating`, async () => client.vectorize.deleteByIds({ - body: bodyData, + ...bodyData, account_id: accountId, index_name: argv["index-name"], } satisfies Request) diff --git a/packages/cli/src/commands/_generated/vectorize/get-by-ids.ts b/packages/cli/src/commands/_generated/vectorize/get-by-ids.ts index a8c32b441..96f2a4df4 100644 --- a/packages/cli/src/commands/_generated/vectorize/get-by-ids.ts +++ b/packages/cli/src/commands/_generated/vectorize/get-by-ids.ts @@ -48,7 +48,7 @@ function builder(yargs: Argv) { type Args = InferArgs; type Request = SdkRequest<"vectorize-get-vectors-by-id">; -type Body = Request["body"]; +type Body = Request; const command: CommandModule = { command: "get-by-ids ", @@ -86,10 +86,10 @@ const command: CommandModule = { argv.accountId = accountId; if (argv.body) { - const bodyData = parseBody(argv.body); + const bodyData = parseBody(argv.body); const result = await withProgress(`Creating`, async () => client.vectorize.getByIds({ - body: bodyData, + ...bodyData, account_id: accountId, index_name: argv["index-name"], } satisfies Request) @@ -104,7 +104,7 @@ const command: CommandModule = { }); const result = await withProgress(`Creating`, async () => client.vectorize.getByIds({ - body: bodyData, + ...bodyData, account_id: accountId, index_name: argv["index-name"], } satisfies Request) diff --git a/packages/cli/src/commands/_generated/zero-trust/cws/deployments/create.ts b/packages/cli/src/commands/_generated/zero-trust/cws/deployments/create.ts index b59d829a4..52e78d4fa 100644 --- a/packages/cli/src/commands/_generated/zero-trust/cws/deployments/create.ts +++ b/packages/cli/src/commands/_generated/zero-trust/cws/deployments/create.ts @@ -54,6 +54,7 @@ function builder(yargs: Argv) { type: "string", description: "Action for runtime Rego errors. Omit to use BLOCK.", choices: ["BLOCK", "SKIP"], + default: "BLOCK", }) .coerce("on-error-action", (value) => resolveFileToken(value, "on-error-action", "text") @@ -67,6 +68,7 @@ function builder(yargs: Argv) { type: "boolean", description: "Whether OPA builtin failures are raised as runtime evaluation errors. Omit to use the default true value.", + default: true, }) .option("dry-run", { type: "boolean", diff --git a/packages/cli/src/commands/_generated/zero-trust/cws/domain-acls/create.ts b/packages/cli/src/commands/_generated/zero-trust/cws/domain-acls/create.ts index 57ce3a30b..d5402cb13 100644 --- a/packages/cli/src/commands/_generated/zero-trust/cws/domain-acls/create.ts +++ b/packages/cli/src/commands/_generated/zero-trust/cws/domain-acls/create.ts @@ -39,7 +39,7 @@ function builder(yargs: Argv) { .option("entries", { type: "string", description: - "Domain entries for this ACL. Provide as a JSON array of objects or @path/to/file.json.", + "Domain entries for this ACL. Each domain must appear at most once. Provide as a JSON array of objects or @path/to/file.json.", }) .option("name", { type: "string", description: "Name of the domain ACL" }) .option("dry-run", { diff --git a/packages/cli/src/commands/_generated/zero-trust/cws/domain-acls/update.ts b/packages/cli/src/commands/_generated/zero-trust/cws/domain-acls/update.ts index 7e1391db9..af7d16d95 100644 --- a/packages/cli/src/commands/_generated/zero-trust/cws/domain-acls/update.ts +++ b/packages/cli/src/commands/_generated/zero-trust/cws/domain-acls/update.ts @@ -44,7 +44,7 @@ function builder(yargs: Argv) { .option("entries", { type: "string", description: - "Replacement set of domain entries. Provide as a JSON array of objects or @path/to/file.json.", + "Replacement set of domain entries. Each domain must appear at most once. Provide as a JSON array of objects or @path/to/file.json.", }) .option("name", { type: "string", description: "Name of the domain ACL" }) .option("dry-run", { diff --git a/packages/cli/src/sdk/openapi-version b/packages/cli/src/sdk/openapi-version index 1cdf134cf..51e9e9446 100644 --- a/packages/cli/src/sdk/openapi-version +++ b/packages/cli/src/sdk/openapi-version @@ -1 +1 @@ -af1cbe5ccd4d92c232d8cd9c10a42a49e276238c +995446172c0e88607283d1aae00f3c1f41294d4b diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/client/Client.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/client/Client.ts index ceab969e5..d782271f9 100644 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/client/Client.ts +++ b/packages/cli/src/sdk/sdk/api/resources/vectorize/client/Client.ts @@ -9,7 +9,6 @@ import * as environments from "../../../../environments.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import type * as CloudflareApi from "../../../index.js"; -import { DeprecatedIndexesClient } from "../resources/deprecatedIndexes/client/Client.js"; import { MetadataIndexClient } from "../resources/metadataIndex/client/Client.js"; export declare namespace VectorizeClient { @@ -20,17 +19,12 @@ export declare namespace VectorizeClient { export class VectorizeClient { protected readonly _options: NormalizedClientOptionsWithAuth; - protected _deprecatedIndexes: DeprecatedIndexesClient | undefined; protected _metadataIndex: MetadataIndexClient | undefined; constructor(options: VectorizeClient.Options = {}) { this._options = normalizeClientOptionsWithAuth(options); } - public get deprecatedIndexes(): DeprecatedIndexesClient { - return (this._deprecatedIndexes ??= new DeprecatedIndexesClient(this._options)); - } - public get metadataIndex(): MetadataIndexClient { return (this._metadataIndex ??= new MetadataIndexClient(this._options)); } @@ -106,7 +100,7 @@ export class VectorizeClient { /** * Creates and returns a new Vectorize Index. * - * @param {CloudflareApi.CreateVectorizeRequest} request + * @param {CloudflareApi.VectorizeCreateIndexRequest} request * @param {VectorizeClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link errors.CloudflareApiError} @@ -115,27 +109,25 @@ export class VectorizeClient { * @example * await client.vectorize.create({ * account_id: "account_id", - * body: { - * config: { - * dimensions: 768, - * metric: "cosine" - * }, - * name: "example-index" - * } + * config: { + * dimensions: 768, + * metric: "cosine" + * }, + * name: "example-index" * }) */ public create( - request: CloudflareApi.CreateVectorizeRequest, + request: CloudflareApi.VectorizeCreateIndexRequest, requestOptions?: VectorizeClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( - request: CloudflareApi.CreateVectorizeRequest, + request: CloudflareApi.VectorizeCreateIndexRequest, requestOptions?: VectorizeClient.RequestOptions, ): Promise> { - const { account_id: accountId, body: _body } = request; + const { account_id: accountId, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -328,7 +320,7 @@ export class VectorizeClient { /** * Delete a set of vectors from an index by their vector identifiers. * - * @param {CloudflareApi.DeleteByIdsVectorizeRequest} request + * @param {CloudflareApi.VectorizeIndexDeleteVectorsByIdRequest} request * @param {VectorizeClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link errors.CloudflareApiError} @@ -337,22 +329,21 @@ export class VectorizeClient { * @example * await client.vectorize.deleteByIds({ * account_id: "account_id", - * index_name: "index_name", - * body: {} + * index_name: "index_name" * }) */ public deleteByIds( - request: CloudflareApi.DeleteByIdsVectorizeRequest, + request: CloudflareApi.VectorizeIndexDeleteVectorsByIdRequest, requestOptions?: VectorizeClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__deleteByIds(request, requestOptions)); } private async __deleteByIds( - request: CloudflareApi.DeleteByIdsVectorizeRequest, + request: CloudflareApi.VectorizeIndexDeleteVectorsByIdRequest, requestOptions?: VectorizeClient.RequestOptions, ): Promise> { - const { account_id: accountId, index_name: indexName, body: _body } = request; + const { account_id: accountId, index_name: indexName, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -404,7 +395,7 @@ export class VectorizeClient { /** * Get a set of vectors from an index by their vector identifiers. * - * @param {CloudflareApi.GetByIdsVectorizeRequest} request + * @param {CloudflareApi.VectorizeIndexGetVectorsByIdRequest} request * @param {VectorizeClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link errors.CloudflareApiError} @@ -413,22 +404,21 @@ export class VectorizeClient { * @example * await client.vectorize.getByIds({ * account_id: "account_id", - * index_name: "index_name", - * body: {} + * index_name: "index_name" * }) */ public getByIds( - request: CloudflareApi.GetByIdsVectorizeRequest, + request: CloudflareApi.VectorizeIndexGetVectorsByIdRequest, requestOptions?: VectorizeClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getByIds(request, requestOptions)); } private async __getByIds( - request: CloudflareApi.GetByIdsVectorizeRequest, + request: CloudflareApi.VectorizeIndexGetVectorsByIdRequest, requestOptions?: VectorizeClient.RequestOptions, ): Promise> { - const { account_id: accountId, index_name: indexName, body: _body } = request; + const { account_id: accountId, index_name: indexName, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/client/requests/CreateVectorizeRequest.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/client/requests/CreateVectorizeRequest.ts deleted file mode 100644 index d9bfb8e4f..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/client/requests/CreateVectorizeRequest.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as CloudflareApi from "../../../../index.js"; - -/** - * @example - * { - * account_id: "account_id", - * body: { - * config: { - * dimensions: 768, - * metric: "cosine" - * }, - * name: "example-index" - * } - * } - */ -export interface CreateVectorizeRequest { - /** Identifier */ - account_id: string; - body: CloudflareApi.VectorizeCreateIndexRequest; -} diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/client/requests/VectorizeCreateIndexRequest.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/client/requests/VectorizeCreateIndexRequest.ts new file mode 100644 index 000000000..a03131831 --- /dev/null +++ b/packages/cli/src/sdk/sdk/api/resources/vectorize/client/requests/VectorizeCreateIndexRequest.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as CloudflareApi from "../../../../index.js"; + +/** + * @example + * { + * account_id: "account_id", + * config: { + * dimensions: 768, + * metric: "cosine" + * }, + * name: "example-index" + * } + */ +export interface VectorizeCreateIndexRequest { + /** Identifier */ + account_id: string; + config: CloudflareApi.VectorizeIndexConfiguration; + description?: CloudflareApi.VectorizeIndexDescription; + name: CloudflareApi.VectorizeIndexName; +} diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/client/requests/GetByIdsVectorizeRequest.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/client/requests/VectorizeIndexDeleteVectorsByIdRequest.ts similarity index 53% rename from packages/cli/src/sdk/sdk/api/resources/vectorize/client/requests/GetByIdsVectorizeRequest.ts rename to packages/cli/src/sdk/sdk/api/resources/vectorize/client/requests/VectorizeIndexDeleteVectorsByIdRequest.ts index 31a5c7a64..f82a5a0ba 100644 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/client/requests/GetByIdsVectorizeRequest.ts +++ b/packages/cli/src/sdk/sdk/api/resources/vectorize/client/requests/VectorizeIndexDeleteVectorsByIdRequest.ts @@ -6,13 +6,13 @@ import * as CloudflareApi from "../../../../index.js"; * @example * { * account_id: "account_id", - * index_name: "index_name", - * body: {} + * index_name: "index_name" * } */ -export interface GetByIdsVectorizeRequest { +export interface VectorizeIndexDeleteVectorsByIdRequest { /** Identifier */ account_id: string; index_name: string; - body: CloudflareApi.VectorizeIndexGetVectorsByIdRequest; + /** A list of vector identifiers to delete from the index indicated by the path. */ + ids?: CloudflareApi.VectorizeVectorIdentifier[]; } diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/client/requests/DeleteByIdsVectorizeRequest.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/client/requests/VectorizeIndexGetVectorsByIdRequest.ts similarity index 53% rename from packages/cli/src/sdk/sdk/api/resources/vectorize/client/requests/DeleteByIdsVectorizeRequest.ts rename to packages/cli/src/sdk/sdk/api/resources/vectorize/client/requests/VectorizeIndexGetVectorsByIdRequest.ts index c192b683a..2ce03f2bd 100644 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/client/requests/DeleteByIdsVectorizeRequest.ts +++ b/packages/cli/src/sdk/sdk/api/resources/vectorize/client/requests/VectorizeIndexGetVectorsByIdRequest.ts @@ -6,13 +6,13 @@ import * as CloudflareApi from "../../../../index.js"; * @example * { * account_id: "account_id", - * index_name: "index_name", - * body: {} + * index_name: "index_name" * } */ -export interface DeleteByIdsVectorizeRequest { +export interface VectorizeIndexGetVectorsByIdRequest { /** Identifier */ account_id: string; index_name: string; - body: CloudflareApi.VectorizeIndexDeleteVectorsByIdRequest; + /** A list of vector identifiers to retrieve from the index indicated by the path. */ + ids?: CloudflareApi.VectorizeVectorIdentifier[]; } diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/client/requests/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/client/requests/index.ts index 6deb05d7d..1c7d8260c 100644 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/client/requests/index.ts +++ b/packages/cli/src/sdk/sdk/api/resources/vectorize/client/requests/index.ts @@ -1,11 +1,11 @@ -export type { CreateVectorizeRequest } from "./CreateVectorizeRequest.js"; -export type { DeleteByIdsVectorizeRequest } from "./DeleteByIdsVectorizeRequest.js"; export type { DeleteVectorizeRequest } from "./DeleteVectorizeRequest.js"; -export type { GetByIdsVectorizeRequest } from "./GetByIdsVectorizeRequest.js"; export type { GetVectorizeRequest } from "./GetVectorizeRequest.js"; export type { InfoVectorizeRequest } from "./InfoVectorizeRequest.js"; export type { InsertVectorizeRequest } from "./InsertVectorizeRequest.js"; export type { ListVectorizeRequest } from "./ListVectorizeRequest.js"; export type { ListVectorsVectorizeRequest } from "./ListVectorsVectorizeRequest.js"; export type { UpsertVectorizeRequest } from "./UpsertVectorizeRequest.js"; +export type { VectorizeCreateIndexRequest } from "./VectorizeCreateIndexRequest.js"; +export type { VectorizeIndexDeleteVectorsByIdRequest } from "./VectorizeIndexDeleteVectorsByIdRequest.js"; +export type { VectorizeIndexGetVectorsByIdRequest } from "./VectorizeIndexGetVectorsByIdRequest.js"; export { VectorizeIndexQueryV2Request } from "./VectorizeIndexQueryV2Request.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/client/Client.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/client/Client.ts deleted file mode 100644 index ed51f4445..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/client/Client.ts +++ /dev/null @@ -1,434 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import * as core from "../../../../../../core/index.js"; -import { mergeHeaders } from "../../../../../../core/headers.js"; -import { mergeAdditionalBodyParameters } from "../../../../../../core/requestBody.js"; -import * as environments from "../../../../../../environments.js"; -import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; -import * as errors from "../../../../../../errors/index.js"; -import type * as CloudflareApi from "../../../../../index.js"; -import { DeleteByClient } from "../resources/deleteBy/client/Client.js"; -import { GetByClient } from "../resources/getBy/client/Client.js"; -import { InsertClient } from "../resources/insert/client/Client.js"; -import { QueryClient } from "../resources/query/client/Client.js"; -import { UpsertClient } from "../resources/upsert/client/Client.js"; - -export declare namespace DeprecatedIndexesClient { - export type Options = BaseClientOptions; - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class DeprecatedIndexesClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - protected _insert: InsertClient | undefined; - protected _query: QueryClient | undefined; - protected _upsert: UpsertClient | undefined; - protected _deleteBy: DeleteByClient | undefined; - protected _getBy: GetByClient | undefined; - - constructor(options: DeprecatedIndexesClient.Options = {}) { - this._options = normalizeClientOptionsWithAuth(options); - } - - public get insert(): InsertClient { - return (this._insert ??= new InsertClient(this._options)); - } - - public get query(): QueryClient { - return (this._query ??= new QueryClient(this._options)); - } - - public get upsert(): UpsertClient { - return (this._upsert ??= new UpsertClient(this._options)); - } - - public get deleteBy(): DeleteByClient { - return (this._deleteBy ??= new DeleteByClient(this._options)); - } - - public get getBy(): GetByClient { - return (this._getBy ??= new GetByClient(this._options)); - } - - /** - * @deprecated - * - * Returns a list of Vectorize Indexes - * - * @param {CloudflareApi.vectorize.ListDeprecatedIndexesRequest} request - * @param {DeprecatedIndexesClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link errors.CloudflareApiError} - * @throws {@link errors.CloudflareApiTimeoutError} - * - * @example - * await client.vectorize.deprecatedIndexes.list({ - * account_id: "account_id" - * }) - */ - public list( - request: CloudflareApi.vectorize.ListDeprecatedIndexesRequest, - requestOptions?: DeprecatedIndexesClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); - } - - private async __list( - request: CloudflareApi.vectorize.ListDeprecatedIndexesRequest, - requestOptions?: DeprecatedIndexesClient.RequestOptions, - ): Promise> { - const { account_id: accountId } = request; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - requestOptions?.headers, - ); - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.CloudflareApiEnvironment.Default, - `accounts/${core.url.encodePathParam(accountId)}/vectorize/indexes`, - ), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: _response.body as CloudflareApi.vectorize.ListDeprecatedIndexesResponse, - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - throw new errors.CloudflareApiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/accounts/{account_id}/vectorize/indexes", - ); - } - - /** - * @deprecated - * - * Creates and returns a new Vectorize Index. - * - * @param {CloudflareApi.vectorize.CreateDeprecatedIndexesRequest} request - * @param {DeprecatedIndexesClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link errors.CloudflareApiError} - * @throws {@link errors.CloudflareApiTimeoutError} - * - * @example - * await client.vectorize.deprecatedIndexes.create({ - * account_id: "account_id", - * body: { - * config: { - * dimensions: 768, - * metric: "cosine" - * }, - * name: "example-index" - * } - * }) - */ - public create( - request: CloudflareApi.vectorize.CreateDeprecatedIndexesRequest, - requestOptions?: DeprecatedIndexesClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); - } - - private async __create( - request: CloudflareApi.vectorize.CreateDeprecatedIndexesRequest, - requestOptions?: DeprecatedIndexesClient.RequestOptions, - ): Promise> { - const { account_id: accountId, body: _body } = request; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - requestOptions?.headers, - ); - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.CloudflareApiEnvironment.Default, - `accounts/${core.url.encodePathParam(accountId)}/vectorize/indexes`, - ), - method: "POST", - headers: _headers, - contentType: "application/json", - queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), - requestType: "json", - body: mergeAdditionalBodyParameters(_body, requestOptions?.additionalBodyParameters), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: _response.body as CloudflareApi.VectorizeCreateIndexResponse, - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - throw new errors.CloudflareApiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "POST", - "/accounts/{account_id}/vectorize/indexes", - ); - } - - /** - * @deprecated - * - * Returns the specified Vectorize Index. - * - * @param {CloudflareApi.vectorize.GetDeprecatedIndexesRequest} request - * @param {DeprecatedIndexesClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link errors.CloudflareApiError} - * @throws {@link errors.CloudflareApiTimeoutError} - * - * @example - * await client.vectorize.deprecatedIndexes.get({ - * account_id: "account_id", - * index_name: "index_name" - * }) - */ - public get( - request: CloudflareApi.vectorize.GetDeprecatedIndexesRequest, - requestOptions?: DeprecatedIndexesClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); - } - - private async __get( - request: CloudflareApi.vectorize.GetDeprecatedIndexesRequest, - requestOptions?: DeprecatedIndexesClient.RequestOptions, - ): Promise> { - const { account_id: accountId, index_name: indexName } = request; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - requestOptions?.headers, - ); - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.CloudflareApiEnvironment.Default, - `accounts/${core.url.encodePathParam(accountId)}/vectorize/indexes/${core.url.encodePathParam(indexName)}`, - ), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: _response.body as CloudflareApi.VectorizeCreateIndexResponse, - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - throw new errors.CloudflareApiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/accounts/{account_id}/vectorize/indexes/{index_name}", - ); - } - - /** - * @deprecated - * - * Updates and returns the specified Vectorize Index. - * - * @param {CloudflareApi.vectorize.VectorizeUpdateIndexRequest} request - * @param {DeprecatedIndexesClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link errors.CloudflareApiError} - * @throws {@link errors.CloudflareApiTimeoutError} - * - * @example - * await client.vectorize.deprecatedIndexes.update({ - * account_id: "account_id", - * index_name: "index_name", - * description: "This is my example index." - * }) - */ - public update( - request: CloudflareApi.vectorize.VectorizeUpdateIndexRequest, - requestOptions?: DeprecatedIndexesClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions)); - } - - private async __update( - request: CloudflareApi.vectorize.VectorizeUpdateIndexRequest, - requestOptions?: DeprecatedIndexesClient.RequestOptions, - ): Promise> { - const { account_id: accountId, index_name: indexName, ..._body } = request; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - requestOptions?.headers, - ); - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.CloudflareApiEnvironment.Default, - `accounts/${core.url.encodePathParam(accountId)}/vectorize/indexes/${core.url.encodePathParam(indexName)}`, - ), - method: "PUT", - headers: _headers, - contentType: "application/json", - queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), - requestType: "json", - body: mergeAdditionalBodyParameters(_body, requestOptions?.additionalBodyParameters), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: _response.body as CloudflareApi.VectorizeCreateIndexResponse, - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - throw new errors.CloudflareApiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "PUT", - "/accounts/{account_id}/vectorize/indexes/{index_name}", - ); - } - - /** - * @deprecated - * - * Deletes the specified Vectorize Index. - * - * @param {CloudflareApi.vectorize.DeleteDeprecatedIndexesRequest} request - * @param {DeprecatedIndexesClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link errors.CloudflareApiError} - * @throws {@link errors.CloudflareApiTimeoutError} - * - * @example - * await client.vectorize.deprecatedIndexes.delete({ - * account_id: "account_id", - * index_name: "index_name" - * }) - */ - public delete( - request: CloudflareApi.vectorize.DeleteDeprecatedIndexesRequest, - requestOptions?: DeprecatedIndexesClient.RequestOptions, - ): core.HttpResponsePromise | null> { - return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions)); - } - - private async __delete( - request: CloudflareApi.vectorize.DeleteDeprecatedIndexesRequest, - requestOptions?: DeprecatedIndexesClient.RequestOptions, - ): Promise | null>> { - const { account_id: accountId, index_name: indexName } = request; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - requestOptions?.headers, - ); - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.CloudflareApiEnvironment.Default, - `accounts/${core.url.encodePathParam(accountId)}/vectorize/indexes/${core.url.encodePathParam(indexName)}`, - ), - method: "DELETE", - headers: _headers, - queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { data: _response.body as Record | null, rawResponse: _response.rawResponse }; - } - - if (_response.error.reason === "status-code") { - throw new errors.CloudflareApiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "DELETE", - "/accounts/{account_id}/vectorize/indexes/{index_name}", - ); - } -} diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/client/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/client/index.ts deleted file mode 100644 index 195f9aa8a..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/client/requests/CreateDeprecatedIndexesRequest.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/client/requests/CreateDeprecatedIndexesRequest.ts deleted file mode 100644 index 78e4f8e83..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/client/requests/CreateDeprecatedIndexesRequest.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as CloudflareApi from "../../../../../../index.js"; - -/** - * @example - * { - * account_id: "account_id", - * body: { - * config: { - * dimensions: 768, - * metric: "cosine" - * }, - * name: "example-index" - * } - * } - */ -export interface CreateDeprecatedIndexesRequest { - /** Identifier */ - account_id: string; - body: CloudflareApi.VectorizeCreateIndexRequest; -} diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/client/requests/DeleteDeprecatedIndexesRequest.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/client/requests/DeleteDeprecatedIndexesRequest.ts deleted file mode 100644 index 72019ba24..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/client/requests/DeleteDeprecatedIndexesRequest.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * account_id: "account_id", - * index_name: "index_name" - * } - */ -export interface DeleteDeprecatedIndexesRequest { - /** Identifier */ - account_id: string; - index_name: string; -} diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/client/requests/GetDeprecatedIndexesRequest.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/client/requests/GetDeprecatedIndexesRequest.ts deleted file mode 100644 index 404279275..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/client/requests/GetDeprecatedIndexesRequest.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * account_id: "account_id", - * index_name: "index_name" - * } - */ -export interface GetDeprecatedIndexesRequest { - /** Identifier */ - account_id: string; - index_name: string; -} diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/client/requests/ListDeprecatedIndexesRequest.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/client/requests/ListDeprecatedIndexesRequest.ts deleted file mode 100644 index a88632fc2..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/client/requests/ListDeprecatedIndexesRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * account_id: "account_id" - * } - */ -export interface ListDeprecatedIndexesRequest { - /** Identifier */ - account_id: string; -} diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/client/requests/VectorizeUpdateIndexRequest.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/client/requests/VectorizeUpdateIndexRequest.ts deleted file mode 100644 index 74621a9cf..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/client/requests/VectorizeUpdateIndexRequest.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as CloudflareApi from "../../../../../../index.js"; - -/** - * @example - * { - * account_id: "account_id", - * index_name: "index_name", - * description: "This is my example index." - * } - */ -export interface VectorizeUpdateIndexRequest { - /** Identifier */ - account_id: string; - index_name: string; - description: CloudflareApi.VectorizeIndexDescription; -} diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/client/requests/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/client/requests/index.ts deleted file mode 100644 index 667083519..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/client/requests/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type { CreateDeprecatedIndexesRequest } from "./CreateDeprecatedIndexesRequest.js"; -export type { DeleteDeprecatedIndexesRequest } from "./DeleteDeprecatedIndexesRequest.js"; -export type { GetDeprecatedIndexesRequest } from "./GetDeprecatedIndexesRequest.js"; -export type { ListDeprecatedIndexesRequest } from "./ListDeprecatedIndexesRequest.js"; -export type { VectorizeUpdateIndexRequest } from "./VectorizeUpdateIndexRequest.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/exports.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/exports.ts deleted file mode 100644 index 3602fca53..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/exports.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { DeprecatedIndexesClient } from "./client/Client.js"; -export * from "./client/index.js"; -export * from "./resources/index.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/index.ts deleted file mode 100644 index 0ef16e763..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./client/index.js"; -export * from "./resources/index.js"; -export * from "./types/index.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/client/Client.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/client/Client.ts deleted file mode 100644 index 6d5a00d9c..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/client/Client.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions } from "../../../../../../../../BaseClient.js"; -import { - normalizeClientOptionsWithAuth, - type NormalizedClientOptionsWithAuth, -} from "../../../../../../../../BaseClient.js"; -import * as core from "../../../../../../../../core/index.js"; -import * as environments from "../../../../../../../../environments.js"; -import { IdsClient } from "../resources/ids/client/Client.js"; - -export declare namespace DeleteByClient { - export type Options = BaseClientOptions; -} - -export class DeleteByClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - protected _ids: IdsClient | undefined; - - constructor(options: DeleteByClient.Options = {}) { - this._options = normalizeClientOptionsWithAuth(options); - } - - public get ids(): IdsClient { - return (this._ids ??= new IdsClient(this._options)); - } -} diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/client/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/client/index.ts deleted file mode 100644 index cb0ff5c3b..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/exports.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/exports.ts deleted file mode 100644 index 5dee50b05..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/exports.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { DeleteByClient } from "./client/Client.js"; -export * from "./client/index.js"; -export * from "./resources/index.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/index.ts deleted file mode 100644 index 9eb1192dc..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./client/index.js"; -export * from "./resources/index.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/resources/ids/client/Client.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/resources/ids/client/Client.ts deleted file mode 100644 index 883173682..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/resources/ids/client/Client.ts +++ /dev/null @@ -1,106 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../../../BaseClient.js"; -import { - normalizeClientOptionsWithAuth, - type NormalizedClientOptionsWithAuth, -} from "../../../../../../../../../../BaseClient.js"; -import * as core from "../../../../../../../../../../core/index.js"; -import { mergeHeaders } from "../../../../../../../../../../core/headers.js"; -import { mergeAdditionalBodyParameters } from "../../../../../../../../../../core/requestBody.js"; -import * as environments from "../../../../../../../../../../environments.js"; -import { handleNonStatusCodeError } from "../../../../../../../../../../errors/handleNonStatusCodeError.js"; -import * as errors from "../../../../../../../../../../errors/index.js"; -import type * as CloudflareApi from "../../../../../../../../../index.js"; - -export declare namespace IdsClient { - export type Options = BaseClientOptions; - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class IdsClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - - constructor(options: IdsClient.Options = {}) { - this._options = normalizeClientOptionsWithAuth(options); - } - - /** - * @deprecated - * - * Delete a set of vectors from an index by their vector identifiers. - * - * @param {CloudflareApi.vectorize.deprecatedIndexes.deleteBy.CreateIdsRequest} request - * @param {IdsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link errors.CloudflareApiError} - * @throws {@link errors.CloudflareApiTimeoutError} - * - * @example - * await client.vectorize.deprecatedIndexes.deleteBy.ids.create({ - * account_id: "account_id", - * index_name: "index_name", - * body: {} - * }) - */ - public create( - request: CloudflareApi.vectorize.deprecatedIndexes.deleteBy.CreateIdsRequest, - requestOptions?: IdsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); - } - - private async __create( - request: CloudflareApi.vectorize.deprecatedIndexes.deleteBy.CreateIdsRequest, - requestOptions?: IdsClient.RequestOptions, - ): Promise> { - const { account_id: accountId, index_name: indexName, body: _body } = request; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - requestOptions?.headers, - ); - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.CloudflareApiEnvironment.Default, - `accounts/${core.url.encodePathParam(accountId)}/vectorize/indexes/${core.url.encodePathParam(indexName)}/delete-by-ids`, - ), - method: "POST", - headers: _headers, - contentType: "application/json", - queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), - requestType: "json", - body: mergeAdditionalBodyParameters(_body, requestOptions?.additionalBodyParameters), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: _response.body as CloudflareApi.VectorizeIndexDeleteVectorsByIdResponse, - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - throw new errors.CloudflareApiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "POST", - "/accounts/{account_id}/vectorize/indexes/{index_name}/delete-by-ids", - ); - } -} diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/resources/ids/client/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/resources/ids/client/index.ts deleted file mode 100644 index 195f9aa8a..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/resources/ids/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/resources/ids/client/requests/CreateIdsRequest.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/resources/ids/client/requests/CreateIdsRequest.ts deleted file mode 100644 index 66020290d..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/resources/ids/client/requests/CreateIdsRequest.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as CloudflareApi from "../../../../../../../../../../index.js"; - -/** - * @example - * { - * account_id: "account_id", - * index_name: "index_name", - * body: {} - * } - */ -export interface CreateIdsRequest { - /** Identifier */ - account_id: string; - index_name: string; - body: CloudflareApi.VectorizeIndexDeleteVectorsByIdRequest; -} diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/resources/ids/client/requests/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/resources/ids/client/requests/index.ts deleted file mode 100644 index 259d36447..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/resources/ids/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export type { CreateIdsRequest } from "./CreateIdsRequest.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/resources/ids/exports.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/resources/ids/exports.ts deleted file mode 100644 index 1f9c3e9f3..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/resources/ids/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { IdsClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/resources/ids/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/resources/ids/index.ts deleted file mode 100644 index 914b8c3c7..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/resources/ids/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/resources/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/resources/index.ts deleted file mode 100644 index a0ca37bf7..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/deleteBy/resources/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * as ids from "./ids/index.js"; -export * from "./ids/client/requests/index.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/client/Client.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/client/Client.ts deleted file mode 100644 index 2507fb1e3..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/client/Client.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions } from "../../../../../../../../BaseClient.js"; -import { - normalizeClientOptionsWithAuth, - type NormalizedClientOptionsWithAuth, -} from "../../../../../../../../BaseClient.js"; -import * as core from "../../../../../../../../core/index.js"; -import * as environments from "../../../../../../../../environments.js"; -import { IdsClient } from "../resources/ids/client/Client.js"; - -export declare namespace GetByClient { - export type Options = BaseClientOptions; -} - -export class GetByClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - protected _ids: IdsClient | undefined; - - constructor(options: GetByClient.Options = {}) { - this._options = normalizeClientOptionsWithAuth(options); - } - - public get ids(): IdsClient { - return (this._ids ??= new IdsClient(this._options)); - } -} diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/client/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/client/index.ts deleted file mode 100644 index cb0ff5c3b..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/exports.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/exports.ts deleted file mode 100644 index 6a828cf9d..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/exports.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { GetByClient } from "./client/Client.js"; -export * from "./client/index.js"; -export * from "./resources/index.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/index.ts deleted file mode 100644 index 9eb1192dc..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./client/index.js"; -export * from "./resources/index.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/resources/ids/client/Client.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/resources/ids/client/Client.ts deleted file mode 100644 index 11a51ff19..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/resources/ids/client/Client.ts +++ /dev/null @@ -1,106 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../../../BaseClient.js"; -import { - normalizeClientOptionsWithAuth, - type NormalizedClientOptionsWithAuth, -} from "../../../../../../../../../../BaseClient.js"; -import * as core from "../../../../../../../../../../core/index.js"; -import { mergeHeaders } from "../../../../../../../../../../core/headers.js"; -import { mergeAdditionalBodyParameters } from "../../../../../../../../../../core/requestBody.js"; -import * as environments from "../../../../../../../../../../environments.js"; -import { handleNonStatusCodeError } from "../../../../../../../../../../errors/handleNonStatusCodeError.js"; -import * as errors from "../../../../../../../../../../errors/index.js"; -import type * as CloudflareApi from "../../../../../../../../../index.js"; - -export declare namespace IdsClient { - export type Options = BaseClientOptions; - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class IdsClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - - constructor(options: IdsClient.Options = {}) { - this._options = normalizeClientOptionsWithAuth(options); - } - - /** - * @deprecated - * - * Get a set of vectors from an index by their vector identifiers. - * - * @param {CloudflareApi.vectorize.deprecatedIndexes.getBy.CreateIdsRequest} request - * @param {IdsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link errors.CloudflareApiError} - * @throws {@link errors.CloudflareApiTimeoutError} - * - * @example - * await client.vectorize.deprecatedIndexes.getBy.ids.create({ - * account_id: "account_id", - * index_name: "index_name", - * body: {} - * }) - */ - public create( - request: CloudflareApi.vectorize.deprecatedIndexes.getBy.CreateIdsRequest, - requestOptions?: IdsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); - } - - private async __create( - request: CloudflareApi.vectorize.deprecatedIndexes.getBy.CreateIdsRequest, - requestOptions?: IdsClient.RequestOptions, - ): Promise> { - const { account_id: accountId, index_name: indexName, body: _body } = request; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - requestOptions?.headers, - ); - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.CloudflareApiEnvironment.Default, - `accounts/${core.url.encodePathParam(accountId)}/vectorize/indexes/${core.url.encodePathParam(indexName)}/get-by-ids`, - ), - method: "POST", - headers: _headers, - contentType: "application/json", - queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), - requestType: "json", - body: mergeAdditionalBodyParameters(_body, requestOptions?.additionalBodyParameters), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: _response.body as CloudflareApi.vectorize.deprecatedIndexes.getBy.CreateIdsResponse, - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - throw new errors.CloudflareApiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "POST", - "/accounts/{account_id}/vectorize/indexes/{index_name}/get-by-ids", - ); - } -} diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/resources/ids/client/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/resources/ids/client/index.ts deleted file mode 100644 index 195f9aa8a..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/resources/ids/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/resources/ids/client/requests/CreateIdsRequest.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/resources/ids/client/requests/CreateIdsRequest.ts deleted file mode 100644 index 6f4346571..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/resources/ids/client/requests/CreateIdsRequest.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as CloudflareApi from "../../../../../../../../../../index.js"; - -/** - * @example - * { - * account_id: "account_id", - * index_name: "index_name", - * body: {} - * } - */ -export interface CreateIdsRequest { - /** Identifier */ - account_id: string; - index_name: string; - body: CloudflareApi.VectorizeIndexGetVectorsByIdRequest; -} diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/resources/ids/client/requests/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/resources/ids/client/requests/index.ts deleted file mode 100644 index 259d36447..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/resources/ids/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export type { CreateIdsRequest } from "./CreateIdsRequest.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/resources/ids/exports.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/resources/ids/exports.ts deleted file mode 100644 index 1f9c3e9f3..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/resources/ids/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { IdsClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/resources/ids/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/resources/ids/index.ts deleted file mode 100644 index d9adb1af9..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/resources/ids/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./client/index.js"; -export * from "./types/index.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/resources/ids/types/CreateIdsResponse.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/resources/ids/types/CreateIdsResponse.ts deleted file mode 100644 index c806b075f..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/resources/ids/types/CreateIdsResponse.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as CloudflareApi from "../../../../../../../../../index.js"; - -export interface CreateIdsResponse { - result: CloudflareApi.VectorizeIndexGetVectorsByIdResponse; - result_info?: Record | undefined; -} diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/resources/ids/types/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/resources/ids/types/index.ts deleted file mode 100644 index 37fa28744..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/resources/ids/types/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./CreateIdsResponse.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/resources/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/resources/index.ts deleted file mode 100644 index 34b25e35e..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/getBy/resources/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * as ids from "./ids/index.js"; -export * from "./ids/client/requests/index.js"; -export * from "./ids/types/index.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/index.ts deleted file mode 100644 index a62817b28..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -export * as deleteBy from "./deleteBy/index.js"; -export * as getBy from "./getBy/index.js"; -export * as insert from "./insert/index.js"; -export * from "./insert/client/requests/index.js"; -export * as query from "./query/index.js"; -export * from "./query/client/requests/index.js"; -export * as upsert from "./upsert/index.js"; -export * from "./upsert/client/requests/index.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/insert/client/Client.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/insert/client/Client.ts deleted file mode 100644 index 5168e01c1..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/insert/client/Client.ts +++ /dev/null @@ -1,106 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../BaseClient.js"; -import { - normalizeClientOptionsWithAuth, - type NormalizedClientOptionsWithAuth, -} from "../../../../../../../../BaseClient.js"; -import * as core from "../../../../../../../../core/index.js"; -import { mergeHeaders } from "../../../../../../../../core/headers.js"; -import { mergeAdditionalBodyParameters } from "../../../../../../../../core/requestBody.js"; -import * as environments from "../../../../../../../../environments.js"; -import { handleNonStatusCodeError } from "../../../../../../../../errors/handleNonStatusCodeError.js"; -import * as errors from "../../../../../../../../errors/index.js"; -import type * as CloudflareApi from "../../../../../../../index.js"; - -export declare namespace InsertClient { - export type Options = BaseClientOptions; - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class InsertClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - - constructor(options: InsertClient.Options = {}) { - this._options = normalizeClientOptionsWithAuth(options); - } - - /** - * @deprecated - * - * Inserts vectors into the specified index and returns the count of the vectors successfully inserted. - * - * @param {CloudflareApi.vectorize.deprecatedIndexes.CreateInsertRequest} request - * @param {InsertClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link errors.CloudflareApiError} - * @throws {@link errors.CloudflareApiTimeoutError} - * - * @example - * await client.vectorize.deprecatedIndexes.insert.create({ - * account_id: "account_id", - * index_name: "index_name", - * body: "@/path/to/vectors.ndjson" - * }) - */ - public create( - request: CloudflareApi.vectorize.deprecatedIndexes.CreateInsertRequest, - requestOptions?: InsertClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); - } - - private async __create( - request: CloudflareApi.vectorize.deprecatedIndexes.CreateInsertRequest, - requestOptions?: InsertClient.RequestOptions, - ): Promise> { - const { account_id: accountId, index_name: indexName, body: _body } = request; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - requestOptions?.headers, - ); - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.CloudflareApiEnvironment.Default, - `accounts/${core.url.encodePathParam(accountId)}/vectorize/indexes/${core.url.encodePathParam(indexName)}/insert`, - ), - method: "POST", - headers: _headers, - contentType: "application/x-ndjson", - queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), - requestType: "json", - body: mergeAdditionalBodyParameters(_body, requestOptions?.additionalBodyParameters), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: _response.body as CloudflareApi.VectorizeIndexInsertResponse, - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - throw new errors.CloudflareApiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "POST", - "/accounts/{account_id}/vectorize/indexes/{index_name}/insert", - ); - } -} diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/insert/client/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/insert/client/index.ts deleted file mode 100644 index 195f9aa8a..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/insert/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/insert/client/requests/CreateInsertRequest.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/insert/client/requests/CreateInsertRequest.ts deleted file mode 100644 index 8c308e8a9..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/insert/client/requests/CreateInsertRequest.ts +++ /dev/null @@ -1,17 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * account_id: "account_id", - * index_name: "index_name", - * body: "@/path/to/vectors.ndjson" - * } - */ -export interface CreateInsertRequest { - /** Identifier */ - account_id: string; - index_name: string; - /** ndjson file containing vectors to insert. */ - body: string; -} diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/insert/client/requests/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/insert/client/requests/index.ts deleted file mode 100644 index 9a308f823..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/insert/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export type { CreateInsertRequest } from "./CreateInsertRequest.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/insert/exports.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/insert/exports.ts deleted file mode 100644 index df7224740..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/insert/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { InsertClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/insert/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/insert/index.ts deleted file mode 100644 index 914b8c3c7..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/insert/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/query/client/Client.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/query/client/Client.ts deleted file mode 100644 index 0c7a60fe2..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/query/client/Client.ts +++ /dev/null @@ -1,106 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../BaseClient.js"; -import { - normalizeClientOptionsWithAuth, - type NormalizedClientOptionsWithAuth, -} from "../../../../../../../../BaseClient.js"; -import * as core from "../../../../../../../../core/index.js"; -import { mergeHeaders } from "../../../../../../../../core/headers.js"; -import { mergeAdditionalBodyParameters } from "../../../../../../../../core/requestBody.js"; -import * as environments from "../../../../../../../../environments.js"; -import { handleNonStatusCodeError } from "../../../../../../../../errors/handleNonStatusCodeError.js"; -import * as errors from "../../../../../../../../errors/index.js"; -import type * as CloudflareApi from "../../../../../../../index.js"; - -export declare namespace QueryClient { - export type Options = BaseClientOptions; - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class QueryClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - - constructor(options: QueryClient.Options = {}) { - this._options = normalizeClientOptionsWithAuth(options); - } - - /** - * @deprecated - * - * Finds vectors closest to a given vector in an index. - * - * @param {CloudflareApi.vectorize.deprecatedIndexes.VectorizeIndexQueryRequest} request - * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link errors.CloudflareApiError} - * @throws {@link errors.CloudflareApiTimeoutError} - * - * @example - * await client.vectorize.deprecatedIndexes.query.create({ - * account_id: "account_id", - * index_name: "index_name", - * vector: [0.5, 0.5, 0.5] - * }) - */ - public create( - request: CloudflareApi.vectorize.deprecatedIndexes.VectorizeIndexQueryRequest, - requestOptions?: QueryClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); - } - - private async __create( - request: CloudflareApi.vectorize.deprecatedIndexes.VectorizeIndexQueryRequest, - requestOptions?: QueryClient.RequestOptions, - ): Promise> { - const { account_id: accountId, index_name: indexName, ..._body } = request; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - requestOptions?.headers, - ); - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.CloudflareApiEnvironment.Default, - `accounts/${core.url.encodePathParam(accountId)}/vectorize/indexes/${core.url.encodePathParam(indexName)}/query`, - ), - method: "POST", - headers: _headers, - contentType: "application/json", - queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), - requestType: "json", - body: mergeAdditionalBodyParameters(_body, requestOptions?.additionalBodyParameters), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: _response.body as CloudflareApi.VectorizeIndexQueryResponse, - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - throw new errors.CloudflareApiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "POST", - "/accounts/{account_id}/vectorize/indexes/{index_name}/query", - ); - } -} diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/query/client/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/query/client/index.ts deleted file mode 100644 index 195f9aa8a..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/query/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/query/client/requests/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/query/client/requests/index.ts deleted file mode 100644 index ea98755d3..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/query/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export type { VectorizeIndexQueryRequest } from "./VectorizeIndexQueryRequest.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/query/exports.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/query/exports.ts deleted file mode 100644 index b3cc1ffcd..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/query/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { QueryClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/query/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/query/index.ts deleted file mode 100644 index 914b8c3c7..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/query/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/upsert/client/Client.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/upsert/client/Client.ts deleted file mode 100644 index c9346bb57..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/upsert/client/Client.ts +++ /dev/null @@ -1,106 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../BaseClient.js"; -import { - normalizeClientOptionsWithAuth, - type NormalizedClientOptionsWithAuth, -} from "../../../../../../../../BaseClient.js"; -import * as core from "../../../../../../../../core/index.js"; -import { mergeHeaders } from "../../../../../../../../core/headers.js"; -import { mergeAdditionalBodyParameters } from "../../../../../../../../core/requestBody.js"; -import * as environments from "../../../../../../../../environments.js"; -import { handleNonStatusCodeError } from "../../../../../../../../errors/handleNonStatusCodeError.js"; -import * as errors from "../../../../../../../../errors/index.js"; -import type * as CloudflareApi from "../../../../../../../index.js"; - -export declare namespace UpsertClient { - export type Options = BaseClientOptions; - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class UpsertClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - - constructor(options: UpsertClient.Options = {}) { - this._options = normalizeClientOptionsWithAuth(options); - } - - /** - * @deprecated - * - * Upserts vectors into the specified index, creating them if they do not exist and returns the count of values and ids successfully inserted. - * - * @param {CloudflareApi.vectorize.deprecatedIndexes.CreateUpsertRequest} request - * @param {UpsertClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link errors.CloudflareApiError} - * @throws {@link errors.CloudflareApiTimeoutError} - * - * @example - * await client.vectorize.deprecatedIndexes.upsert.create({ - * account_id: "account_id", - * index_name: "index_name", - * body: "@/path/to/vectors.ndjson" - * }) - */ - public create( - request: CloudflareApi.vectorize.deprecatedIndexes.CreateUpsertRequest, - requestOptions?: UpsertClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); - } - - private async __create( - request: CloudflareApi.vectorize.deprecatedIndexes.CreateUpsertRequest, - requestOptions?: UpsertClient.RequestOptions, - ): Promise> { - const { account_id: accountId, index_name: indexName, body: _body } = request; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - requestOptions?.headers, - ); - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.CloudflareApiEnvironment.Default, - `accounts/${core.url.encodePathParam(accountId)}/vectorize/indexes/${core.url.encodePathParam(indexName)}/upsert`, - ), - method: "POST", - headers: _headers, - contentType: "application/x-ndjson", - queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), - requestType: "json", - body: mergeAdditionalBodyParameters(_body, requestOptions?.additionalBodyParameters), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: _response.body as CloudflareApi.VectorizeIndexUpsertResponse, - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - throw new errors.CloudflareApiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "POST", - "/accounts/{account_id}/vectorize/indexes/{index_name}/upsert", - ); - } -} diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/upsert/client/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/upsert/client/index.ts deleted file mode 100644 index 195f9aa8a..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/upsert/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/upsert/client/requests/CreateUpsertRequest.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/upsert/client/requests/CreateUpsertRequest.ts deleted file mode 100644 index 5399d0375..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/upsert/client/requests/CreateUpsertRequest.ts +++ /dev/null @@ -1,17 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * account_id: "account_id", - * index_name: "index_name", - * body: "@/path/to/vectors.ndjson" - * } - */ -export interface CreateUpsertRequest { - /** Identifier */ - account_id: string; - index_name: string; - /** ndjson file containing vectors to upsert. */ - body: string; -} diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/upsert/client/requests/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/upsert/client/requests/index.ts deleted file mode 100644 index a59c69d62..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/upsert/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export type { CreateUpsertRequest } from "./CreateUpsertRequest.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/upsert/exports.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/upsert/exports.ts deleted file mode 100644 index 432bdd55b..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/upsert/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { UpsertClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/upsert/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/upsert/index.ts deleted file mode 100644 index 914b8c3c7..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/upsert/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/types/ListDeprecatedIndexesResponse.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/types/ListDeprecatedIndexesResponse.ts deleted file mode 100644 index df765b1a0..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/types/ListDeprecatedIndexesResponse.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as CloudflareApi from "../../../../../index.js"; - -export interface ListDeprecatedIndexesResponse { - result: CloudflareApi.VectorizeCreateIndexResponse[]; - result_info?: Record | undefined; -} diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/types/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/types/index.ts deleted file mode 100644 index 326ffb6c8..000000000 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/types/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./ListDeprecatedIndexesResponse.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/index.ts b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/index.ts index 5c4a94b43..787e64aa5 100644 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/index.ts +++ b/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/index.ts @@ -1,5 +1,2 @@ -export * as deprecatedIndexes from "./deprecatedIndexes/index.js"; -export * from "./deprecatedIndexes/client/requests/index.js"; -export * from "./deprecatedIndexes/types/index.js"; export * as metadataIndex from "./metadataIndex/index.js"; export * from "./metadataIndex/client/requests/index.js"; diff --git a/packages/cli/src/sdk/sdk/api/resources/zeroTrust/resources/cws/resources/domainAcls/client/requests/CwsCreateDomainAclInputBody.ts b/packages/cli/src/sdk/sdk/api/resources/zeroTrust/resources/cws/resources/domainAcls/client/requests/CwsCreateDomainAclInputBody.ts index f13effa3a..a66e6bdde 100644 --- a/packages/cli/src/sdk/sdk/api/resources/zeroTrust/resources/cws/resources/domainAcls/client/requests/CwsCreateDomainAclInputBody.ts +++ b/packages/cli/src/sdk/sdk/api/resources/zeroTrust/resources/cws/resources/domainAcls/client/requests/CwsCreateDomainAclInputBody.ts @@ -15,7 +15,7 @@ export interface CwsCreateDomainAclInputBody { account_id: string; /** Default action when no entry matches */ default_action: CwsCreateDomainAclInputBody.DefaultAction; - /** Domain entries for this ACL */ + /** Domain entries for this ACL. Each domain must appear at most once. */ entries: CloudflareApi.CwsDomainAclEntry[] | null; /** Name of the domain ACL */ name: string; diff --git a/packages/cli/src/sdk/sdk/api/resources/zeroTrust/resources/cws/resources/domainAcls/client/requests/CwsUpdateDomainAclInputBody.ts b/packages/cli/src/sdk/sdk/api/resources/zeroTrust/resources/cws/resources/domainAcls/client/requests/CwsUpdateDomainAclInputBody.ts index 8676eea4b..84ec25cde 100644 --- a/packages/cli/src/sdk/sdk/api/resources/zeroTrust/resources/cws/resources/domainAcls/client/requests/CwsUpdateDomainAclInputBody.ts +++ b/packages/cli/src/sdk/sdk/api/resources/zeroTrust/resources/cws/resources/domainAcls/client/requests/CwsUpdateDomainAclInputBody.ts @@ -18,7 +18,7 @@ export interface CwsUpdateDomainAclInputBody { domain_acl_id: string; /** Default action when no entry matches */ default_action: CwsUpdateDomainAclInputBody.DefaultAction; - /** Replacement set of domain entries */ + /** Replacement set of domain entries. Each domain must appear at most once. */ entries: CloudflareApi.CwsDomainAclEntry[] | null; /** Name of the domain ACL */ name: string; diff --git a/packages/cli/src/sdk/sdk/api/resources/zeroTrust/resources/cws/resources/regoMetadata/client/Client.ts b/packages/cli/src/sdk/sdk/api/resources/zeroTrust/resources/cws/resources/regoMetadata/client/Client.ts index cf32dee3f..8fa83b7dc 100644 --- a/packages/cli/src/sdk/sdk/api/resources/zeroTrust/resources/cws/resources/regoMetadata/client/Client.ts +++ b/packages/cli/src/sdk/sdk/api/resources/zeroTrust/resources/cws/resources/regoMetadata/client/Client.ts @@ -136,7 +136,7 @@ export class RegoMetadataClient { * await client.zeroTrust.cws.regoMetadata.create({ * account_id: "account_id", * body: { - * data: null, + * data: {}, * import_path: "import_path", * name: "name" * } @@ -282,7 +282,7 @@ export class RegoMetadataClient { * account_id: "account_id", * rego_metadata_id: "rego_metadata_id", * body: { - * data: null, + * data: {}, * import_path: "import_path", * name: "name" * } diff --git a/packages/cli/src/sdk/sdk/api/resources/zeroTrust/resources/cws/resources/regoMetadata/client/requests/CreateRegoMetadataRequest.ts b/packages/cli/src/sdk/sdk/api/resources/zeroTrust/resources/cws/resources/regoMetadata/client/requests/CreateRegoMetadataRequest.ts index 0df92d629..d28a412cb 100644 --- a/packages/cli/src/sdk/sdk/api/resources/zeroTrust/resources/cws/resources/regoMetadata/client/requests/CreateRegoMetadataRequest.ts +++ b/packages/cli/src/sdk/sdk/api/resources/zeroTrust/resources/cws/resources/regoMetadata/client/requests/CreateRegoMetadataRequest.ts @@ -7,7 +7,7 @@ import * as CloudflareApi from "../../../../../../../../index.js"; * { * account_id: "account_id", * body: { - * data: null, + * data: {}, * import_path: "import_path", * name: "name" * } diff --git a/packages/cli/src/sdk/sdk/api/resources/zeroTrust/resources/cws/resources/regoMetadata/client/requests/UpdateRegoMetadataRequest.ts b/packages/cli/src/sdk/sdk/api/resources/zeroTrust/resources/cws/resources/regoMetadata/client/requests/UpdateRegoMetadataRequest.ts index 7f1a7bf22..4ceac705c 100644 --- a/packages/cli/src/sdk/sdk/api/resources/zeroTrust/resources/cws/resources/regoMetadata/client/requests/UpdateRegoMetadataRequest.ts +++ b/packages/cli/src/sdk/sdk/api/resources/zeroTrust/resources/cws/resources/regoMetadata/client/requests/UpdateRegoMetadataRequest.ts @@ -8,7 +8,7 @@ import * as CloudflareApi from "../../../../../../../../index.js"; * account_id: "account_id", * rego_metadata_id: "rego_metadata_id", * body: { - * data: null, + * data: {}, * import_path: "import_path", * name: "name" * } diff --git a/packages/cli/src/sdk/sdk/api/types/CwsDomainAcl.ts b/packages/cli/src/sdk/sdk/api/types/CwsDomainAcl.ts index ec117c17a..bf864b4ce 100644 --- a/packages/cli/src/sdk/sdk/api/types/CwsDomainAcl.ts +++ b/packages/cli/src/sdk/sdk/api/types/CwsDomainAcl.ts @@ -6,7 +6,7 @@ export interface CwsDomainAcl { created_at?: string | undefined; /** Action applied when no entry matches the request domain */ default_action: CwsDomainAcl.DefaultAction; - /** Per-domain action overrides */ + /** Per-domain action overrides. Each domain appears at most once. */ entries: CloudflareApi.CwsDomainAclEntry[] | null; /** Server-assigned UUID */ id?: string | undefined; diff --git a/packages/cli/src/sdk/sdk/api/types/CwsJsonDocument.ts b/packages/cli/src/sdk/sdk/api/types/CwsJsonDocument.ts new file mode 100644 index 000000000..5fd88897f --- /dev/null +++ b/packages/cli/src/sdk/sdk/api/types/CwsJsonDocument.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as CloudflareApi from "../index.js"; + +export type CwsJsonDocument = + | Record + | CloudflareApi.CwsJsonValue[] + | string + | number + | boolean; diff --git a/packages/cli/src/sdk/sdk/api/types/CwsRegoMetadata.ts b/packages/cli/src/sdk/sdk/api/types/CwsRegoMetadata.ts index cda8ac200..f704e048c 100644 --- a/packages/cli/src/sdk/sdk/api/types/CwsRegoMetadata.ts +++ b/packages/cli/src/sdk/sdk/api/types/CwsRegoMetadata.ts @@ -4,8 +4,8 @@ import * as CloudflareApi from "../index.js"; export interface CwsRegoMetadata { created_at?: string | undefined; - /** Arbitrary JSON document with at most 100 nesting levels. PostgreSQL-normalized JSON must not exceed 65536 bytes; exponent-form numbers count at expanded decimal size. */ - data: CloudflareApi.CwsJsonValue; + /** Arbitrary non-null JSON document with at most 100 nesting levels. Nested null values are supported. PostgreSQL-normalized JSON must not exceed 65536 bytes; exponent-form numbers count at expanded decimal size. */ + data: CloudflareApi.CwsJsonDocument; /** Server-assigned UUID */ id?: string | undefined; /** Unique Rego import path in the form metadata., with one alphanumeric or underscore segment. Reference it as data.. */ diff --git a/packages/cli/src/sdk/sdk/api/types/CwsRegoMetadataBody.ts b/packages/cli/src/sdk/sdk/api/types/CwsRegoMetadataBody.ts index 925657a4e..2946eeb97 100644 --- a/packages/cli/src/sdk/sdk/api/types/CwsRegoMetadataBody.ts +++ b/packages/cli/src/sdk/sdk/api/types/CwsRegoMetadataBody.ts @@ -3,8 +3,8 @@ import * as CloudflareApi from "../index.js"; export interface CwsRegoMetadataBody { - /** Arbitrary JSON payload with at most 100 nesting levels. PostgreSQL-normalized JSON must not exceed 65536 bytes; exponent-form numbers count at expanded decimal size. */ - data: CloudflareApi.CwsJsonValue; + /** Arbitrary non-null JSON payload with at most 100 nesting levels. Nested null values are supported. PostgreSQL-normalized JSON must not exceed 65536 bytes; exponent-form numbers count at expanded decimal size. */ + data: CloudflareApi.CwsJsonDocument; /** Unique Rego import path in the form metadata., with one alphanumeric or underscore segment. Reference it as data.. */ import_path: string; /** Name of the rego metadata document (unique per account) */ diff --git a/packages/cli/src/sdk/sdk/api/types/VectorizeApiResponseCollection.ts b/packages/cli/src/sdk/sdk/api/types/VectorizeApiResponseCollection.ts deleted file mode 100644 index 2517ffa95..000000000 --- a/packages/cli/src/sdk/sdk/api/types/VectorizeApiResponseCollection.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as CloudflareApi from "../index.js"; - -export interface VectorizeApiResponseCollection { - errors: CloudflareApi.VectorizeMessages; - messages: CloudflareApi.VectorizeMessages; - result: unknown[] | null; - /** Whether the API call was successful */ - success: true; - result_info?: CloudflareApi.VectorizeResultInfo | undefined; -} diff --git a/packages/cli/src/sdk/sdk/api/types/VectorizeApiResponseCommonResult.ts b/packages/cli/src/sdk/sdk/api/types/VectorizeApiResponseCommonResult.ts index 0a88f154e..1d79bb77e 100644 --- a/packages/cli/src/sdk/sdk/api/types/VectorizeApiResponseCommonResult.ts +++ b/packages/cli/src/sdk/sdk/api/types/VectorizeApiResponseCommonResult.ts @@ -1,3 +1,3 @@ // This file was auto-generated by Fern from our API Definition. -export type VectorizeApiResponseCommonResult = Record | unknown[] | string; +export type VectorizeApiResponseCommonResult = Record | Record[] | string; diff --git a/packages/cli/src/sdk/sdk/api/types/VectorizeCreateIndexRequest.ts b/packages/cli/src/sdk/sdk/api/types/VectorizeCreateIndexRequest.ts deleted file mode 100644 index c3572b225..000000000 --- a/packages/cli/src/sdk/sdk/api/types/VectorizeCreateIndexRequest.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as CloudflareApi from "../index.js"; - -export interface VectorizeCreateIndexRequest { - config: CloudflareApi.VectorizeIndexConfiguration; - description?: CloudflareApi.VectorizeIndexDescription | undefined; - name: CloudflareApi.VectorizeIndexName; -} diff --git a/packages/cli/src/sdk/sdk/api/types/VectorizeIndexDeleteVectorsByIdRequest.ts b/packages/cli/src/sdk/sdk/api/types/VectorizeIndexDeleteVectorsByIdRequest.ts deleted file mode 100644 index fc1bf40dd..000000000 --- a/packages/cli/src/sdk/sdk/api/types/VectorizeIndexDeleteVectorsByIdRequest.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as CloudflareApi from "../index.js"; - -export interface VectorizeIndexDeleteVectorsByIdRequest { - /** A list of vector identifiers to delete from the index indicated by the path. */ - ids?: CloudflareApi.VectorizeVectorIdentifier[] | undefined; -} diff --git a/packages/cli/src/sdk/sdk/api/types/VectorizeIndexGetVectorsByIdRequest.ts b/packages/cli/src/sdk/sdk/api/types/VectorizeIndexGetVectorsByIdRequest.ts deleted file mode 100644 index 7b1dc3f94..000000000 --- a/packages/cli/src/sdk/sdk/api/types/VectorizeIndexGetVectorsByIdRequest.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as CloudflareApi from "../index.js"; - -export interface VectorizeIndexGetVectorsByIdRequest { - /** A list of vector identifiers to retrieve from the index indicated by the path. */ - ids?: CloudflareApi.VectorizeVectorIdentifier[] | undefined; -} diff --git a/packages/cli/src/sdk/sdk/api/types/VectorizeIndexInfoResponse.ts b/packages/cli/src/sdk/sdk/api/types/VectorizeIndexInfoResponse.ts index 29e8d3e65..f144a9fb0 100644 --- a/packages/cli/src/sdk/sdk/api/types/VectorizeIndexInfoResponse.ts +++ b/packages/cli/src/sdk/sdk/api/types/VectorizeIndexInfoResponse.ts @@ -6,7 +6,7 @@ export interface VectorizeIndexInfoResponse { dimensions?: CloudflareApi.VectorizeIndexDimensions | undefined; /** Specifies the timestamp the last mutation batch was processed as an ISO8601 string. */ processedUpToDatetime?: (string | null) | undefined; - processedUpToMutation?: CloudflareApi.VectorizeMutationUuid | undefined; + processedUpToMutation?: (string | null) | undefined; /** Specifies the number of vectors present in the index */ vectorCount?: number | undefined; } diff --git a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/query/client/requests/VectorizeIndexQueryRequest.ts b/packages/cli/src/sdk/sdk/api/types/VectorizeIndexQueryRequest.ts similarity index 60% rename from packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/query/client/requests/VectorizeIndexQueryRequest.ts rename to packages/cli/src/sdk/sdk/api/types/VectorizeIndexQueryRequest.ts index 1d02b0227..84249d91e 100644 --- a/packages/cli/src/sdk/sdk/api/resources/vectorize/resources/deprecatedIndexes/resources/query/client/requests/VectorizeIndexQueryRequest.ts +++ b/packages/cli/src/sdk/sdk/api/types/VectorizeIndexQueryRequest.ts @@ -1,25 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -/** - * @example - * { - * account_id: "account_id", - * index_name: "index_name", - * vector: [0.5, 0.5, 0.5] - * } - */ export interface VectorizeIndexQueryRequest { - /** Identifier */ - account_id: string; - index_name: string; /** A metadata filter expression used to limit nearest neighbor results. */ - filter?: Record; + filter?: Record | undefined; /** Whether to return the metadata associated with the closest vectors. */ - returnMetadata?: boolean; + returnMetadata?: boolean | undefined; /** Whether to return the values associated with the closest vectors. */ - returnValues?: boolean; + returnValues?: boolean | undefined; /** The number of nearest neighbors to find. */ - topK?: number; + topK?: number | undefined; /** The search vector that will be used to find the nearest neighbors. */ vector: number[]; } diff --git a/packages/cli/src/sdk/sdk/api/types/VectorizeMutationUuid.ts b/packages/cli/src/sdk/sdk/api/types/VectorizeMutationUuid.ts index e59a44f29..1ad7a689c 100644 --- a/packages/cli/src/sdk/sdk/api/types/VectorizeMutationUuid.ts +++ b/packages/cli/src/sdk/sdk/api/types/VectorizeMutationUuid.ts @@ -3,4 +3,4 @@ /** * The unique identifier for the async mutation operation containing the changeset. */ -export type VectorizeMutationUuid = unknown; +export type VectorizeMutationUuid = string; diff --git a/packages/cli/src/sdk/sdk/api/types/VectorizeResultInfo.ts b/packages/cli/src/sdk/sdk/api/types/VectorizeResultInfo.ts deleted file mode 100644 index e10360522..000000000 --- a/packages/cli/src/sdk/sdk/api/types/VectorizeResultInfo.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export interface VectorizeResultInfo { - /** Total number of results for the requested service */ - count?: number | undefined; - /** Current page within paginated list of results */ - page?: number | undefined; - /** Number of results per page of results */ - per_page?: number | undefined; - /** Total results available without any search parameters */ - total_count?: number | undefined; -} diff --git a/packages/cli/src/sdk/sdk/api/types/VectorizeUpdateIndexRequest.ts b/packages/cli/src/sdk/sdk/api/types/VectorizeUpdateIndexRequest.ts new file mode 100644 index 000000000..df6dbde30 --- /dev/null +++ b/packages/cli/src/sdk/sdk/api/types/VectorizeUpdateIndexRequest.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as CloudflareApi from "../index.js"; + +export interface VectorizeUpdateIndexRequest { + description: CloudflareApi.VectorizeIndexDescription; +} diff --git a/packages/cli/src/sdk/sdk/api/types/index.ts b/packages/cli/src/sdk/sdk/api/types/index.ts index 0347706f6..d7ed72685 100644 --- a/packages/cli/src/sdk/sdk/api/types/index.ts +++ b/packages/cli/src/sdk/sdk/api/types/index.ts @@ -2102,6 +2102,7 @@ export * from "./CwsDomainAclEntry.js"; export * from "./CwsErrorResponse.js"; export * from "./CwsFilterField.js"; export * from "./CwsFilterSchema.js"; +export * from "./CwsJsonDocument.js"; export * from "./CwsJsonValue.js"; export * from "./CwsMessageSource.js"; export * from "./CwsPageResponseBasicAuthCredential.js"; @@ -6819,24 +6820,20 @@ export * from "./UsageAnalyticsErrorResponse.js"; export * from "./UsageAnalyticsIdentifier.js"; export * from "./UsageAnalyticsStreamUsageDataPoint.js"; export * from "./UsageAnalyticsStreamUsageResponse.js"; -export * from "./VectorizeApiResponseCollection.js"; export * from "./VectorizeApiResponseCommon.js"; export * from "./VectorizeApiResponseCommonFailure.js"; export * from "./VectorizeApiResponseCommonResult.js"; export * from "./VectorizeApiResponseSingle.js"; -export * from "./VectorizeCreateIndexRequest.js"; export * from "./VectorizeCreateIndexResponse.js"; export * from "./VectorizeCreateMetadataIndexResponse.js"; export * from "./VectorizeDeleteMetadataIndexResponse.js"; export * from "./VectorizeIdentifier.js"; export * from "./VectorizeIndexConfiguration.js"; -export * from "./VectorizeIndexDeleteVectorsByIdRequest.js"; export * from "./VectorizeIndexDeleteVectorsByIdResponse.js"; export * from "./VectorizeIndexDeleteVectorsByIdV2Response.js"; export * from "./VectorizeIndexDescription.js"; export * from "./VectorizeIndexDimensionConfiguration.js"; export * from "./VectorizeIndexDimensions.js"; -export * from "./VectorizeIndexGetVectorsByIdRequest.js"; export * from "./VectorizeIndexGetVectorsByIdResponse.js"; export * from "./VectorizeIndexGetVectorsByIdResponseItem.js"; export * from "./VectorizeIndexInfoResponse.js"; @@ -6847,6 +6844,7 @@ export * from "./VectorizeIndexMetric.js"; export * from "./VectorizeIndexName.js"; export * from "./VectorizeIndexPreset.js"; export * from "./VectorizeIndexPresetConfiguration.js"; +export * from "./VectorizeIndexQueryRequest.js"; export * from "./VectorizeIndexQueryResponse.js"; export * from "./VectorizeIndexQueryResponseMatchesItem.js"; export * from "./VectorizeIndexQueryV2Response.js"; @@ -6858,7 +6856,7 @@ export * from "./VectorizeListMetadataIndexResponseMetadataIndexesItem.js"; export * from "./VectorizeMessages.js"; export * from "./VectorizeMessagesItem.js"; export * from "./VectorizeMutationUuid.js"; -export * from "./VectorizeResultInfo.js"; +export * from "./VectorizeUpdateIndexRequest.js"; export * from "./VectorizeVectorIdentifier.js"; export * from "./VectorizeVectorListItem.js"; export * from "./VulnScannerApiResponseCollection.js"; diff --git a/packages/cli/src/sdk/sdk/sdk-map.json b/packages/cli/src/sdk/sdk/sdk-map.json index 9d8bf8f7b..a426b9d8b 100644 --- a/packages/cli/src/sdk/sdk/sdk-map.json +++ b/packages/cli/src/sdk/sdk/sdk-map.json @@ -26132,7 +26132,7 @@ "path": "/user/load_balancers/pools", "responseType": "PoolsPoolsResponse", "requiredRequestProperties": [ - "__@iterator@7090", + "__@iterator@7010", "anchor", "at", "big", @@ -43228,172 +43228,6 @@ "path": "/user", "responseType": "GetUserResponse" }, - "vectorize-(-deprecated)-create-vectorize-index": { - "accessor": [ - "vectorize", - "deprecatedIndexes" - ], - "method": "create", - "httpMethod": "POST", - "path": "/accounts/{account_id}/vectorize/indexes", - "requestType": "CreateDeprecatedIndexesRequest", - "responseType": "VectorizeCreateIndexResponse", - "requestBodyProperty": "body", - "requiredRequestProperties": [ - "account_id", - "body" - ] - }, - "vectorize-(-deprecated)-delete-vectorize-index": { - "accessor": [ - "vectorize", - "deprecatedIndexes" - ], - "method": "delete", - "httpMethod": "DELETE", - "path": "/accounts/{account_id}/vectorize/indexes/{index_name}", - "requestType": "DeleteDeprecatedIndexesRequest", - "requiredRequestProperties": [ - "account_id", - "index_name" - ] - }, - "vectorize-(-deprecated)-delete-vectors-by-id": { - "accessor": [ - "vectorize", - "deprecatedIndexes", - "deleteBy", - "ids" - ], - "method": "create", - "httpMethod": "POST", - "path": "/accounts/{account_id}/vectorize/indexes/{index_name}/delete-by-ids", - "requestType": "CreateIdsRequest", - "responseType": "VectorizeIndexDeleteVectorsByIdResponse", - "requestBodyProperty": "body", - "requiredRequestProperties": [ - "account_id", - "body", - "index_name" - ] - }, - "vectorize-(-deprecated)-get-vectorize-index": { - "accessor": [ - "vectorize", - "deprecatedIndexes" - ], - "method": "get", - "httpMethod": "GET", - "path": "/accounts/{account_id}/vectorize/indexes/{index_name}", - "requestType": "GetDeprecatedIndexesRequest", - "responseType": "VectorizeCreateIndexResponse", - "requiredRequestProperties": [ - "account_id", - "index_name" - ] - }, - "vectorize-(-deprecated)-get-vectors-by-id": { - "accessor": [ - "vectorize", - "deprecatedIndexes", - "getBy", - "ids" - ], - "method": "create", - "httpMethod": "POST", - "path": "/accounts/{account_id}/vectorize/indexes/{index_name}/get-by-ids", - "requestType": "CreateIdsRequest", - "responseType": "CreateIdsResponse", - "requestBodyProperty": "body", - "requiredRequestProperties": [ - "account_id", - "body", - "index_name" - ] - }, - "vectorize-(-deprecated)-insert-vector": { - "accessor": [ - "vectorize", - "deprecatedIndexes", - "insert" - ], - "method": "create", - "httpMethod": "POST", - "path": "/accounts/{account_id}/vectorize/indexes/{index_name}/insert", - "requestType": "CreateInsertRequest", - "responseType": "VectorizeIndexInsertResponse", - "requestBodyProperty": "body", - "requiredRequestProperties": [ - "account_id", - "body", - "index_name" - ] - }, - "vectorize-(-deprecated)-list-vectorize-indexes": { - "accessor": [ - "vectorize", - "deprecatedIndexes" - ], - "method": "list", - "httpMethod": "GET", - "path": "/accounts/{account_id}/vectorize/indexes", - "requestType": "ListDeprecatedIndexesRequest", - "responseType": "ListDeprecatedIndexesResponse", - "requiredRequestProperties": [ - "account_id" - ] - }, - "vectorize-(-deprecated)-query-vector": { - "accessor": [ - "vectorize", - "deprecatedIndexes", - "query" - ], - "method": "create", - "httpMethod": "POST", - "path": "/accounts/{account_id}/vectorize/indexes/{index_name}/query", - "requestType": "VectorizeIndexQueryRequest", - "responseType": "VectorizeIndexQueryResponse", - "requiredRequestProperties": [ - "account_id", - "index_name", - "vector" - ] - }, - "vectorize-(-deprecated)-update-vectorize-index": { - "accessor": [ - "vectorize", - "deprecatedIndexes" - ], - "method": "update", - "httpMethod": "PUT", - "path": "/accounts/{account_id}/vectorize/indexes/{index_name}", - "requestType": "VectorizeUpdateIndexRequest", - "responseType": "VectorizeCreateIndexResponse", - "requiredRequestProperties": [ - "account_id", - "description", - "index_name" - ] - }, - "vectorize-(-deprecated)-upsert-vector": { - "accessor": [ - "vectorize", - "deprecatedIndexes", - "upsert" - ], - "method": "create", - "httpMethod": "POST", - "path": "/accounts/{account_id}/vectorize/indexes/{index_name}/upsert", - "requestType": "CreateUpsertRequest", - "responseType": "VectorizeIndexUpsertResponse", - "requestBodyProperty": "body", - "requiredRequestProperties": [ - "account_id", - "body", - "index_name" - ] - }, "vectorize-create-metadata-index": { "accessor": [ "vectorize", @@ -43418,12 +43252,12 @@ "method": "create", "httpMethod": "POST", "path": "/accounts/{account_id}/vectorize/v2/indexes", - "requestType": "CreateVectorizeRequest", + "requestType": "VectorizeCreateIndexRequest", "responseType": "VectorizeCreateIndexResponse", - "requestBodyProperty": "body", "requiredRequestProperties": [ "account_id", - "body" + "config", + "name" ] }, "vectorize-delete-metadata-index": { @@ -43462,12 +43296,10 @@ "method": "deleteByIds", "httpMethod": "POST", "path": "/accounts/{account_id}/vectorize/v2/indexes/{index_name}/delete_by_ids", - "requestType": "DeleteByIdsVectorizeRequest", + "requestType": "VectorizeIndexDeleteVectorsByIdRequest", "responseType": "VectorizeIndexDeleteVectorsByIdV2Response", - "requestBodyProperty": "body", "requiredRequestProperties": [ "account_id", - "body", "index_name" ] }, @@ -43492,12 +43324,10 @@ "method": "getByIds", "httpMethod": "POST", "path": "/accounts/{account_id}/vectorize/v2/indexes/{index_name}/get_by_ids", - "requestType": "GetByIdsVectorizeRequest", + "requestType": "VectorizeIndexGetVectorsByIdRequest", "responseType": "GetByIdsVectorizeResponse", - "requestBodyProperty": "body", "requiredRequestProperties": [ "account_id", - "body", "index_name" ] }, diff --git a/packages/cli/src/sdk/sdk/sdk-operation-types.ts b/packages/cli/src/sdk/sdk/sdk-operation-types.ts index 09641d579..d7783884b 100644 --- a/packages/cli/src/sdk/sdk/sdk-operation-types.ts +++ b/packages/cli/src/sdk/sdk/sdk-operation-types.ts @@ -2737,23 +2737,13 @@ export interface SdkOperationRequestMap { "user'-s-organizations-leave-organization": CloudflareApi.user.DeleteOrganizationsRequest; "user'-s-organizations-list-organizations": CloudflareApi.user.ListOrganizationsRequest; "user'-s-organizations-organization-details": CloudflareApi.user.GetOrganizationsRequest; - "vectorize-(-deprecated)-create-vectorize-index": CloudflareApi.vectorize.CreateDeprecatedIndexesRequest; - "vectorize-(-deprecated)-delete-vectorize-index": CloudflareApi.vectorize.DeleteDeprecatedIndexesRequest; - "vectorize-(-deprecated)-delete-vectors-by-id": CloudflareApi.vectorize.deprecatedIndexes.deleteBy.CreateIdsRequest; - "vectorize-(-deprecated)-get-vectorize-index": CloudflareApi.vectorize.GetDeprecatedIndexesRequest; - "vectorize-(-deprecated)-get-vectors-by-id": CloudflareApi.vectorize.deprecatedIndexes.getBy.CreateIdsRequest; - "vectorize-(-deprecated)-insert-vector": CloudflareApi.vectorize.deprecatedIndexes.CreateInsertRequest; - "vectorize-(-deprecated)-list-vectorize-indexes": CloudflareApi.vectorize.ListDeprecatedIndexesRequest; - "vectorize-(-deprecated)-query-vector": CloudflareApi.vectorize.deprecatedIndexes.VectorizeIndexQueryRequest; - "vectorize-(-deprecated)-update-vectorize-index": CloudflareApi.vectorize.VectorizeUpdateIndexRequest; - "vectorize-(-deprecated)-upsert-vector": CloudflareApi.vectorize.deprecatedIndexes.CreateUpsertRequest; "vectorize-create-metadata-index": CloudflareApi.vectorize.VectorizeCreateMetadataIndexRequest; - "vectorize-create-vectorize-index": CloudflareApi.CreateVectorizeRequest; + "vectorize-create-vectorize-index": CloudflareApi.VectorizeCreateIndexRequest; "vectorize-delete-metadata-index": CloudflareApi.vectorize.VectorizeDeleteMetadataIndexRequest; "vectorize-delete-vectorize-index": CloudflareApi.DeleteVectorizeRequest; - "vectorize-delete-vectors-by-id": CloudflareApi.DeleteByIdsVectorizeRequest; + "vectorize-delete-vectors-by-id": CloudflareApi.VectorizeIndexDeleteVectorsByIdRequest; "vectorize-get-vectorize-index": CloudflareApi.GetVectorizeRequest; - "vectorize-get-vectors-by-id": CloudflareApi.GetByIdsVectorizeRequest; + "vectorize-get-vectors-by-id": CloudflareApi.VectorizeIndexGetVectorsByIdRequest; "vectorize-index-info": CloudflareApi.InfoVectorizeRequest; "vectorize-insert-vector": CloudflareApi.InsertVectorizeRequest; "vectorize-list-metadata-indexes": CloudflareApi.vectorize.ListMetadataIndexRequest; diff --git a/packages/wrangler-tests/src/__tests__/vectorize/vectorize.test.ts b/packages/wrangler-tests/src/__tests__/vectorize/vectorize.test.ts index 242b57409..eb0949007 100644 --- a/packages/wrangler-tests/src/__tests__/vectorize/vectorize.test.ts +++ b/packages/wrangler-tests/src/__tests__/vectorize/vectorize.test.ts @@ -72,12 +72,16 @@ describe("vectorize commands", () => { it.skip("should handle a delete on a vectorize V1 index", async () => {}); it("should handle creating a vectorize index", async ({ expect }) => { - mockVectorizeV2Request(); + const onCreate = mockVectorizeV2Request(); // cf's `vectorize create` has no positional; the index name // is the `--name` body field. await runWrangler( - "vectorize create --name=test-index --config-dimensions=1536 --config-metric=euclidean" + "vectorize create --name=test-index --index-config-dimensions=1536 --index-config-metric=euclidean" ); + expect(onCreate).toHaveBeenCalledExactlyOnceWith({ + name: "test-index", + config: { dimensions: 1536, metric: "euclidean" }, + }); expect(JSON.parse(std.out)).toMatchInlineSnapshot(` { "config": { @@ -95,10 +99,14 @@ describe("vectorize commands", () => { it("should handle creating a vectorize index with preset", async ({ expect, }) => { - mockVectorizeV2Request(); + const onCreate = mockVectorizeV2Request(); await runWrangler( - "vectorize create --name=test-index --config-preset=openai/text-embedding-ada-002" + "vectorize create --name=test-index --index-config-preset=openai/text-embedding-ada-002" ); + expect(onCreate).toHaveBeenCalledExactlyOnceWith({ + name: "test-index", + config: { preset: "openai/text-embedding-ada-002" }, + }); expect(JSON.parse(std.out)).toMatchInlineSnapshot(` { "config": { @@ -118,11 +126,11 @@ describe("vectorize commands", () => { await expect(() => runWrangler( - "vectorize create --name=test-index --config-dimensions=1536 --config-metric=pythagorian" + "vectorize create --name=test-index --index-config-dimensions=1536 --index-config-metric=pythagorian" ) ).rejects.toThrow( `Invalid values: - Argument: config-metric, Given: "pythagorian", Choices: "cosine", "euclidean", "dot-product"` + Argument: index-config-metric, Given: "pythagorian", Choices: "cosine", "euclidean", "dot-product"` ); }); @@ -131,11 +139,11 @@ describe("vectorize commands", () => { await expect(() => runWrangler( - "vectorize create --name=test-index --config-preset=openai/gpt-400-pro-max-ultra" + "vectorize create --name=test-index --index-config-preset=openai/gpt-400-pro-max-ultra" ) ).rejects.toThrow( `Invalid values: - Argument: config-preset, Given: "openai/gpt-400-pro-max-ultra", Choices: "@cf/baai/bge-small-en-v1.5", "@cf/baai/bge-base-en-v1.5", "@cf/baai/bge-large-en-v1.5", "openai/text-embedding-ada-002", "cohere/embed-multilingual-v2.0"` + Argument: index-config-preset, Given: "openai/gpt-400-pro-max-ultra", Choices: "@cf/baai/bge-small-en-v1.5", "@cf/baai/bge-base-en-v1.5", "@cf/baai/bge-large-en-v1.5", "openai/text-embedding-ada-002", "cohere/embed-multilingual-v2.0"` ); }); @@ -679,6 +687,7 @@ describe.skip("vectorize query filter", () => { /** Create a mock handler for the Vectorize V2 API */ function mockVectorizeV2Request() { + const onCreate = vi.fn<(body: unknown) => void>(); msw.use( http.get( "*/accounts/:accountId/vectorize/v2/indexes/test-index", @@ -703,7 +712,8 @@ function mockVectorizeV2Request() { ), http.post( "*/accounts/:accountId/vectorize/v2/indexes", - () => { + async ({ request }) => { + onCreate(await request.json()); return HttpResponse.json( createFetchResult( { @@ -966,6 +976,7 @@ function mockVectorizeV2Request() { { once: true } ) ); + return onCreate; } function mockVectorizeV2RequestError() { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7ef2de94c..4b3954a4c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -539,7 +539,7 @@ packages: resolution: {integrity: sha512-87zwEhdT0k26tiLe8F4sdo6MZvfoHDji3GzoPn480aJwgD4OBobEz4Z/Tjf2QVsDyFNhX0+L1rgZQnIErTWEqA==} '@cloudflare/forge-transformer-sdk-ts@file:vendor/cloudflare-forge-transformer-sdk-ts-0.1.0.tgz': - resolution: {integrity: sha512-/AVcz9RE3WUYcSifly2Qd2sLOCtw359/KntVDOBOIawkzHEhwEsyvFArFaApdH624/xdFkqN0mDRv0vCICNkEA==, tarball: file:vendor/cloudflare-forge-transformer-sdk-ts-0.1.0.tgz} + resolution: {integrity: sha512-GOVrkVWcsq6219Vn+Vxj1ftbiGYqA9/0yMdo88UI8zDzzAt8ZG5lJP+AEtVcQ88X/StrGIP87e4PhNRuFfeMZQ==, tarball: file:vendor/cloudflare-forge-transformer-sdk-ts-0.1.0.tgz} version: 0.1.0 engines: {node: '>=22'} hasBin: true diff --git a/vendor/cloudflare-forge-transformer-sdk-ts-0.1.0.tgz b/vendor/cloudflare-forge-transformer-sdk-ts-0.1.0.tgz index 9820f73c9..22b576b51 100644 Binary files a/vendor/cloudflare-forge-transformer-sdk-ts-0.1.0.tgz and b/vendor/cloudflare-forge-transformer-sdk-ts-0.1.0.tgz differ