diff --git a/.devcontainer/devcontainer-lock.json b/.devcontainer/devcontainer-lock.json
new file mode 100644
index 00000000..96d86886
--- /dev/null
+++ b/.devcontainer/devcontainer-lock.json
@@ -0,0 +1,9 @@
+{
+ "features": {
+ "ghcr.io/devcontainers/features/node:1": {
+ "version": "1.7.1",
+ "resolved": "ghcr.io/devcontainers/features/node@sha256:8c0de46939b61958041700ee89e3493f3b2e4131a06dc46b4d9423427d06e5f6",
+ "integrity": "sha256:8c0de46939b61958041700ee89e3493f3b2e4131a06dc46b4d9423427d06e5f6"
+ }
+ }
+}
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 4aacb168..21fe4464 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -18,7 +18,7 @@ jobs:
lint:
timeout-minutes: 10
name: lint
- runs-on: ${{ github.repository == 'stainless-sdks/imagekit-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
+ runs-on: ubuntu-latest
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -37,7 +37,7 @@ jobs:
build:
timeout-minutes: 5
name: build
- runs-on: ${{ github.repository == 'stainless-sdks/imagekit-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
+ runs-on: ubuntu-latest
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
permissions:
contents: read
@@ -55,54 +55,3 @@ jobs:
- name: Check build
run: ./scripts/build
-
- - name: Get GitHub OIDC Token
- if: |-
- github.repository == 'stainless-sdks/imagekit-typescript' &&
- !startsWith(github.ref, 'refs/heads/stl/')
- id: github-oidc
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
- with:
- script: core.setOutput('github_token', await core.getIDToken());
-
- - name: Upload tarball
- if: |-
- github.repository == 'stainless-sdks/imagekit-typescript' &&
- !startsWith(github.ref, 'refs/heads/stl/')
- env:
- URL: https://pkg.stainless.com/s
- AUTH: ${{ steps.github-oidc.outputs.github_token }}
- SHA: ${{ github.sha }}
- run: ./scripts/utils/upload-artifact.sh
-
- - name: Upload MCP Server tarball
- if: |-
- github.repository == 'stainless-sdks/imagekit-typescript' &&
- !startsWith(github.ref, 'refs/heads/stl/')
- env:
- URL: https://pkg.stainless.com/s?subpackage=mcp-server
- AUTH: ${{ steps.github-oidc.outputs.github_token }}
- SHA: ${{ github.sha }}
- BASE_PATH: packages/mcp-server
- run: ./scripts/utils/upload-artifact.sh
- test:
- timeout-minutes: 10
- name: test
- runs-on: ${{ github.repository == 'stainless-sdks/imagekit-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
- if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
- steps:
- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
-
- - name: Set up Node
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
- with:
- node-version: '22'
-
- - name: Bootstrap
- run: ./scripts/bootstrap
-
- - name: Build
- run: ./scripts/build
-
- - name: Run tests
- run: ./scripts/test
diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml
index 96ac53f2..efe38d9c 100644
--- a/.github/workflows/release-doctor.yml
+++ b/.github/workflows/release-doctor.yml
@@ -18,4 +18,5 @@ jobs:
run: |
bash ./bin/check-release-environment
env:
+ RELEASE_PLEASE_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN }}
NPM_TOKEN: ${{ secrets.IMAGE_KIT_NPM_TOKEN || secrets.NPM_TOKEN }}
diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml
new file mode 100644
index 00000000..53b49d0a
--- /dev/null
+++ b/.github/workflows/release-please.yml
@@ -0,0 +1,20 @@
+name: Release Please
+on:
+ push:
+ branches:
+ - master
+
+permissions:
+ contents: write
+ pull-requests: write
+
+jobs:
+ release-please:
+ if: github.repository == 'imagekit-developer/imagekit-nodejs'
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: googleapis/release-please-action@5c625bfb5d1ff62eadeeb3772007f7f66fdcf071 # v4.4.1
+ id: release
+ with:
+ token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
diff --git a/.github/workflows/stlc-promote.yml b/.github/workflows/stlc-promote.yml
new file mode 100644
index 00000000..de27e39f
--- /dev/null
+++ b/.github/workflows/stlc-promote.yml
@@ -0,0 +1,65 @@
+name: Promote SDKs
+
+on:
+ push:
+ branches: [main]
+
+permissions:
+ contents: read
+
+jobs:
+ promote:
+ runs-on: ubuntu-latest
+ env:
+ PRODUCTION_REPO: imagekit-developer/imagekit-nodejs
+ PRODUCTION_BRANCH: master
+ GH_TOKEN: ${{ secrets.SDK_WRITE_TOKEN }}
+ steps:
+ - name: Check out staging
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ persist-credentials: false
+
+ - name: Fetch production main
+ run: |
+ git remote add production \
+ "https://x-access-token:${GH_TOKEN}@github.com/${PRODUCTION_REPO}.git"
+ git fetch production "${PRODUCTION_BRANCH}"
+
+ - name: Check if production is already in sync
+ id: diff
+ run: |
+ STAGING_SHA=$(git rev-parse origin/main)
+ PRODUCTION_SHA=$(git rev-parse production/${PRODUCTION_BRANCH})
+ if [ "$STAGING_SHA" = "$PRODUCTION_SHA" ]; then
+ echo "Production is already at $STAGING_SHA. Nothing to release."
+ echo "synced=true" >> "$GITHUB_OUTPUT"
+ else
+ echo "synced=false" >> "$GITHUB_OUTPUT"
+ fi
+
+ - name: Push staging main to the release branch on production
+ if: steps.diff.outputs.synced == 'false'
+ run: |
+ git push production origin/main:refs/heads/stainless/release --force
+
+ - name: Open or update the release PR on production
+ if: steps.diff.outputs.synced == 'false'
+ run: |
+ EXISTING_PR=$(gh pr list \
+ --repo "${PRODUCTION_REPO}" \
+ --head stainless/release \
+ --state open \
+ --json number \
+ --jq '.[0].number')
+ if [ -z "${EXISTING_PR}" ]; then
+ gh pr create \
+ --repo "${PRODUCTION_REPO}" \
+ --base "${PRODUCTION_BRANCH}" \
+ --head stainless/release \
+ --title "Release SDK updates" \
+ --body "$(git log --oneline production/${PRODUCTION_BRANCH}..origin/main)"
+ else
+ echo "Release PR #${EXISTING_PR} already exists. Force-push has updated it."
+ fi
diff --git a/.github/workflows/sync-release-as.yml b/.github/workflows/sync-release-as.yml
new file mode 100644
index 00000000..99150044
--- /dev/null
+++ b/.github/workflows/sync-release-as.yml
@@ -0,0 +1,63 @@
+name: Sync Release-As from release PR title
+
+on:
+ pull_request:
+ types: [edited]
+
+permissions:
+ contents: write
+
+jobs:
+ sync:
+ if: >-
+ github.event.pull_request.base.ref == 'master' &&
+ startsWith(github.event.pull_request.head.ref, 'release-please--') &&
+ github.event.changes.title != null
+ runs-on: ubuntu-latest
+ steps:
+ - name: Extract versions from old and new title
+ id: parse
+ env:
+ NEW_TITLE: ${{ github.event.pull_request.title }}
+ OLD_TITLE: ${{ github.event.changes.title.from }}
+ run: |
+ # Anchored on pull-request-title-pattern "release: ${version}" from release-please-config.json.
+ extract() {
+ echo "$1" | grep -oE '^release:[[:space:]]+v?[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?' \
+ | sed -E 's/^release:[[:space:]]+v?//'
+ }
+ NEW_VERSION=$(extract "$NEW_TITLE")
+ OLD_VERSION=$(extract "$OLD_TITLE")
+ echo "old=$OLD_VERSION"
+ echo "new=$NEW_VERSION"
+ if [ -z "$NEW_VERSION" ]; then
+ echo "::notice::No semver in new title; nothing to do."
+ echo "skip=true" >> "$GITHUB_OUTPUT"
+ exit 0
+ fi
+ if [ "$NEW_VERSION" = "$OLD_VERSION" ]; then
+ echo "::notice::Version unchanged ($NEW_VERSION); not pushing."
+ echo "skip=true" >> "$GITHUB_OUTPUT"
+ exit 0
+ fi
+ echo "version=$NEW_VERSION" >> "$GITHUB_OUTPUT"
+
+ - name: Check out master
+ if: steps.parse.outputs.skip != 'true'
+ uses: actions/checkout@v6
+ with:
+ ref: master
+ token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
+ fetch-depth: 1
+
+ - name: Push empty Release-As commit
+ if: steps.parse.outputs.skip != 'true'
+ env:
+ VERSION: ${{ steps.parse.outputs.version }}
+ run: |
+ git config user.name "release-as-bot"
+ git config user.email "release-as-bot@users.noreply.github.com"
+ git commit --allow-empty -m "chore: pin next release
+
+ Release-As: ${VERSION}"
+ git push origin master
diff --git a/.stats.yml b/.stats.yml
index 1eed5544..006b15f4 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1 @@
configured_endpoints: 47
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-01267e4c07ec30011b8445babed88fbd2133b65198f42d0310b7ab39c74751d4.yml
-openapi_spec_hash: 7c103e2dff0edcbeea82057e62f58d4d
-config_hash: 7ef70b333059ca21bef0f0a6d4cbb282
diff --git a/api.md b/api.md
index 742e7a39..ddd53dd9 100644
--- a/api.md
+++ b/api.md
@@ -35,8 +35,8 @@ Types:
Methods:
- client.customMetadataFields.create({ ...params }) -> CustomMetadataField
-- client.customMetadataFields.update(id, { ...params }) -> CustomMetadataField
- client.customMetadataFields.list({ ...params }) -> CustomMetadataFieldListResponse
+- client.customMetadataFields.update(id, { ...params }) -> CustomMetadataField
- client.customMetadataFields.delete(id) -> CustomMetadataFieldDeleteResponse
# Files
@@ -55,13 +55,13 @@ Types:
Methods:
+- client.files.upload({ ...params }) -> FileUploadResponse
+- client.files.get(fileID) -> File
- client.files.update(fileID, { ...params }) -> FileUpdateResponse
- client.files.delete(fileID) -> void
- client.files.copy({ ...params }) -> FileCopyResponse
-- client.files.get(fileID) -> File
- client.files.move({ ...params }) -> FileMoveResponse
- client.files.rename({ ...params }) -> FileRenameResponse
-- client.files.upload({ ...params }) -> FileUploadResponse
## Bulk
@@ -76,8 +76,8 @@ Methods:
- client.files.bulk.delete({ ...params }) -> BulkDeleteResponse
- client.files.bulk.addTags({ ...params }) -> BulkAddTagsResponse
-- client.files.bulk.removeAITags({ ...params }) -> BulkRemoveAITagsResponse
- client.files.bulk.removeTags({ ...params }) -> BulkRemoveTagsResponse
+- client.files.bulk.removeAITags({ ...params }) -> BulkRemoveAITagsResponse
## Versions
@@ -89,8 +89,8 @@ Types:
Methods:
- client.files.versions.list(fileID) -> VersionListResponse
-- client.files.versions.delete(versionID, { ...params }) -> VersionDeleteResponse
- client.files.versions.get(versionID, { ...params }) -> File
+- client.files.versions.delete(versionID, { ...params }) -> VersionDeleteResponse
- client.files.versions.restore(versionID, { ...params }) -> File
## Metadata
@@ -108,11 +108,11 @@ Types:
Methods:
+- client.savedExtensions.list() -> SavedExtensionListResponse
- client.savedExtensions.create({ ...params }) -> SavedExtension
+- client.savedExtensions.get(id) -> SavedExtension
- client.savedExtensions.update(id, { ...params }) -> SavedExtension
-- client.savedExtensions.list() -> SavedExtensionListResponse
- client.savedExtensions.delete(id) -> void
-- client.savedExtensions.get(id) -> SavedExtension
# Assets
@@ -188,11 +188,11 @@ Types:
Methods:
+- client.accounts.origins.list() -> OriginListResponse
- client.accounts.origins.create({ ...params }) -> OriginResponse
+- client.accounts.origins.get(id) -> OriginResponse
- client.accounts.origins.update(id, { ...params }) -> OriginResponse
-- client.accounts.origins.list() -> OriginListResponse
- client.accounts.origins.delete(id) -> void
-- client.accounts.origins.get(id) -> OriginResponse
## URLEndpoints
@@ -204,11 +204,11 @@ Types:
Methods:
+- client.accounts.urlEndpoints.list() -> URLEndpointListResponse
- client.accounts.urlEndpoints.create({ ...params }) -> URLEndpointResponse
+- client.accounts.urlEndpoints.get(id) -> URLEndpointResponse
- client.accounts.urlEndpoints.update(id, { ...params }) -> URLEndpointResponse
-- client.accounts.urlEndpoints.list() -> URLEndpointListResponse
- client.accounts.urlEndpoints.delete(id) -> void
-- client.accounts.urlEndpoints.get(id) -> URLEndpointResponse
# Beta
@@ -246,5 +246,5 @@ Types:
Methods:
-- client.webhooks.unsafeUnwrap(body) -> void
- client.webhooks.unwrap(body) -> void
+- client.webhooks.unsafeUnwrap(body) -> void
diff --git a/bin/check-release-environment b/bin/check-release-environment
index e4b6d58e..d273344e 100644
--- a/bin/check-release-environment
+++ b/bin/check-release-environment
@@ -2,6 +2,10 @@
errors=()
+if [ -z "${RELEASE_PLEASE_TOKEN}" ]; then
+ errors+=("The RELEASE_PLEASE_TOKEN secret has not been set. Create a fine-grained GitHub PAT and add it as a repository secret.")
+fi
+
if [ -z "${NPM_TOKEN}" ]; then
errors+=("The NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
fi
diff --git a/packages/mcp-server/cloudflare-worker/src/index.ts b/packages/mcp-server/cloudflare-worker/src/index.ts
index bc239058..4d402a97 100644
--- a/packages/mcp-server/cloudflare-worker/src/index.ts
+++ b/packages/mcp-server/cloudflare-worker/src/index.ts
@@ -51,7 +51,7 @@ const serverConfig: ServerConfig = {
// key: 'webhookSecret',
// label: 'Webhook Secret',
// description:
- // "Your ImageKit webhook secret for verifying webhook signatures (starts with `whsec_`).\nYou can find this in the [ImageKit dashboard](https://imagekit.io/dashboard/developer/webhooks).\nOnly required if you're using webhooks.\n",
+ // 'Your ImageKit webhook secret for verifying webhook signatures (starts with `whsec_`).\nYou can find this in the [ImageKit dashboard](https://imagekit.io/dashboard/developer/webhooks).\nOnly required if you are using webhooks.\n',
// required: false,
// default: null,
// placeholder: 'My Webhook Secret',
diff --git a/packages/mcp-server/manifest.json b/packages/mcp-server/manifest.json
index 54a143e7..563e480c 100644
--- a/packages/mcp-server/manifest.json
+++ b/packages/mcp-server/manifest.json
@@ -43,7 +43,7 @@
},
"IMAGEKIT_WEBHOOK_SECRET": {
"title": "webhook_secret",
- "description": "Your ImageKit webhook secret for verifying webhook signatures (starts with `whsec_`).\nYou can find this in the [ImageKit dashboard](https://imagekit.io/dashboard/developer/webhooks).\nOnly required if you're using webhooks.\n",
+ "description": "Your ImageKit webhook secret for verifying webhook signatures (starts with `whsec_`).\nYou can find this in the [ImageKit dashboard](https://imagekit.io/dashboard/developer/webhooks).\nOnly required if you are using webhooks.\n",
"required": false,
"type": "string"
}
diff --git a/packages/mcp-server/src/code-tool.ts b/packages/mcp-server/src/code-tool.ts
index 0d5a3ac3..3104cf5b 100644
--- a/packages/mcp-server/src/code-tool.ts
+++ b/packages/mcp-server/src/code-tool.ts
@@ -1,17 +1,8 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import {
- ContentBlock,
- McpRequestContext,
- McpTool,
- Metadata,
- ToolCallResult,
- asErrorResult,
- asTextContentResult,
-} from './types';
+import { ContentBlock, McpRequestContext, McpTool, Metadata, ToolCallResult, asErrorResult } from './types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
-import { readEnv, requireValue } from './util';
-import { WorkerInput, WorkerOutput } from './code-tool-types';
+import { WorkerOutput } from './code-tool-types';
import { getLogger } from './logger';
import { SdkMethod } from './methods';
import { McpCodeExecutionMode } from './options';
@@ -108,13 +99,8 @@ export function codeTool({
let result: ToolCallResult;
const startTime = Date.now();
- if (codeExecutionMode === 'local') {
- logger.debug('Executing code in local Deno environment');
- result = await localDenoHandler({ reqContext, args });
- } else {
- logger.debug('Executing code in remote Stainless environment');
- result = await remoteStainlessHandler({ reqContext, args });
- }
+ logger.debug('Executing code in local Deno environment');
+ result = await localDenoHandler({ reqContext, args });
logger.info(
{
@@ -131,73 +117,6 @@ export function codeTool({
return { metadata, tool, handler };
}
-const remoteStainlessHandler = async ({
- reqContext,
- args,
-}: {
- reqContext: McpRequestContext;
- args: any;
-}): Promise => {
- const code = args.code as string;
- const intent = args.intent as string | undefined;
- const client = reqContext.client;
-
- const codeModeEndpoint = readEnv('CODE_MODE_ENDPOINT_URL') ?? 'https://api.stainless.com/api/ai/code-tool';
-
- const localClientEnvs = {
- IMAGEKIT_PRIVATE_KEY: requireValue(
- readEnv('IMAGEKIT_PRIVATE_KEY') ?? client.privateKey,
- 'set IMAGEKIT_PRIVATE_KEY environment variable or provide privateKey client option',
- ),
- OPTIONAL_IMAGEKIT_IGNORES_THIS: readEnv('OPTIONAL_IMAGEKIT_IGNORES_THIS') ?? client.password ?? undefined,
- IMAGEKIT_WEBHOOK_SECRET: readEnv('IMAGEKIT_WEBHOOK_SECRET') ?? client.webhookSecret ?? undefined,
- IMAGE_KIT_BASE_URL: readEnv('IMAGE_KIT_BASE_URL') ?? client.baseURL ?? undefined,
- };
- // Merge any upstream client envs from the request header, with upstream values taking precedence.
- const mergedClientEnvs = { ...localClientEnvs, ...reqContext.upstreamClientEnvs };
-
- // Setting a Stainless API key authenticates requests to the code tool endpoint.
- const res = await fetch(codeModeEndpoint, {
- method: 'POST',
- headers: {
- ...(reqContext.stainlessApiKey && { Authorization: reqContext.stainlessApiKey }),
- 'Content-Type': 'application/json',
- 'x-stainless-mcp-client-envs': JSON.stringify(mergedClientEnvs),
- },
- body: JSON.stringify({
- project_name: 'imagekit',
- code,
- intent,
- client_opts: {},
- } satisfies WorkerInput),
- });
-
- if (!res.ok) {
- if (res.status === 404 && !reqContext.stainlessApiKey) {
- throw new Error(
- 'Could not access code tool for this project. You may need to provide a Stainless API key via the STAINLESS_API_KEY environment variable, the --stainless-api-key flag, or the x-stainless-api-key HTTP header.',
- );
- }
- throw new Error(
- `${res.status}: ${
- res.statusText
- } error when trying to contact Code Tool server. Details: ${await res.text()}`,
- );
- }
-
- const { is_error, result, log_lines, err_lines } = (await res.json()) as WorkerOutput;
- const hasLogs = log_lines.length > 0 || err_lines.length > 0;
- const output = {
- result,
- ...(log_lines.length > 0 && { log_lines }),
- ...(err_lines.length > 0 && { err_lines }),
- };
- if (is_error) {
- return asErrorResult(typeof result === 'string' && !hasLogs ? result : JSON.stringify(output, null, 2));
- }
- return asTextContentResult(output);
-};
-
const localDenoHandler = async ({
reqContext,
args,
diff --git a/packages/mcp-server/src/docs-search-tool.ts b/packages/mcp-server/src/docs-search-tool.ts
index 25c9c7ea..eafcd871 100644
--- a/packages/mcp-server/src/docs-search-tool.ts
+++ b/packages/mcp-server/src/docs-search-tool.ts
@@ -2,7 +2,7 @@
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import { Metadata, McpRequestContext, asTextContentResult } from './types';
-import { getLogger } from './logger';
+
import type { LocalDocsSearch } from './local-docs-search';
export const metadata: Metadata = {
@@ -41,9 +41,6 @@ export const tool: Tool = {
},
};
-const docsSearchURL =
- process.env['DOCS_SEARCH_URL'] || 'https://api.stainless.com/api/projects/imagekit/docs/search';
-
let _localSearch: LocalDocsSearch | undefined;
export function setLocalSearch(search: LocalDocsSearch): void {
@@ -67,58 +64,6 @@ async function searchLocal(args: Record): Promise {
}).results;
}
-async function searchRemote(args: Record, reqContext: McpRequestContext): Promise {
- const body = args as any;
- const query = new URLSearchParams(body).toString();
-
- const startTime = Date.now();
- const result = await fetch(`${docsSearchURL}?${query}`, {
- headers: {
- ...(reqContext.stainlessApiKey && { Authorization: reqContext.stainlessApiKey }),
- ...(reqContext.mcpSessionId && { 'x-stainless-mcp-session-id': reqContext.mcpSessionId }),
- ...(reqContext.mcpClientInfo && {
- 'x-stainless-mcp-client-info': JSON.stringify(reqContext.mcpClientInfo),
- }),
- },
- });
-
- const logger = getLogger();
-
- if (!result.ok) {
- const errorText = await result.text();
- logger.warn(
- {
- durationMs: Date.now() - startTime,
- query: body.query,
- status: result.status,
- statusText: result.statusText,
- errorText,
- },
- 'Got error response from docs search tool',
- );
-
- if (result.status === 404 && !reqContext.stainlessApiKey) {
- throw new Error(
- 'Could not find docs for this project. You may need to provide a Stainless API key via the STAINLESS_API_KEY environment variable, the --stainless-api-key flag, or the x-stainless-api-key HTTP header.',
- );
- }
-
- throw new Error(
- `${result.status}: ${result.statusText} when using doc search tool. Details: ${errorText}`,
- );
- }
-
- const resultBody = await result.json();
- logger.info(
- {
- durationMs: Date.now() - startTime,
- query: body.query,
- },
- 'Got docs search result',
- );
- return resultBody;
-}
-
export const handler = async ({
reqContext,
args,
@@ -128,11 +73,7 @@ export const handler = async ({
}) => {
const body = args ?? {};
- if (_localSearch) {
- return asTextContentResult(await searchLocal(body));
- }
-
- return asTextContentResult(await searchRemote(body, reqContext));
+ return asTextContentResult(await searchLocal(body));
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/instructions.ts b/packages/mcp-server/src/instructions.ts
index ffe655a0..357376c2 100644
--- a/packages/mcp-server/src/instructions.ts
+++ b/packages/mcp-server/src/instructions.ts
@@ -2,7 +2,6 @@
import fs from 'fs/promises';
import { getLogger } from './logger';
-import { readEnv } from './util';
const INSTRUCTIONS_CACHE_TTL_MS = 15 * 60 * 1000; // 15 minutes
@@ -40,7 +39,8 @@ export async function getInstructions({
if (customInstructionsPath) {
fetchedInstructions = await fetchLatestInstructionsFromFile(customInstructionsPath);
} else {
- fetchedInstructions = await fetchLatestInstructionsFromApi(stainlessApiKey);
+ fetchedInstructions =
+ '\n This is the imagekit MCP server.\n\n Available tools:\n - search_docs: Search SDK documentation to find the right methods and parameters.\n - execute: Run TypeScript code against a pre-authenticated SDK client. Define an async run(client) function.\n\n Workflow:\n - If unsure about the API, call search_docs first.\n - Write complete solutions in a single execute call when possible. For large datasets, use API filters to narrow results or paginate within a single execute block.\n - If execute returns an error, read the error and fix your code rather than retrying the same approach.\n - Variables do not persist between execute calls. Return or log all data you need.\n - Individual HTTP requests to the API have a 30-second timeout. If a request times out, try a smaller query or add filters.\n - Code execution has a total timeout of approximately 5 minutes. If your code times out, simplify it or break it into smaller steps.\n ';
}
instructionsCache.set(cacheKey, { fetchedInstructions, fetchedAt: now });
@@ -55,29 +55,3 @@ async function fetchLatestInstructionsFromFile(path: string): Promise {
throw error;
}
}
-
-async function fetchLatestInstructionsFromApi(stainlessApiKey: string | undefined): Promise {
- // Setting the stainless API key is optional, but may be required
- // to authenticate requests to the Stainless API.
- const response = await fetch(
- readEnv('CODE_MODE_INSTRUCTIONS_URL') ?? 'https://api.stainless.com/api/ai/instructions/imagekit',
- {
- method: 'GET',
- headers: { ...(stainlessApiKey && { Authorization: stainlessApiKey }) },
- },
- );
-
- let instructions: string | undefined;
- if (!response.ok) {
- getLogger().warn(
- 'Warning: failed to retrieve MCP server instructions. Proceeding with default instructions...',
- );
-
- instructions =
- '\n This is the imagekit MCP server.\n\n Available tools:\n - search_docs: Search SDK documentation to find the right methods and parameters.\n - execute: Run TypeScript code against a pre-authenticated SDK client. Define an async run(client) function.\n\n Workflow:\n - If unsure about the API, call search_docs first.\n - Write complete solutions in a single execute call when possible. For large datasets, use API filters to narrow results or paginate within a single execute block.\n - If execute returns an error, read the error and fix your code rather than retrying the same approach.\n - Variables do not persist between execute calls. Return or log all data you need.\n - Individual HTTP requests to the API have a 30-second timeout. If a request times out, try a smaller query or add filters.\n - Code execution has a total timeout of approximately 5 minutes. If your code times out, simplify it or break it into smaller steps.\n ';
- }
-
- instructions ??= ((await response.json()) as { instructions: string }).instructions;
-
- return instructions;
-}
diff --git a/packages/mcp-server/src/local-docs-search.ts b/packages/mcp-server/src/local-docs-search.ts
index fa0c6099..10f4b133 100644
--- a/packages/mcp-server/src/local-docs-search.ts
+++ b/packages/mcp-server/src/local-docs-search.ts
@@ -74,6 +74,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst customMetadataField = await client.customMetadataFields.create({\n label: 'price',\n name: 'price',\n schema: {\n type: 'Number',\n minValue: 1000,\n maxValue: 3000,\n },\n});\n\nconsole.log(customMetadataField.id);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/customMetadataFields \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "label": "price",\n "name": "price",\n "schema": {\n "type": "Number",\n "maxValue": 3000,\n "minValue": 1000\n }\n }\'',
+ },
python: {
method: 'custom_metadata_fields.create',
example:
@@ -84,11 +88,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.custommetadatafields.CustomMetadataField;\nimport io.imagekit.models.custommetadatafields.CustomMetadataFieldCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n CustomMetadataFieldCreateParams params = CustomMetadataFieldCreateParams.builder()\n .label("price")\n .name("price")\n .schema(CustomMetadataFieldCreateParams.Schema.builder()\n .type(CustomMetadataFieldCreateParams.Schema.Type.NUMBER)\n .build())\n .build();\n CustomMetadataField customMetadataField = client.customMetadataFields().create(params);\n }\n}',
},
- kotlin: {
- method: 'customMetadataFields().create',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.custommetadatafields.CustomMetadataField\nimport io.imagekit.models.custommetadatafields.CustomMetadataFieldCreateParams\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val params: CustomMetadataFieldCreateParams = CustomMetadataFieldCreateParams.builder()\n .label("price")\n .name("price")\n .schema(CustomMetadataFieldCreateParams.Schema.builder()\n .type(CustomMetadataFieldCreateParams.Schema.Type.NUMBER)\n .build())\n .build()\n val customMetadataField: CustomMetadataField = client.customMetadataFields().create(params)\n}',
- },
go: {
method: 'client.CustomMetadataFields.New',
example:
@@ -99,11 +98,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\ncustom_metadata_field = image_kit.custom_metadata_fields.create(label: "price", name: "price", schema: {type: :Number})\n\nputs(custom_metadata_field)',
},
- cli: {
- method: 'customMetadataFields create',
- example:
- "imagekit custom-metadata-fields create \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --label price \\\n --name price \\\n --schema '{type: Number}'",
- },
php: {
method: 'customMetadataFields->create',
example:
@@ -114,10 +108,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'CustomMetadataFieldCreateParams parameters = new()\n{\n Label = "price",\n Name = "price",\n Schema = new()\n {\n Type = Type.Number,\n DefaultValue = new(\n\n [\n new DefaultValueItem(true),\n new DefaultValueItem(10),\n new DefaultValueItem("Hello"),\n ]\n ),\n IsValueRequired = true,\n MaxLength = 0,\n MaxValue = 3000,\n MinLength = 0,\n MinValue = 1000,\n SelectOptions =\n [\n "small", "medium", "large", 30, 40, true\n ],\n },\n};\n\nvar customMetadataField = await client.CustomMetadataFields.Create(parameters);\n\nConsole.WriteLine(customMetadataField);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/customMetadataFields \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "label": "price",\n "name": "price",\n "schema": {\n "type": "Number",\n "maxValue": 3000,\n "minValue": 1000\n }\n }\'',
- },
},
},
{
@@ -140,6 +130,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst customMetadataFields = await client.customMetadataFields.list();\n\nconsole.log(customMetadataFields);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/customMetadataFields \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
+ },
python: {
method: 'custom_metadata_fields.list',
example:
@@ -150,11 +144,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.custommetadatafields.CustomMetadataField;\nimport io.imagekit.models.custommetadatafields.CustomMetadataFieldListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n List customMetadataFields = client.customMetadataFields().list();\n }\n}',
},
- kotlin: {
- method: 'customMetadataFields().list',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.custommetadatafields.CustomMetadataField\nimport io.imagekit.models.custommetadatafields.CustomMetadataFieldListParams\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val customMetadataFields: List = client.customMetadataFields().list()\n}',
- },
go: {
method: 'client.CustomMetadataFields.List',
example:
@@ -165,11 +154,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\ncustom_metadata_fields = image_kit.custom_metadata_fields.list\n\nputs(custom_metadata_fields)',
},
- cli: {
- method: 'customMetadataFields list',
- example:
- "imagekit custom-metadata-fields list \\\n --private-key 'My Private Key' \\\n --password 'My Password'",
- },
php: {
method: 'customMetadataFields->list',
example:
@@ -180,10 +164,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'CustomMetadataFieldListParams parameters = new();\n\nvar customMetadataFields = await client.CustomMetadataFields.List(parameters);\n\nConsole.WriteLine(customMetadataFields);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/customMetadataFields \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
- },
},
},
{
@@ -209,6 +189,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst customMetadataField = await client.customMetadataFields.update('id', {\n label: 'price',\n schema: { minValue: 1000, maxValue: 3000 },\n});\n\nconsole.log(customMetadataField.id);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/customMetadataFields/$ID \\\n -X PATCH \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
+ },
python: {
method: 'custom_metadata_fields.update',
example:
@@ -219,11 +203,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.custommetadatafields.CustomMetadataField;\nimport io.imagekit.models.custommetadatafields.CustomMetadataFieldUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n CustomMetadataField customMetadataField = client.customMetadataFields().update("id");\n }\n}',
},
- kotlin: {
- method: 'customMetadataFields().update',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.custommetadatafields.CustomMetadataField\nimport io.imagekit.models.custommetadatafields.CustomMetadataFieldUpdateParams\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val customMetadataField: CustomMetadataField = client.customMetadataFields().update("id")\n}',
- },
go: {
method: 'client.CustomMetadataFields.Update',
example:
@@ -234,11 +213,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\ncustom_metadata_field = image_kit.custom_metadata_fields.update("id")\n\nputs(custom_metadata_field)',
},
- cli: {
- method: 'customMetadataFields update',
- example:
- "imagekit custom-metadata-fields update \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --id id",
- },
php: {
method: 'customMetadataFields->update',
example:
@@ -249,10 +223,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'CustomMetadataFieldUpdateParams parameters = new() { ID = "id" };\n\nvar customMetadataField = await client.CustomMetadataFields.Update(parameters);\n\nConsole.WriteLine(customMetadataField);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/customMetadataFields/$ID \\\n -X PATCH \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
- },
},
},
{
@@ -274,6 +244,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst customMetadataField = await client.customMetadataFields.delete('id');\n\nconsole.log(customMetadataField);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/customMetadataFields/$ID \\\n -X DELETE \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
+ },
python: {
method: 'custom_metadata_fields.delete',
example:
@@ -284,11 +258,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.custommetadatafields.CustomMetadataFieldDeleteParams;\nimport io.imagekit.models.custommetadatafields.CustomMetadataFieldDeleteResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n CustomMetadataFieldDeleteResponse customMetadataField = client.customMetadataFields().delete("id");\n }\n}',
},
- kotlin: {
- method: 'customMetadataFields().delete',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.custommetadatafields.CustomMetadataFieldDeleteParams\nimport io.imagekit.models.custommetadatafields.CustomMetadataFieldDeleteResponse\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val customMetadataField: CustomMetadataFieldDeleteResponse = client.customMetadataFields().delete("id")\n}',
- },
go: {
method: 'client.CustomMetadataFields.Delete',
example:
@@ -299,11 +268,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\ncustom_metadata_field = image_kit.custom_metadata_fields.delete("id")\n\nputs(custom_metadata_field)',
},
- cli: {
- method: 'customMetadataFields delete',
- example:
- "imagekit custom-metadata-fields delete \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --id id",
- },
php: {
method: 'customMetadataFields->delete',
example:
@@ -314,10 +278,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'CustomMetadataFieldDeleteParams parameters = new() { ID = "id" };\n\nvar customMetadataField = await client.CustomMetadataFields.Delete(parameters);\n\nConsole.WriteLine(customMetadataField);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/customMetadataFields/$ID \\\n -X DELETE \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
- },
},
},
{
@@ -364,6 +324,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import fs from 'fs';\nimport ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst response = await client.files.upload({\n file: fs.createReadStream('path/to/file'),\n fileName: 'fileName',\n});\n\nconsole.log(response.videoCodec);",
},
+ http: {
+ example:
+ 'curl https://upload.imagekit.io/api/v1/files/upload \\\n -H \'Content-Type: multipart/form-data\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -F \'file=@/path/to/file\' \\\n -F fileName=fileName \\\n -F checks=\'"request.folder" : "marketing/"\n \' \\\n -F customMetadata=\'{"brand":"bar","color":"bar"}\' \\\n -F description=\'Running shoes\' \\\n -F extensions=\'[{"name":"remove-bg","options":{"add_shadow":true}},{"maxTags":5,"minConfidence":95,"name":"google-auto-tagging"},{"name":"ai-auto-description"},{"name":"ai-tasks","tasks":[{"instruction":"What types of clothing items are visible in this image?","type":"select_tags","vocabulary":["shirt","tshirt","dress","trousers","jacket"]},{"instruction":"Is this a luxury or high-end fashion item?","type":"yes_no","on_yes":{"add_tags":["luxury","premium"]}}]},{"id":"ext_abc123","name":"saved-extension"}]\' \\\n -F responseFields=\'["tags","customCoordinates","isPrivateFile"]\' \\\n -F tags=\'["t-shirt","round-neck","men"]\' \\\n -F transformation=\'{"post":[{"type":"thumbnail","value":"w-150,h-150"},{"protocol":"dash","type":"abs","value":"sr-240_360_480_720_1080"}]}\'',
+ },
python: {
method: 'files.upload',
example:
@@ -374,11 +338,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.files.FileUploadParams;\nimport io.imagekit.models.files.FileUploadResponse;\nimport java.io.ByteArrayInputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n FileUploadParams params = FileUploadParams.builder()\n .file(new ByteArrayInputStream("Example data".getBytes()))\n .fileName("fileName")\n .build();\n FileUploadResponse response = client.files().upload(params);\n }\n}',
},
- kotlin: {
- method: 'files().upload',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.files.FileUploadParams\nimport io.imagekit.models.files.FileUploadResponse\nimport java.io.ByteArrayInputStream\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val params: FileUploadParams = FileUploadParams.builder()\n .file("Example data".byteInputStream())\n .fileName("fileName")\n .build()\n val response: FileUploadResponse = client.files().upload(params)\n}',
- },
go: {
method: 'client.Files.Upload',
example:
@@ -389,11 +348,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nresponse = image_kit.files.upload(file: StringIO.new("Example data"), file_name: "fileName")\n\nputs(response)',
},
- cli: {
- method: 'files upload',
- example:
- "imagekit files upload \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --file 'Example data' \\\n --file-name fileName",
- },
php: {
method: 'files->upload',
example:
@@ -404,10 +358,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'FileUploadParams parameters = new()\n{\n File = Encoding.UTF8.GetBytes("Example data"),\n FileName = "fileName",\n};\n\nvar response = await client.Files.Upload(parameters);\n\nConsole.WriteLine(response);',
},
- http: {
- example:
- 'curl https://upload.imagekit.io/api/v1/files/upload \\\n -H \'Content-Type: multipart/form-data\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -F \'file=@/path/to/file\' \\\n -F fileName=fileName \\\n -F checks=\'"request.folder" : "marketing/"\n \' \\\n -F customMetadata=\'{"brand":"bar","color":"bar"}\' \\\n -F description=\'Running shoes\' \\\n -F extensions=\'[{"name":"remove-bg","options":{"add_shadow":true}},{"maxTags":5,"minConfidence":95,"name":"google-auto-tagging"},{"name":"ai-auto-description"},{"name":"ai-tasks","tasks":[{"instruction":"What types of clothing items are visible in this image?","type":"select_tags","vocabulary":["shirt","tshirt","dress","trousers","jacket"]},{"instruction":"Is this a luxury or high-end fashion item?","type":"yes_no","on_yes":{"add_tags":["luxury","premium"]}}]},{"id":"ext_abc123","name":"saved-extension"}]\' \\\n -F responseFields=\'["tags","customCoordinates","isPrivateFile"]\' \\\n -F tags=\'["t-shirt","round-neck","men"]\' \\\n -F transformation=\'{"post":[{"type":"thumbnail","value":"w-150,h-150"},{"protocol":"dash","type":"abs","value":"sr-240_360_480_720_1080"}]}\'',
- },
},
},
{
@@ -430,6 +380,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst file = await client.files.get('fileId');\n\nconsole.log(file.videoCodec);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/files/$FILE_ID/details \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
+ },
python: {
method: 'files.get',
example:
@@ -440,11 +394,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.files.File;\nimport io.imagekit.models.files.FileGetParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n File file = client.files().get("fileId");\n }\n}',
},
- kotlin: {
- method: 'files().get',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.files.File\nimport io.imagekit.models.files.FileGetParams\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val file: File = client.files().get("fileId")\n}',
- },
go: {
method: 'client.Files.Get',
example:
@@ -455,11 +404,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nfile = image_kit.files.get("fileId")\n\nputs(file)',
},
- cli: {
- method: 'files get',
- example:
- "imagekit files get \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --file-id fileId",
- },
php: {
method: 'files->get',
example:
@@ -470,10 +414,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'FileGetParams parameters = new() { FileID = "fileId" };\n\nvar file = await client.Files.Get(parameters);\n\nConsole.WriteLine(file);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/files/$FILE_ID/details \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
- },
},
},
{
@@ -497,6 +437,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst file = await client.files.update('fileId');\n\nconsole.log(file);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/files/$FILE_ID/details \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "extensions": [\n {\n "name": "remove-bg",\n "options": {\n "add_shadow": true\n }\n },\n {\n "maxTags": 5,\n "minConfidence": 95,\n "name": "google-auto-tagging"\n },\n {\n "name": "ai-auto-description"\n },\n {\n "name": "ai-tasks",\n "tasks": [\n {\n "instruction": "What types of clothing items are visible in this image?",\n "type": "select_tags",\n "vocabulary": [\n "shirt",\n "tshirt",\n "dress",\n "trousers",\n "jacket"\n ]\n },\n {\n "instruction": "Is this a luxury or high-end fashion item?",\n "type": "yes_no",\n "on_yes": {\n "add_tags": [\n "luxury",\n "premium"\n ]\n }\n }\n ]\n },\n {\n "id": "ext_abc123",\n "name": "saved-extension"\n }\n ],\n "tags": [\n "tag1",\n "tag2"\n ]\n }\'',
+ },
python: {
method: 'files.update',
example:
@@ -507,11 +451,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.files.FileUpdateParams;\nimport io.imagekit.models.files.FileUpdateResponse;\nimport io.imagekit.models.files.UpdateFileRequest;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n FileUpdateParams params = FileUpdateParams.builder()\n .fileId("fileId")\n .updateFileRequest(UpdateFileRequest.UpdateFileDetails.builder().build())\n .build();\n FileUpdateResponse file = client.files().update(params);\n }\n}',
},
- kotlin: {
- method: 'files().update',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.files.FileUpdateParams\nimport io.imagekit.models.files.FileUpdateResponse\nimport io.imagekit.models.files.UpdateFileRequest\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val params: FileUpdateParams = FileUpdateParams.builder()\n .fileId("fileId")\n .updateFileRequest(UpdateFileRequest.UpdateFileDetails.builder().build())\n .build()\n val file: FileUpdateResponse = client.files().update(params)\n}',
- },
go: {
method: 'client.Files.Update',
example:
@@ -522,11 +461,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nfile = image_kit.files.update("fileId", update_file_request: {})\n\nputs(file)',
},
- cli: {
- method: 'files update',
- example:
- "imagekit files update \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --file-id fileId",
- },
php: {
method: 'files->update',
example:
@@ -537,10 +471,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'FileUpdateParams parameters = new()\n{\n FileID = "fileId",\n UpdateFileRequest = new UpdateFileDetails()\n {\n CustomCoordinates = "10,10,100,100",\n CustomMetadata = new Dictionary()\n {\n { "brand", JsonSerializer.SerializeToElement("bar") },\n { "color", JsonSerializer.SerializeToElement("bar") },\n },\n Description = "description",\n Extensions =\n [\n new RemoveBg()\n {\n Options = new()\n {\n AddShadow = true,\n BgColor = "bg_color",\n BgImageUrl = "bg_image_url",\n Semitransparency = true,\n },\n },\n new AutoTaggingExtension()\n {\n MaxTags = 10,\n MinConfidence = 80,\n Name = Name.GoogleAutoTagging,\n },\n new AutoTaggingExtension()\n {\n MaxTags = 10,\n MinConfidence = 80,\n Name = Name.AwsAutoTagging,\n },\n new AIAutoDescription(),\n new AITasks(\n\n [\n new SelectTags()\n {\n Instruction = "What types of clothing items are visible?",\n MaxSelections = 1,\n MinSelections = 0,\n Vocabulary =\n [\n "shirt", "dress", "jacket"\n ],\n },\n ]\n ),\n new SavedExtension("ext_abc123"),\n ],\n RemoveAITags = new(\n\n [\n "car", "vehicle", "motorsports"\n ]\n ),\n Tags =\n [\n "tag1", "tag2"\n ],\n WebhookUrl = "https://webhook.site/0d6b6c7a-8e5a-4b3a-8b7c-0d6b6c7a8e5a",\n },\n};\n\nvar file = await client.Files.Update(parameters);\n\nConsole.WriteLine(file);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/files/$FILE_ID/details \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "extensions": [\n {\n "name": "remove-bg",\n "options": {\n "add_shadow": true\n }\n },\n {\n "maxTags": 5,\n "minConfidence": 95,\n "name": "google-auto-tagging"\n },\n {\n "name": "ai-auto-description"\n },\n {\n "name": "ai-tasks",\n "tasks": [\n {\n "instruction": "What types of clothing items are visible in this image?",\n "type": "select_tags",\n "vocabulary": [\n "shirt",\n "tshirt",\n "dress",\n "trousers",\n "jacket"\n ]\n },\n {\n "instruction": "Is this a luxury or high-end fashion item?",\n "type": "yes_no",\n "on_yes": {\n "add_tags": [\n "luxury",\n "premium"\n ]\n }\n }\n ]\n },\n {\n "id": "ext_abc123",\n "name": "saved-extension"\n }\n ],\n "tags": [\n "tag1",\n "tag2"\n ]\n }\'',
- },
},
},
{
@@ -561,6 +491,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nawait client.files.delete('fileId');",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/files/$FILE_ID \\\n -X DELETE \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
+ },
python: {
method: 'files.delete',
example:
@@ -571,11 +505,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.files.FileDeleteParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n client.files().delete("fileId");\n }\n}',
},
- kotlin: {
- method: 'files().delete',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.files.FileDeleteParams\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n client.files().delete("fileId")\n}',
- },
go: {
method: 'client.Files.Delete',
example:
@@ -586,11 +515,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nresult = image_kit.files.delete("fileId")\n\nputs(result)',
},
- cli: {
- method: 'files delete',
- example:
- "imagekit files delete \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --file-id fileId",
- },
php: {
method: 'files->delete',
example:
@@ -601,10 +525,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'FileDeleteParams parameters = new() { FileID = "fileId" };\n\nawait client.Files.Delete(parameters);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/files/$FILE_ID \\\n -X DELETE \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
- },
},
},
{
@@ -626,6 +546,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst response = await client.files.copy({\n destinationPath: '/folder/to/copy/into/',\n sourceFilePath: '/path/to/file.jpg',\n});\n\nconsole.log(response);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/files/copy \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "destinationPath": "/folder/to/copy/into/",\n "sourceFilePath": "/path/to/file.jpg",\n "includeFileVersions": false\n }\'',
+ },
python: {
method: 'files.copy',
example:
@@ -636,11 +560,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.files.FileCopyParams;\nimport io.imagekit.models.files.FileCopyResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n FileCopyParams params = FileCopyParams.builder()\n .destinationPath("/folder/to/copy/into/")\n .sourceFilePath("/path/to/file.jpg")\n .build();\n FileCopyResponse response = client.files().copy(params);\n }\n}',
},
- kotlin: {
- method: 'files().copy',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.files.FileCopyParams\nimport io.imagekit.models.files.FileCopyResponse\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val params: FileCopyParams = FileCopyParams.builder()\n .destinationPath("/folder/to/copy/into/")\n .sourceFilePath("/path/to/file.jpg")\n .build()\n val response: FileCopyResponse = client.files().copy(params)\n}',
- },
go: {
method: 'client.Files.Copy',
example:
@@ -651,11 +570,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nresponse = image_kit.files.copy(destination_path: "/folder/to/copy/into/", source_file_path: "/path/to/file.jpg")\n\nputs(response)',
},
- cli: {
- method: 'files copy',
- example:
- "imagekit files copy \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --destination-path /folder/to/copy/into/ \\\n --source-file-path /path/to/file.jpg",
- },
php: {
method: 'files->copy',
example:
@@ -666,10 +580,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'FileCopyParams parameters = new()\n{\n DestinationPath = "/folder/to/copy/into/",\n SourceFilePath = "/path/to/file.jpg",\n};\n\nvar response = await client.Files.Copy(parameters);\n\nConsole.WriteLine(response);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/files/copy \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "destinationPath": "/folder/to/copy/into/",\n "sourceFilePath": "/path/to/file.jpg",\n "includeFileVersions": false\n }\'',
- },
},
},
{
@@ -691,6 +601,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst response = await client.files.move({\n destinationPath: '/folder/to/move/into/',\n sourceFilePath: '/path/to/file.jpg',\n});\n\nconsole.log(response);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/files/move \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "destinationPath": "/folder/to/move/into/",\n "sourceFilePath": "/path/to/file.jpg"\n }\'',
+ },
python: {
method: 'files.move',
example:
@@ -701,11 +615,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.files.FileMoveParams;\nimport io.imagekit.models.files.FileMoveResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n FileMoveParams params = FileMoveParams.builder()\n .destinationPath("/folder/to/move/into/")\n .sourceFilePath("/path/to/file.jpg")\n .build();\n FileMoveResponse response = client.files().move(params);\n }\n}',
},
- kotlin: {
- method: 'files().move',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.files.FileMoveParams\nimport io.imagekit.models.files.FileMoveResponse\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val params: FileMoveParams = FileMoveParams.builder()\n .destinationPath("/folder/to/move/into/")\n .sourceFilePath("/path/to/file.jpg")\n .build()\n val response: FileMoveResponse = client.files().move(params)\n}',
- },
go: {
method: 'client.Files.Move',
example:
@@ -716,11 +625,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nresponse = image_kit.files.move(destination_path: "/folder/to/move/into/", source_file_path: "/path/to/file.jpg")\n\nputs(response)',
},
- cli: {
- method: 'files move',
- example:
- "imagekit files move \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --destination-path /folder/to/move/into/ \\\n --source-file-path /path/to/file.jpg",
- },
php: {
method: 'files->move',
example:
@@ -731,10 +635,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'FileMoveParams parameters = new()\n{\n DestinationPath = "/folder/to/move/into/",\n SourceFilePath = "/path/to/file.jpg",\n};\n\nvar response = await client.Files.Move(parameters);\n\nConsole.WriteLine(response);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/files/move \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "destinationPath": "/folder/to/move/into/",\n "sourceFilePath": "/path/to/file.jpg"\n }\'',
- },
},
},
{
@@ -756,6 +656,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst response = await client.files.rename({\n filePath: '/path/to/file.jpg',\n newFileName: 'newFileName.jpg',\n});\n\nconsole.log(response.purgeRequestId);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/files/rename \\\n -X PUT \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "filePath": "/path/to/file.jpg",\n "newFileName": "newFileName.jpg",\n "purgeCache": true\n }\'',
+ },
python: {
method: 'files.rename',
example:
@@ -766,11 +670,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.files.FileRenameParams;\nimport io.imagekit.models.files.FileRenameResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n FileRenameParams params = FileRenameParams.builder()\n .filePath("/path/to/file.jpg")\n .newFileName("newFileName.jpg")\n .build();\n FileRenameResponse response = client.files().rename(params);\n }\n}',
},
- kotlin: {
- method: 'files().rename',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.files.FileRenameParams\nimport io.imagekit.models.files.FileRenameResponse\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val params: FileRenameParams = FileRenameParams.builder()\n .filePath("/path/to/file.jpg")\n .newFileName("newFileName.jpg")\n .build()\n val response: FileRenameResponse = client.files().rename(params)\n}',
- },
go: {
method: 'client.Files.Rename',
example:
@@ -781,11 +680,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nresponse = image_kit.files.rename(file_path: "/path/to/file.jpg", new_file_name: "newFileName.jpg")\n\nputs(response)',
},
- cli: {
- method: 'files rename',
- example:
- "imagekit files rename \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --file-path /path/to/file.jpg \\\n --new-file-name newFileName.jpg",
- },
php: {
method: 'files->rename',
example:
@@ -796,10 +690,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'FileRenameParams parameters = new()\n{\n FilePath = "/path/to/file.jpg",\n NewFileName = "newFileName.jpg",\n};\n\nvar response = await client.Files.Rename(parameters);\n\nConsole.WriteLine(response);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/files/rename \\\n -X PUT \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "filePath": "/path/to/file.jpg",\n "newFileName": "newFileName.jpg",\n "purgeCache": true\n }\'',
- },
},
},
{
@@ -821,6 +711,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst bulk = await client.files.bulk.delete({\n fileIds: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'],\n});\n\nconsole.log(bulk.successfullyDeletedFileIds);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/files/batch/deleteByFileIds \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "fileIds": [\n "598821f949c0a938d57563bd",\n "598821f949c0a938d57563be"\n ]\n }\'',
+ },
python: {
method: 'files.bulk.delete',
example:
@@ -831,11 +725,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.files.bulk.BulkDeleteParams;\nimport io.imagekit.models.files.bulk.BulkDeleteResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n BulkDeleteParams params = BulkDeleteParams.builder()\n .addFileId("598821f949c0a938d57563bd")\n .addFileId("598821f949c0a938d57563be")\n .build();\n BulkDeleteResponse bulk = client.files().bulk().delete(params);\n }\n}',
},
- kotlin: {
- method: 'files().bulk().delete',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.files.bulk.BulkDeleteParams\nimport io.imagekit.models.files.bulk.BulkDeleteResponse\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val params: BulkDeleteParams = BulkDeleteParams.builder()\n .addFileId("598821f949c0a938d57563bd")\n .addFileId("598821f949c0a938d57563be")\n .build()\n val bulk: BulkDeleteResponse = client.files().bulk().delete(params)\n}',
- },
go: {
method: 'client.Files.Bulk.Delete',
example:
@@ -846,11 +735,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nbulk = image_kit.files.bulk.delete(file_ids: ["598821f949c0a938d57563bd", "598821f949c0a938d57563be"])\n\nputs(bulk)',
},
- cli: {
- method: 'bulk delete',
- example:
- "imagekit files:bulk delete \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --file-id 598821f949c0a938d57563bd \\\n --file-id 598821f949c0a938d57563be",
- },
php: {
method: 'files->bulk->delete',
example:
@@ -861,10 +745,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'BulkDeleteParams parameters = new()\n{\n FileIds =\n [\n "598821f949c0a938d57563bd", "598821f949c0a938d57563be"\n ],\n};\n\nvar bulk = await client.Files.Bulk.Delete(parameters);\n\nConsole.WriteLine(bulk);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/files/batch/deleteByFileIds \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "fileIds": [\n "598821f949c0a938d57563bd",\n "598821f949c0a938d57563be"\n ]\n }\'',
- },
},
},
{
@@ -886,6 +766,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst response = await client.files.bulk.addTags({\n fileIds: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'],\n tags: ['t-shirt', 'round-neck', 'sale2019'],\n});\n\nconsole.log(response.successfullyUpdatedFileIds);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/files/addTags \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "fileIds": [\n "598821f949c0a938d57563bd",\n "598821f949c0a938d57563be"\n ],\n "tags": [\n "t-shirt",\n "round-neck",\n "sale2019"\n ]\n }\'',
+ },
python: {
method: 'files.bulk.add_tags',
example:
@@ -896,11 +780,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.files.bulk.BulkAddTagsParams;\nimport io.imagekit.models.files.bulk.BulkAddTagsResponse;\nimport java.util.List;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n BulkAddTagsParams params = BulkAddTagsParams.builder()\n .addFileId("598821f949c0a938d57563bd")\n .addFileId("598821f949c0a938d57563be")\n .tags(List.of(\n "t-shirt",\n "round-neck",\n "sale2019"\n ))\n .build();\n BulkAddTagsResponse response = client.files().bulk().addTags(params);\n }\n}',
},
- kotlin: {
- method: 'files().bulk().addTags',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.files.bulk.BulkAddTagsParams\nimport io.imagekit.models.files.bulk.BulkAddTagsResponse\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val params: BulkAddTagsParams = BulkAddTagsParams.builder()\n .addFileId("598821f949c0a938d57563bd")\n .addFileId("598821f949c0a938d57563be")\n .tags(listOf(\n "t-shirt",\n "round-neck",\n "sale2019",\n ))\n .build()\n val response: BulkAddTagsResponse = client.files().bulk().addTags(params)\n}',
- },
go: {
method: 'client.Files.Bulk.AddTags',
example:
@@ -911,11 +790,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nresponse = image_kit.files.bulk.add_tags(\n file_ids: ["598821f949c0a938d57563bd", "598821f949c0a938d57563be"],\n tags: ["t-shirt", "round-neck", "sale2019"]\n)\n\nputs(response)',
},
- cli: {
- method: 'bulk addTags',
- example:
- "imagekit files:bulk add-tags \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --file-id 598821f949c0a938d57563bd \\\n --file-id 598821f949c0a938d57563be \\\n --tag t-shirt \\\n --tag round-neck \\\n --tag sale2019",
- },
php: {
method: 'files->bulk->addTags',
example:
@@ -926,10 +800,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'BulkAddTagsParams parameters = new()\n{\n FileIds =\n [\n "598821f949c0a938d57563bd", "598821f949c0a938d57563be"\n ],\n Tags =\n [\n "t-shirt", "round-neck", "sale2019"\n ],\n};\n\nvar response = await client.Files.Bulk.AddTags(parameters);\n\nConsole.WriteLine(response);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/files/addTags \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "fileIds": [\n "598821f949c0a938d57563bd",\n "598821f949c0a938d57563be"\n ],\n "tags": [\n "t-shirt",\n "round-neck",\n "sale2019"\n ]\n }\'',
- },
},
},
{
@@ -951,6 +821,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst response = await client.files.bulk.removeTags({\n fileIds: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'],\n tags: ['t-shirt', 'round-neck', 'sale2019'],\n});\n\nconsole.log(response.successfullyUpdatedFileIds);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/files/removeTags \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "fileIds": [\n "598821f949c0a938d57563bd",\n "598821f949c0a938d57563be"\n ],\n "tags": [\n "t-shirt",\n "round-neck",\n "sale2019"\n ]\n }\'',
+ },
python: {
method: 'files.bulk.remove_tags',
example:
@@ -961,11 +835,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.files.bulk.BulkRemoveTagsParams;\nimport io.imagekit.models.files.bulk.BulkRemoveTagsResponse;\nimport java.util.List;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n BulkRemoveTagsParams params = BulkRemoveTagsParams.builder()\n .addFileId("598821f949c0a938d57563bd")\n .addFileId("598821f949c0a938d57563be")\n .tags(List.of(\n "t-shirt",\n "round-neck",\n "sale2019"\n ))\n .build();\n BulkRemoveTagsResponse response = client.files().bulk().removeTags(params);\n }\n}',
},
- kotlin: {
- method: 'files().bulk().removeTags',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.files.bulk.BulkRemoveTagsParams\nimport io.imagekit.models.files.bulk.BulkRemoveTagsResponse\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val params: BulkRemoveTagsParams = BulkRemoveTagsParams.builder()\n .addFileId("598821f949c0a938d57563bd")\n .addFileId("598821f949c0a938d57563be")\n .tags(listOf(\n "t-shirt",\n "round-neck",\n "sale2019",\n ))\n .build()\n val response: BulkRemoveTagsResponse = client.files().bulk().removeTags(params)\n}',
- },
go: {
method: 'client.Files.Bulk.RemoveTags',
example:
@@ -976,11 +845,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nresponse = image_kit.files.bulk.remove_tags(\n file_ids: ["598821f949c0a938d57563bd", "598821f949c0a938d57563be"],\n tags: ["t-shirt", "round-neck", "sale2019"]\n)\n\nputs(response)',
},
- cli: {
- method: 'bulk removeTags',
- example:
- "imagekit files:bulk remove-tags \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --file-id 598821f949c0a938d57563bd \\\n --file-id 598821f949c0a938d57563be \\\n --tag t-shirt \\\n --tag round-neck \\\n --tag sale2019",
- },
php: {
method: 'files->bulk->removeTags',
example:
@@ -991,10 +855,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'BulkRemoveTagsParams parameters = new()\n{\n FileIds =\n [\n "598821f949c0a938d57563bd", "598821f949c0a938d57563be"\n ],\n Tags =\n [\n "t-shirt", "round-neck", "sale2019"\n ],\n};\n\nvar response = await client.Files.Bulk.RemoveTags(parameters);\n\nConsole.WriteLine(response);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/files/removeTags \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "fileIds": [\n "598821f949c0a938d57563bd",\n "598821f949c0a938d57563be"\n ],\n "tags": [\n "t-shirt",\n "round-neck",\n "sale2019"\n ]\n }\'',
- },
},
},
{
@@ -1016,6 +876,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst response = await client.files.bulk.removeAITags({\n AITags: ['t-shirt', 'round-neck', 'sale2019'],\n fileIds: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'],\n});\n\nconsole.log(response.successfullyUpdatedFileIds);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/files/removeAITags \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "AITags": [\n "t-shirt",\n "round-neck",\n "sale2019"\n ],\n "fileIds": [\n "598821f949c0a938d57563bd",\n "598821f949c0a938d57563be"\n ]\n }\'',
+ },
python: {
method: 'files.bulk.remove_ai_tags',
example:
@@ -1026,11 +890,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.files.bulk.BulkRemoveAiTagsParams;\nimport io.imagekit.models.files.bulk.BulkRemoveAiTagsResponse;\nimport java.util.List;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n BulkRemoveAiTagsParams params = BulkRemoveAiTagsParams.builder()\n .aiTags(List.of(\n "t-shirt",\n "round-neck",\n "sale2019"\n ))\n .addFileId("598821f949c0a938d57563bd")\n .addFileId("598821f949c0a938d57563be")\n .build();\n BulkRemoveAiTagsResponse response = client.files().bulk().removeAiTags(params);\n }\n}',
},
- kotlin: {
- method: 'files().bulk().removeAiTags',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.files.bulk.BulkRemoveAiTagsParams\nimport io.imagekit.models.files.bulk.BulkRemoveAiTagsResponse\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val params: BulkRemoveAiTagsParams = BulkRemoveAiTagsParams.builder()\n .aiTags(listOf(\n "t-shirt",\n "round-neck",\n "sale2019",\n ))\n .addFileId("598821f949c0a938d57563bd")\n .addFileId("598821f949c0a938d57563be")\n .build()\n val response: BulkRemoveAiTagsResponse = client.files().bulk().removeAiTags(params)\n}',
- },
go: {
method: 'client.Files.Bulk.RemoveAITags',
example:
@@ -1041,11 +900,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nresponse = image_kit.files.bulk.remove_ai_tags(\n ai_tags: ["t-shirt", "round-neck", "sale2019"],\n file_ids: ["598821f949c0a938d57563bd", "598821f949c0a938d57563be"]\n)\n\nputs(response)',
},
- cli: {
- method: 'bulk removeAiTags',
- example:
- "imagekit files:bulk remove-ai-tags \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --ai-tag t-shirt \\\n --ai-tag round-neck \\\n --ai-tag sale2019 \\\n --file-id 598821f949c0a938d57563bd \\\n --file-id 598821f949c0a938d57563be",
- },
php: {
method: 'files->bulk->removeAITags',
example:
@@ -1056,10 +910,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'BulkRemoveAITagsParams parameters = new()\n{\n AITags =\n [\n "t-shirt", "round-neck", "sale2019"\n ],\n FileIds =\n [\n "598821f949c0a938d57563bd", "598821f949c0a938d57563be"\n ],\n};\n\nvar response = await client.Files.Bulk.RemoveAITags(parameters);\n\nConsole.WriteLine(response);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/files/removeAITags \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "AITags": [\n "t-shirt",\n "round-neck",\n "sale2019"\n ],\n "fileIds": [\n "598821f949c0a938d57563bd",\n "598821f949c0a938d57563be"\n ]\n }\'',
- },
},
},
{
@@ -1081,6 +931,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst files = await client.files.versions.list('fileId');\n\nconsole.log(files);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/files/$FILE_ID/versions \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
+ },
python: {
method: 'files.versions.list',
example:
@@ -1091,11 +945,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.files.File;\nimport io.imagekit.models.files.versions.VersionListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n List files = client.files().versions().list("fileId");\n }\n}',
},
- kotlin: {
- method: 'files().versions().list',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.files.File\nimport io.imagekit.models.files.versions.VersionListParams\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val files: List = client.files().versions().list("fileId")\n}',
- },
go: {
method: 'client.Files.Versions.List',
example:
@@ -1106,11 +955,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nfiles = image_kit.files.versions.list("fileId")\n\nputs(files)',
},
- cli: {
- method: 'versions list',
- example:
- "imagekit files:versions list \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --file-id fileId",
- },
php: {
method: 'files->versions->list',
example:
@@ -1121,10 +965,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'VersionListParams parameters = new() { FileID = "fileId" };\n\nvar files = await client.Files.Versions.List(parameters);\n\nConsole.WriteLine(files);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/files/$FILE_ID/versions \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
- },
},
},
{
@@ -1146,6 +986,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst file = await client.files.versions.get('versionId', { fileId: 'fileId' });\n\nconsole.log(file.videoCodec);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/files/$FILE_ID/versions/$VERSION_ID \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
+ },
python: {
method: 'files.versions.get',
example:
@@ -1156,11 +1000,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.files.File;\nimport io.imagekit.models.files.versions.VersionGetParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n VersionGetParams params = VersionGetParams.builder()\n .fileId("fileId")\n .versionId("versionId")\n .build();\n File file = client.files().versions().get(params);\n }\n}',
},
- kotlin: {
- method: 'files().versions().get',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.files.File\nimport io.imagekit.models.files.versions.VersionGetParams\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val params: VersionGetParams = VersionGetParams.builder()\n .fileId("fileId")\n .versionId("versionId")\n .build()\n val file: File = client.files().versions().get(params)\n}',
- },
go: {
method: 'client.Files.Versions.Get',
example:
@@ -1171,11 +1010,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nfile = image_kit.files.versions.get("versionId", file_id: "fileId")\n\nputs(file)',
},
- cli: {
- method: 'versions get',
- example:
- "imagekit files:versions get \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --file-id fileId \\\n --version-id versionId",
- },
php: {
method: 'files->versions->get',
example:
@@ -1186,10 +1020,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'VersionGetParams parameters = new()\n{\n FileID = "fileId",\n VersionID = "versionId",\n};\n\nvar file = await client.Files.Versions.Get(parameters);\n\nConsole.WriteLine(file);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/files/$FILE_ID/versions/$VERSION_ID \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
- },
},
},
{
@@ -1211,6 +1041,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst version = await client.files.versions.delete('versionId', { fileId: 'fileId' });\n\nconsole.log(version);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/files/$FILE_ID/versions/$VERSION_ID \\\n -X DELETE \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
+ },
python: {
method: 'files.versions.delete',
example:
@@ -1221,11 +1055,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.files.versions.VersionDeleteParams;\nimport io.imagekit.models.files.versions.VersionDeleteResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n VersionDeleteParams params = VersionDeleteParams.builder()\n .fileId("fileId")\n .versionId("versionId")\n .build();\n VersionDeleteResponse version = client.files().versions().delete(params);\n }\n}',
},
- kotlin: {
- method: 'files().versions().delete',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.files.versions.VersionDeleteParams\nimport io.imagekit.models.files.versions.VersionDeleteResponse\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val params: VersionDeleteParams = VersionDeleteParams.builder()\n .fileId("fileId")\n .versionId("versionId")\n .build()\n val version: VersionDeleteResponse = client.files().versions().delete(params)\n}',
- },
go: {
method: 'client.Files.Versions.Delete',
example:
@@ -1236,11 +1065,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nversion = image_kit.files.versions.delete("versionId", file_id: "fileId")\n\nputs(version)',
},
- cli: {
- method: 'versions delete',
- example:
- "imagekit files:versions delete \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --file-id fileId \\\n --version-id versionId",
- },
php: {
method: 'files->versions->delete',
example:
@@ -1251,10 +1075,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'VersionDeleteParams parameters = new()\n{\n FileID = "fileId",\n VersionID = "versionId",\n};\n\nvar version = await client.Files.Versions.Delete(parameters);\n\nConsole.WriteLine(version);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/files/$FILE_ID/versions/$VERSION_ID \\\n -X DELETE \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
- },
},
},
{
@@ -1276,6 +1096,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst file = await client.files.versions.restore('versionId', { fileId: 'fileId' });\n\nconsole.log(file.videoCodec);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/files/$FILE_ID/versions/$VERSION_ID/restore \\\n -X PUT \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
+ },
python: {
method: 'files.versions.restore',
example:
@@ -1286,11 +1110,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.files.File;\nimport io.imagekit.models.files.versions.VersionRestoreParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n VersionRestoreParams params = VersionRestoreParams.builder()\n .fileId("fileId")\n .versionId("versionId")\n .build();\n File file = client.files().versions().restore(params);\n }\n}',
},
- kotlin: {
- method: 'files().versions().restore',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.files.File\nimport io.imagekit.models.files.versions.VersionRestoreParams\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val params: VersionRestoreParams = VersionRestoreParams.builder()\n .fileId("fileId")\n .versionId("versionId")\n .build()\n val file: File = client.files().versions().restore(params)\n}',
- },
go: {
method: 'client.Files.Versions.Restore',
example:
@@ -1301,11 +1120,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nfile = image_kit.files.versions.restore("versionId", file_id: "fileId")\n\nputs(file)',
},
- cli: {
- method: 'versions restore',
- example:
- "imagekit files:versions restore \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --file-id fileId \\\n --version-id versionId",
- },
php: {
method: 'files->versions->restore',
example:
@@ -1316,10 +1130,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'VersionRestoreParams parameters = new()\n{\n FileID = "fileId",\n VersionID = "versionId",\n};\n\nvar file = await client.Files.Versions.Restore(parameters);\n\nConsole.WriteLine(file);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/files/$FILE_ID/versions/$VERSION_ID/restore \\\n -X PUT \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
- },
},
},
{
@@ -1342,6 +1152,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst metadata = await client.files.metadata.get('fileId');\n\nconsole.log(metadata.videoCodec);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/files/$FILE_ID/metadata \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
+ },
python: {
method: 'files.metadata.get',
example:
@@ -1352,11 +1166,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.files.Metadata;\nimport io.imagekit.models.files.metadata.MetadataGetParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n Metadata metadata = client.files().metadata().get("fileId");\n }\n}',
},
- kotlin: {
- method: 'files().metadata().get',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.files.Metadata\nimport io.imagekit.models.files.metadata.MetadataGetParams\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val metadata: Metadata = client.files().metadata().get("fileId")\n}',
- },
go: {
method: 'client.Files.Metadata.Get',
example:
@@ -1367,11 +1176,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nmetadata = image_kit.files.metadata.get("fileId")\n\nputs(metadata)',
},
- cli: {
- method: 'metadata get',
- example:
- "imagekit files:metadata get \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --file-id fileId",
- },
php: {
method: 'files->metadata->get',
example:
@@ -1382,10 +1186,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'MetadataGetParams parameters = new() { FileID = "fileId" };\n\nvar metadata = await client.Files.Metadata.Get(parameters);\n\nConsole.WriteLine(metadata);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/files/$FILE_ID/metadata \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
- },
},
},
{
@@ -1408,6 +1208,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst metadata = await client.files.metadata.getFromURL({ url: 'https://example.com' });\n\nconsole.log(metadata.videoCodec);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/metadata \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
+ },
python: {
method: 'files.metadata.get_from_url',
example:
@@ -1418,11 +1222,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.files.Metadata;\nimport io.imagekit.models.files.metadata.MetadataGetFromUrlParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n MetadataGetFromUrlParams params = MetadataGetFromUrlParams.builder()\n .url("https://example.com")\n .build();\n Metadata metadata = client.files().metadata().getFromUrl(params);\n }\n}',
},
- kotlin: {
- method: 'files().metadata().getFromUrl',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.files.Metadata\nimport io.imagekit.models.files.metadata.MetadataGetFromUrlParams\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val params: MetadataGetFromUrlParams = MetadataGetFromUrlParams.builder()\n .url("https://example.com")\n .build()\n val metadata: Metadata = client.files().metadata().getFromUrl(params)\n}',
- },
go: {
method: 'client.Files.Metadata.GetFromURL',
example:
@@ -1433,11 +1232,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nmetadata = image_kit.files.metadata.get_from_url(url: "https://example.com")\n\nputs(metadata)',
},
- cli: {
- method: 'metadata getFromURL',
- example:
- "imagekit files:metadata get-from-url \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --url https://example.com",
- },
php: {
method: 'files->metadata->getFromURL',
example:
@@ -1448,10 +1242,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'MetadataGetFromUrlParams parameters = new() { Url = "https://example.com" };\n\nvar metadata = await client.Files.Metadata.GetFromUrl(parameters);\n\nConsole.WriteLine(metadata);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/metadata \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
- },
},
},
{
@@ -1473,6 +1263,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst savedExtensions = await client.savedExtensions.list();\n\nconsole.log(savedExtensions);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/saved-extensions \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
+ },
python: {
method: 'saved_extensions.list',
example:
@@ -1483,11 +1277,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.SavedExtension;\nimport io.imagekit.models.savedextensions.SavedExtensionListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n List savedExtensions = client.savedExtensions().list();\n }\n}',
},
- kotlin: {
- method: 'savedExtensions().list',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.SavedExtension\nimport io.imagekit.models.savedextensions.SavedExtensionListParams\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val savedExtensions: List = client.savedExtensions().list()\n}',
- },
go: {
method: 'client.SavedExtensions.List',
example:
@@ -1498,11 +1287,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nsaved_extensions = image_kit.saved_extensions.list\n\nputs(saved_extensions)',
},
- cli: {
- method: 'savedExtensions list',
- example:
- "imagekit saved-extensions list \\\n --private-key 'My Private Key' \\\n --password 'My Password'",
- },
php: {
method: 'savedExtensions->list',
example:
@@ -1513,10 +1297,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'SavedExtensionListParams parameters = new();\n\nvar savedExtensions = await client.SavedExtensions.List(parameters);\n\nConsole.WriteLine(savedExtensions);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/saved-extensions \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
- },
},
},
{
@@ -1543,6 +1323,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst savedExtension = await client.savedExtensions.create({\n config: { name: 'remove-bg' },\n description: 'Analyzes vehicle images for type, condition, and quality assessment',\n name: 'Car Quality Analysis',\n});\n\nconsole.log(savedExtension.id);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/saved-extensions \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "config": {\n "name": "remove-bg"\n },\n "description": "Analyzes vehicle images for type, condition, and quality assessment",\n "name": "Car Quality Analysis"\n }\'',
+ },
python: {
method: 'saved_extensions.create',
example:
@@ -1553,11 +1337,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.ExtensionConfig;\nimport io.imagekit.models.SavedExtension;\nimport io.imagekit.models.savedextensions.SavedExtensionCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n SavedExtensionCreateParams params = SavedExtensionCreateParams.builder()\n .config(ExtensionConfig.RemoveBg.builder().build())\n .description("Analyzes vehicle images for type, condition, and quality assessment")\n .name("Car Quality Analysis")\n .build();\n SavedExtension savedExtension = client.savedExtensions().create(params);\n }\n}',
},
- kotlin: {
- method: 'savedExtensions().create',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.ExtensionConfig\nimport io.imagekit.models.SavedExtension\nimport io.imagekit.models.savedextensions.SavedExtensionCreateParams\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val params: SavedExtensionCreateParams = SavedExtensionCreateParams.builder()\n .config(ExtensionConfig.RemoveBg.builder().build())\n .description("Analyzes vehicle images for type, condition, and quality assessment")\n .name("Car Quality Analysis")\n .build()\n val savedExtension: SavedExtension = client.savedExtensions().create(params)\n}',
- },
go: {
method: 'client.SavedExtensions.New',
example:
@@ -1568,11 +1347,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nsaved_extension = image_kit.saved_extensions.create(\n config: {name: :"remove-bg"},\n description: "Analyzes vehicle images for type, condition, and quality assessment",\n name: "Car Quality Analysis"\n)\n\nputs(saved_extension)',
},
- cli: {
- method: 'savedExtensions create',
- example:
- "imagekit saved-extensions create \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --config '{name: remove-bg}' \\\n --description 'Analyzes vehicle images for type, condition, and quality assessment' \\\n --name 'Car Quality Analysis'",
- },
php: {
method: 'savedExtensions->create',
example:
@@ -1583,10 +1357,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'SavedExtensionCreateParams parameters = new()\n{\n Config = new RemoveBg()\n {\n Options = new()\n {\n AddShadow = true,\n BgColor = "bg_color",\n BgImageUrl = "bg_image_url",\n Semitransparency = true,\n },\n },\n Description = "Analyzes vehicle images for type, condition, and quality assessment",\n Name = "Car Quality Analysis",\n};\n\nvar savedExtension = await client.SavedExtensions.Create(parameters);\n\nConsole.WriteLine(savedExtension);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/saved-extensions \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "config": {\n "name": "remove-bg"\n },\n "description": "Analyzes vehicle images for type, condition, and quality assessment",\n "name": "Car Quality Analysis"\n }\'',
- },
},
},
{
@@ -1608,6 +1378,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst savedExtension = await client.savedExtensions.get('id');\n\nconsole.log(savedExtension.id);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/saved-extensions/$ID \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
+ },
python: {
method: 'saved_extensions.get',
example:
@@ -1618,11 +1392,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.SavedExtension;\nimport io.imagekit.models.savedextensions.SavedExtensionGetParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n SavedExtension savedExtension = client.savedExtensions().get("id");\n }\n}',
},
- kotlin: {
- method: 'savedExtensions().get',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.SavedExtension\nimport io.imagekit.models.savedextensions.SavedExtensionGetParams\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val savedExtension: SavedExtension = client.savedExtensions().get("id")\n}',
- },
go: {
method: 'client.SavedExtensions.Get',
example:
@@ -1633,11 +1402,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nsaved_extension = image_kit.saved_extensions.get("id")\n\nputs(saved_extension)',
},
- cli: {
- method: 'savedExtensions get',
- example:
- "imagekit saved-extensions get \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --id id",
- },
php: {
method: 'savedExtensions->get',
example:
@@ -1648,10 +1412,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'SavedExtensionGetParams parameters = new() { ID = "id" };\n\nvar savedExtension = await client.SavedExtensions.Get(parameters);\n\nConsole.WriteLine(savedExtension);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/saved-extensions/$ID \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
- },
},
},
{
@@ -1679,6 +1439,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst savedExtension = await client.savedExtensions.update('id');\n\nconsole.log(savedExtension.id);",
},
+ http: {
+ example:
+ "curl https://api.imagekit.io/v1/saved-extensions/$ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -u \"$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS\" \\\n -d '{}'",
+ },
python: {
method: 'saved_extensions.update',
example:
@@ -1689,11 +1453,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.SavedExtension;\nimport io.imagekit.models.savedextensions.SavedExtensionUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n SavedExtension savedExtension = client.savedExtensions().update("id");\n }\n}',
},
- kotlin: {
- method: 'savedExtensions().update',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.SavedExtension\nimport io.imagekit.models.savedextensions.SavedExtensionUpdateParams\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val savedExtension: SavedExtension = client.savedExtensions().update("id")\n}',
- },
go: {
method: 'client.SavedExtensions.Update',
example:
@@ -1704,11 +1463,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nsaved_extension = image_kit.saved_extensions.update("id")\n\nputs(saved_extension)',
},
- cli: {
- method: 'savedExtensions update',
- example:
- "imagekit saved-extensions update \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --id id",
- },
php: {
method: 'savedExtensions->update',
example:
@@ -1719,10 +1473,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'SavedExtensionUpdateParams parameters = new() { ID = "id" };\n\nvar savedExtension = await client.SavedExtensions.Update(parameters);\n\nConsole.WriteLine(savedExtension);',
},
- http: {
- example:
- "curl https://api.imagekit.io/v1/saved-extensions/$ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -u \"$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS\" \\\n -d '{}'",
- },
},
},
{
@@ -1742,6 +1492,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nawait client.savedExtensions.delete('id');",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/saved-extensions/$ID \\\n -X DELETE \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
+ },
python: {
method: 'saved_extensions.delete',
example:
@@ -1752,11 +1506,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.savedextensions.SavedExtensionDeleteParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n client.savedExtensions().delete("id");\n }\n}',
},
- kotlin: {
- method: 'savedExtensions().delete',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.savedextensions.SavedExtensionDeleteParams\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n client.savedExtensions().delete("id")\n}',
- },
go: {
method: 'client.SavedExtensions.Delete',
example:
@@ -1767,11 +1516,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nresult = image_kit.saved_extensions.delete("id")\n\nputs(result)',
},
- cli: {
- method: 'savedExtensions delete',
- example:
- "imagekit saved-extensions delete \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --id id",
- },
php: {
method: 'savedExtensions->delete',
example:
@@ -1782,10 +1526,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'SavedExtensionDeleteParams parameters = new() { ID = "id" };\n\nawait client.SavedExtensions.Delete(parameters);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/saved-extensions/$ID \\\n -X DELETE \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
- },
},
},
{
@@ -1809,13 +1549,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
response:
"{ AITags?: { confidence?: number; name?: string; source?: string; }[]; audioCodec?: string; bitRate?: number; createdAt?: string; customCoordinates?: string; customMetadata?: object; description?: string; duration?: number; embeddedMetadata?: object; fileId?: string; filePath?: string; fileType?: string; hasAlpha?: boolean; height?: number; isPrivateFile?: boolean; isPublished?: boolean; mime?: string; name?: string; selectedFieldsSchema?: object; size?: number; tags?: string[]; thumbnail?: string; type?: 'file' | 'file-version'; updatedAt?: string; url?: string; versionInfo?: { id?: string; name?: string; }; videoCodec?: string; width?: number; } | { createdAt?: string; customMetadata?: object; folderId?: string; folderPath?: string; name?: string; type?: 'folder'; updatedAt?: string; }[]",
markdown:
- "## list\n\n`client.assets.list(fileType?: 'all' | 'image' | 'non-image', limit?: number, path?: string, searchQuery?: string, skip?: number, sort?: string, type?: 'file' | 'file-version' | 'folder' | 'all'): object | object[]`\n\n**get** `/v1/files`\n\nThis API can list all the uploaded files and folders in your ImageKit.io media library. In addition, you can fine-tune your query by specifying various filters by generating a query string in a Lucene-like syntax and provide this generated string as the value of the `searchQuery`.\n\n\n### Parameters\n\n- `fileType?: 'all' | 'image' | 'non-image'`\n Filter results by file type.\n\n- `all` — include all file types \n- `image` — include only image files \n- `non-image` — include only non-image files (e.g., JS, CSS, video)\n\n- `limit?: number`\n The maximum number of results to return in response.\n\n\n- `path?: string`\n Folder path if you want to limit the search within a specific folder. For example, `/sales-banner/` will only search in folder sales-banner.\n\nNote : If your use case involves searching within a folder as well as its subfolders, you can use `path` parameter in `searchQuery` with appropriate operator.\nCheckout [Supported parameters](/docs/api-reference/digital-asset-management-dam/list-and-search-assets#supported-parameters) for more information.\n\n\n- `searchQuery?: string`\n Query string in a Lucene-like query language e.g. `createdAt > \"7d\"`.\n\nNote : When the searchQuery parameter is present, the following query parameters will have no effect on the result:\n\n1. `tags`\n2. `type`\n3. `name`\n\n[Learn more](/docs/api-reference/digital-asset-management-dam/list-and-search-assets#advanced-search-queries) from examples.\n\n\n- `skip?: number`\n The number of results to skip before returning results.\n\n\n- `sort?: string`\n Sort the results by one of the supported fields in ascending or descending order.\n\n- `type?: 'file' | 'file-version' | 'folder' | 'all'`\n Filter results by asset type.\n\n- `file` — returns only files \n- `file-version` — returns specific file versions \n- `folder` — returns only folders \n- `all` — returns both files and folders (excludes `file-version`)\n\n### Returns\n\n- `{ AITags?: { confidence?: number; name?: string; source?: string; }[]; audioCodec?: string; bitRate?: number; createdAt?: string; customCoordinates?: string; customMetadata?: object; description?: string; duration?: number; embeddedMetadata?: object; fileId?: string; filePath?: string; fileType?: string; hasAlpha?: boolean; height?: number; isPrivateFile?: boolean; isPublished?: boolean; mime?: string; name?: string; selectedFieldsSchema?: object; size?: number; tags?: string[]; thumbnail?: string; type?: 'file' | 'file-version'; updatedAt?: string; url?: string; versionInfo?: { id?: string; name?: string; }; videoCodec?: string; width?: number; } | { createdAt?: string; customMetadata?: object; folderId?: string; folderPath?: string; name?: string; type?: 'folder'; updatedAt?: string; }[]`\n\n### Example\n\n```typescript\nimport ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit();\n\nconst assets = await client.assets.list();\n\nconsole.log(assets);\n```",
+ "## list\n\n`client.assets.list(fileType?: 'all' | 'image' | 'non-image', limit?: number, path?: string, searchQuery?: string, skip?: number, sort?: string, type?: 'file' | 'file-version' | 'folder' | 'all'): object | object[]`\n\n**get** `/v1/files`\n\nThis API can list all the uploaded files and folders in your ImageKit.io media library. In addition, you can fine-tune your query by specifying various filters by generating a query string in a Lucene-like syntax and provide this generated string as the value of the `searchQuery`.\n\n\n### Parameters\n\n- `fileType?: 'all' | 'image' | 'non-image'`\n Filter results by file type.\n\n- `all` — include all file types \n- `image` — include only image files \n- `non-image` — include only non-image files (e.g., JS, CSS, video)\n\n\n- `limit?: number`\n The maximum number of results to return in response.\n\n\n- `path?: string`\n Folder path if you want to limit the search within a specific folder. For example, `/sales-banner/` will only search in folder sales-banner.\n\nNote : If your use case involves searching within a folder as well as its subfolders, you can use `path` parameter in `searchQuery` with appropriate operator.\nCheckout [Supported parameters](/docs/api-reference/digital-asset-management-dam/list-and-search-assets#supported-parameters) for more information.\n\n\n- `searchQuery?: string`\n Query string in a Lucene-like query language e.g. `createdAt > \"7d\"`.\n\nNote : When the searchQuery parameter is present, the following query parameters will have no effect on the result:\n\n1. `tags`\n2. `type`\n3. `name`\n\n[Learn more](/docs/api-reference/digital-asset-management-dam/list-and-search-assets#advanced-search-queries) from examples.\n\n\n- `skip?: number`\n The number of results to skip before returning results.\n\n\n- `sort?: string`\n Sort the results by one of the supported fields in ascending or descending order.\n\n\n- `type?: 'file' | 'file-version' | 'folder' | 'all'`\n Filter results by asset type.\n\n- `file` — returns only files \n- `file-version` — returns specific file versions \n- `folder` — returns only folders \n- `all` — returns both files and folders (excludes `file-version`)\n\n\n### Returns\n\n- `{ AITags?: { confidence?: number; name?: string; source?: string; }[]; audioCodec?: string; bitRate?: number; createdAt?: string; customCoordinates?: string; customMetadata?: object; description?: string; duration?: number; embeddedMetadata?: object; fileId?: string; filePath?: string; fileType?: string; hasAlpha?: boolean; height?: number; isPrivateFile?: boolean; isPublished?: boolean; mime?: string; name?: string; selectedFieldsSchema?: object; size?: number; tags?: string[]; thumbnail?: string; type?: 'file' | 'file-version'; updatedAt?: string; url?: string; versionInfo?: { id?: string; name?: string; }; videoCodec?: string; width?: number; } | { createdAt?: string; customMetadata?: object; folderId?: string; folderPath?: string; name?: string; type?: 'folder'; updatedAt?: string; }[]`\n\n### Example\n\n```typescript\nimport ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit();\n\nconst assets = await client.assets.list();\n\nconsole.log(assets);\n```",
perLanguage: {
typescript: {
method: 'client.assets.list',
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst assets = await client.assets.list();\n\nconsole.log(assets);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/files \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
+ },
python: {
method: 'assets.list',
example:
@@ -1826,11 +1570,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.assets.AssetListParams;\nimport io.imagekit.models.assets.AssetListResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n List assets = client.assets().list();\n }\n}',
},
- kotlin: {
- method: 'assets().list',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.assets.AssetListParams\nimport io.imagekit.models.assets.AssetListResponse\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val assets: List = client.assets().list()\n}',
- },
go: {
method: 'client.Assets.List',
example:
@@ -1841,10 +1580,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nassets = image_kit.assets.list\n\nputs(assets)',
},
- cli: {
- method: 'assets list',
- example: "imagekit assets list \\\n --private-key 'My Private Key' \\\n --password 'My Password'",
- },
php: {
method: 'assets->list',
example:
@@ -1855,10 +1590,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'AssetListParams parameters = new();\n\nvar assets = await client.Assets.List(parameters);\n\nConsole.WriteLine(assets);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/files \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
- },
},
},
{
@@ -1880,6 +1611,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst invalidation = await client.cache.invalidation.create({\n url: 'https://ik.imagekit.io/your_imagekit_id/default-image.jpg',\n});\n\nconsole.log(invalidation.requestId);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/files/purge \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "url": "https://ik.imagekit.io/your_imagekit_id/default-image.jpg"\n }\'',
+ },
python: {
method: 'cache.invalidation.create',
example:
@@ -1890,11 +1625,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.cache.invalidation.InvalidationCreateParams;\nimport io.imagekit.models.cache.invalidation.InvalidationCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n InvalidationCreateParams params = InvalidationCreateParams.builder()\n .url("https://ik.imagekit.io/your_imagekit_id/default-image.jpg")\n .build();\n InvalidationCreateResponse invalidation = client.cache().invalidation().create(params);\n }\n}',
},
- kotlin: {
- method: 'cache().invalidation().create',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.cache.invalidation.InvalidationCreateParams\nimport io.imagekit.models.cache.invalidation.InvalidationCreateResponse\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val params: InvalidationCreateParams = InvalidationCreateParams.builder()\n .url("https://ik.imagekit.io/your_imagekit_id/default-image.jpg")\n .build()\n val invalidation: InvalidationCreateResponse = client.cache().invalidation().create(params)\n}',
- },
go: {
method: 'client.Cache.Invalidation.New',
example:
@@ -1905,11 +1635,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\ninvalidation = image_kit.cache.invalidation.create(url: "https://ik.imagekit.io/your_imagekit_id/default-image.jpg")\n\nputs(invalidation)',
},
- cli: {
- method: 'invalidation create',
- example:
- "imagekit cache:invalidation create \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --url https://ik.imagekit.io/your_imagekit_id/default-image.jpg",
- },
php: {
method: 'cache->invalidation->create',
example:
@@ -1920,10 +1645,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'InvalidationCreateParams parameters = new()\n{\n Url = "https://ik.imagekit.io/your_imagekit_id/default-image.jpg"\n};\n\nvar invalidation = await client.Cache.Invalidation.Create(parameters);\n\nConsole.WriteLine(invalidation);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/files/purge \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "url": "https://ik.imagekit.io/your_imagekit_id/default-image.jpg"\n }\'',
- },
},
},
{
@@ -1944,6 +1665,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst invalidation = await client.cache.invalidation.get('requestId');\n\nconsole.log(invalidation.status);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/files/purge/$REQUEST_ID \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
+ },
python: {
method: 'cache.invalidation.get',
example:
@@ -1954,11 +1679,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.cache.invalidation.InvalidationGetParams;\nimport io.imagekit.models.cache.invalidation.InvalidationGetResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n InvalidationGetResponse invalidation = client.cache().invalidation().get("requestId");\n }\n}',
},
- kotlin: {
- method: 'cache().invalidation().get',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.cache.invalidation.InvalidationGetParams\nimport io.imagekit.models.cache.invalidation.InvalidationGetResponse\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val invalidation: InvalidationGetResponse = client.cache().invalidation().get("requestId")\n}',
- },
go: {
method: 'client.Cache.Invalidation.Get',
example:
@@ -1969,11 +1689,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\ninvalidation = image_kit.cache.invalidation.get("requestId")\n\nputs(invalidation)',
},
- cli: {
- method: 'invalidation get',
- example:
- "imagekit cache:invalidation get \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --request-id requestId",
- },
php: {
method: 'cache->invalidation->get',
example:
@@ -1984,10 +1699,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'InvalidationGetParams parameters = new() { RequestID = "requestId" };\n\nvar invalidation = await client.Cache.Invalidation.Get(parameters);\n\nConsole.WriteLine(invalidation);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/files/purge/$REQUEST_ID \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
- },
},
},
{
@@ -2009,6 +1720,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst folder = await client.folders.create({\n folderName: 'summer',\n parentFolderPath: '/product/images/',\n});\n\nconsole.log(folder);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/folder \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "folderName": "summer",\n "parentFolderPath": "/product/images/"\n }\'',
+ },
python: {
method: 'folders.create',
example:
@@ -2019,11 +1734,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.folders.FolderCreateParams;\nimport io.imagekit.models.folders.FolderCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n FolderCreateParams params = FolderCreateParams.builder()\n .folderName("summer")\n .parentFolderPath("/product/images/")\n .build();\n FolderCreateResponse folder = client.folders().create(params);\n }\n}',
},
- kotlin: {
- method: 'folders().create',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.folders.FolderCreateParams\nimport io.imagekit.models.folders.FolderCreateResponse\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val params: FolderCreateParams = FolderCreateParams.builder()\n .folderName("summer")\n .parentFolderPath("/product/images/")\n .build()\n val folder: FolderCreateResponse = client.folders().create(params)\n}',
- },
go: {
method: 'client.Folders.New',
example:
@@ -2034,11 +1744,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nfolder = image_kit.folders.create(folder_name: "summer", parent_folder_path: "/product/images/")\n\nputs(folder)',
},
- cli: {
- method: 'folders create',
- example:
- "imagekit folders create \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --folder-name summer \\\n --parent-folder-path /product/images/",
- },
php: {
method: 'folders->create',
example:
@@ -2049,10 +1754,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'FolderCreateParams parameters = new()\n{\n FolderName = "summer",\n ParentFolderPath = "/product/images/",\n};\n\nvar folder = await client.Folders.Create(parameters);\n\nConsole.WriteLine(folder);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/folder \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "folderName": "summer",\n "parentFolderPath": "/product/images/"\n }\'',
- },
},
},
{
@@ -2074,6 +1775,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst folder = await client.folders.delete({ folderPath: '/folder/to/delete/' });\n\nconsole.log(folder);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/folder \\\n -X DELETE \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
+ },
python: {
method: 'folders.delete',
example:
@@ -2084,11 +1789,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.folders.FolderDeleteParams;\nimport io.imagekit.models.folders.FolderDeleteResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n FolderDeleteParams params = FolderDeleteParams.builder()\n .folderPath("/folder/to/delete/")\n .build();\n FolderDeleteResponse folder = client.folders().delete(params);\n }\n}',
},
- kotlin: {
- method: 'folders().delete',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.folders.FolderDeleteParams\nimport io.imagekit.models.folders.FolderDeleteResponse\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val params: FolderDeleteParams = FolderDeleteParams.builder()\n .folderPath("/folder/to/delete/")\n .build()\n val folder: FolderDeleteResponse = client.folders().delete(params)\n}',
- },
go: {
method: 'client.Folders.Delete',
example:
@@ -2099,11 +1799,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nfolder = image_kit.folders.delete(folder_path: "/folder/to/delete/")\n\nputs(folder)',
},
- cli: {
- method: 'folders delete',
- example:
- "imagekit folders delete \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --folder-path /folder/to/delete/",
- },
php: {
method: 'folders->delete',
example:
@@ -2114,10 +1809,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'FolderDeleteParams parameters = new() { FolderPath = "/folder/to/delete/" };\n\nvar folder = await client.Folders.Delete(parameters);\n\nConsole.WriteLine(folder);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/folder \\\n -X DELETE \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
- },
},
},
{
@@ -2139,6 +1830,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst response = await client.folders.copy({\n destinationPath: '/path/of/destination/folder',\n sourceFolderPath: '/path/of/source/folder',\n});\n\nconsole.log(response.jobId);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/bulkJobs/copyFolder \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "destinationPath": "/path/of/destination/folder",\n "sourceFolderPath": "/path/of/source/folder",\n "includeVersions": true\n }\'',
+ },
python: {
method: 'folders.copy',
example:
@@ -2149,11 +1844,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.folders.FolderCopyParams;\nimport io.imagekit.models.folders.FolderCopyResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n FolderCopyParams params = FolderCopyParams.builder()\n .destinationPath("/path/of/destination/folder")\n .sourceFolderPath("/path/of/source/folder")\n .build();\n FolderCopyResponse response = client.folders().copy(params);\n }\n}',
},
- kotlin: {
- method: 'folders().copy',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.folders.FolderCopyParams\nimport io.imagekit.models.folders.FolderCopyResponse\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val params: FolderCopyParams = FolderCopyParams.builder()\n .destinationPath("/path/of/destination/folder")\n .sourceFolderPath("/path/of/source/folder")\n .build()\n val response: FolderCopyResponse = client.folders().copy(params)\n}',
- },
go: {
method: 'client.Folders.Copy',
example:
@@ -2164,11 +1854,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nresponse = image_kit.folders.copy(\n destination_path: "/path/of/destination/folder",\n source_folder_path: "/path/of/source/folder"\n)\n\nputs(response)',
},
- cli: {
- method: 'folders copy',
- example:
- "imagekit folders copy \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --destination-path /path/of/destination/folder \\\n --source-folder-path /path/of/source/folder",
- },
php: {
method: 'folders->copy',
example:
@@ -2179,10 +1864,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'FolderCopyParams parameters = new()\n{\n DestinationPath = "/path/of/destination/folder",\n SourceFolderPath = "/path/of/source/folder",\n};\n\nvar response = await client.Folders.Copy(parameters);\n\nConsole.WriteLine(response);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/bulkJobs/copyFolder \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "destinationPath": "/path/of/destination/folder",\n "sourceFolderPath": "/path/of/source/folder",\n "includeVersions": true\n }\'',
- },
},
},
{
@@ -2204,6 +1885,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst response = await client.folders.move({\n destinationPath: '/path/of/destination/folder',\n sourceFolderPath: '/path/of/source/folder',\n});\n\nconsole.log(response.jobId);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/bulkJobs/moveFolder \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "destinationPath": "/path/of/destination/folder",\n "sourceFolderPath": "/path/of/source/folder"\n }\'',
+ },
python: {
method: 'folders.move',
example:
@@ -2214,11 +1899,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.folders.FolderMoveParams;\nimport io.imagekit.models.folders.FolderMoveResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n FolderMoveParams params = FolderMoveParams.builder()\n .destinationPath("/path/of/destination/folder")\n .sourceFolderPath("/path/of/source/folder")\n .build();\n FolderMoveResponse response = client.folders().move(params);\n }\n}',
},
- kotlin: {
- method: 'folders().move',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.folders.FolderMoveParams\nimport io.imagekit.models.folders.FolderMoveResponse\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val params: FolderMoveParams = FolderMoveParams.builder()\n .destinationPath("/path/of/destination/folder")\n .sourceFolderPath("/path/of/source/folder")\n .build()\n val response: FolderMoveResponse = client.folders().move(params)\n}',
- },
go: {
method: 'client.Folders.Move',
example:
@@ -2229,11 +1909,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nresponse = image_kit.folders.move(\n destination_path: "/path/of/destination/folder",\n source_folder_path: "/path/of/source/folder"\n)\n\nputs(response)',
},
- cli: {
- method: 'folders move',
- example:
- "imagekit folders move \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --destination-path /path/of/destination/folder \\\n --source-folder-path /path/of/source/folder",
- },
php: {
method: 'folders->move',
example:
@@ -2244,10 +1919,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'FolderMoveParams parameters = new()\n{\n DestinationPath = "/path/of/destination/folder",\n SourceFolderPath = "/path/of/source/folder",\n};\n\nvar response = await client.Folders.Move(parameters);\n\nConsole.WriteLine(response);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/bulkJobs/moveFolder \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "destinationPath": "/path/of/destination/folder",\n "sourceFolderPath": "/path/of/source/folder"\n }\'',
- },
},
},
{
@@ -2269,6 +1940,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst response = await client.folders.rename({\n folderPath: '/path/of/folder',\n newFolderName: 'new-folder-name',\n});\n\nconsole.log(response.jobId);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/bulkJobs/renameFolder \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "folderPath": "/path/of/folder",\n "newFolderName": "new-folder-name",\n "purgeCache": true\n }\'',
+ },
python: {
method: 'folders.rename',
example:
@@ -2279,11 +1954,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.folders.FolderRenameParams;\nimport io.imagekit.models.folders.FolderRenameResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n FolderRenameParams params = FolderRenameParams.builder()\n .folderPath("/path/of/folder")\n .newFolderName("new-folder-name")\n .build();\n FolderRenameResponse response = client.folders().rename(params);\n }\n}',
},
- kotlin: {
- method: 'folders().rename',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.folders.FolderRenameParams\nimport io.imagekit.models.folders.FolderRenameResponse\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val params: FolderRenameParams = FolderRenameParams.builder()\n .folderPath("/path/of/folder")\n .newFolderName("new-folder-name")\n .build()\n val response: FolderRenameResponse = client.folders().rename(params)\n}',
- },
go: {
method: 'client.Folders.Rename',
example:
@@ -2294,11 +1964,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nresponse = image_kit.folders.rename(folder_path: "/path/of/folder", new_folder_name: "new-folder-name")\n\nputs(response)',
},
- cli: {
- method: 'folders rename',
- example:
- "imagekit folders rename \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --folder-path /path/of/folder \\\n --new-folder-name new-folder-name",
- },
php: {
method: 'folders->rename',
example:
@@ -2309,10 +1974,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'FolderRenameParams parameters = new()\n{\n FolderPath = "/path/of/folder",\n NewFolderName = "new-folder-name",\n};\n\nvar response = await client.Folders.Rename(parameters);\n\nConsole.WriteLine(response);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/bulkJobs/renameFolder \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "folderPath": "/path/of/folder",\n "newFolderName": "new-folder-name",\n "purgeCache": true\n }\'',
- },
},
},
{
@@ -2334,6 +1995,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst job = await client.folders.job.get('jobId');\n\nconsole.log(job.jobId);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/bulkJobs/$JOB_ID \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
+ },
python: {
method: 'folders.job.get',
example:
@@ -2344,11 +2009,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.folders.job.JobGetParams;\nimport io.imagekit.models.folders.job.JobGetResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n JobGetResponse job = client.folders().job().get("jobId");\n }\n}',
},
- kotlin: {
- method: 'folders().job().get',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.folders.job.JobGetParams\nimport io.imagekit.models.folders.job.JobGetResponse\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val job: JobGetResponse = client.folders().job().get("jobId")\n}',
- },
go: {
method: 'client.Folders.Job.Get',
example:
@@ -2359,11 +2019,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\njob = image_kit.folders.job.get("jobId")\n\nputs(job)',
},
- cli: {
- method: 'job get',
- example:
- "imagekit folders:job get \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --job-id jobId",
- },
php: {
method: 'folders->job->get',
example:
@@ -2374,10 +2029,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'JobGetParams parameters = new() { JobID = "jobId" };\n\nvar job = await client.Folders.Job.Get(parameters);\n\nConsole.WriteLine(job);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/bulkJobs/$JOB_ID \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
- },
},
},
{
@@ -2400,6 +2051,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst usage = await client.accounts.usage.get({ endDate: '2019-12-27', startDate: '2019-12-27' });\n\nconsole.log(usage.bandwidthBytes);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/accounts/usage \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
+ },
python: {
method: 'accounts.usage.get',
example:
@@ -2410,11 +2065,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.accounts.usage.UsageGetParams;\nimport io.imagekit.models.accounts.usage.UsageGetResponse;\nimport java.time.LocalDate;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n UsageGetParams params = UsageGetParams.builder()\n .endDate(LocalDate.parse("2019-12-27"))\n .startDate(LocalDate.parse("2019-12-27"))\n .build();\n UsageGetResponse usage = client.accounts().usage().get(params);\n }\n}',
},
- kotlin: {
- method: 'accounts().usage().get',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.accounts.usage.UsageGetParams\nimport io.imagekit.models.accounts.usage.UsageGetResponse\nimport java.time.LocalDate\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val params: UsageGetParams = UsageGetParams.builder()\n .endDate(LocalDate.parse("2019-12-27"))\n .startDate(LocalDate.parse("2019-12-27"))\n .build()\n val usage: UsageGetResponse = client.accounts().usage().get(params)\n}',
- },
go: {
method: 'client.Accounts.Usage.Get',
example:
@@ -2425,11 +2075,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nusage = image_kit.accounts.usage.get(end_date: "2019-12-27", start_date: "2019-12-27")\n\nputs(usage)',
},
- cli: {
- method: 'usage get',
- example:
- "imagekit accounts:usage get \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --end-date \"'2019-12-27'\" \\\n --start-date \"'2019-12-27'\"",
- },
php: {
method: 'accounts->usage->get',
example:
@@ -2440,10 +2085,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'UsageGetParams parameters = new()\n{\n EndDate = "2019-12-27",\n StartDate = "2019-12-27",\n};\n\nvar usage = await client.Accounts.Usage.Get(parameters);\n\nConsole.WriteLine(usage);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/accounts/usage \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
- },
},
},
{
@@ -2464,6 +2105,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst originResponses = await client.accounts.origins.list();\n\nconsole.log(originResponses);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/accounts/origins \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
+ },
python: {
method: 'accounts.origins.list',
example:
@@ -2474,11 +2119,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.accounts.origins.OriginListParams;\nimport io.imagekit.models.accounts.origins.OriginResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n List originResponses = client.accounts().origins().list();\n }\n}',
},
- kotlin: {
- method: 'accounts().origins().list',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.accounts.origins.OriginListParams\nimport io.imagekit.models.accounts.origins.OriginResponse\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val originResponses: List = client.accounts().origins().list()\n}',
- },
go: {
method: 'client.Accounts.Origins.List',
example:
@@ -2489,11 +2129,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\norigin_responses = image_kit.accounts.origins.list\n\nputs(origin_responses)',
},
- cli: {
- method: 'origins list',
- example:
- "imagekit accounts:origins list \\\n --private-key 'My Private Key' \\\n --password 'My Password'",
- },
php: {
method: 'accounts->origins->list',
example:
@@ -2504,10 +2139,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'OriginListParams parameters = new();\n\nvar originResponses = await client.Accounts.Origins.List(parameters);\n\nConsole.WriteLine(originResponses);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/accounts/origins \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
- },
},
},
{
@@ -2529,6 +2160,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst originResponse = await client.accounts.origins.create({\n accessKey: 'AKIAIOSFODNN7EXAMPLE',\n bucket: 'product-images',\n name: 'US S3 Storage',\n secretKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',\n type: 'S3',\n});\n\nconsole.log(originResponse);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/accounts/origins \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "accessKey": "AKIAIOSFODNN7EXAMPLE",\n "bucket": "product-images",\n "name": "US S3 Storage",\n "secretKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",\n "type": "S3",\n "baseUrlForCanonicalHeader": "https://cdn.example.com",\n "includeCanonicalHeader": false,\n "prefix": "raw-assets"\n }\'',
+ },
python: {
method: 'accounts.origins.create',
example:
@@ -2539,11 +2174,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.accounts.origins.OriginRequest;\nimport io.imagekit.models.accounts.origins.OriginResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n OriginRequest.S3 params = OriginRequest.S3.builder()\n .accessKey("AKIATEST123")\n .bucket("test-bucket")\n .name("My S3 Origin")\n .secretKey("secrettest123")\n .build();\n OriginResponse originResponse = client.accounts().origins().create(params);\n }\n}',
},
- kotlin: {
- method: 'accounts().origins().create',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.accounts.origins.OriginRequest\nimport io.imagekit.models.accounts.origins.OriginResponse\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val params: OriginRequest.S3 = OriginRequest.S3.builder()\n .accessKey("AKIATEST123")\n .bucket("test-bucket")\n .name("My S3 Origin")\n .secretKey("secrettest123")\n .build()\n val originResponse: OriginResponse = client.accounts().origins().create(params)\n}',
- },
go: {
method: 'client.Accounts.Origins.New',
example:
@@ -2554,11 +2184,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\norigin_response = image_kit.accounts.origins.create(\n origin_request: {accessKey: "AKIATEST123", bucket: "test-bucket", name: "My S3 Origin", secretKey: "secrettest123", type: :S3}\n)\n\nputs(origin_response)',
},
- cli: {
- method: 'origins create',
- example:
- "imagekit accounts:origins create \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --access-key AKIAIOSFODNN7EXAMPLE \\\n --bucket product-images \\\n --name 'US S3 Storage' \\\n --secret-key wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY \\\n --type S3 \\\n --endpoint https://s3.eu-central-1.wasabisys.com \\\n --base-url https://images.example.com/assets \\\n --client-email service-account@project.iam.gserviceaccount.com \\\n --private-key '-----BEGIN PRIVATE KEY-----\\\\nMIIEv...' \\\n --account-name account123 \\\n --container images \\\n --sas-token '?sv=2023-01-03&sr=c&sig=abc123' \\\n --client-id akeneo-client-id \\\n --client-secret akeneo-client-secret \\\n --password strongpassword123 \\\n --username integration-user",
- },
php: {
method: 'accounts->origins->create',
example:
@@ -2569,10 +2194,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'OriginCreateParams parameters = new()\n{\n OriginRequest = new S3()\n {\n AccessKey = "AKIATEST123",\n Bucket = "test-bucket",\n Name = "My S3 Origin",\n SecretKey = "secrettest123",\n BaseUrlForCanonicalHeader = "https://cdn.example.com",\n IncludeCanonicalHeader = false,\n Prefix = "images",\n },\n};\n\nvar originResponse = await client.Accounts.Origins.Create(parameters);\n\nConsole.WriteLine(originResponse);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/accounts/origins \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "accessKey": "AKIAIOSFODNN7EXAMPLE",\n "bucket": "product-images",\n "name": "US S3 Storage",\n "secretKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",\n "type": "S3",\n "baseUrlForCanonicalHeader": "https://cdn.example.com",\n "includeCanonicalHeader": false,\n "prefix": "raw-assets"\n }\'',
- },
},
},
{
@@ -2593,6 +2214,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst originResponse = await client.accounts.origins.get('id');\n\nconsole.log(originResponse);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/accounts/origins/$ID \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
+ },
python: {
method: 'accounts.origins.get',
example:
@@ -2603,11 +2228,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.accounts.origins.OriginGetParams;\nimport io.imagekit.models.accounts.origins.OriginResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n OriginResponse originResponse = client.accounts().origins().get("id");\n }\n}',
},
- kotlin: {
- method: 'accounts().origins().get',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.accounts.origins.OriginGetParams\nimport io.imagekit.models.accounts.origins.OriginResponse\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val originResponse: OriginResponse = client.accounts().origins().get("id")\n}',
- },
go: {
method: 'client.Accounts.Origins.Get',
example:
@@ -2618,11 +2238,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\norigin_response = image_kit.accounts.origins.get("id")\n\nputs(origin_response)',
},
- cli: {
- method: 'origins get',
- example:
- "imagekit accounts:origins get \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --id id",
- },
php: {
method: 'accounts->origins->get',
example:
@@ -2633,10 +2248,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'OriginGetParams parameters = new() { ID = "id" };\n\nvar originResponse = await client.Accounts.Origins.Get(parameters);\n\nConsole.WriteLine(originResponse);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/accounts/origins/$ID \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
- },
},
},
{
@@ -2659,6 +2270,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst originResponse = await client.accounts.origins.update('id', {\n accessKey: 'AKIAIOSFODNN7EXAMPLE',\n bucket: 'product-images',\n name: 'US S3 Storage',\n secretKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',\n type: 'S3',\n});\n\nconsole.log(originResponse);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/accounts/origins/$ID \\\n -X PUT \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "accessKey": "AKIAIOSFODNN7EXAMPLE",\n "bucket": "product-images",\n "name": "US S3 Storage",\n "secretKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",\n "type": "S3",\n "baseUrlForCanonicalHeader": "https://cdn.example.com",\n "includeCanonicalHeader": false,\n "prefix": "raw-assets"\n }\'',
+ },
python: {
method: 'accounts.origins.update',
example:
@@ -2669,11 +2284,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.accounts.origins.OriginRequest;\nimport io.imagekit.models.accounts.origins.OriginResponse;\nimport io.imagekit.models.accounts.origins.OriginUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n OriginUpdateParams params = OriginUpdateParams.builder()\n .id("id")\n .originRequest(OriginRequest.S3.builder()\n .accessKey("AKIATEST123")\n .bucket("test-bucket")\n .name("My S3 Origin")\n .secretKey("secrettest123")\n .build())\n .build();\n OriginResponse originResponse = client.accounts().origins().update(params);\n }\n}',
},
- kotlin: {
- method: 'accounts().origins().update',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.accounts.origins.OriginRequest\nimport io.imagekit.models.accounts.origins.OriginResponse\nimport io.imagekit.models.accounts.origins.OriginUpdateParams\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val params: OriginUpdateParams = OriginUpdateParams.builder()\n .id("id")\n .originRequest(OriginRequest.S3.builder()\n .accessKey("AKIATEST123")\n .bucket("test-bucket")\n .name("My S3 Origin")\n .secretKey("secrettest123")\n .build())\n .build()\n val originResponse: OriginResponse = client.accounts().origins().update(params)\n}',
- },
go: {
method: 'client.Accounts.Origins.Update',
example:
@@ -2684,11 +2294,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\norigin_response = image_kit.accounts.origins.update(\n "id",\n origin_request: {accessKey: "AKIATEST123", bucket: "test-bucket", name: "My S3 Origin", secretKey: "secrettest123", type: :S3}\n)\n\nputs(origin_response)',
},
- cli: {
- method: 'origins update',
- example:
- "imagekit accounts:origins update \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --id id \\\n --access-key AKIAIOSFODNN7EXAMPLE \\\n --bucket product-images \\\n --name 'US S3 Storage' \\\n --secret-key wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY \\\n --type S3 \\\n --endpoint https://s3.eu-central-1.wasabisys.com \\\n --base-url https://images.example.com/assets \\\n --client-email service-account@project.iam.gserviceaccount.com \\\n --private-key '-----BEGIN PRIVATE KEY-----\\\\nMIIEv...' \\\n --account-name account123 \\\n --container images \\\n --sas-token '?sv=2023-01-03&sr=c&sig=abc123' \\\n --client-id akeneo-client-id \\\n --client-secret akeneo-client-secret \\\n --password strongpassword123 \\\n --username integration-user",
- },
php: {
method: 'accounts->origins->update',
example:
@@ -2699,10 +2304,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'OriginUpdateParams parameters = new()\n{\n ID = "id",\n OriginRequest = new S3()\n {\n AccessKey = "AKIATEST123",\n Bucket = "test-bucket",\n Name = "My S3 Origin",\n SecretKey = "secrettest123",\n BaseUrlForCanonicalHeader = "https://cdn.example.com",\n IncludeCanonicalHeader = false,\n Prefix = "images",\n },\n};\n\nvar originResponse = await client.Accounts.Origins.Update(parameters);\n\nConsole.WriteLine(originResponse);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/accounts/origins/$ID \\\n -X PUT \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "accessKey": "AKIAIOSFODNN7EXAMPLE",\n "bucket": "product-images",\n "name": "US S3 Storage",\n "secretKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",\n "type": "S3",\n "baseUrlForCanonicalHeader": "https://cdn.example.com",\n "includeCanonicalHeader": false,\n "prefix": "raw-assets"\n }\'',
- },
},
},
{
@@ -2723,6 +2324,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nawait client.accounts.origins.delete('id');",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/accounts/origins/$ID \\\n -X DELETE \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
+ },
python: {
method: 'accounts.origins.delete',
example:
@@ -2733,11 +2338,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.accounts.origins.OriginDeleteParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n client.accounts().origins().delete("id");\n }\n}',
},
- kotlin: {
- method: 'accounts().origins().delete',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.accounts.origins.OriginDeleteParams\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n client.accounts().origins().delete("id")\n}',
- },
go: {
method: 'client.Accounts.Origins.Delete',
example:
@@ -2748,11 +2348,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nresult = image_kit.accounts.origins.delete("id")\n\nputs(result)',
},
- cli: {
- method: 'origins delete',
- example:
- "imagekit accounts:origins delete \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --id id",
- },
php: {
method: 'accounts->origins->delete',
example:
@@ -2763,10 +2358,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'OriginDeleteParams parameters = new() { ID = "id" };\n\nawait client.Accounts.Origins.Delete(parameters);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/accounts/origins/$ID \\\n -X DELETE \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
- },
},
},
{
@@ -2788,6 +2379,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst urlEndpointResponses = await client.accounts.urlEndpoints.list();\n\nconsole.log(urlEndpointResponses);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/accounts/url-endpoints \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
+ },
python: {
method: 'accounts.url_endpoints.list',
example:
@@ -2798,11 +2393,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.accounts.urlendpoints.UrlEndpointListParams;\nimport io.imagekit.models.accounts.urlendpoints.UrlEndpointResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n List urlEndpointResponses = client.accounts().urlEndpoints().list();\n }\n}',
},
- kotlin: {
- method: 'accounts().urlEndpoints().list',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.accounts.urlendpoints.UrlEndpointListParams\nimport io.imagekit.models.accounts.urlendpoints.UrlEndpointResponse\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val urlEndpointResponses: List = client.accounts().urlEndpoints().list()\n}',
- },
go: {
method: 'client.Accounts.URLEndpoints.List',
example:
@@ -2813,11 +2403,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nurl_endpoint_responses = image_kit.accounts.url_endpoints.list\n\nputs(url_endpoint_responses)',
},
- cli: {
- method: 'urlEndpoints list',
- example:
- "imagekit accounts:url-endpoints list \\\n --private-key 'My Private Key' \\\n --password 'My Password'",
- },
php: {
method: 'accounts->urlEndpoints->list',
example:
@@ -2828,10 +2413,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'UrlEndpointListParams parameters = new();\n\nvar urlEndpointResponses = await client.Accounts.UrlEndpoints.List(parameters);\n\nConsole.WriteLine(urlEndpointResponses);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/accounts/url-endpoints \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
- },
},
},
{
@@ -2859,6 +2440,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst urlEndpointResponse = await client.accounts.urlEndpoints.create({\n description: 'My custom URL endpoint',\n});\n\nconsole.log(urlEndpointResponse.id);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/accounts/url-endpoints \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "description": "My custom URL endpoint",\n "origins": [\n "origin-id-1"\n ],\n "urlPrefix": "product-images"\n }\'',
+ },
python: {
method: 'accounts.url_endpoints.create',
example:
@@ -2869,11 +2454,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.accounts.urlendpoints.UrlEndpointRequest;\nimport io.imagekit.models.accounts.urlendpoints.UrlEndpointResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n UrlEndpointRequest params = UrlEndpointRequest.builder()\n .description("My custom URL endpoint")\n .build();\n UrlEndpointResponse urlEndpointResponse = client.accounts().urlEndpoints().create(params);\n }\n}',
},
- kotlin: {
- method: 'accounts().urlEndpoints().create',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.accounts.urlendpoints.UrlEndpointRequest\nimport io.imagekit.models.accounts.urlendpoints.UrlEndpointResponse\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val params: UrlEndpointRequest = UrlEndpointRequest.builder()\n .description("My custom URL endpoint")\n .build()\n val urlEndpointResponse: UrlEndpointResponse = client.accounts().urlEndpoints().create(params)\n}',
- },
go: {
method: 'client.Accounts.URLEndpoints.New',
example:
@@ -2884,11 +2464,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nurl_endpoint_response = image_kit.accounts.url_endpoints.create(description: "My custom URL endpoint")\n\nputs(url_endpoint_response)',
},
- cli: {
- method: 'urlEndpoints create',
- example:
- "imagekit accounts:url-endpoints create \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --description 'My custom URL endpoint'",
- },
php: {
method: 'accounts->urlEndpoints->create',
example:
@@ -2899,10 +2474,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'UrlEndpointCreateParams parameters = new()\n{\n Description = "My custom URL endpoint"\n};\n\nvar urlEndpointResponse = await client.Accounts.UrlEndpoints.Create(parameters);\n\nConsole.WriteLine(urlEndpointResponse);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/accounts/url-endpoints \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "description": "My custom URL endpoint",\n "origins": [\n "origin-id-1"\n ],\n "urlPrefix": "product-images"\n }\'',
- },
},
},
{
@@ -2925,6 +2496,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst urlEndpointResponse = await client.accounts.urlEndpoints.get('id');\n\nconsole.log(urlEndpointResponse.id);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/accounts/url-endpoints/$ID \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
+ },
python: {
method: 'accounts.url_endpoints.get',
example:
@@ -2935,11 +2510,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.accounts.urlendpoints.UrlEndpointGetParams;\nimport io.imagekit.models.accounts.urlendpoints.UrlEndpointResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n UrlEndpointResponse urlEndpointResponse = client.accounts().urlEndpoints().get("id");\n }\n}',
},
- kotlin: {
- method: 'accounts().urlEndpoints().get',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.accounts.urlendpoints.UrlEndpointGetParams\nimport io.imagekit.models.accounts.urlendpoints.UrlEndpointResponse\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val urlEndpointResponse: UrlEndpointResponse = client.accounts().urlEndpoints().get("id")\n}',
- },
go: {
method: 'client.Accounts.URLEndpoints.Get',
example:
@@ -2950,11 +2520,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nurl_endpoint_response = image_kit.accounts.url_endpoints.get("id")\n\nputs(url_endpoint_response)',
},
- cli: {
- method: 'urlEndpoints get',
- example:
- "imagekit accounts:url-endpoints get \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --id id",
- },
php: {
method: 'accounts->urlEndpoints->get',
example:
@@ -2965,10 +2530,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'UrlEndpointGetParams parameters = new() { ID = "id" };\n\nvar urlEndpointResponse = await client.Accounts.UrlEndpoints.Get(parameters);\n\nConsole.WriteLine(urlEndpointResponse);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/accounts/url-endpoints/$ID \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
- },
},
},
{
@@ -2997,6 +2558,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst urlEndpointResponse = await client.accounts.urlEndpoints.update('id', {\n description: 'My custom URL endpoint',\n});\n\nconsole.log(urlEndpointResponse.id);",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/accounts/url-endpoints/$ID \\\n -X PUT \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "description": "My custom URL endpoint",\n "origins": [\n "origin-id-1"\n ],\n "urlPrefix": "product-images"\n }\'',
+ },
python: {
method: 'accounts.url_endpoints.update',
example:
@@ -3007,11 +2572,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.accounts.urlendpoints.UrlEndpointRequest;\nimport io.imagekit.models.accounts.urlendpoints.UrlEndpointResponse;\nimport io.imagekit.models.accounts.urlendpoints.UrlEndpointUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n UrlEndpointUpdateParams params = UrlEndpointUpdateParams.builder()\n .id("id")\n .urlEndpointRequest(UrlEndpointRequest.builder()\n .description("My custom URL endpoint")\n .build())\n .build();\n UrlEndpointResponse urlEndpointResponse = client.accounts().urlEndpoints().update(params);\n }\n}',
},
- kotlin: {
- method: 'accounts().urlEndpoints().update',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.accounts.urlendpoints.UrlEndpointRequest\nimport io.imagekit.models.accounts.urlendpoints.UrlEndpointResponse\nimport io.imagekit.models.accounts.urlendpoints.UrlEndpointUpdateParams\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val params: UrlEndpointUpdateParams = UrlEndpointUpdateParams.builder()\n .id("id")\n .urlEndpointRequest(UrlEndpointRequest.builder()\n .description("My custom URL endpoint")\n .build())\n .build()\n val urlEndpointResponse: UrlEndpointResponse = client.accounts().urlEndpoints().update(params)\n}',
- },
go: {
method: 'client.Accounts.URLEndpoints.Update',
example:
@@ -3022,11 +2582,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nurl_endpoint_response = image_kit.accounts.url_endpoints.update("id", description: "My custom URL endpoint")\n\nputs(url_endpoint_response)',
},
- cli: {
- method: 'urlEndpoints update',
- example:
- "imagekit accounts:url-endpoints update \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --id id \\\n --description 'My custom URL endpoint'",
- },
php: {
method: 'accounts->urlEndpoints->update',
example:
@@ -3037,10 +2592,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'UrlEndpointUpdateParams parameters = new()\n{\n ID = "id",\n Description = "My custom URL endpoint",\n};\n\nvar urlEndpointResponse = await client.Accounts.UrlEndpoints.Update(parameters);\n\nConsole.WriteLine(urlEndpointResponse);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/accounts/url-endpoints/$ID \\\n -X PUT \\\n -H \'Content-Type: application/json\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -d \'{\n "description": "My custom URL endpoint",\n "origins": [\n "origin-id-1"\n ],\n "urlPrefix": "product-images"\n }\'',
- },
},
},
{
@@ -3061,6 +2612,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nawait client.accounts.urlEndpoints.delete('id');",
},
+ http: {
+ example:
+ 'curl https://api.imagekit.io/v1/accounts/url-endpoints/$ID \\\n -X DELETE \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
+ },
python: {
method: 'accounts.url_endpoints.delete',
example:
@@ -3071,11 +2626,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.accounts.urlendpoints.UrlEndpointDeleteParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n client.accounts().urlEndpoints().delete("id");\n }\n}',
},
- kotlin: {
- method: 'accounts().urlEndpoints().delete',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.accounts.urlendpoints.UrlEndpointDeleteParams\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n client.accounts().urlEndpoints().delete("id")\n}',
- },
go: {
method: 'client.Accounts.URLEndpoints.Delete',
example:
@@ -3086,11 +2636,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nresult = image_kit.accounts.url_endpoints.delete("id")\n\nputs(result)',
},
- cli: {
- method: 'urlEndpoints delete',
- example:
- "imagekit accounts:url-endpoints delete \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --id id",
- },
php: {
method: 'accounts->urlEndpoints->delete',
example:
@@ -3101,10 +2646,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'UrlEndpointDeleteParams parameters = new() { ID = "id" };\n\nawait client.Accounts.UrlEndpoints.Delete(parameters);',
},
- http: {
- example:
- 'curl https://api.imagekit.io/v1/accounts/url-endpoints/$ID \\\n -X DELETE \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS"',
- },
},
},
{
@@ -3148,6 +2689,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
"import fs from 'fs';\nimport ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst response = await client.beta.v2.files.upload({\n file: fs.createReadStream('path/to/file'),\n fileName: 'fileName',\n});\n\nconsole.log(response.videoCodec);",
},
+ http: {
+ example:
+ 'curl https://upload.imagekit.io/api/v2/files/upload \\\n -H \'Content-Type: multipart/form-data\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -F \'file=@/path/to/file\' \\\n -F fileName=fileName \\\n -F checks=\'"request.folder" : "marketing/"\n \' \\\n -F customMetadata=\'{"brand":"bar","color":"bar"}\' \\\n -F description=\'Running shoes\' \\\n -F extensions=\'[{"name":"remove-bg","options":{"add_shadow":true}},{"maxTags":5,"minConfidence":95,"name":"google-auto-tagging"},{"name":"ai-auto-description"},{"name":"ai-tasks","tasks":[{"instruction":"What types of clothing items are visible in this image?","type":"select_tags","vocabulary":["shirt","tshirt","dress","trousers","jacket"]},{"instruction":"Is this a luxury or high-end fashion item?","type":"yes_no","on_yes":{"add_tags":["luxury","premium"]}}]},{"id":"ext_abc123","name":"saved-extension"}]\' \\\n -F responseFields=\'["tags","customCoordinates","isPrivateFile"]\' \\\n -F tags=\'["t-shirt","round-neck","men"]\' \\\n -F transformation=\'{"post":[{"type":"thumbnail","value":"w-150,h-150"},{"protocol":"dash","type":"abs","value":"sr-240_360_480_720_1080"}]}\'',
+ },
python: {
method: 'beta.v2.files.upload',
example:
@@ -3158,11 +2703,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.beta.v2.files.FileUploadParams;\nimport io.imagekit.models.beta.v2.files.FileUploadResponse;\nimport java.io.ByteArrayInputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n FileUploadParams params = FileUploadParams.builder()\n .file(new ByteArrayInputStream("Example data".getBytes()))\n .fileName("fileName")\n .build();\n FileUploadResponse response = client.beta().v2().files().upload(params);\n }\n}',
},
- kotlin: {
- method: 'beta().v2().files().upload',
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.beta.v2.files.FileUploadParams\nimport io.imagekit.models.beta.v2.files.FileUploadResponse\nimport java.io.ByteArrayInputStream\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n val params: FileUploadParams = FileUploadParams.builder()\n .file("Example data".byteInputStream())\n .fileName("fileName")\n .build()\n val response: FileUploadResponse = client.beta().v2().files().upload(params)\n}',
- },
go: {
method: 'client.Beta.V2.Files.Upload',
example:
@@ -3173,11 +2713,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nresponse = image_kit.beta.v2.files.upload(file: StringIO.new("Example data"), file_name: "fileName")\n\nputs(response)',
},
- cli: {
- method: 'files upload',
- example:
- "imagekit beta:v2:files upload \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --file 'Example data' \\\n --file-name fileName",
- },
php: {
method: 'beta->v2->files->upload',
example:
@@ -3188,10 +2723,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'FileUploadParams parameters = new()\n{\n File = Encoding.UTF8.GetBytes("Example data"),\n FileName = "fileName",\n};\n\nvar response = await client.Beta.V2.Files.Upload(parameters);\n\nConsole.WriteLine(response);',
},
- http: {
- example:
- 'curl https://upload.imagekit.io/api/v2/files/upload \\\n -H \'Content-Type: multipart/form-data\' \\\n -u "$IMAGEKIT_PRIVATE_KEY:OPTIONAL_IMAGEKIT_IGNORES_THIS" \\\n -F \'file=@/path/to/file\' \\\n -F fileName=fileName \\\n -F checks=\'"request.folder" : "marketing/"\n \' \\\n -F customMetadata=\'{"brand":"bar","color":"bar"}\' \\\n -F description=\'Running shoes\' \\\n -F extensions=\'[{"name":"remove-bg","options":{"add_shadow":true}},{"maxTags":5,"minConfidence":95,"name":"google-auto-tagging"},{"name":"ai-auto-description"},{"name":"ai-tasks","tasks":[{"instruction":"What types of clothing items are visible in this image?","type":"select_tags","vocabulary":["shirt","tshirt","dress","trousers","jacket"]},{"instruction":"Is this a luxury or high-end fashion item?","type":"yes_no","on_yes":{"add_tags":["luxury","premium"]}}]},{"id":"ext_abc123","name":"saved-extension"}]\' \\\n -F responseFields=\'["tags","customCoordinates","isPrivateFile"]\' \\\n -F tags=\'["t-shirt","round-neck","men"]\' \\\n -F transformation=\'{"post":[{"type":"thumbnail","value":"w-150,h-150"},{"protocol":"dash","type":"abs","value":"sr-240_360_480_720_1080"}]}\'',
- },
},
},
{
@@ -3217,10 +2748,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.webhooks.WebhookUnwrapParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n client.webhooks().unwrap();\n }\n}',
},
- kotlin: {
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.webhooks.WebhookUnwrapParams\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n client.webhooks().unwrap()\n}',
- },
go: {
method: 'client.Webhooks.Unwrap',
example:
@@ -3231,10 +2758,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nresult = image_kit.webhooks.unwrap\n\nputs(result)',
},
- cli: {
- example:
- "imagekit webhooks unwrap \\\n --private-key 'My Private Key' \\\n --password 'My Password'",
- },
php: {
method: 'webhooks->unwrap',
example:
@@ -3268,10 +2791,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'package io.imagekit.example;\n\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.webhooks.WebhookUnsafeUnwrapParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n ImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\n client.webhooks().unsafeUnwrap();\n }\n}',
},
- kotlin: {
- example:
- 'package io.imagekit.example\n\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.webhooks.WebhookUnsafeUnwrapParams\n\nfun main() {\n val client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\n client.webhooks().unsafeUnwrap()\n}',
- },
go: {
method: 'client.Webhooks.UnsafeUnwrap',
example:
@@ -3282,10 +2801,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
example:
'require "imagekitio"\n\nimage_kit = Imagekitio::Client.new(private_key: "My Private Key", password: "My Password")\n\nresult = image_kit.webhooks.unsafe_unwrap\n\nputs(result)',
},
- cli: {
- example:
- "imagekit webhooks unsafe-unwrap \\\n --private-key 'My Private Key' \\\n --password 'My Password'",
- },
php: {
method: 'webhooks->unsafeUnwrap',
example:
@@ -3297,23 +2812,40 @@ const EMBEDDED_METHODS: MethodEntry[] = [
},
},
},
+ {
+ name: 'create',
+ endpoint: '/v1/dummy/test',
+ httpMethod: 'post',
+ summary: 'Dummy test endpoint using all shared models',
+ description:
+ 'Internal test endpoint for SDK generation purposes only. This endpoint demonstrates usage of all shared models defined in the Stainless configuration and is not intended for public consumption.\n',
+ stainlessPath: '(resource) dummy > (method) create',
+ qualified: 'create',
+ perLanguage: {
+ python: {
+ method: 'dummy.create',
+ example:
+ 'import os\nfrom imagekitio import ImageKit\n\nclient = ImageKit(\n private_key=os.environ.get("IMAGEKIT_PRIVATE_KEY"), # This is the default and can be omitted\n password=os.environ.get("OPTIONAL_IMAGEKIT_IGNORES_THIS"), # This is the default and can be omitted\n)\nclient.dummy.create()',
+ },
+ go: {
+ method: 'client.Dummy.New',
+ example:
+ 'package main\n\nimport (\n\t"context"\n\n\t"github.com/imagekit-developer/imagekit-go"\n\t"github.com/imagekit-developer/imagekit-go/option"\n)\n\nfunc main() {\n\tclient := imagekit.NewClient(\n\t\toption.WithPrivateKey("My Private Key"),\n\t\toption.WithPassword("My Password"),\n\t)\n\terr := client.Dummy.New(context.TODO(), imagekit.DummyNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
+ },
+ },
+ },
];
const EMBEDDED_READMES: { language: string; content: string }[] = [
{
- language: 'cli',
- content:
- "# Image Kit CLI\n\nThe official CLI for the [Image Kit REST API](https://imagekit.io/docs/api-reference).\n\n## Installation\n\n### Installing with Go\n\nTo test or install the CLI locally, you need [Go](https://go.dev/doc/install) version 1.22 or later installed.\n\n~~~sh\ngo install 'github.com/stainless-sdks/imagekit-cli/cmd/imagekit@latest'\n~~~\n\nOnce you have run `go install`, the binary is placed in your Go bin directory:\n\n- **Default location**: `$HOME/go/bin` (or `$GOPATH/bin` if GOPATH is set)\n- **Check your path**: Run `go env GOPATH` to see the base directory\n\nIf commands aren't found after installation, add the Go bin directory to your PATH:\n\n~~~sh\n# Add to your shell profile (.zshrc, .bashrc, etc.)\nexport PATH=\"$PATH:$(go env GOPATH)/bin\"\n~~~\n\n### Running Locally\n\nAfter cloning the git repository for this project, you can use the\n`scripts/run` script to run the tool locally:\n\n~~~sh\n./scripts/run args...\n~~~\n\n## Usage\n\nThe CLI follows a resource-based command structure:\n\n~~~sh\nimagekit [resource] [flags...]\n~~~\n\n~~~sh\nimagekit files upload \\\n --private-key 'My Private Key' \\\n --password 'My Password' \\\n --file 'Example data' \\\n --file-name file-name.jpg\n~~~\n\nFor details about specific commands, use the `--help` flag.\n\n### Environment variables\n\n| Environment variable | Description | Required | Default value |\n| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------------- |\n| `IMAGEKIT_PRIVATE_KEY` | Your ImageKit private API key (starts with `private_`).\nYou can find this in the [ImageKit dashboard](https://imagekit.io/dashboard/developer/api-keys).\n | yes | |\n| `OPTIONAL_IMAGEKIT_IGNORES_THIS` | ImageKit uses your API key as username and ignores the password. \nThe SDK sets a dummy value. You can ignore this field.\n | no | `\"do_not_set\"` |\n| `IMAGEKIT_WEBHOOK_SECRET` | Your ImageKit webhook secret for verifying webhook signatures (starts with `whsec_`).\nYou can find this in the [ImageKit dashboard](https://imagekit.io/dashboard/developer/webhooks).\nOnly required if you're using webhooks.\n | no | `null` |\n\n### Global flags\n\n- `--private-key` - Your ImageKit private API key (starts with `private_`).\nYou can find this in the [ImageKit dashboard](https://imagekit.io/dashboard/developer/api-keys).\n (can also be set with `IMAGEKIT_PRIVATE_KEY` env var)\n- `--password` - ImageKit uses your API key as username and ignores the password. \nThe SDK sets a dummy value. You can ignore this field.\n (can also be set with `OPTIONAL_IMAGEKIT_IGNORES_THIS` env var)\n- `--webhook-secret` - Your ImageKit webhook secret for verifying webhook signatures (starts with `whsec_`).\nYou can find this in the [ImageKit dashboard](https://imagekit.io/dashboard/developer/webhooks).\nOnly required if you're using webhooks.\n (can also be set with `IMAGEKIT_WEBHOOK_SECRET` env var)\n- `--help` - Show command line usage\n- `--debug` - Enable debug logging (includes HTTP request/response details)\n- `--version`, `-v` - Show the CLI version\n- `--base-url` - Use a custom API backend URL\n- `--format` - Change the output format (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--format-error` - Change the output format for errors (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--transform` - Transform the data output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n- `--transform-error` - Transform the error output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n\n### Passing files as arguments\n\nTo pass files to your API, you can use the `@myfile.ext` syntax:\n\n~~~bash\nimagekit --arg @abe.jpg\n~~~\n\nFiles can also be passed inside JSON or YAML blobs:\n\n~~~bash\nimagekit --arg '{image: \"@abe.jpg\"}'\n# Equivalent:\nimagekit < --username '\\@abe'\n~~~\n\n#### Explicit encoding\n\nFor JSON endpoints, the CLI tool does filetype sniffing to determine whether the\nfile contents should be sent as a string literal (for plain text files) or as a\nbase64-encoded string literal (for binary files). If you need to explicitly send\nthe file as either plain text or base64-encoded data, you can use\n`@file://myfile.txt` (for string encoding) or `@data://myfile.dat` (for\nbase64-encoding). Note that absolute paths will begin with `@file://` or\n`@data://`, followed by a third `/` (for example, `@file:///tmp/file.txt`).\n\n~~~bash\nimagekit --arg @data://file.txt\n~~~\n\n## Linking different Go SDK versions\n\nYou can link the CLI against a different version of the Image Kit Go SDK\nfor development purposes using the `./scripts/link` script.\n\nTo link to a specific version from a repository (version can be a branch,\ngit tag, or commit hash):\n\n~~~bash\n./scripts/link github.com/org/repo@version\n~~~\n\nTo link to a local copy of the SDK:\n\n~~~bash\n./scripts/link ../path/to/imagekit-go\n~~~\n\nIf you run the link script without any arguments, it will default to `../imagekit-go`.\n",
- },
- {
- language: 'csharp',
+ language: 'typescript',
content:
- '# Image Kit C# API Library\n\nThe Image Kit C# SDK provides convenient access to the [Image Kit REST API](https://imagekit.io/docs/api-reference) from applications written in C#.\n\n## Installation\n\n```bash\ngit clone git@github.com:stainless-sdks/imagekit-csharp.git\ndotnet add reference imagekit-csharp/src/Imagekit\n```\n\n## Requirements\n\nThis library requires .NET Standard 2.0 or later.\n\n## Usage\n\nSee the [`examples`](examples) directory for complete and runnable examples.\n\n```csharp\nImageKitClient client = new();\n\nFileUploadParams parameters = new()\n{\n File = Encoding.UTF8.GetBytes("https://www.example.com/public-url.jpg"),\n FileName = "file-name.jpg",\n};\n\nvar response = await client.Files.Upload(parameters);\n\nConsole.WriteLine(response);\n```',
+ "# Image Kit TypeScript API Library\n\n[)](https://npmjs.org/package/@imagekit/nodejs) \n\nThis library provides convenient access to the Image Kit REST API from server-side TypeScript or JavaScript.\n\n\n\nThe REST API documentation can be found on [imagekit.io](https://imagekit.io/docs/api-reference). The full API of this library can be found in [api.md](api.md).\n\n\n\n## MCP Server\n\nUse the Image Kit MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40imagekit%2Fapi-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBpbWFnZWtpdC9hcGktbWNwIl0sImVudiI6eyJJTUFHRUtJVF9QUklWQVRFX0tFWSI6Ik15IFByaXZhdGUgS2V5IiwiT1BUSU9OQUxfSU1BR0VLSVRfSUdOT1JFU19USElTIjoiTXkgUGFzc3dvcmQiLCJJTUFHRUtJVF9XRUJIT09LX1NFQ1JFVCI6Ik15IFdlYmhvb2sgU2VjcmV0In19)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40imagekit%2Fapi-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40imagekit%2Fapi-mcp%22%5D%2C%22env%22%3A%7B%22IMAGEKIT_PRIVATE_KEY%22%3A%22My%20Private%20Key%22%2C%22OPTIONAL_IMAGEKIT_IGNORES_THIS%22%3A%22My%20Password%22%2C%22IMAGEKIT_WEBHOOK_SECRET%22%3A%22My%20Webhook%20Secret%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n```sh\nnpm install @imagekit/nodejs\n```\n\n\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n\n```js\nimport ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst response = await client.files.upload({\n file: fs.createReadStream('path/to/file'),\n fileName: 'file-name.jpg',\n});\n\nconsole.log(response.videoCodec);\n```\n\n\n\n### Request & Response types\n\nThis library includes TypeScript definitions for all request params and response fields. You may import and use them like so:\n\n\n```ts\nimport ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst params: ImageKit.FileUploadParams = {\n file: fs.createReadStream('path/to/file'),\n fileName: 'file-name.jpg',\n};\nconst response: ImageKit.FileUploadResponse = await client.files.upload(params);\n```\n\nDocumentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.\n\n## File uploads\n\nRequest parameters that correspond to file uploads can be passed in many different forms:\n- `File` (or an object with the same structure)\n- a `fetch` `Response` (or an object with the same structure)\n- an `fs.ReadStream`\n- the return value of our `toFile` helper\n\n```ts\nimport fs from 'fs';\nimport ImageKit, { toFile } from '@imagekit/nodejs';\n\nconst client = new ImageKit();\n\n// If you have access to Node `fs` we recommend using `fs.createReadStream()`:\nawait client.files.upload({ file: fs.createReadStream('/path/to/file'), fileName: 'fileName' });\n\n// Or if you have the web `File` API you can pass a `File` instance:\nawait client.files.upload({ file: new File(['my bytes'], 'file'), fileName: 'fileName' });\n\n// You can also pass a `fetch` `Response`:\nawait client.files.upload({ file: await fetch('https://somesite/file'), fileName: 'fileName' });\n\n// Finally, if none of the above are convenient, you can use our `toFile` helper:\nawait client.files.upload({\n file: await toFile(Buffer.from('my bytes'), 'file'),\n fileName: 'fileName',\n});\nawait client.files.upload({\n file: await toFile(new Uint8Array([0, 1, 2]), 'file'),\n fileName: 'fileName',\n});\n```\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API,\nor if the API returns a non-success status code (i.e., 4xx or 5xx response),\na subclass of `APIError` will be thrown:\n\n\n```ts\nconst response = await client.files\n .upload({ file: fs.createReadStream('path/to/file'), fileName: 'file-name.jpg' })\n .catch(async (err) => {\n if (err instanceof ImageKit.APIError) {\n console.log(err.status); // 400\n console.log(err.name); // BadRequestError\n console.log(err.headers); // {server: 'nginx', ...}\n } else {\n throw err;\n }\n });\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors will all be retried by default.\n\nYou can use the `maxRetries` option to configure or disable this:\n\n\n```js\n// Configure the default for all requests:\nconst client = new ImageKit({\n maxRetries: 0, // default is 2\n});\n\n// Or, configure per-request:\nawait client.files.upload({ file: fs.createReadStream('path/to/file'), fileName: 'file-name.jpg' }, {\n maxRetries: 5,\n});\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default. You can configure this with a `timeout` option:\n\n\n```ts\n// Configure the default for all requests:\nconst client = new ImageKit({\n timeout: 20 * 1000, // 20 seconds (default is 1 minute)\n});\n\n// Override per-request:\nawait client.files.upload({ file: fs.createReadStream('path/to/file'), fileName: 'file-name.jpg' }, {\n timeout: 5 * 1000,\n});\n```\n\nOn timeout, an `APIConnectionTimeoutError` is thrown.\n\nNote that requests which time out will be [retried twice by default](#retries).\n\n\n\n\n\n## Advanced Usage\n\n### Accessing raw Response data (e.g., headers)\n\nThe \"raw\" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.\nThis method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.\n\nYou can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.\nUnlike `.asResponse()` this method consumes the body, returning once it is parsed.\n\n\n```ts\nconst client = new ImageKit();\n\nconst response = await client.files\n .upload({ file: fs.createReadStream('path/to/file'), fileName: 'file-name.jpg' })\n .asResponse();\nconsole.log(response.headers.get('X-My-Header'));\nconsole.log(response.statusText); // access the underlying Response object\n\nconst { data: response, response: raw } = await client.files\n .upload({ file: fs.createReadStream('path/to/file'), fileName: 'file-name.jpg' })\n .withResponse();\nconsole.log(raw.headers.get('X-My-Header'));\nconsole.log(response.videoCodec);\n```\n\n### Logging\n\n> [!IMPORTANT]\n> All log messages are intended for debugging only. The format and content of log messages\n> may change between releases.\n\n#### Log levels\n\nThe log level can be configured in two ways:\n\n1. Via the `IMAGE_KIT_LOG` environment variable\n2. Using the `logLevel` client option (overrides the environment variable if set)\n\n```ts\nimport ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n logLevel: 'debug', // Show all log messages\n});\n```\n\nAvailable log levels, from most to least verbose:\n\n- `'debug'` - Show debug messages, info, warnings, and errors\n- `'info'` - Show info messages, warnings, and errors\n- `'warn'` - Show warnings and errors (default)\n- `'error'` - Show only errors\n- `'off'` - Disable all logging\n\nAt the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.\nSome authentication-related headers are redacted, but sensitive data in request and response bodies\nmay still be visible.\n\n#### Custom logger\n\nBy default, this library logs to `globalThis.console`. You can also provide a custom logger.\nMost logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.\n\nWhen providing a custom logger, the `logLevel` option still controls which messages are emitted, messages\nbelow the configured level will not be sent to your logger.\n\n```ts\nimport ImageKit from '@imagekit/nodejs';\nimport pino from 'pino';\n\nconst logger = pino();\n\nconst client = new ImageKit({\n logger: logger.child({ name: 'ImageKit' }),\n logLevel: 'debug', // Send all messages to pino, allowing it to filter\n});\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.\nOptions on the client, such as retries, will be respected when making these requests.\n\n```ts\nawait client.post('/some/path', {\n body: { some_prop: 'foo' },\n query: { some_query_arg: 'bar' },\n});\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented\nparameter. This library doesn't validate at runtime that the request matches the type, so any extra values you\nsend will be sent as-is.\n\n```ts\nclient.files.upload({\n // ...\n // @ts-expect-error baz is not yet public\n baz: 'undocumented option',\n});\n```\n\nFor requests with the `GET` verb, any extra params will be in the query, all other requests will send the\nextra param in the body.\n\nIf you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may access the response object with `// @ts-expect-error` on\nthe response object, or cast the response object to the requisite type. Like the request params, we do not\nvalidate or strip extra properties from the response from the API.\n\n### Customizing the fetch client\n\nBy default, this library expects a global `fetch` function is defined.\n\nIf you want to use a different `fetch` function, you can either polyfill the global:\n\n```ts\nimport fetch from 'my-fetch';\n\nglobalThis.fetch = fetch;\n```\n\nOr pass it to the client:\n\n```ts\nimport ImageKit from '@imagekit/nodejs';\nimport fetch from 'my-fetch';\n\nconst client = new ImageKit({ fetch });\n```\n\n### Fetch options\n\nIf you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)\n\n```ts\nimport ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n fetchOptions: {\n // `RequestInit` options\n },\n});\n```\n\n#### Configuring proxies\n\nTo modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy\noptions to requests:\n\n
**Node** [[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]\n\n```ts\nimport ImageKit from '@imagekit/nodejs';\nimport * as undici from 'undici';\n\nconst proxyAgent = new undici.ProxyAgent('http://localhost:8888');\nconst client = new ImageKit({\n fetchOptions: {\n dispatcher: proxyAgent,\n },\n});\n```\n\n
**Bun** [[docs](https://bun.sh/guides/http/proxy)]\n\n```ts\nimport ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n fetchOptions: {\n proxy: 'http://localhost:8888',\n },\n});\n```\n\n
**Deno** [[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]\n\n```ts\nimport ImageKit from 'npm:@imagekit/nodejs';\n\nconst httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });\nconst client = new ImageKit({\n fetchOptions: {\n client: httpClient,\n },\n});\n```\n\n## Frequently Asked Questions\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/imagekit-developer/imagekit-nodejs/issues) with questions, bugs, or suggestions.\n\n## Requirements\n\nTypeScript >= 4.9 is supported.\n\nThe following runtimes are supported:\n\n- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)\n- Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.\n- Deno v1.28.0 or higher.\n- Bun 1.0 or later.\n- Cloudflare Workers.\n- Vercel Edge Runtime.\n- Jest 28 or greater with the `\"node\"` environment (`\"jsdom\"` is not supported at this time).\n- Nitro v2.6 or greater.\n\nNote that React Native is not supported at this time.\n\nIf you are interested in other runtime environments, please open or upvote an issue on GitHub.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n",
},
{
- language: 'go',
+ language: 'python',
content:
- '# Image Kit Go API Library\n\n
\n\nThe Image Kit Go library provides convenient access to the [Image Kit REST API](https://imagekit.io/docs/api-reference)\nfrom applications written in Go.\n\n\n\n## MCP Server\n\nUse the Image Kit MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40imagekit%2Fapi-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBpbWFnZWtpdC9hcGktbWNwIl0sImVudiI6eyJJTUFHRUtJVF9QUklWQVRFX0tFWSI6Ik15IFByaXZhdGUgS2V5IiwiT1BUSU9OQUxfSU1BR0VLSVRfSUdOT1JFU19USElTIjoiTXkgUGFzc3dvcmQiLCJJTUFHRUtJVF9XRUJIT09LX1NFQ1JFVCI6Ik15IFdlYmhvb2sgU2VjcmV0In19)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40imagekit%2Fapi-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40imagekit%2Fapi-mcp%22%5D%2C%22env%22%3A%7B%22IMAGEKIT_PRIVATE_KEY%22%3A%22My%20Private%20Key%22%2C%22OPTIONAL_IMAGEKIT_IGNORES_THIS%22%3A%22My%20Password%22%2C%22IMAGEKIT_WEBHOOK_SECRET%22%3A%22My%20Webhook%20Secret%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n\n\n```go\nimport (\n\t"github.com/imagekit-developer/imagekit-go" // imported as SDK_PackageName\n)\n```\n\n\n\nOr to pin the version:\n\n\n\n```sh\ngo get -u \'github.com/imagekit-developer/imagekit-go@v0.0.1\'\n```\n\n\n\n## Requirements\n\nThis library requires Go 1.22+.\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```go\npackage main\n\nimport (\n\t"bytes"\n\t"context"\n\t"fmt"\n\t"io"\n\n\t"github.com/imagekit-developer/imagekit-go"\n\t"github.com/imagekit-developer/imagekit-go/option"\n)\n\nfunc main() {\n\tclient := imagekit.NewClient(\n\t\toption.WithPrivateKey("My Private Key"), // defaults to os.LookupEnv("IMAGEKIT_PRIVATE_KEY")\n\t\toption.WithPassword("My Password"), // defaults to os.LookupEnv("OPTIONAL_IMAGEKIT_IGNORES_THIS")\n\t)\n\tresponse, err := client.Files.Upload(context.TODO(), imagekit.FileUploadParams{\n\t\tFile: io.Reader(bytes.NewBuffer([]byte("https://www.example.com/public-url.jpg"))),\n\t\tFileName: "file-name.jpg",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.VideoCodec)\n}\n\n```\n\n### Request fields\n\nAll request parameters are wrapped in a generic `Field` type,\nwhich we use to distinguish zero values from null or omitted fields.\n\nThis prevents accidentally sending a zero value if you forget a required parameter,\nand enables explicitly sending `null`, `false`, `\'\'`, or `0` on optional parameters.\nAny field not specified is not sent.\n\nTo construct fields with values, use the helpers `String()`, `Int()`, `Float()`, or most commonly, the generic `F[T]()`.\nTo send a null, use `Null[T]()`, and to send a nonconforming value, use `Raw[T](any)`. For example:\n\n```go\nparams := FooParams{\n\tName: SDK_PackageName.F("hello"),\n\n\t// Explicitly send `"description": null`\n\tDescription: SDK_PackageName.Null[string](),\n\n\tPoint: SDK_PackageName.F(SDK_PackageName.Point{\n\t\tX: SDK_PackageName.Int(0),\n\t\tY: SDK_PackageName.Int(1),\n\n\t\t// In cases where the API specifies a given type,\n\t\t// but you want to send something else, use `Raw`:\n\t\tZ: SDK_PackageName.Raw[int64](0.01), // sends a float\n\t}),\n}\n```\n\n### Response objects\n\nAll fields in response structs are value types (not pointers or wrappers).\n\nIf a given field is `null`, not present, or invalid, the corresponding field\nwill simply be its zero value.\n\nAll response structs also include a special `JSON` field, containing more detailed\ninformation about each property, which you can use like so:\n\n```go\nif res.Name == "" {\n\t// true if `"name"` is either not present or explicitly null\n\tres.JSON.Name.IsNull()\n\n\t// true if the `"name"` key was not present in the response JSON at all\n\tres.JSON.Name.IsMissing()\n\n\t// When the API returns data that cannot be coerced to the expected type:\n\tif res.JSON.Name.IsInvalid() {\n\t\traw := res.JSON.Name.Raw()\n\n\t\tlegacyName := struct{\n\t\t\tFirst string `json:"first"`\n\t\t\tLast string `json:"last"`\n\t\t}{}\n\t\tjson.Unmarshal([]byte(raw), &legacyName)\n\t\tname = legacyName.First + " " + legacyName.Last\n\t}\n}\n```\n\nThese `.JSON` structs also include an `Extras` map containing\nany properties in the json response that were not specified\nin the struct. This can be useful for API features not yet\npresent in the SDK.\n\n```go\nbody := res.JSON.ExtraFields["my_unexpected_field"].Raw()\n```\n\n### RequestOptions\n\nThis library uses the functional options pattern. Functions defined in the\n`SDK_PackageOptionName` package return a `RequestOption`, which is a closure that mutates a\n`RequestConfig`. These options can be supplied to the client or at individual\nrequests. For example:\n\n```go\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\t// Adds a header to every request made by the client\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "custom_header_info"),\n)\n\nclient.Files.Upload(context.TODO(), ...,\n\t// Override the header\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "some_other_custom_header_info"),\n\t// Add an undocumented field to the request body, using sjson syntax\n\tSDK_PackageOptionName.WithJSONSet("some.json.path", map[string]string{"my": "object"}),\n)\n```\n\nSee the [full list of request options](https://pkg.go.dev/github.com/imagekit-developer/imagekit-go/SDK_PackageOptionName).\n\n### Pagination\n\nThis library provides some conveniences for working with paginated list endpoints.\n\nYou can use `.ListAutoPaging()` methods to iterate through items across all pages:\n\n\n\nOr you can use simple `.List()` methods to fetch a single page and receive a standard response object\nwith additional helper methods like `.GetNextPage()`, e.g.:\n\n\n\n### Errors\n\nWhen the API returns a non-success status code, we return an error with type\n`*SDK_PackageName.Error`. This contains the `StatusCode`, `*http.Request`, and\n`*http.Response` values of the request, as well as the JSON of the error body\n(much like other response objects in the SDK).\n\nTo handle errors, we recommend that you use the `errors.As` pattern:\n\n```go\n_, err := client.Files.Upload(context.TODO(), imagekit.FileUploadParams{\n\tFile: io.Reader(bytes.NewBuffer([]byte("https://www.example.com/public-url.jpg"))),\n\tFileName: "file-name.jpg",\n})\nif err != nil {\n\tvar apierr *imagekit.Error\n\tif errors.As(err, &apierr) {\n\t\tprintln(string(apierr.DumpRequest(true))) // Prints the serialized HTTP request\n\t\tprintln(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response\n\t}\n\tpanic(err.Error()) // GET "/api/v1/files/upload": 400 Bad Request { ... }\n}\n```\n\nWhen other errors occur, they are returned unwrapped; for example,\nif HTTP transport fails, you might receive `*url.Error` wrapping `*net.OpError`.\n\n### Timeouts\n\nRequests do not time out by default; use context to configure a timeout for a request lifecycle.\n\nNote that if a request is [retried](#retries), the context timeout does not start over.\nTo set a per-retry timeout, use `SDK_PackageOptionName.WithRequestTimeout()`.\n\n```go\n// This sets the timeout for the request, including all the retries.\nctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)\ndefer cancel()\nclient.Files.Upload(\n\tctx,\n\timagekit.FileUploadParams{\n\t\tFile: io.Reader(bytes.NewBuffer([]byte("https://www.example.com/public-url.jpg"))),\n\t\tFileName: "file-name.jpg",\n\t},\n\t// This sets the per-retry timeout\n\toption.WithRequestTimeout(20*time.Second),\n)\n```\n\n### File uploads\n\nRequest parameters that correspond to file uploads in multipart requests are typed as\n`param.Field[io.Reader]`. The contents of the `io.Reader` will by default be sent as a multipart form\npart with the file name of "anonymous_file" and content-type of "application/octet-stream".\n\nThe file name and content-type can be customized by implementing `Name() string` or `ContentType()\nstring` on the run-time type of `io.Reader`. Note that `os.File` implements `Name() string`, so a\nfile returned by `os.Open` will be sent with the file name on disk.\n\nWe also provide a helper `SDK_PackageName.FileParam(reader io.Reader, filename string, contentType string)`\nwhich can be used to wrap any `io.Reader` with the appropriate file name and content type.\n\n```go\n// A file from the file system\nfile, err := os.Open("/path/to/file")\nimagekit.FileUploadParams{\n\tFile: file,\n\tFileName: "fileName",\n}\n\n// A file from a string\nimagekit.FileUploadParams{\n\tFile: strings.NewReader("my file contents"),\n\tFileName: "fileName",\n}\n\n// With a custom filename and contentType\nimagekit.FileUploadParams{\n\tFile: imagekit.NewFile(strings.NewReader(`{"hello": "foo"}`), "file.go", "application/json"),\n\tFileName: "fileName",\n}\n```\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nWe retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit,\nand >=500 Internal errors.\n\nYou can use the `WithMaxRetries` option to configure or disable this:\n\n```go\n// Configure the default for all requests:\nclient := imagekit.NewClient(\n\toption.WithMaxRetries(0), // default is 2\n)\n\n// Override per-request:\nclient.Files.Upload(\n\tcontext.TODO(),\n\timagekit.FileUploadParams{\n\t\tFile: io.Reader(bytes.NewBuffer([]byte("https://www.example.com/public-url.jpg"))),\n\t\tFileName: "file-name.jpg",\n\t},\n\toption.WithMaxRetries(5),\n)\n```\n\n\n### Accessing raw response data (e.g. response headers)\n\nYou can access the raw HTTP response data by using the `option.WithResponseInto()` request option. This is useful when\nyou need to examine response headers, status codes, or other details.\n\n```go\n// Create a variable to store the HTTP response\nvar response *http.Response\nresponse, err := client.Files.Upload(\n\tcontext.TODO(),\n\timagekit.FileUploadParams{\n\t\tFile: io.Reader(bytes.NewBuffer([]byte("https://www.example.com/public-url.jpg"))),\n\t\tFileName: "file-name.jpg",\n\t},\n\toption.WithResponseInto(&response),\n)\nif err != nil {\n\t// handle error\n}\nfmt.Printf("%+v\\n", response)\n\nfmt.Printf("Status Code: %d\\n", response.StatusCode)\nfmt.Printf("Headers: %+#v\\n", response.Header)\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.Get`, `client.Post`, and other HTTP verbs.\n`RequestOptions` on the client, such as retries, will be respected when making these requests.\n\n```go\nvar (\n // params can be an io.Reader, a []byte, an encoding/json serializable object,\n // or a "…Params" struct defined in this library.\n params map[string]interface{}\n\n // result can be an []byte, *http.Response, a encoding/json deserializable object,\n // or a model defined in this library.\n result *http.Response\n)\nerr := client.Post(context.Background(), "/unspecified", params, &result)\nif err != nil {\n …\n}\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use either the `SDK_PackageOptionName.WithQuerySet()`\nor the `SDK_PackageOptionName.WithJSONSet()` methods.\n\n```go\nparams := FooNewParams{\n ID: SDK_PackageName.F("id_xxxx"),\n Data: SDK_PackageName.F(FooNewParamsData{\n FirstName: SDK_PackageName.F("John"),\n }),\n}\nclient.Foo.New(context.Background(), params, SDK_PackageOptionName.WithJSONSet("data.last_name", "Doe"))\n```\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may either access the raw JSON of the response as a string\nwith `result.JSON.RawJSON()`, or get the raw JSON of a particular field on the result with\n`result.JSON.Foo.Raw()`.\n\nAny fields that are not present on the response struct will be saved and can be accessed by `result.JSON.ExtraFields()` which returns the extra fields as a `map[string]Field`.\n\n### Middleware\n\nWe provide `SDK_PackageOptionName.WithMiddleware` which applies the given\nmiddleware to requests.\n\n```go\nfunc Logger(req *http.Request, next SDK_PackageOptionName.MiddlewareNext) (res *http.Response, err error) {\n\t// Before the request\n\tstart := time.Now()\n\tLogReq(req)\n\n\t// Forward the request to the next handler\n\tres, err = next(req)\n\n\t// Handle stuff after the request\n\tend := time.Now()\n\tLogRes(res, err, start - end)\n\n return res, err\n}\n\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\tSDK_PackageOptionName.WithMiddleware(Logger),\n)\n```\n\nWhen multiple middlewares are provided as variadic arguments, the middlewares\nare applied left to right. If `SDK_PackageOptionName.WithMiddleware` is given\nmultiple times, for example first in the client then the method, the\nmiddleware in the client will run first and the middleware given in the method\nwill run next.\n\nYou may also replace the default `http.Client` with\n`SDK_PackageOptionName.WithHTTPClient(client)`. Only one http client is\naccepted (this overwrites any previous client) and receives requests after any\nmiddleware has been applied.\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/imagekit-developer/imagekit-go/issues) with questions, bugs, or suggestions.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
+ '# Image Kit Python API library\n\n\n[)](https://pypi.org/project/imagekitio/)\n\nThe Image Kit Python library provides convenient access to the Image Kit REST API from any Python 3.9+\napplication. The library includes type definitions for all request params and response fields,\nand offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).\n\n\n\n\n\n## MCP Server\n\nUse the Image Kit MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40imagekit%2Fapi-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBpbWFnZWtpdC9hcGktbWNwIl0sImVudiI6eyJJTUFHRUtJVF9QUklWQVRFX0tFWSI6Ik15IFByaXZhdGUgS2V5IiwiT1BUSU9OQUxfSU1BR0VLSVRfSUdOT1JFU19USElTIjoiTXkgUGFzc3dvcmQiLCJJTUFHRUtJVF9XRUJIT09LX1NFQ1JFVCI6Ik15IFdlYmhvb2sgU2VjcmV0In19)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40imagekit%2Fapi-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40imagekit%2Fapi-mcp%22%5D%2C%22env%22%3A%7B%22IMAGEKIT_PRIVATE_KEY%22%3A%22My%20Private%20Key%22%2C%22OPTIONAL_IMAGEKIT_IGNORES_THIS%22%3A%22My%20Password%22%2C%22IMAGEKIT_WEBHOOK_SECRET%22%3A%22My%20Webhook%20Secret%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\nThe REST API documentation can be found on [imagekit.io](https://imagekit.io/docs/api-reference). The full API of this library can be found in [api.md](api.md).\n\n## Installation\n\n```sh\n# install from PyPI\npip install imagekitio\n```\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```python\nimport os\nfrom imagekitio import ImageKit\n\nclient = ImageKit(\n private_key=os.environ.get("IMAGEKIT_PRIVATE_KEY"), # This is the default and can be omitted\n password=os.environ.get("OPTIONAL_IMAGEKIT_IGNORES_THIS"), # This is the default and can be omitted\n)\n\nresponse = client.files.upload(\n file=b"https://www.example.com/public-url.jpg",\n file_name="file-name.jpg",\n)\nprint(response.video_codec)\n```\n\nWhile you can provide a `private_key` keyword argument,\nwe recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)\nto add `IMAGEKIT_PRIVATE_KEY="My Private Key"` to your `.env` file\nso that your Private Key is not stored in source control.\n\n## Async usage\n\nSimply import `AsyncImageKit` instead of `ImageKit` and use `await` with each API call:\n\n```python\nimport os\nimport asyncio\nfrom imagekitio import AsyncImageKit\n\nclient = AsyncImageKit(\n private_key=os.environ.get("IMAGEKIT_PRIVATE_KEY"), # This is the default and can be omitted\n password=os.environ.get("OPTIONAL_IMAGEKIT_IGNORES_THIS"), # This is the default and can be omitted\n)\n\nasync def main() -> None:\n response = await client.files.upload(\n file=b"https://www.example.com/public-url.jpg",\n file_name="file-name.jpg",\n )\n print(response.video_codec)\n\nasyncio.run(main())\n```\n\nFunctionality between the synchronous and asynchronous clients is otherwise identical.\n\n### With aiohttp\n\nBy default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.\n\nYou can enable this by installing `aiohttp`:\n\n```sh\n# install from PyPI\npip install imagekitio[aiohttp]\n```\n\nThen you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:\n\n```python\nimport os\nimport asyncio\nfrom imagekitio import DefaultAioHttpClient\nfrom imagekitio import AsyncImageKit\n\nasync def main() -> None:\n async with AsyncImageKit(\n private_key=os.environ.get("IMAGEKIT_PRIVATE_KEY"), # This is the default and can be omitted\n password=os.environ.get("OPTIONAL_IMAGEKIT_IGNORES_THIS"), # This is the default and can be omitted\n http_client=DefaultAioHttpClient(),\n) as client:\n response = await client.files.upload(\n file=b"https://www.example.com/public-url.jpg",\n file_name="file-name.jpg",\n )\n print(response.video_codec)\n\nasyncio.run(main())\n```\n\n\n\n## Using types\n\nNested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:\n\n- Serializing back into JSON, `model.to_json()`\n- Converting to a dictionary, `model.to_dict()`\n\nTyped requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.\n\n\n\n## Nested params\n\nNested parameters are dictionaries, typed using `TypedDict`, for example:\n\n```python\nfrom imagekitio import ImageKit\n\nclient = ImageKit()\n\nresponse = client.files.upload(\n file=b"Example data",\n file_name="fileName",\n transformation={\n "post": [{\n "type": "thumbnail",\n "value": "w-150,h-150",\n }, {\n "protocol": "dash",\n "type": "abs",\n "value": "sr-240_360_480_720_1080",\n }]\n },\n)\nprint(response.transformation)\n```\n\n## File uploads\n\nRequest parameters that correspond to file uploads can be passed as `bytes`, or a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.\n\n```python\nfrom pathlib import Path\nfrom imagekitio import ImageKit\n\nclient = ImageKit()\n\nclient.files.upload(\n file=Path("/path/to/file"),\n file_name="fileName",\n)\n```\n\nThe async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.\n\n## Handling errors\n\nWhen the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `imagekitio.APIConnectionError` is raised.\n\nWhen the API returns a non-success status code (that is, 4xx or 5xx\nresponse), a subclass of `imagekitio.APIStatusError` is raised, containing `status_code` and `response` properties.\n\nAll errors inherit from `imagekitio.APIError`.\n\n```python\nimport imagekitio\nfrom imagekitio import ImageKit\n\nclient = ImageKit()\n\ntry:\n client.files.upload(\n file=b"https://www.example.com/public-url.jpg",\n file_name="file-name.jpg",\n )\nexcept imagekitio.APIConnectionError as e:\n print("The server could not be reached")\n print(e.__cause__) # an underlying Exception, likely raised within httpx.\nexcept imagekitio.RateLimitError as e:\n print("A 429 status code was received; we should back off a bit.")\nexcept imagekitio.APIStatusError as e:\n print("Another non-200-range status code was received")\n print(e.status_code)\n print(e.response)\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors are automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors are all retried by default.\n\nYou can use the `max_retries` option to configure or disable retry settings:\n\n```python\nfrom imagekitio import ImageKit\n\n# Configure the default for all requests:\nclient = ImageKit(\n # default is 2\n max_retries=0,\n)\n\n# Or, configure per-request:\nclient.with_options(max_retries = 5).files.upload(\n file=b"https://www.example.com/public-url.jpg",\n file_name="file-name.jpg",\n)\n```\n\n### Timeouts\n\nBy default requests time out after 1 minute. You can configure this with a `timeout` option,\nwhich accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:\n\n```python\nfrom imagekitio import ImageKit\n\n# Configure the default for all requests:\nclient = ImageKit(\n # 20 seconds (default is 1 minute)\n timeout=20.0,\n)\n\n# More granular control:\nclient = ImageKit(\n timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),\n)\n\n# Override per-request:\nclient.with_options(timeout = 5.0).files.upload(\n file=b"https://www.example.com/public-url.jpg",\n file_name="file-name.jpg",\n)\n```\n\nOn timeout, an `APITimeoutError` is thrown.\n\nNote that requests that time out are [retried twice by default](#retries).\n\n\n\n## Advanced\n\n### Logging\n\nWe use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.\n\nYou can enable logging by setting the environment variable `IMAGE_KIT_LOG` to `info`.\n\n```shell\n$ export IMAGE_KIT_LOG=info\n```\n\nOr to `debug` for more verbose logging.\n\n### How to tell whether `None` means `null` or missing\n\nIn an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:\n\n```py\nif response.my_field is None:\n if \'my_field\' not in response.model_fields_set:\n print(\'Got json like {}, without a "my_field" key present at all.\')\n else:\n print(\'Got json like {"my_field": null}.\')\n```\n\n### Accessing raw response data (e.g. headers)\n\nThe "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,\n\n```py\nfrom imagekitio import ImageKit\n\nclient = ImageKit()\nresponse = client.files.with_raw_response.upload(\n file=b"https://www.example.com/public-url.jpg",\n file_name="file-name.jpg",\n)\nprint(response.headers.get(\'X-My-Header\'))\n\nfile = response.parse() # get the object that `files.upload()` would have returned\nprint(file.video_codec)\n```\n\nThese methods return an [`APIResponse`](https://github.com/imagekit-developer/imagekit-python/tree/master/src/imagekitio/_response.py) object.\n\nThe async client returns an [`AsyncAPIResponse`](https://github.com/imagekit-developer/imagekit-python/tree/master/src/imagekitio/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.\n\n#### `.with_streaming_response`\n\nThe above interface eagerly reads the full response body when you make the request, which may not always be what you want.\n\nTo stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.\n\n```python\nwith client.files.with_streaming_response.upload(\n file=b"https://www.example.com/public-url.jpg",\n file_name="file-name.jpg",\n) as response :\n print(response.headers.get(\'X-My-Header\'))\n\n for line in response.iter_lines():\n print(line)\n```\n\nThe context manager is required so that the response will reliably be closed.\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API.\n\nIf you need to access undocumented endpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other\nhttp verbs. Options on the client will be respected (such as retries) when making this request.\n\n```py\nimport httpx\n\nresponse = client.post(\n "/foo",\n cast_to=httpx.Response,\n body={"my_param": True},\n)\n\nprint(response.headers.get("x-foo"))\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You\ncan also get all the extra fields on the Pydantic model as a dict with\n[`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).\n\n### Configuring the HTTP client\n\nYou can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:\n\n- Support for [proxies](https://www.python-httpx.org/advanced/proxies/)\n- Custom [transports](https://www.python-httpx.org/advanced/transports/)\n- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality\n\n```python\nimport httpx\nfrom imagekitio import ImageKit, DefaultHttpxClient\n\nclient = ImageKit(\n # Or use the `IMAGE_KIT_BASE_URL` env var\n base_url="http://my.test.server.example.com:8083",\n http_client=DefaultHttpxClient(proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0")),\n)\n```\n\nYou can also customize the client on a per-request basis by using `with_options()`:\n\n```python\nclient.with_options(http_client=DefaultHttpxClient(...))\n```\n\n### Managing HTTP resources\n\nBy default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.\n\n```py\nfrom imagekitio import ImageKit\n\nwith ImageKit() as client:\n # make requests here\n ...\n\n# HTTP client is now closed\n```\n\n## Versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/imagekit-developer/imagekit-python/issues) with questions, bugs, or suggestions.\n\n### Determining the installed version\n\nIf you\'ve upgraded to the latest version but aren\'t seeing any new features you were expecting then your python environment is likely still using an older version.\n\nYou can determine the version that is being used at runtime with:\n\n```py\nimport imagekitio\nprint(imagekitio.__version__)\n```\n\n## Requirements\n\nPython 3.9 or higher.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
},
{
language: 'java',
@@ -3321,19 +2853,9 @@ const EMBEDDED_READMES: { language: string; content: string }[] = [
'# Image Kit Java API Library\n\n\n[](https://central.sonatype.com/artifact/io.imagekit/image-kit-java/0.0.1)\n[](https://javadoc.io/doc/io.imagekit/image-kit-java/0.0.1)\n\n\nThe Image Kit Java SDK provides convenient access to the [Image Kit REST API](https://imagekit.io/docs/api-reference) from applications written in Java.\n\n\n\n\n\n## MCP Server\n\nUse the Image Kit MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40imagekit%2Fapi-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBpbWFnZWtpdC9hcGktbWNwIl0sImVudiI6eyJJTUFHRUtJVF9QUklWQVRFX0tFWSI6Ik15IFByaXZhdGUgS2V5IiwiT1BUSU9OQUxfSU1BR0VLSVRfSUdOT1JFU19USElTIjoiTXkgUGFzc3dvcmQiLCJJTUFHRUtJVF9XRUJIT09LX1NFQ1JFVCI6Ik15IFdlYmhvb2sgU2VjcmV0In19)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40imagekit%2Fapi-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40imagekit%2Fapi-mcp%22%5D%2C%22env%22%3A%7B%22IMAGEKIT_PRIVATE_KEY%22%3A%22My%20Private%20Key%22%2C%22OPTIONAL_IMAGEKIT_IGNORES_THIS%22%3A%22My%20Password%22%2C%22IMAGEKIT_WEBHOOK_SECRET%22%3A%22My%20Webhook%20Secret%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n\n\nThe REST API documentation can be found on [imagekit.io](https://imagekit.io/docs/api-reference). Javadocs are available on [javadoc.io](https://javadoc.io/doc/io.imagekit/image-kit-java/0.0.1).\n\n\n\n## Installation\n\n\n\n### Gradle\n\n~~~kotlin\nimplementation("io.imagekit:image-kit-java:0.0.1")\n~~~\n\n### Maven\n\n~~~xml\n\n io.imagekit\n image-kit-java\n 0.0.1\n\n~~~\n\n\n\n## Requirements\n\nThis library requires Java 8 or later.\n\n## Usage\n\n```java\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.files.FileUploadParams;\nimport io.imagekit.models.files.FileUploadResponse;\nimport java.io.ByteArrayInputStream;\n\n// Configures using the `imagekit.imagekitPrivateKey`, `imagekit.optionalImagekitIgnoresThis`, `imagekit.imagekitWebhookSecret` and `imagekit.baseUrl` system properties\n// Or configures using the `IMAGEKIT_PRIVATE_KEY`, `OPTIONAL_IMAGEKIT_IGNORES_THIS`, `IMAGEKIT_WEBHOOK_SECRET` and `IMAGE_KIT_BASE_URL` environment variables\nImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\nFileUploadParams params = FileUploadParams.builder()\n .file(new ByteArrayInputStream("https://www.example.com/public-url.jpg".getBytes()))\n .fileName("file-name.jpg")\n .build();\nFileUploadResponse response = client.files().upload(params);\n```\n\n## Client configuration\n\nConfigure the client using system properties or environment variables:\n\n```java\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\n\n// Configures using the `imagekit.imagekitPrivateKey`, `imagekit.optionalImagekitIgnoresThis`, `imagekit.imagekitWebhookSecret` and `imagekit.baseUrl` system properties\n// Or configures using the `IMAGEKIT_PRIVATE_KEY`, `OPTIONAL_IMAGEKIT_IGNORES_THIS`, `IMAGEKIT_WEBHOOK_SECRET` and `IMAGE_KIT_BASE_URL` environment variables\nImageKitClient client = ImageKitOkHttpClient.fromEnv();\n```\n\nOr manually:\n\n```java\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\n\nImageKitClient client = ImageKitOkHttpClient.builder()\n .privateKey("My Private Key")\n .password("My Password")\n .build();\n```\n\nOr using a combination of the two approaches:\n\n```java\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\n\nImageKitClient client = ImageKitOkHttpClient.builder()\n // Configures using the `imagekit.imagekitPrivateKey`, `imagekit.optionalImagekitIgnoresThis`, `imagekit.imagekitWebhookSecret` and `imagekit.baseUrl` system properties\n // Or configures using the `IMAGEKIT_PRIVATE_KEY`, `OPTIONAL_IMAGEKIT_IGNORES_THIS`, `IMAGEKIT_WEBHOOK_SECRET` and `IMAGE_KIT_BASE_URL` environment variables\n .fromEnv()\n .privateKey("My Private Key")\n .build();\n```\n\nSee this table for the available options:\n\n| Setter | System property | Environment variable | Required | Default value |\n| --------------- | -------------------------------------- | -------------------------------- | -------- | --------------------------- |\n| `privateKey` | `imagekit.imagekitPrivateKey` | `IMAGEKIT_PRIVATE_KEY` | true | - |\n| `password` | `imagekit.optionalImagekitIgnoresThis` | `OPTIONAL_IMAGEKIT_IGNORES_THIS` | false | `"do_not_set"` |\n| `webhookSecret` | `imagekit.imagekitWebhookSecret` | `IMAGEKIT_WEBHOOK_SECRET` | false | - |\n| `baseUrl` | `imagekit.baseUrl` | `IMAGE_KIT_BASE_URL` | true | `"https://api.imagekit.io"` |\n\nSystem properties take precedence over environment variables.\n\n> [!TIP]\n> Don\'t create more than one client in the same application. Each client has a connection pool and\n> thread pools, which are more efficient to share between requests.\n\n### Modifying configuration\n\nTo temporarily use a modified client configuration, while reusing the same connection and thread pools, call `withOptions()` on any client or service:\n\n```java\nimport io.imagekit.client.ImageKitClient;\n\nImageKitClient clientWithOptions = client.withOptions(optionsBuilder -> {\n optionsBuilder.baseUrl("https://example.com");\n optionsBuilder.maxRetries(42);\n});\n```\n\nThe `withOptions()` method does not affect the original client or service.\n\n## Requests and responses\n\nTo send a request to the Image Kit API, build an instance of some `Params` class and pass it to the corresponding client method. When the response is received, it will be deserialized into an instance of a Java class.\n\nFor example, `client.files().upload(...)` should be called with an instance of `FileUploadParams`, and it will return an instance of `FileUploadResponse`.\n\n## Immutability\n\nEach class in the SDK has an associated [builder](https://blogs.oracle.com/javamagazine/post/exploring-joshua-blochs-builder-design-pattern-in-java) or factory method for constructing it.\n\nEach class is [immutable](https://docs.oracle.com/javase/tutorial/essential/concurrency/immutable.html) once constructed. If the class has an associated builder, then it has a `toBuilder()` method, which can be used to convert it back to a builder for making a modified copy.\n\nBecause each class is immutable, builder modification will _never_ affect already built class instances.\n\n## Asynchronous execution\n\nThe default client is synchronous. To switch to asynchronous execution, call the `async()` method:\n\n```java\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.models.files.FileUploadParams;\nimport io.imagekit.models.files.FileUploadResponse;\nimport java.io.ByteArrayInputStream;\nimport java.util.concurrent.CompletableFuture;\n\n// Configures using the `imagekit.imagekitPrivateKey`, `imagekit.optionalImagekitIgnoresThis`, `imagekit.imagekitWebhookSecret` and `imagekit.baseUrl` system properties\n// Or configures using the `IMAGEKIT_PRIVATE_KEY`, `OPTIONAL_IMAGEKIT_IGNORES_THIS`, `IMAGEKIT_WEBHOOK_SECRET` and `IMAGE_KIT_BASE_URL` environment variables\nImageKitClient client = ImageKitOkHttpClient.fromEnv();\n\nFileUploadParams params = FileUploadParams.builder()\n .file(new ByteArrayInputStream("https://www.example.com/public-url.jpg".getBytes()))\n .fileName("file-name.jpg")\n .build();\nCompletableFuture response = client.async().files().upload(params);\n```\n\nOr create an asynchronous client from the beginning:\n\n```java\nimport io.imagekit.client.ImageKitClientAsync;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClientAsync;\nimport io.imagekit.models.files.FileUploadParams;\nimport io.imagekit.models.files.FileUploadResponse;\nimport java.io.ByteArrayInputStream;\nimport java.util.concurrent.CompletableFuture;\n\n// Configures using the `imagekit.imagekitPrivateKey`, `imagekit.optionalImagekitIgnoresThis`, `imagekit.imagekitWebhookSecret` and `imagekit.baseUrl` system properties\n// Or configures using the `IMAGEKIT_PRIVATE_KEY`, `OPTIONAL_IMAGEKIT_IGNORES_THIS`, `IMAGEKIT_WEBHOOK_SECRET` and `IMAGE_KIT_BASE_URL` environment variables\nImageKitClientAsync client = ImageKitOkHttpClientAsync.fromEnv();\n\nFileUploadParams params = FileUploadParams.builder()\n .file(new ByteArrayInputStream("https://www.example.com/public-url.jpg".getBytes()))\n .fileName("file-name.jpg")\n .build();\nCompletableFuture response = client.files().upload(params);\n```\n\nThe asynchronous client supports the same options as the synchronous one, except most methods return `CompletableFuture`s.\n\n\n\n## File uploads\n\nThe SDK defines methods that accept files.\n\nTo upload a file, pass a [`Path`](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html):\n\n```java\nimport io.imagekit.models.files.FileUploadParams;\nimport io.imagekit.models.files.FileUploadResponse;\nimport java.nio.file.Paths;\n\nFileUploadParams params = FileUploadParams.builder()\n .fileName("fileName")\n .file(Paths.get("/path/to/file"))\n .build();\nFileUploadResponse response = client.files().upload(params);\n```\n\nOr an arbitrary [`InputStream`](https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html):\n\n```java\nimport io.imagekit.models.files.FileUploadParams;\nimport io.imagekit.models.files.FileUploadResponse;\nimport java.net.URL;\n\nFileUploadParams params = FileUploadParams.builder()\n .fileName("fileName")\n .file(new URL("https://example.com//path/to/file").openStream())\n .build();\nFileUploadResponse response = client.files().upload(params);\n```\n\nOr a `byte[]` array:\n\n```java\nimport io.imagekit.models.files.FileUploadParams;\nimport io.imagekit.models.files.FileUploadResponse;\n\nFileUploadParams params = FileUploadParams.builder()\n .fileName("fileName")\n .file("content".getBytes())\n .build();\nFileUploadResponse response = client.files().upload(params);\n```\n\nNote that when passing a non-`Path` its filename is unknown so it will not be included in the request. To manually set a filename, pass a [`MultipartField`](image-kit-java-core/src/main/kotlin/io/imagekit/core/Values.kt):\n\n```java\nimport io.imagekit.core.MultipartField;\nimport io.imagekit.models.files.FileUploadParams;\nimport io.imagekit.models.files.FileUploadResponse;\nimport java.io.InputStream;\nimport java.net.URL;\n\nFileUploadParams params = FileUploadParams.builder()\n .fileName("fileName")\n .file(MultipartField.builder()\n .value(new URL("https://example.com//path/to/file").openStream())\n .filename("/path/to/file")\n .build())\n .build();\nFileUploadResponse response = client.files().upload(params);\n```\n\n\n\n## Raw responses\n\nThe SDK defines methods that deserialize responses into instances of Java classes. However, these methods don\'t provide access to the response headers, status code, or the raw response body.\n\nTo access this data, prefix any HTTP method call on a client or service with `withRawResponse()`:\n\n```java\nimport io.imagekit.core.http.Headers;\nimport io.imagekit.core.http.HttpResponseFor;\nimport io.imagekit.models.files.FileUploadParams;\nimport io.imagekit.models.files.FileUploadResponse;\nimport java.io.ByteArrayInputStream;\n\nFileUploadParams params = FileUploadParams.builder()\n .file(new ByteArrayInputStream("https://www.example.com/public-url.jpg".getBytes()))\n .fileName("file-name.jpg")\n .build();\nHttpResponseFor response = client.files().withRawResponse().upload(params);\n\nint statusCode = response.statusCode();\nHeaders headers = response.headers();\n```\n\nYou can still deserialize the response into an instance of a Java class if needed:\n\n```java\nimport io.imagekit.models.files.FileUploadResponse;\n\nFileUploadResponse parsedResponse = response.parse();\n```\n\n## Error handling\n\nThe SDK throws custom unchecked exception types:\n\n- [`ImageKitServiceException`](image-kit-java-core/src/main/kotlin/io/imagekit/errors/ImageKitServiceException.kt): Base class for HTTP errors. See this table for which exception subclass is thrown for each HTTP status code:\n\n | Status | Exception |\n | ------ | -------------------------------------------------- |\n | 400 | [`BadRequestException`](image-kit-java-core/src/main/kotlin/io/imagekit/errors/BadRequestException.kt) |\n | 401 | [`UnauthorizedException`](image-kit-java-core/src/main/kotlin/io/imagekit/errors/UnauthorizedException.kt) |\n | 403 | [`PermissionDeniedException`](image-kit-java-core/src/main/kotlin/io/imagekit/errors/PermissionDeniedException.kt) |\n | 404 | [`NotFoundException`](image-kit-java-core/src/main/kotlin/io/imagekit/errors/NotFoundException.kt) |\n | 422 | [`UnprocessableEntityException`](image-kit-java-core/src/main/kotlin/io/imagekit/errors/UnprocessableEntityException.kt) |\n | 429 | [`RateLimitException`](image-kit-java-core/src/main/kotlin/io/imagekit/errors/RateLimitException.kt) |\n | 5xx | [`InternalServerException`](image-kit-java-core/src/main/kotlin/io/imagekit/errors/InternalServerException.kt) |\n | others | [`UnexpectedStatusCodeException`](image-kit-java-core/src/main/kotlin/io/imagekit/errors/UnexpectedStatusCodeException.kt) |\n\n- [`ImageKitIoException`](image-kit-java-core/src/main/kotlin/io/imagekit/errors/ImageKitIoException.kt): I/O networking errors.\n\n- [`ImageKitRetryableException`](image-kit-java-core/src/main/kotlin/io/imagekit/errors/ImageKitRetryableException.kt): Generic error indicating a failure that could be retried by the client.\n\n- [`ImageKitInvalidDataException`](image-kit-java-core/src/main/kotlin/io/imagekit/errors/ImageKitInvalidDataException.kt): Failure to interpret successfully parsed data. For example, when accessing a property that\'s supposed to be required, but the API unexpectedly omitted it from the response.\n\n- [`ImageKitException`](image-kit-java-core/src/main/kotlin/io/imagekit/errors/ImageKitException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class.\n\n\n\n## Logging\n\nEnable logging by setting the `IMAGE_KIT_LOG` environment variable to `info`:\n\n```sh\nexport IMAGE_KIT_LOG=info\n```\n\nOr to `debug` for more verbose logging:\n\n```sh\nexport IMAGE_KIT_LOG=debug\n```\n\nOr configure the client manually using the `logLevel` method:\n\n```java\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.core.LogLevel;\n\nImageKitClient client = ImageKitOkHttpClient.builder()\n .fromEnv()\n .logLevel(LogLevel.INFO)\n .build();\n```\n\n## ProGuard and R8\n\nAlthough the SDK uses reflection, it is still usable with [ProGuard](https://github.com/Guardsquare/proguard) and [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization) because `image-kit-java-core` is published with a [configuration file](image-kit-java-core/src/main/resources/META-INF/proguard/image-kit-java-core.pro) containing [keep rules](https://www.guardsquare.com/manual/configuration/usage).\n\nProGuard and R8 should automatically detect and use the published rules, but you can also manually copy the keep rules if necessary.\n\n\n\n\n\n## Jackson\n\nThe SDK depends on [Jackson](https://github.com/FasterXML/jackson) for JSON serialization/deserialization. It is compatible with version 2.13.4 or higher, but depends on version 2.18.2 by default.\n\nThe SDK throws an exception if it detects an incompatible Jackson version at runtime (e.g. if the default version was overridden in your Maven or Gradle config).\n\nIf the SDK threw an exception, but you\'re _certain_ the version is compatible, then disable the version check using the `checkJacksonVersionCompatibility` on [`ImageKitOkHttpClient`](image-kit-java-client-okhttp/src/main/kotlin/io/imagekit/client/okhttp/ImageKitOkHttpClient.kt) or [`ImageKitOkHttpClientAsync`](image-kit-java-client-okhttp/src/main/kotlin/io/imagekit/client/okhttp/ImageKitOkHttpClientAsync.kt).\n\n> [!CAUTION]\n> We make no guarantee that the SDK works correctly when the Jackson version check is disabled.\n\nAlso note that there are bugs in older Jackson versions that can affect the SDK. We don\'t work around all Jackson bugs ([example](https://github.com/FasterXML/jackson-databind/issues/3240)) and expect users to upgrade Jackson for those instead.\n\n## Network options\n\n### Retries\n\nThe SDK automatically retries 2 times by default, with a short exponential backoff between requests.\n\nOnly the following error types are retried:\n- Connection errors (for example, due to a network connectivity problem)\n- 408 Request Timeout\n- 409 Conflict\n- 429 Rate Limit\n- 5xx Internal\n\nThe API may also explicitly instruct the SDK to retry or not retry a request.\n\nTo set a custom number of retries, configure the client using the `maxRetries` method:\n\n```java\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\n\nImageKitClient client = ImageKitOkHttpClient.builder()\n .fromEnv()\n .maxRetries(4)\n .build();\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default.\n\nTo set a custom timeout, configure the method call using the `timeout` method:\n\n```java\nimport io.imagekit.models.files.FileUploadResponse;\n\nFileUploadResponse response = client.files().upload(\n params, RequestOptions.builder().timeout(Duration.ofSeconds(30)).build()\n);\n```\n\nOr configure the default for all method calls at the client level:\n\n```java\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport java.time.Duration;\n\nImageKitClient client = ImageKitOkHttpClient.builder()\n .fromEnv()\n .timeout(Duration.ofSeconds(30))\n .build();\n```\n\n### Proxies\n\nTo route requests through a proxy, configure the client using the `proxy` method:\n\n```java\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport java.net.InetSocketAddress;\nimport java.net.Proxy;\n\nImageKitClient client = ImageKitOkHttpClient.builder()\n .fromEnv()\n .proxy(new Proxy(\n Proxy.Type.HTTP, new InetSocketAddress(\n "https://example.com", 8080\n )\n ))\n .build();\n```\n\nIf the proxy responds with `407 Proxy Authentication Required`, supply credentials by also configuring `proxyAuthenticator`:\n\n```java\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport io.imagekit.core.http.ProxyAuthenticator;\n\nImageKitClient client = ImageKitOkHttpClient.builder()\n .fromEnv()\n .proxy(...)\n // Or a custom implementation of `ProxyAuthenticator`.\n .proxyAuthenticator(ProxyAuthenticator.basic("username", "password"))\n .build();\n```\n\n### Connection pooling\n\nTo customize the underlying OkHttp connection pool, configure the client using the `maxIdleConnections` and `keepAliveDuration` methods:\n\n```java\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\nimport java.time.Duration;\n\nImageKitClient client = ImageKitOkHttpClient.builder()\n .fromEnv()\n // If `maxIdleConnections` is set, then `keepAliveDuration` must be set, and vice versa.\n .maxIdleConnections(10)\n .keepAliveDuration(Duration.ofMinutes(2))\n .build();\n```\n\nIf both options are unset, OkHttp\'s default connection pool settings are used.\n\n### HTTPS\n\n> [!NOTE]\n> Most applications should not call these methods, and instead use the system defaults. The defaults include\n> special optimizations that can be lost if the implementations are modified.\n\nTo configure how HTTPS connections are secured, configure the client using the `sslSocketFactory`, `trustManager`, and `hostnameVerifier` methods:\n\n```java\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\n\nImageKitClient client = ImageKitOkHttpClient.builder()\n .fromEnv()\n // If `sslSocketFactory` is set, then `trustManager` must be set, and vice versa.\n .sslSocketFactory(yourSSLSocketFactory)\n .trustManager(yourTrustManager)\n .hostnameVerifier(yourHostnameVerifier)\n .build();\n```\n\n\n\n### Custom HTTP client\n\nThe SDK consists of three artifacts:\n- `image-kit-java-core`\n - Contains core SDK logic\n - Does not depend on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`ImageKitClient`](image-kit-java-core/src/main/kotlin/io/imagekit/client/ImageKitClient.kt), [`ImageKitClientAsync`](image-kit-java-core/src/main/kotlin/io/imagekit/client/ImageKitClientAsync.kt), [`ImageKitClientImpl`](image-kit-java-core/src/main/kotlin/io/imagekit/client/ImageKitClientImpl.kt), and [`ImageKitClientAsyncImpl`](image-kit-java-core/src/main/kotlin/io/imagekit/client/ImageKitClientAsyncImpl.kt), all of which can work with any HTTP client\n- `image-kit-java-client-okhttp`\n - Depends on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`ImageKitOkHttpClient`](image-kit-java-client-okhttp/src/main/kotlin/io/imagekit/client/okhttp/ImageKitOkHttpClient.kt) and [`ImageKitOkHttpClientAsync`](image-kit-java-client-okhttp/src/main/kotlin/io/imagekit/client/okhttp/ImageKitOkHttpClientAsync.kt), which provide a way to construct [`ImageKitClientImpl`](image-kit-java-core/src/main/kotlin/io/imagekit/client/ImageKitClientImpl.kt) and [`ImageKitClientAsyncImpl`](image-kit-java-core/src/main/kotlin/io/imagekit/client/ImageKitClientAsyncImpl.kt), respectively, using OkHttp\n- `image-kit-java`\n - Depends on and exposes the APIs of both `image-kit-java-core` and `image-kit-java-client-okhttp`\n - Does not have its own logic\n\nThis structure allows replacing the SDK\'s default HTTP client without pulling in unnecessary dependencies.\n\n#### Customized [`OkHttpClient`](https://square.github.io/okhttp/3.x/okhttp/okhttp3/OkHttpClient.html)\n\n> [!TIP]\n> Try the available [network options](#network-options) before replacing the default client.\n\nTo use a customized `OkHttpClient`:\n\n1. Replace your [`image-kit-java` dependency](#installation) with `image-kit-java-core`\n2. Copy `image-kit-java-client-okhttp`\'s [`OkHttpClient`](image-kit-java-client-okhttp/src/main/kotlin/io/imagekit/client/okhttp/OkHttpClient.kt) class into your code and customize it\n3. Construct [`ImageKitClientImpl`](image-kit-java-core/src/main/kotlin/io/imagekit/client/ImageKitClientImpl.kt) or [`ImageKitClientAsyncImpl`](image-kit-java-core/src/main/kotlin/io/imagekit/client/ImageKitClientAsyncImpl.kt), similarly to [`ImageKitOkHttpClient`](image-kit-java-client-okhttp/src/main/kotlin/io/imagekit/client/okhttp/ImageKitOkHttpClient.kt) or [`ImageKitOkHttpClientAsync`](image-kit-java-client-okhttp/src/main/kotlin/io/imagekit/client/okhttp/ImageKitOkHttpClientAsync.kt), using your customized client\n\n### Completely custom HTTP client\n\nTo use a completely custom HTTP client:\n\n1. Replace your [`image-kit-java` dependency](#installation) with `image-kit-java-core`\n2. Write a class that implements the [`HttpClient`](image-kit-java-core/src/main/kotlin/io/imagekit/core/http/HttpClient.kt) interface\n3. Construct [`ImageKitClientImpl`](image-kit-java-core/src/main/kotlin/io/imagekit/client/ImageKitClientImpl.kt) or [`ImageKitClientAsyncImpl`](image-kit-java-core/src/main/kotlin/io/imagekit/client/ImageKitClientAsyncImpl.kt), similarly to [`ImageKitOkHttpClient`](image-kit-java-client-okhttp/src/main/kotlin/io/imagekit/client/okhttp/ImageKitOkHttpClient.kt) or [`ImageKitOkHttpClientAsync`](image-kit-java-client-okhttp/src/main/kotlin/io/imagekit/client/okhttp/ImageKitOkHttpClientAsync.kt), using your new client class\n\n## Undocumented API functionality\n\nThe SDK is typed for convenient usage of the documented API. However, it also supports working with undocumented or not yet supported parts of the API.\n\n### Parameters\n\nTo set undocumented parameters, call the `putAdditionalHeader`, `putAdditionalQueryParam`, or `putAdditionalBodyProperty` methods on any `Params` class:\n\n```java\nimport io.imagekit.core.JsonValue;\nimport io.imagekit.models.files.FileUploadParams;\n\nFileUploadParams params = FileUploadParams.builder()\n .putAdditionalHeader("Secret-Header", "42")\n .putAdditionalQueryParam("secret_query_param", "42")\n .putAdditionalBodyProperty("secretProperty", JsonValue.from("42"))\n .build();\n```\n\nThese can be accessed on the built object later using the `_additionalHeaders()`, `_additionalQueryParams()`, and `_additionalBodyProperties()` methods.\n\nTo set undocumented parameters on _nested_ headers, query params, or body classes, call the `putAdditionalProperty` method on the nested class:\n\n```java\nimport io.imagekit.core.JsonValue;\nimport io.imagekit.models.files.FileUploadParams;\n\nFileUploadParams params = FileUploadParams.builder()\n .transformation(FileUploadParams.UploadTransformation.builder()\n .putAdditionalProperty("secretProperty", JsonValue.from("42"))\n .build())\n .build();\n```\n\nThese properties can be accessed on the nested built object later using the `_additionalProperties()` method.\n\nTo set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](image-kit-java-core/src/main/kotlin/io/imagekit/core/Values.kt) object to its setter:\n\n```java\nimport io.imagekit.core.JsonValue;\nimport io.imagekit.models.files.FileUploadParams;\n\nFileUploadParams params = FileUploadParams.builder()\n .file(JsonValue.from(42))\n .fileName("file-name.jpg")\n .build();\n```\n\nThe most straightforward way to create a [`JsonValue`](image-kit-java-core/src/main/kotlin/io/imagekit/core/Values.kt) is using its `from(...)` method:\n\n```java\nimport io.imagekit.core.JsonValue;\nimport java.util.List;\nimport java.util.Map;\n\n// Create primitive JSON values\nJsonValue nullValue = JsonValue.from(null);\nJsonValue booleanValue = JsonValue.from(true);\nJsonValue numberValue = JsonValue.from(42);\nJsonValue stringValue = JsonValue.from("Hello World!");\n\n// Create a JSON array value equivalent to `["Hello", "World"]`\nJsonValue arrayValue = JsonValue.from(List.of(\n "Hello", "World"\n));\n\n// Create a JSON object value equivalent to `{ "a": 1, "b": 2 }`\nJsonValue objectValue = JsonValue.from(Map.of(\n "a", 1,\n "b", 2\n));\n\n// Create an arbitrarily nested JSON equivalent to:\n// {\n// "a": [1, 2],\n// "b": [3, 4]\n// }\nJsonValue complexValue = JsonValue.from(Map.of(\n "a", List.of(\n 1, 2\n ),\n "b", List.of(\n 3, 4\n )\n));\n```\n\nNormally a `Builder` class\'s `build` method will throw [`IllegalStateException`](https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html) if any required parameter or property is unset.\n\nTo forcibly omit a required parameter or property, pass [`JsonMissing`](image-kit-java-core/src/main/kotlin/io/imagekit/core/Values.kt):\n\n```java\nimport io.imagekit.core.JsonMissing;\nimport io.imagekit.models.files.FileUploadParams;\n\nFileUploadParams params = FileUploadParams.builder()\n .fileName("fileName")\n .file(JsonMissing.of())\n .build();\n```\n\n### Response properties\n\nTo access undocumented response properties, call the `_additionalProperties()` method:\n\n```java\nimport io.imagekit.core.JsonValue;\nimport java.util.Map;\n\nMap additionalProperties = client.files().upload(params)._additionalProperties();\nJsonValue secretPropertyValue = additionalProperties.get("secretProperty");\n\nString result = secretPropertyValue.accept(new JsonValue.Visitor<>() {\n @Override\n public String visitNull() {\n return "It\'s null!";\n }\n\n @Override\n public String visitBoolean(boolean value) {\n return "It\'s a boolean!";\n }\n\n @Override\n public String visitNumber(Number value) {\n return "It\'s a number!";\n }\n\n // Other methods include `visitMissing`, `visitString`, `visitArray`, and `visitObject`\n // The default implementation of each unimplemented method delegates to `visitDefault`, which throws by default, but can also be overridden\n});\n```\n\nTo access a property\'s raw JSON value, which may be undocumented, call its `_` prefixed method:\n\n```java\nimport io.imagekit.core.JsonField;\nimport java.io.InputStream;\nimport java.util.Optional;\n\nJsonField file = client.files().upload(params)._file();\n\nif (file.isMissing()) {\n // The property is absent from the JSON response\n} else if (file.isNull()) {\n // The property was set to literal null\n} else {\n // Check if value was provided as a string\n // Other methods include `asNumber()`, `asBoolean()`, etc.\n Optional jsonString = file.asString();\n\n // Try to deserialize into a custom type\n MyClass myObject = file.asUnknown().orElseThrow().convert(MyClass.class);\n}\n```\n\n### Response validation\n\nIn rare cases, the API may return a response that doesn\'t match the expected type. For example, the SDK may expect a property to contain a `String`, but the API could return something else.\n\nBy default, the SDK will not throw an exception in this case. It will throw [`ImageKitInvalidDataException`](image-kit-java-core/src/main/kotlin/io/imagekit/errors/ImageKitInvalidDataException.kt) only if you directly access the property.\n\nValidating the response is _not_ forwards compatible with new types from the API for existing fields.\n\nIf you would still prefer to check that the response is completely well-typed upfront, then either call `validate()`:\n\n```java\nimport io.imagekit.models.files.FileUploadResponse;\n\nFileUploadResponse response = client.files().upload(params).validate();\n```\n\nOr configure the method call to validate the response using the `responseValidation` method:\n\n```java\nimport io.imagekit.models.files.FileUploadResponse;\n\nFileUploadResponse response = client.files().upload(\n params, RequestOptions.builder().responseValidation(true).build()\n);\n```\n\nOr configure the default for all method calls at the client level:\n\n```java\nimport io.imagekit.client.ImageKitClient;\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient;\n\nImageKitClient client = ImageKitOkHttpClient.builder()\n .fromEnv()\n .responseValidation(true)\n .build();\n```\n\n## FAQ\n\n### Why don\'t you use plain `enum` classes?\n\nJava `enum` classes are not trivially [forwards compatible](https://www.stainless.com/blog/making-java-enums-forwards-compatible). Using them in the SDK could cause runtime exceptions if the API is updated to respond with a new enum value.\n\n### Why do you represent fields using `JsonField` instead of just plain `T`?\n\nUsing `JsonField` enables a few features:\n\n- Allowing usage of [undocumented API functionality](#undocumented-api-functionality)\n- Lazily [validating the API response against the expected shape](#response-validation)\n- Representing absent vs explicitly null values\n\n### Why don\'t you use [`data` classes](https://kotlinlang.org/docs/data-classes.html)?\n\nIt is not [backwards compatible to add new fields to a data class](https://kotlinlang.org/docs/api-guidelines-backward-compatibility.html#avoid-using-data-classes-in-your-api) and we don\'t want to introduce a breaking change every time we add a field to a class.\n\n### Why don\'t you use checked exceptions?\n\nChecked exceptions are widely considered a mistake in the Java programming language. In fact, they were omitted from Kotlin for this reason.\n\nChecked exceptions:\n\n- Are verbose to handle\n- Encourage error handling at the wrong level of abstraction, where nothing can be done about the error\n- Are tedious to propagate due to the [function coloring problem](https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function)\n- Don\'t play well with lambdas (also due to the function coloring problem)\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/imagekit-developer/imagekit-java/issues) with questions, bugs, or suggestions.\n',
},
{
- language: 'kotlin',
- content:
- '# Image Kit Kotlin API Library\n\n\n[](https://central.sonatype.com/artifact/io.imagekit/image-kit-kotlin/0.0.1)\n[](https://javadoc.io/doc/io.imagekit/image-kit-kotlin/0.0.1)\n\n\nThe Image Kit Kotlin SDK provides convenient access to the [Image Kit REST API](https://imagekit.io/docs/api-reference) from applications written in Kotlin.\n\nThe Image Kit Kotlin SDK is similar to the Image Kit Java SDK but with minor differences that make it more ergonomic for use in Kotlin, such as nullable values instead of `Optional`, `Sequence` instead of `Stream`, and suspend functions instead of `CompletableFuture`.\n\n\n\n## MCP Server\n\nUse the Image Kit MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40imagekit%2Fapi-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBpbWFnZWtpdC9hcGktbWNwIl0sImVudiI6eyJJTUFHRUtJVF9QUklWQVRFX0tFWSI6Ik15IFByaXZhdGUgS2V5IiwiT1BUSU9OQUxfSU1BR0VLSVRfSUdOT1JFU19USElTIjoiTXkgUGFzc3dvcmQiLCJJTUFHRUtJVF9XRUJIT09LX1NFQ1JFVCI6Ik15IFdlYmhvb2sgU2VjcmV0In19)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40imagekit%2Fapi-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40imagekit%2Fapi-mcp%22%5D%2C%22env%22%3A%7B%22IMAGEKIT_PRIVATE_KEY%22%3A%22My%20Private%20Key%22%2C%22OPTIONAL_IMAGEKIT_IGNORES_THIS%22%3A%22My%20Password%22%2C%22IMAGEKIT_WEBHOOK_SECRET%22%3A%22My%20Webhook%20Secret%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\nThe REST API documentation can be found on [imagekit.io](https://imagekit.io/docs/api-reference). KDocs are available on [javadoc.io](https://javadoc.io/doc/io.imagekit/image-kit-kotlin/0.0.1).\n\n## Installation\n\n### Gradle\n\n~~~kotlin\nimplementation("io.imagekit:image-kit-kotlin:0.0.1")\n~~~\n\n### Maven\n\n~~~xml\n\n io.imagekit\n image-kit-kotlin\n 0.0.1\n\n~~~\n\n## Requirements\n\nThis library requires Java 8 or later.\n\n## Usage\n\n```kotlin\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.files.FileUploadParams\nimport io.imagekit.models.files.FileUploadResponse\nimport java.io.ByteArrayInputStream\n\n// Configures using the `imagekit.imagekitPrivateKey`, `imagekit.optionalImagekitIgnoresThis`, `imagekit.imagekitWebhookSecret` and `imagekit.baseUrl` system properties\n// Or configures using the `IMAGEKIT_PRIVATE_KEY`, `OPTIONAL_IMAGEKIT_IGNORES_THIS`, `IMAGEKIT_WEBHOOK_SECRET` and `IMAGE_KIT_BASE_URL` environment variables\nval client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\nval params: FileUploadParams = FileUploadParams.builder()\n .file("https://www.example.com/public-url.jpg".byteInputStream())\n .fileName("file-name.jpg")\n .build()\nval response: FileUploadResponse = client.files().upload(params)\n```\n\n## Client configuration\n\nConfigure the client using system properties or environment variables:\n\n```kotlin\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\n\n// Configures using the `imagekit.imagekitPrivateKey`, `imagekit.optionalImagekitIgnoresThis`, `imagekit.imagekitWebhookSecret` and `imagekit.baseUrl` system properties\n// Or configures using the `IMAGEKIT_PRIVATE_KEY`, `OPTIONAL_IMAGEKIT_IGNORES_THIS`, `IMAGEKIT_WEBHOOK_SECRET` and `IMAGE_KIT_BASE_URL` environment variables\nval client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n```\n\nOr manually:\n\n```kotlin\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\n\nval client: ImageKitClient = ImageKitOkHttpClient.builder()\n .privateKey("My Private Key")\n .password("My Password")\n .build()\n```\n\nOr using a combination of the two approaches:\n\n```kotlin\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\n\nval client: ImageKitClient = ImageKitOkHttpClient.builder()\n // Configures using the `imagekit.imagekitPrivateKey`, `imagekit.optionalImagekitIgnoresThis`, `imagekit.imagekitWebhookSecret` and `imagekit.baseUrl` system properties\n // Or configures using the `IMAGEKIT_PRIVATE_KEY`, `OPTIONAL_IMAGEKIT_IGNORES_THIS`, `IMAGEKIT_WEBHOOK_SECRET` and `IMAGE_KIT_BASE_URL` environment variables\n .fromEnv()\n .privateKey("My Private Key")\n .build()\n```\n\nSee this table for the available options:\n\n| Setter | System property | Environment variable | Required | Default value |\n| --------------- | -------------------------------------- | -------------------------------- | -------- | --------------------------- |\n| `privateKey` | `imagekit.imagekitPrivateKey` | `IMAGEKIT_PRIVATE_KEY` | true | - |\n| `password` | `imagekit.optionalImagekitIgnoresThis` | `OPTIONAL_IMAGEKIT_IGNORES_THIS` | false | `"do_not_set"` |\n| `webhookSecret` | `imagekit.imagekitWebhookSecret` | `IMAGEKIT_WEBHOOK_SECRET` | false | - |\n| `baseUrl` | `imagekit.baseUrl` | `IMAGE_KIT_BASE_URL` | true | `"https://api.imagekit.io"` |\n\nSystem properties take precedence over environment variables.\n\n> [!TIP]\n> Don\'t create more than one client in the same application. Each client has a connection pool and\n> thread pools, which are more efficient to share between requests.\n\n### Modifying configuration\n\nTo temporarily use a modified client configuration, while reusing the same connection and thread pools, call `withOptions()` on any client or service:\n\n```kotlin\nimport io.imagekit.client.ImageKitClient\n\nval clientWithOptions: ImageKitClient = client.withOptions {\n it.baseUrl("https://example.com")\n it.maxRetries(42)\n}\n```\n\nThe `withOptions()` method does not affect the original client or service.\n\n## Requests and responses\n\nTo send a request to the Image Kit API, build an instance of some `Params` class and pass it to the corresponding client method. When the response is received, it will be deserialized into an instance of a Kotlin class.\n\nFor example, `client.files().upload(...)` should be called with an instance of `FileUploadParams`, and it will return an instance of `FileUploadResponse`.\n\n## Immutability\n\nEach class in the SDK has an associated [builder](https://blogs.oracle.com/javamagazine/post/exploring-joshua-blochs-builder-design-pattern-in-java) or factory method for constructing it.\n\nEach class is [immutable](https://docs.oracle.com/javase/tutorial/essential/concurrency/immutable.html) once constructed. If the class has an associated builder, then it has a `toBuilder()` method, which can be used to convert it back to a builder for making a modified copy.\n\nBecause each class is immutable, builder modification will _never_ affect already built class instances.\n\n## Asynchronous execution\n\nThe default client is synchronous. To switch to asynchronous execution, call the `async()` method:\n\n```kotlin\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.models.files.FileUploadParams\nimport io.imagekit.models.files.FileUploadResponse\nimport java.io.ByteArrayInputStream\n\n// Configures using the `imagekit.imagekitPrivateKey`, `imagekit.optionalImagekitIgnoresThis`, `imagekit.imagekitWebhookSecret` and `imagekit.baseUrl` system properties\n// Or configures using the `IMAGEKIT_PRIVATE_KEY`, `OPTIONAL_IMAGEKIT_IGNORES_THIS`, `IMAGEKIT_WEBHOOK_SECRET` and `IMAGE_KIT_BASE_URL` environment variables\nval client: ImageKitClient = ImageKitOkHttpClient.fromEnv()\n\nval params: FileUploadParams = FileUploadParams.builder()\n .file("https://www.example.com/public-url.jpg".byteInputStream())\n .fileName("file-name.jpg")\n .build()\nval response: FileUploadResponse = client.async().files().upload(params)\n```\n\nOr create an asynchronous client from the beginning:\n\n```kotlin\nimport io.imagekit.client.ImageKitClientAsync\nimport io.imagekit.client.okhttp.ImageKitOkHttpClientAsync\nimport io.imagekit.models.files.FileUploadParams\nimport io.imagekit.models.files.FileUploadResponse\nimport java.io.ByteArrayInputStream\n\n// Configures using the `imagekit.imagekitPrivateKey`, `imagekit.optionalImagekitIgnoresThis`, `imagekit.imagekitWebhookSecret` and `imagekit.baseUrl` system properties\n// Or configures using the `IMAGEKIT_PRIVATE_KEY`, `OPTIONAL_IMAGEKIT_IGNORES_THIS`, `IMAGEKIT_WEBHOOK_SECRET` and `IMAGE_KIT_BASE_URL` environment variables\nval client: ImageKitClientAsync = ImageKitOkHttpClientAsync.fromEnv()\n\nval params: FileUploadParams = FileUploadParams.builder()\n .file("https://www.example.com/public-url.jpg".byteInputStream())\n .fileName("file-name.jpg")\n .build()\nval response: FileUploadResponse = client.files().upload(params)\n```\n\nThe asynchronous client supports the same options as the synchronous one, except most methods are [suspending](https://kotlinlang.org/docs/coroutines-guide.html).\n\n\n\n## File uploads\n\nThe SDK defines methods that accept files.\n\nTo upload a file, pass a [`Path`](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html):\n\n```kotlin\nimport io.imagekit.models.files.FileUploadParams\nimport io.imagekit.models.files.FileUploadResponse\nimport java.nio.file.Paths\n\nval params: FileUploadParams = FileUploadParams.builder()\n .fileName("fileName")\n .file(Paths.get("/path/to/file"))\n .build()\nval response: FileUploadResponse = client.files().upload(params)\n```\n\nOr an arbitrary [`InputStream`](https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html):\n\n```kotlin\nimport io.imagekit.models.files.FileUploadParams\nimport io.imagekit.models.files.FileUploadResponse\nimport java.net.URL\n\nval params: FileUploadParams = FileUploadParams.builder()\n .fileName("fileName")\n .file(URL("https://example.com//path/to/file").openStream())\n .build()\nval response: FileUploadResponse = client.files().upload(params)\n```\n\nOr a `ByteArray`:\n\n```kotlin\nimport io.imagekit.models.files.FileUploadParams\nimport io.imagekit.models.files.FileUploadResponse\n\nval params: FileUploadParams = FileUploadParams.builder()\n .fileName("fileName")\n .file("content".toByteArray())\n .build()\nval response: FileUploadResponse = client.files().upload(params)\n```\n\nNote that when passing a non-`Path` its filename is unknown so it will not be included in the request. To manually set a filename, pass a [`MultipartField`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/core/Values.kt):\n\n```kotlin\nimport io.imagekit.core.MultipartField\nimport io.imagekit.models.files.FileUploadParams\nimport io.imagekit.models.files.FileUploadResponse\nimport java.io.InputStream\nimport java.net.URL\n\nval params: FileUploadParams = FileUploadParams.builder()\n .fileName("fileName")\n .file(MultipartField.builder()\n .value(URL("https://example.com//path/to/file").openStream())\n .filename("/path/to/file")\n .build())\n .build()\nval response: FileUploadResponse = client.files().upload(params)\n```\n\n\n\n## Raw responses\n\nThe SDK defines methods that deserialize responses into instances of Kotlin classes. However, these methods don\'t provide access to the response headers, status code, or the raw response body.\n\nTo access this data, prefix any HTTP method call on a client or service with `withRawResponse()`:\n\n```kotlin\nimport io.imagekit.core.http.Headers\nimport io.imagekit.core.http.HttpResponseFor\nimport io.imagekit.models.files.FileUploadParams\nimport io.imagekit.models.files.FileUploadResponse\nimport java.io.ByteArrayInputStream\n\nval params: FileUploadParams = FileUploadParams.builder()\n .file("https://www.example.com/public-url.jpg".byteInputStream())\n .fileName("file-name.jpg")\n .build()\nval response: HttpResponseFor = client.files().withRawResponse().upload(params)\n\nval statusCode: Int = response.statusCode()\nval headers: Headers = response.headers()\n```\n\nYou can still deserialize the response into an instance of a Kotlin class if needed:\n\n```kotlin\nimport io.imagekit.models.files.FileUploadResponse\n\nval parsedResponse: FileUploadResponse = response.parse()\n```\n\n## Error handling\n\nThe SDK throws custom unchecked exception types:\n\n- [`ImageKitServiceException`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/errors/ImageKitServiceException.kt): Base class for HTTP errors. See this table for which exception subclass is thrown for each HTTP status code:\n\n | Status | Exception |\n | ------ | -------------------------------------------------- |\n | 400 | [`BadRequestException`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/errors/BadRequestException.kt) |\n | 401 | [`UnauthorizedException`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/errors/UnauthorizedException.kt) |\n | 403 | [`PermissionDeniedException`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/errors/PermissionDeniedException.kt) |\n | 404 | [`NotFoundException`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/errors/NotFoundException.kt) |\n | 422 | [`UnprocessableEntityException`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/errors/UnprocessableEntityException.kt) |\n | 429 | [`RateLimitException`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/errors/RateLimitException.kt) |\n | 5xx | [`InternalServerException`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/errors/InternalServerException.kt) |\n | others | [`UnexpectedStatusCodeException`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/errors/UnexpectedStatusCodeException.kt) |\n\n- [`ImageKitIoException`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/errors/ImageKitIoException.kt): I/O networking errors.\n\n- [`ImageKitRetryableException`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/errors/ImageKitRetryableException.kt): Generic error indicating a failure that could be retried by the client.\n\n- [`ImageKitInvalidDataException`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/errors/ImageKitInvalidDataException.kt): Failure to interpret successfully parsed data. For example, when accessing a property that\'s supposed to be required, but the API unexpectedly omitted it from the response.\n\n- [`ImageKitException`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/errors/ImageKitException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class.\n\n\n\n## Logging\n\nEnable logging by setting the `IMAGE_KIT_LOG` environment variable to `info`:\n\n```sh\nexport IMAGE_KIT_LOG=info\n```\n\nOr to `debug` for more verbose logging:\n\n```sh\nexport IMAGE_KIT_LOG=debug\n```\n\nOr configure the client manually using the `logLevel` method:\n\n```kotlin\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.core.LogLevel\n\nval client: ImageKitClient = ImageKitOkHttpClient.builder()\n .fromEnv()\n .logLevel(LogLevel.INFO)\n .build()\n```\n\n## ProGuard and R8\n\nAlthough the SDK uses reflection, it is still usable with [ProGuard](https://github.com/Guardsquare/proguard) and [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization) because `image-kit-kotlin-core` is published with a [configuration file](image-kit-kotlin-core/src/main/resources/META-INF/proguard/image-kit-kotlin-core.pro) containing [keep rules](https://www.guardsquare.com/manual/configuration/usage).\n\nProGuard and R8 should automatically detect and use the published rules, but you can also manually copy the keep rules if necessary.\n\n\n\n\n\n## Jackson\n\nThe SDK depends on [Jackson](https://github.com/FasterXML/jackson) for JSON serialization/deserialization. It is compatible with version 2.13.4 or higher, but depends on version 2.18.2 by default.\n\nThe SDK throws an exception if it detects an incompatible Jackson version at runtime (e.g. if the default version was overridden in your Maven or Gradle config).\n\nIf the SDK threw an exception, but you\'re _certain_ the version is compatible, then disable the version check using the `checkJacksonVersionCompatibility` on [`ImageKitOkHttpClient`](image-kit-kotlin-client-okhttp/src/main/kotlin/io/imagekit/client/okhttp/ImageKitOkHttpClient.kt) or [`ImageKitOkHttpClientAsync`](image-kit-kotlin-client-okhttp/src/main/kotlin/io/imagekit/client/okhttp/ImageKitOkHttpClientAsync.kt).\n\n> [!CAUTION]\n> We make no guarantee that the SDK works correctly when the Jackson version check is disabled.\n\nAlso note that there are bugs in older Jackson versions that can affect the SDK. We don\'t work around all Jackson bugs ([example](https://github.com/FasterXML/jackson-databind/issues/3240)) and expect users to upgrade Jackson for those instead.\n\n## Network options\n\n### Retries\n\nThe SDK automatically retries 2 times by default, with a short exponential backoff between requests.\n\nOnly the following error types are retried:\n- Connection errors (for example, due to a network connectivity problem)\n- 408 Request Timeout\n- 409 Conflict\n- 429 Rate Limit\n- 5xx Internal\n\nThe API may also explicitly instruct the SDK to retry or not retry a request.\n\nTo set a custom number of retries, configure the client using the `maxRetries` method:\n\n```kotlin\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\n\nval client: ImageKitClient = ImageKitOkHttpClient.builder()\n .fromEnv()\n .maxRetries(4)\n .build()\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default.\n\nTo set a custom timeout, configure the method call using the `timeout` method:\n\n```kotlin\nimport io.imagekit.models.files.FileUploadResponse\n\nval response: FileUploadResponse = client.files().upload(\n params, RequestOptions.builder().timeout(Duration.ofSeconds(30)).build()\n)\n```\n\nOr configure the default for all method calls at the client level:\n\n```kotlin\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport java.time.Duration\n\nval client: ImageKitClient = ImageKitOkHttpClient.builder()\n .fromEnv()\n .timeout(Duration.ofSeconds(30))\n .build()\n```\n\n### Proxies\n\nTo route requests through a proxy, configure the client using the `proxy` method:\n\n```kotlin\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport java.net.InetSocketAddress\nimport java.net.Proxy\n\nval client: ImageKitClient = ImageKitOkHttpClient.builder()\n .fromEnv()\n .proxy(Proxy(\n Proxy.Type.HTTP, InetSocketAddress(\n "https://example.com", 8080\n )\n ))\n .build()\n```\n\nIf the proxy responds with `407 Proxy Authentication Required`, supply credentials by also configuring `proxyAuthenticator`:\n\n```kotlin\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport io.imagekit.core.http.ProxyAuthenticator\n\nval client: ImageKitClient = ImageKitOkHttpClient.builder()\n .fromEnv()\n .proxy(...)\n // Or a custom implementation of `ProxyAuthenticator`.\n .proxyAuthenticator(ProxyAuthenticator.basic("username", "password"))\n .build()\n```\n\n### Connection pooling\n\nTo customize the underlying OkHttp connection pool, configure the client using the `maxIdleConnections` and `keepAliveDuration` methods:\n\n```kotlin\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\nimport java.time.Duration\n\nval client: ImageKitClient = ImageKitOkHttpClient.builder()\n .fromEnv()\n // If `maxIdleConnections` is set, then `keepAliveDuration` must be set, and vice versa.\n .maxIdleConnections(10)\n .keepAliveDuration(Duration.ofMinutes(2))\n .build()\n```\n\nIf both options are unset, OkHttp\'s default connection pool settings are used.\n\n### HTTPS\n\n> [!NOTE]\n> Most applications should not call these methods, and instead use the system defaults. The defaults include\n> special optimizations that can be lost if the implementations are modified.\n\nTo configure how HTTPS connections are secured, configure the client using the `sslSocketFactory`, `trustManager`, and `hostnameVerifier` methods:\n\n```kotlin\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\n\nval client: ImageKitClient = ImageKitOkHttpClient.builder()\n .fromEnv()\n // If `sslSocketFactory` is set, then `trustManager` must be set, and vice versa.\n .sslSocketFactory(yourSSLSocketFactory)\n .trustManager(yourTrustManager)\n .hostnameVerifier(yourHostnameVerifier)\n .build()\n```\n\n\n\n### Custom HTTP client\n\nThe SDK consists of three artifacts:\n- `image-kit-kotlin-core`\n - Contains core SDK logic\n - Does not depend on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`ImageKitClient`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/client/ImageKitClient.kt), [`ImageKitClientAsync`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/client/ImageKitClientAsync.kt), [`ImageKitClientImpl`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/client/ImageKitClientImpl.kt), and [`ImageKitClientAsyncImpl`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/client/ImageKitClientAsyncImpl.kt), all of which can work with any HTTP client\n- `image-kit-kotlin-client-okhttp`\n - Depends on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`ImageKitOkHttpClient`](image-kit-kotlin-client-okhttp/src/main/kotlin/io/imagekit/client/okhttp/ImageKitOkHttpClient.kt) and [`ImageKitOkHttpClientAsync`](image-kit-kotlin-client-okhttp/src/main/kotlin/io/imagekit/client/okhttp/ImageKitOkHttpClientAsync.kt), which provide a way to construct [`ImageKitClientImpl`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/client/ImageKitClientImpl.kt) and [`ImageKitClientAsyncImpl`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/client/ImageKitClientAsyncImpl.kt), respectively, using OkHttp\n- `image-kit-kotlin`\n - Depends on and exposes the APIs of both `image-kit-kotlin-core` and `image-kit-kotlin-client-okhttp`\n - Does not have its own logic\n\nThis structure allows replacing the SDK\'s default HTTP client without pulling in unnecessary dependencies.\n\n#### Customized [`OkHttpClient`](https://square.github.io/okhttp/3.x/okhttp/okhttp3/OkHttpClient.html)\n\n> [!TIP]\n> Try the available [network options](#network-options) before replacing the default client.\n\nTo use a customized `OkHttpClient`:\n\n1. Replace your [`image-kit-kotlin` dependency](#installation) with `image-kit-kotlin-core`\n2. Copy `image-kit-kotlin-client-okhttp`\'s [`OkHttpClient`](image-kit-kotlin-client-okhttp/src/main/kotlin/io/imagekit/client/okhttp/OkHttpClient.kt) class into your code and customize it\n3. Construct [`ImageKitClientImpl`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/client/ImageKitClientImpl.kt) or [`ImageKitClientAsyncImpl`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/client/ImageKitClientAsyncImpl.kt), similarly to [`ImageKitOkHttpClient`](image-kit-kotlin-client-okhttp/src/main/kotlin/io/imagekit/client/okhttp/ImageKitOkHttpClient.kt) or [`ImageKitOkHttpClientAsync`](image-kit-kotlin-client-okhttp/src/main/kotlin/io/imagekit/client/okhttp/ImageKitOkHttpClientAsync.kt), using your customized client\n\n### Completely custom HTTP client\n\nTo use a completely custom HTTP client:\n\n1. Replace your [`image-kit-kotlin` dependency](#installation) with `image-kit-kotlin-core`\n2. Write a class that implements the [`HttpClient`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/core/http/HttpClient.kt) interface\n3. Construct [`ImageKitClientImpl`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/client/ImageKitClientImpl.kt) or [`ImageKitClientAsyncImpl`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/client/ImageKitClientAsyncImpl.kt), similarly to [`ImageKitOkHttpClient`](image-kit-kotlin-client-okhttp/src/main/kotlin/io/imagekit/client/okhttp/ImageKitOkHttpClient.kt) or [`ImageKitOkHttpClientAsync`](image-kit-kotlin-client-okhttp/src/main/kotlin/io/imagekit/client/okhttp/ImageKitOkHttpClientAsync.kt), using your new client class\n\n## Undocumented API functionality\n\nThe SDK is typed for convenient usage of the documented API. However, it also supports working with undocumented or not yet supported parts of the API.\n\n### Parameters\n\nTo set undocumented parameters, call the `putAdditionalHeader`, `putAdditionalQueryParam`, or `putAdditionalBodyProperty` methods on any `Params` class:\n\n```kotlin\nimport io.imagekit.core.JsonValue\nimport io.imagekit.models.files.FileUploadParams\n\nval params: FileUploadParams = FileUploadParams.builder()\n .putAdditionalHeader("Secret-Header", "42")\n .putAdditionalQueryParam("secret_query_param", "42")\n .putAdditionalBodyProperty("secretProperty", JsonValue.from("42"))\n .build()\n```\n\nThese can be accessed on the built object later using the `_additionalHeaders()`, `_additionalQueryParams()`, and `_additionalBodyProperties()` methods.\n\nTo set undocumented parameters on _nested_ headers, query params, or body classes, call the `putAdditionalProperty` method on the nested class:\n\n```kotlin\nimport io.imagekit.core.JsonValue\nimport io.imagekit.models.files.FileUploadParams\n\nval params: FileUploadParams = FileUploadParams.builder()\n .transformation(FileUploadParams.UploadTransformation.builder()\n .putAdditionalProperty("secretProperty", JsonValue.from("42"))\n .build())\n .build()\n```\n\nThese properties can be accessed on the nested built object later using the `_additionalProperties()` method.\n\nTo set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/core/Values.kt) object to its setter:\n\n```kotlin\nimport io.imagekit.core.JsonValue\nimport io.imagekit.models.files.FileUploadParams\n\nval params: FileUploadParams = FileUploadParams.builder()\n .file(JsonValue.from(42))\n .fileName("file-name.jpg")\n .build()\n```\n\nThe most straightforward way to create a [`JsonValue`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/core/Values.kt) is using its `from(...)` method:\n\n```kotlin\nimport io.imagekit.core.JsonValue\n\n// Create primitive JSON values\nval nullValue: JsonValue = JsonValue.from(null)\nval booleanValue: JsonValue = JsonValue.from(true)\nval numberValue: JsonValue = JsonValue.from(42)\nval stringValue: JsonValue = JsonValue.from("Hello World!")\n\n// Create a JSON array value equivalent to `["Hello", "World"]`\nval arrayValue: JsonValue = JsonValue.from(listOf(\n "Hello", "World"\n))\n\n// Create a JSON object value equivalent to `{ "a": 1, "b": 2 }`\nval objectValue: JsonValue = JsonValue.from(mapOf(\n "a" to 1, "b" to 2\n))\n\n// Create an arbitrarily nested JSON equivalent to:\n// {\n// "a": [1, 2],\n// "b": [3, 4]\n// }\nval complexValue: JsonValue = JsonValue.from(mapOf(\n "a" to listOf(\n 1, 2\n ), "b" to listOf(\n 3, 4\n )\n))\n```\n\nNormally a `Builder` class\'s `build` method will throw [`IllegalStateException`](https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html) if any required parameter or property is unset.\n\nTo forcibly omit a required parameter or property, pass [`JsonMissing`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/core/Values.kt):\n\n```kotlin\nimport io.imagekit.core.JsonMissing\nimport io.imagekit.models.files.FileUploadParams\n\nval params: FileUploadParams = FileUploadParams.builder()\n .fileName("fileName")\n .file(JsonMissing.of())\n .build()\n```\n\n### Response properties\n\nTo access undocumented response properties, call the `_additionalProperties()` method:\n\n```kotlin\nimport io.imagekit.core.JsonBoolean\nimport io.imagekit.core.JsonNull\nimport io.imagekit.core.JsonNumber\nimport io.imagekit.core.JsonValue\n\nval additionalProperties: Map = client.files().upload(params)._additionalProperties()\nval secretPropertyValue: JsonValue = additionalProperties.get("secretProperty")\n\nval result = when (secretPropertyValue) {\n is JsonNull -> "It\'s null!"\n is JsonBoolean -> "It\'s a boolean!"\n is JsonNumber -> "It\'s a number!"\n // Other types include `JsonMissing`, `JsonString`, `JsonArray`, and `JsonObject`\n else -> "It\'s something else!"\n}\n```\n\nTo access a property\'s raw JSON value, which may be undocumented, call its `_` prefixed method:\n\n```kotlin\nimport io.imagekit.core.JsonField\nimport java.io.InputStream\n\nval file: JsonField = client.files().upload(params)._file()\n\nif (file.isMissing()) {\n // The property is absent from the JSON response\n} else if (file.isNull()) {\n // The property was set to literal null\n} else {\n // Check if value was provided as a string\n // Other methods include `asNumber()`, `asBoolean()`, etc.\n val jsonString: String? = file.asString();\n\n // Try to deserialize into a custom type\n val myObject: MyClass = file.asUnknown()!!.convert(MyClass::class.java)\n}\n```\n\n### Response validation\n\nIn rare cases, the API may return a response that doesn\'t match the expected type. For example, the SDK may expect a property to contain a `String`, but the API could return something else.\n\nBy default, the SDK will not throw an exception in this case. It will throw [`ImageKitInvalidDataException`](image-kit-kotlin-core/src/main/kotlin/io/imagekit/errors/ImageKitInvalidDataException.kt) only if you directly access the property.\n\nValidating the response is _not_ forwards compatible with new types from the API for existing fields.\n\nIf you would still prefer to check that the response is completely well-typed upfront, then either call `validate()`:\n\n```kotlin\nimport io.imagekit.models.files.FileUploadResponse\n\nval response: FileUploadResponse = client.files().upload(params).validate()\n```\n\nOr configure the method call to validate the response using the `responseValidation` method:\n\n```kotlin\nimport io.imagekit.models.files.FileUploadResponse\n\nval response: FileUploadResponse = client.files().upload(\n params, RequestOptions.builder().responseValidation(true).build()\n)\n```\n\nOr configure the default for all method calls at the client level:\n\n```kotlin\nimport io.imagekit.client.ImageKitClient\nimport io.imagekit.client.okhttp.ImageKitOkHttpClient\n\nval client: ImageKitClient = ImageKitOkHttpClient.builder()\n .fromEnv()\n .responseValidation(true)\n .build()\n```\n\n## FAQ\n\n### Why don\'t you use plain `enum` classes?\n\nKotlin `enum` classes are not trivially [forwards compatible](https://www.stainless.com/blog/making-java-enums-forwards-compatible). Using them in the SDK could cause runtime exceptions if the API is updated to respond with a new enum value.\n\n### Why do you represent fields using `JsonField` instead of just plain `T`?\n\nUsing `JsonField` enables a few features:\n\n- Allowing usage of [undocumented API functionality](#undocumented-api-functionality)\n- Lazily [validating the API response against the expected shape](#response-validation)\n- Representing absent vs explicitly null values\n\n### Why don\'t you use [`data` classes](https://kotlinlang.org/docs/data-classes.html)?\n\nIt is not [backwards compatible to add new fields to a data class](https://kotlinlang.org/docs/api-guidelines-backward-compatibility.html#avoid-using-data-classes-in-your-api) and we don\'t want to introduce a breaking change every time we add a field to a class.\n\n### Why don\'t you use checked exceptions?\n\nChecked exceptions are widely considered a mistake in the Java programming language. In fact, they were omitted from Kotlin for this reason.\n\nChecked exceptions:\n\n- Are verbose to handle\n- Encourage error handling at the wrong level of abstraction, where nothing can be done about the error\n- Are tedious to propagate due to the [function coloring problem](https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function)\n- Don\'t play well with lambdas (also due to the function coloring problem)\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/imagekit-kotlin/issues) with questions, bugs, or suggestions.\n',
- },
- {
- language: 'php',
- content:
- '# Image Kit PHP API Library\n\nThe Image Kit PHP library provides convenient access to the Image Kit REST API from any PHP 8.1.0+ application.\n\n## Installation\n\nTo use this package, install via Composer by adding the following to your application\'s `composer.json`:\n\n```json\n{\n "repositories": [\n {\n "type": "vcs",\n "url": "git@github.com:stainless-sdks/imagekit-php.git"\n }\n ],\n "require": {\n "imagekit/imagekit": "dev-main"\n }\n}\n```\n\n## Usage\n\n```php\nfiles->upload(\n file: FileParam::fromString(\'https://www.example.com/public-url.jpg\', filename: uniqid(\'file-upload-\', true)),\n fileName: \'file-name.jpg\',\n);\n\nvar_dump($response->videoCodec);\n```',
- },
- {
- language: 'python',
+ language: 'go',
content:
- '# Image Kit Python API library\n\n\n[)](https://pypi.org/project/imagekitio/)\n\nThe Image Kit Python library provides convenient access to the Image Kit REST API from any Python 3.9+\napplication. The library includes type definitions for all request params and response fields,\nand offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).\n\n\n\n\n\n## MCP Server\n\nUse the Image Kit MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40imagekit%2Fapi-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBpbWFnZWtpdC9hcGktbWNwIl0sImVudiI6eyJJTUFHRUtJVF9QUklWQVRFX0tFWSI6Ik15IFByaXZhdGUgS2V5IiwiT1BUSU9OQUxfSU1BR0VLSVRfSUdOT1JFU19USElTIjoiTXkgUGFzc3dvcmQiLCJJTUFHRUtJVF9XRUJIT09LX1NFQ1JFVCI6Ik15IFdlYmhvb2sgU2VjcmV0In19)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40imagekit%2Fapi-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40imagekit%2Fapi-mcp%22%5D%2C%22env%22%3A%7B%22IMAGEKIT_PRIVATE_KEY%22%3A%22My%20Private%20Key%22%2C%22OPTIONAL_IMAGEKIT_IGNORES_THIS%22%3A%22My%20Password%22%2C%22IMAGEKIT_WEBHOOK_SECRET%22%3A%22My%20Webhook%20Secret%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\nThe REST API documentation can be found on [imagekit.io](https://imagekit.io/docs/api-reference). The full API of this library can be found in [api.md](api.md).\n\n## Installation\n\n```sh\n# install from PyPI\npip install imagekitio\n```\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```python\nimport os\nfrom imagekitio import ImageKit\n\nclient = ImageKit(\n private_key=os.environ.get("IMAGEKIT_PRIVATE_KEY"), # This is the default and can be omitted\n password=os.environ.get("OPTIONAL_IMAGEKIT_IGNORES_THIS"), # This is the default and can be omitted\n)\n\nresponse = client.files.upload(\n file=b"https://www.example.com/public-url.jpg",\n file_name="file-name.jpg",\n)\nprint(response.video_codec)\n```\n\nWhile you can provide a `private_key` keyword argument,\nwe recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)\nto add `IMAGEKIT_PRIVATE_KEY="My Private Key"` to your `.env` file\nso that your Private Key is not stored in source control.\n\n## Async usage\n\nSimply import `AsyncImageKit` instead of `ImageKit` and use `await` with each API call:\n\n```python\nimport os\nimport asyncio\nfrom imagekitio import AsyncImageKit\n\nclient = AsyncImageKit(\n private_key=os.environ.get("IMAGEKIT_PRIVATE_KEY"), # This is the default and can be omitted\n password=os.environ.get("OPTIONAL_IMAGEKIT_IGNORES_THIS"), # This is the default and can be omitted\n)\n\nasync def main() -> None:\n response = await client.files.upload(\n file=b"https://www.example.com/public-url.jpg",\n file_name="file-name.jpg",\n )\n print(response.video_codec)\n\nasyncio.run(main())\n```\n\nFunctionality between the synchronous and asynchronous clients is otherwise identical.\n\n### With aiohttp\n\nBy default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.\n\nYou can enable this by installing `aiohttp`:\n\n```sh\n# install from PyPI\npip install imagekitio[aiohttp]\n```\n\nThen you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:\n\n```python\nimport os\nimport asyncio\nfrom imagekitio import DefaultAioHttpClient\nfrom imagekitio import AsyncImageKit\n\nasync def main() -> None:\n async with AsyncImageKit(\n private_key=os.environ.get("IMAGEKIT_PRIVATE_KEY"), # This is the default and can be omitted\n password=os.environ.get("OPTIONAL_IMAGEKIT_IGNORES_THIS"), # This is the default and can be omitted\n http_client=DefaultAioHttpClient(),\n) as client:\n response = await client.files.upload(\n file=b"https://www.example.com/public-url.jpg",\n file_name="file-name.jpg",\n )\n print(response.video_codec)\n\nasyncio.run(main())\n```\n\n\n\n## Using types\n\nNested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:\n\n- Serializing back into JSON, `model.to_json()`\n- Converting to a dictionary, `model.to_dict()`\n\nTyped requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.\n\n\n\n## Nested params\n\nNested parameters are dictionaries, typed using `TypedDict`, for example:\n\n```python\nfrom imagekitio import ImageKit\n\nclient = ImageKit()\n\nresponse = client.files.upload(\n file=b"Example data",\n file_name="fileName",\n transformation={\n "post": [{\n "type": "thumbnail",\n "value": "w-150,h-150",\n }, {\n "protocol": "dash",\n "type": "abs",\n "value": "sr-240_360_480_720_1080",\n }]\n },\n)\nprint(response.transformation)\n```\n\n## File uploads\n\nRequest parameters that correspond to file uploads can be passed as `bytes`, or a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.\n\n```python\nfrom pathlib import Path\nfrom imagekitio import ImageKit\n\nclient = ImageKit()\n\nclient.files.upload(\n file=Path("/path/to/file"),\n file_name="fileName",\n)\n```\n\nThe async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.\n\n## Handling errors\n\nWhen the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `imagekitio.APIConnectionError` is raised.\n\nWhen the API returns a non-success status code (that is, 4xx or 5xx\nresponse), a subclass of `imagekitio.APIStatusError` is raised, containing `status_code` and `response` properties.\n\nAll errors inherit from `imagekitio.APIError`.\n\n```python\nimport imagekitio\nfrom imagekitio import ImageKit\n\nclient = ImageKit()\n\ntry:\n client.files.upload(\n file=b"https://www.example.com/public-url.jpg",\n file_name="file-name.jpg",\n )\nexcept imagekitio.APIConnectionError as e:\n print("The server could not be reached")\n print(e.__cause__) # an underlying Exception, likely raised within httpx.\nexcept imagekitio.RateLimitError as e:\n print("A 429 status code was received; we should back off a bit.")\nexcept imagekitio.APIStatusError as e:\n print("Another non-200-range status code was received")\n print(e.status_code)\n print(e.response)\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors are automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors are all retried by default.\n\nYou can use the `max_retries` option to configure or disable retry settings:\n\n```python\nfrom imagekitio import ImageKit\n\n# Configure the default for all requests:\nclient = ImageKit(\n # default is 2\n max_retries=0,\n)\n\n# Or, configure per-request:\nclient.with_options(max_retries = 5).files.upload(\n file=b"https://www.example.com/public-url.jpg",\n file_name="file-name.jpg",\n)\n```\n\n### Timeouts\n\nBy default requests time out after 1 minute. You can configure this with a `timeout` option,\nwhich accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:\n\n```python\nfrom imagekitio import ImageKit\n\n# Configure the default for all requests:\nclient = ImageKit(\n # 20 seconds (default is 1 minute)\n timeout=20.0,\n)\n\n# More granular control:\nclient = ImageKit(\n timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),\n)\n\n# Override per-request:\nclient.with_options(timeout = 5.0).files.upload(\n file=b"https://www.example.com/public-url.jpg",\n file_name="file-name.jpg",\n)\n```\n\nOn timeout, an `APITimeoutError` is thrown.\n\nNote that requests that time out are [retried twice by default](#retries).\n\n\n\n## Advanced\n\n### Logging\n\nWe use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.\n\nYou can enable logging by setting the environment variable `IMAGE_KIT_LOG` to `info`.\n\n```shell\n$ export IMAGE_KIT_LOG=info\n```\n\nOr to `debug` for more verbose logging.\n\n### How to tell whether `None` means `null` or missing\n\nIn an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:\n\n```py\nif response.my_field is None:\n if \'my_field\' not in response.model_fields_set:\n print(\'Got json like {}, without a "my_field" key present at all.\')\n else:\n print(\'Got json like {"my_field": null}.\')\n```\n\n### Accessing raw response data (e.g. headers)\n\nThe "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,\n\n```py\nfrom imagekitio import ImageKit\n\nclient = ImageKit()\nresponse = client.files.with_raw_response.upload(\n file=b"https://www.example.com/public-url.jpg",\n file_name="file-name.jpg",\n)\nprint(response.headers.get(\'X-My-Header\'))\n\nfile = response.parse() # get the object that `files.upload()` would have returned\nprint(file.video_codec)\n```\n\nThese methods return an [`APIResponse`](https://github.com/imagekit-developer/imagekit-python/tree/master/src/imagekitio/_response.py) object.\n\nThe async client returns an [`AsyncAPIResponse`](https://github.com/imagekit-developer/imagekit-python/tree/master/src/imagekitio/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.\n\n#### `.with_streaming_response`\n\nThe above interface eagerly reads the full response body when you make the request, which may not always be what you want.\n\nTo stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.\n\n```python\nwith client.files.with_streaming_response.upload(\n file=b"https://www.example.com/public-url.jpg",\n file_name="file-name.jpg",\n) as response :\n print(response.headers.get(\'X-My-Header\'))\n\n for line in response.iter_lines():\n print(line)\n```\n\nThe context manager is required so that the response will reliably be closed.\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API.\n\nIf you need to access undocumented endpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other\nhttp verbs. Options on the client will be respected (such as retries) when making this request.\n\n```py\nimport httpx\n\nresponse = client.post(\n "/foo",\n cast_to=httpx.Response,\n body={"my_param": True},\n)\n\nprint(response.headers.get("x-foo"))\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You\ncan also get all the extra fields on the Pydantic model as a dict with\n[`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).\n\n### Configuring the HTTP client\n\nYou can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:\n\n- Support for [proxies](https://www.python-httpx.org/advanced/proxies/)\n- Custom [transports](https://www.python-httpx.org/advanced/transports/)\n- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality\n\n```python\nimport httpx\nfrom imagekitio import ImageKit, DefaultHttpxClient\n\nclient = ImageKit(\n # Or use the `IMAGE_KIT_BASE_URL` env var\n base_url="http://my.test.server.example.com:8083",\n http_client=DefaultHttpxClient(proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0")),\n)\n```\n\nYou can also customize the client on a per-request basis by using `with_options()`:\n\n```python\nclient.with_options(http_client=DefaultHttpxClient(...))\n```\n\n### Managing HTTP resources\n\nBy default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.\n\n```py\nfrom imagekitio import ImageKit\n\nwith ImageKit() as client:\n # make requests here\n ...\n\n# HTTP client is now closed\n```\n\n## Versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/imagekit-developer/imagekit-python/issues) with questions, bugs, or suggestions.\n\n### Determining the installed version\n\nIf you\'ve upgraded to the latest version but aren\'t seeing any new features you were expecting then your python environment is likely still using an older version.\n\nYou can determine the version that is being used at runtime with:\n\n```py\nimport imagekitio\nprint(imagekitio.__version__)\n```\n\n## Requirements\n\nPython 3.9 or higher.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
+ '# Image Kit Go API Library\n\n
\n\nThe Image Kit Go library provides convenient access to the [Image Kit REST API](https://imagekit.io/docs/api-reference)\nfrom applications written in Go.\n\n\n\n## MCP Server\n\nUse the Image Kit MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40imagekit%2Fapi-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBpbWFnZWtpdC9hcGktbWNwIl0sImVudiI6eyJJTUFHRUtJVF9QUklWQVRFX0tFWSI6Ik15IFByaXZhdGUgS2V5IiwiT1BUSU9OQUxfSU1BR0VLSVRfSUdOT1JFU19USElTIjoiTXkgUGFzc3dvcmQiLCJJTUFHRUtJVF9XRUJIT09LX1NFQ1JFVCI6Ik15IFdlYmhvb2sgU2VjcmV0In19)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40imagekit%2Fapi-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40imagekit%2Fapi-mcp%22%5D%2C%22env%22%3A%7B%22IMAGEKIT_PRIVATE_KEY%22%3A%22My%20Private%20Key%22%2C%22OPTIONAL_IMAGEKIT_IGNORES_THIS%22%3A%22My%20Password%22%2C%22IMAGEKIT_WEBHOOK_SECRET%22%3A%22My%20Webhook%20Secret%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n\n\n```go\nimport (\n\t"github.com/imagekit-developer/imagekit-go" // imported as SDK_PackageName\n)\n```\n\n\n\nOr to pin the version:\n\n\n\n```sh\ngo get -u \'github.com/imagekit-developer/imagekit-go@v0.0.1\'\n```\n\n\n\n## Requirements\n\nThis library requires Go 1.22+.\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```go\npackage main\n\nimport (\n\t"bytes"\n\t"context"\n\t"fmt"\n\t"io"\n\n\t"github.com/imagekit-developer/imagekit-go"\n\t"github.com/imagekit-developer/imagekit-go/option"\n)\n\nfunc main() {\n\tclient := imagekit.NewClient(\n\t\toption.WithPrivateKey("My Private Key"), // defaults to os.LookupEnv("IMAGEKIT_PRIVATE_KEY")\n\t\toption.WithPassword("My Password"), // defaults to os.LookupEnv("OPTIONAL_IMAGEKIT_IGNORES_THIS")\n\t)\n\tresponse, err := client.Files.Upload(context.TODO(), imagekit.FileUploadParams{\n\t\tFile: io.Reader(bytes.NewBuffer([]byte("https://www.example.com/public-url.jpg"))),\n\t\tFileName: "file-name.jpg",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.VideoCodec)\n}\n\n```\n\n### Request fields\n\nAll request parameters are wrapped in a generic `Field` type,\nwhich we use to distinguish zero values from null or omitted fields.\n\nThis prevents accidentally sending a zero value if you forget a required parameter,\nand enables explicitly sending `null`, `false`, `\'\'`, or `0` on optional parameters.\nAny field not specified is not sent.\n\nTo construct fields with values, use the helpers `String()`, `Int()`, `Float()`, or most commonly, the generic `F[T]()`.\nTo send a null, use `Null[T]()`, and to send a nonconforming value, use `Raw[T](any)`. For example:\n\n```go\nparams := FooParams{\n\tName: SDK_PackageName.F("hello"),\n\n\t// Explicitly send `"description": null`\n\tDescription: SDK_PackageName.Null[string](),\n\n\tPoint: SDK_PackageName.F(SDK_PackageName.Point{\n\t\tX: SDK_PackageName.Int(0),\n\t\tY: SDK_PackageName.Int(1),\n\n\t\t// In cases where the API specifies a given type,\n\t\t// but you want to send something else, use `Raw`:\n\t\tZ: SDK_PackageName.Raw[int64](0.01), // sends a float\n\t}),\n}\n```\n\n### Response objects\n\nAll fields in response structs are value types (not pointers or wrappers).\n\nIf a given field is `null`, not present, or invalid, the corresponding field\nwill simply be its zero value.\n\nAll response structs also include a special `JSON` field, containing more detailed\ninformation about each property, which you can use like so:\n\n```go\nif res.Name == "" {\n\t// true if `"name"` is either not present or explicitly null\n\tres.JSON.Name.IsNull()\n\n\t// true if the `"name"` key was not present in the response JSON at all\n\tres.JSON.Name.IsMissing()\n\n\t// When the API returns data that cannot be coerced to the expected type:\n\tif res.JSON.Name.IsInvalid() {\n\t\traw := res.JSON.Name.Raw()\n\n\t\tlegacyName := struct{\n\t\t\tFirst string `json:"first"`\n\t\t\tLast string `json:"last"`\n\t\t}{}\n\t\tjson.Unmarshal([]byte(raw), &legacyName)\n\t\tname = legacyName.First + " " + legacyName.Last\n\t}\n}\n```\n\nThese `.JSON` structs also include an `Extras` map containing\nany properties in the json response that were not specified\nin the struct. This can be useful for API features not yet\npresent in the SDK.\n\n```go\nbody := res.JSON.ExtraFields["my_unexpected_field"].Raw()\n```\n\n### RequestOptions\n\nThis library uses the functional options pattern. Functions defined in the\n`SDK_PackageOptionName` package return a `RequestOption`, which is a closure that mutates a\n`RequestConfig`. These options can be supplied to the client or at individual\nrequests. For example:\n\n```go\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\t// Adds a header to every request made by the client\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "custom_header_info"),\n)\n\nclient.Files.Upload(context.TODO(), ...,\n\t// Override the header\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "some_other_custom_header_info"),\n\t// Add an undocumented field to the request body, using sjson syntax\n\tSDK_PackageOptionName.WithJSONSet("some.json.path", map[string]string{"my": "object"}),\n)\n```\n\nSee the [full list of request options](https://pkg.go.dev/github.com/imagekit-developer/imagekit-go/SDK_PackageOptionName).\n\n### Pagination\n\nThis library provides some conveniences for working with paginated list endpoints.\n\nYou can use `.ListAutoPaging()` methods to iterate through items across all pages:\n\n\n\nOr you can use simple `.List()` methods to fetch a single page and receive a standard response object\nwith additional helper methods like `.GetNextPage()`, e.g.:\n\n\n\n### Errors\n\nWhen the API returns a non-success status code, we return an error with type\n`*SDK_PackageName.Error`. This contains the `StatusCode`, `*http.Request`, and\n`*http.Response` values of the request, as well as the JSON of the error body\n(much like other response objects in the SDK).\n\nTo handle errors, we recommend that you use the `errors.As` pattern:\n\n```go\n_, err := client.Files.Upload(context.TODO(), imagekit.FileUploadParams{\n\tFile: io.Reader(bytes.NewBuffer([]byte("https://www.example.com/public-url.jpg"))),\n\tFileName: "file-name.jpg",\n})\nif err != nil {\n\tvar apierr *imagekit.Error\n\tif errors.As(err, &apierr) {\n\t\tprintln(string(apierr.DumpRequest(true))) // Prints the serialized HTTP request\n\t\tprintln(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response\n\t}\n\tpanic(err.Error()) // GET "/api/v1/files/upload": 400 Bad Request { ... }\n}\n```\n\nWhen other errors occur, they are returned unwrapped; for example,\nif HTTP transport fails, you might receive `*url.Error` wrapping `*net.OpError`.\n\n### Timeouts\n\nRequests do not time out by default; use context to configure a timeout for a request lifecycle.\n\nNote that if a request is [retried](#retries), the context timeout does not start over.\nTo set a per-retry timeout, use `SDK_PackageOptionName.WithRequestTimeout()`.\n\n```go\n// This sets the timeout for the request, including all the retries.\nctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)\ndefer cancel()\nclient.Files.Upload(\n\tctx,\n\timagekit.FileUploadParams{\n\t\tFile: io.Reader(bytes.NewBuffer([]byte("https://www.example.com/public-url.jpg"))),\n\t\tFileName: "file-name.jpg",\n\t},\n\t// This sets the per-retry timeout\n\toption.WithRequestTimeout(20*time.Second),\n)\n```\n\n### File uploads\n\nRequest parameters that correspond to file uploads in multipart requests are typed as\n`param.Field[io.Reader]`. The contents of the `io.Reader` will by default be sent as a multipart form\npart with the file name of "anonymous_file" and content-type of "application/octet-stream".\n\nThe file name and content-type can be customized by implementing `Name() string` or `ContentType()\nstring` on the run-time type of `io.Reader`. Note that `os.File` implements `Name() string`, so a\nfile returned by `os.Open` will be sent with the file name on disk.\n\nWe also provide a helper `SDK_PackageName.FileParam(reader io.Reader, filename string, contentType string)`\nwhich can be used to wrap any `io.Reader` with the appropriate file name and content type.\n\n```go\n// A file from the file system\nfile, err := os.Open("/path/to/file")\nimagekit.FileUploadParams{\n\tFile: file,\n\tFileName: "fileName",\n}\n\n// A file from a string\nimagekit.FileUploadParams{\n\tFile: strings.NewReader("my file contents"),\n\tFileName: "fileName",\n}\n\n// With a custom filename and contentType\nimagekit.FileUploadParams{\n\tFile: imagekit.NewFile(strings.NewReader(`{"hello": "foo"}`), "file.go", "application/json"),\n\tFileName: "fileName",\n}\n```\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nWe retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit,\nand >=500 Internal errors.\n\nYou can use the `WithMaxRetries` option to configure or disable this:\n\n```go\n// Configure the default for all requests:\nclient := imagekit.NewClient(\n\toption.WithMaxRetries(0), // default is 2\n)\n\n// Override per-request:\nclient.Files.Upload(\n\tcontext.TODO(),\n\timagekit.FileUploadParams{\n\t\tFile: io.Reader(bytes.NewBuffer([]byte("https://www.example.com/public-url.jpg"))),\n\t\tFileName: "file-name.jpg",\n\t},\n\toption.WithMaxRetries(5),\n)\n```\n\n\n### Accessing raw response data (e.g. response headers)\n\nYou can access the raw HTTP response data by using the `option.WithResponseInto()` request option. This is useful when\nyou need to examine response headers, status codes, or other details.\n\n```go\n// Create a variable to store the HTTP response\nvar response *http.Response\nresponse, err := client.Files.Upload(\n\tcontext.TODO(),\n\timagekit.FileUploadParams{\n\t\tFile: io.Reader(bytes.NewBuffer([]byte("https://www.example.com/public-url.jpg"))),\n\t\tFileName: "file-name.jpg",\n\t},\n\toption.WithResponseInto(&response),\n)\nif err != nil {\n\t// handle error\n}\nfmt.Printf("%+v\\n", response)\n\nfmt.Printf("Status Code: %d\\n", response.StatusCode)\nfmt.Printf("Headers: %+#v\\n", response.Header)\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.Get`, `client.Post`, and other HTTP verbs.\n`RequestOptions` on the client, such as retries, will be respected when making these requests.\n\n```go\nvar (\n // params can be an io.Reader, a []byte, an encoding/json serializable object,\n // or a "…Params" struct defined in this library.\n params map[string]interface{}\n\n // result can be an []byte, *http.Response, a encoding/json deserializable object,\n // or a model defined in this library.\n result *http.Response\n)\nerr := client.Post(context.Background(), "/unspecified", params, &result)\nif err != nil {\n …\n}\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use either the `SDK_PackageOptionName.WithQuerySet()`\nor the `SDK_PackageOptionName.WithJSONSet()` methods.\n\n```go\nparams := FooNewParams{\n ID: SDK_PackageName.F("id_xxxx"),\n Data: SDK_PackageName.F(FooNewParamsData{\n FirstName: SDK_PackageName.F("John"),\n }),\n}\nclient.Foo.New(context.Background(), params, SDK_PackageOptionName.WithJSONSet("data.last_name", "Doe"))\n```\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may either access the raw JSON of the response as a string\nwith `result.JSON.RawJSON()`, or get the raw JSON of a particular field on the result with\n`result.JSON.Foo.Raw()`.\n\nAny fields that are not present on the response struct will be saved and can be accessed by `result.JSON.ExtraFields()` which returns the extra fields as a `map[string]Field`.\n\n### Middleware\n\nWe provide `SDK_PackageOptionName.WithMiddleware` which applies the given\nmiddleware to requests.\n\n```go\nfunc Logger(req *http.Request, next SDK_PackageOptionName.MiddlewareNext) (res *http.Response, err error) {\n\t// Before the request\n\tstart := time.Now()\n\tLogReq(req)\n\n\t// Forward the request to the next handler\n\tres, err = next(req)\n\n\t// Handle stuff after the request\n\tend := time.Now()\n\tLogRes(res, err, start - end)\n\n return res, err\n}\n\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\tSDK_PackageOptionName.WithMiddleware(Logger),\n)\n```\n\nWhen multiple middlewares are provided as variadic arguments, the middlewares\nare applied left to right. If `SDK_PackageOptionName.WithMiddleware` is given\nmultiple times, for example first in the client then the method, the\nmiddleware in the client will run first and the middleware given in the method\nwill run next.\n\nYou may also replace the default `http.Client` with\n`SDK_PackageOptionName.WithHTTPClient(client)`. Only one http client is\naccepted (this overwrites any previous client) and receives requests after any\nmiddleware has been applied.\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/imagekit-developer/imagekit-go/issues) with questions, bugs, or suggestions.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
},
{
language: 'ruby',
@@ -3341,14 +2863,14 @@ const EMBEDDED_READMES: { language: string; content: string }[] = [
'# Image Kit Ruby API library\n\nThe Image Kit Ruby library provides convenient access to the Image Kit REST API from any Ruby 3.2.0+ application. It ships with comprehensive types & docstrings in Yard, RBS, and RBI – [see below](https://github.com/imagekit-developer/imagekit-ruby#Sorbet) for usage with Sorbet. The standard library\'s `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem.\n\n\n\n\n\n## MCP Server\n\nUse the Image Kit MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40imagekit%2Fapi-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBpbWFnZWtpdC9hcGktbWNwIl0sImVudiI6eyJJTUFHRUtJVF9QUklWQVRFX0tFWSI6Ik15IFByaXZhdGUgS2V5IiwiT1BUSU9OQUxfSU1BR0VLSVRfSUdOT1JFU19USElTIjoiTXkgUGFzc3dvcmQiLCJJTUFHRUtJVF9XRUJIT09LX1NFQ1JFVCI6Ik15IFdlYmhvb2sgU2VjcmV0In19)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40imagekit%2Fapi-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40imagekit%2Fapi-mcp%22%5D%2C%22env%22%3A%7B%22IMAGEKIT_PRIVATE_KEY%22%3A%22My%20Private%20Key%22%2C%22OPTIONAL_IMAGEKIT_IGNORES_THIS%22%3A%22My%20Password%22%2C%22IMAGEKIT_WEBHOOK_SECRET%22%3A%22My%20Webhook%20Secret%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\nDocumentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/imagekitio).\n\nThe REST API documentation can be found on [imagekit.io](https://imagekit.io/docs/api-reference).\n\n## Installation\n\nTo use this gem, install via Bundler by adding the following to your application\'s `Gemfile`:\n\n\n\n```ruby\ngem "imagekitio", "~> 0.0.1"\n```\n\n\n\n## Usage\n\n```ruby\nrequire "bundler/setup"\nrequire "imagekitio"\n\nimage_kit = Imagekitio::Client.new(\n private_key: ENV["IMAGEKIT_PRIVATE_KEY"], # This is the default and can be omitted\n password: ENV["OPTIONAL_IMAGEKIT_IGNORES_THIS"] # This is the default and can be omitted\n)\n\nresponse = image_kit.files.upload(\n file: StringIO.new("https://www.example.com/public-url.jpg"),\n file_name: "file-name.jpg"\n)\n\nputs(response.videoCodec)\n```\n\n\n\n\n\n### File uploads\n\nRequest parameters that correspond to file uploads can be passed as raw contents, a [`Pathname`](https://rubyapi.org/3.2/o/pathname) instance, [`StringIO`](https://rubyapi.org/3.2/o/stringio), or more.\n\n```ruby\nrequire "pathname"\n\n# Use `Pathname` to send the filename and/or avoid paging a large file into memory:\nresponse = image_kit.files.upload(file: Pathname("/path/to/file"))\n\n# Alternatively, pass file contents or a `StringIO` directly:\nresponse = image_kit.files.upload(file: File.read("/path/to/file"))\n\n# Or, to control the filename and/or content type:\nfile = Imagekitio::FilePart.new(File.read("/path/to/file"), filename: "/path/to/file", content_type: "…")\nresponse = image_kit.files.upload(file: file)\n\nputs(response.videoCodec)\n```\n\nNote that you can also pass a raw `IO` descriptor, but this disables retries, as the library can\'t be sure if the descriptor is a file or pipe (which cannot be rewound).\n\n### Handling errors\n\nWhen the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `Imagekitio::Errors::APIError` will be thrown:\n\n```ruby\nbegin\n file = image_kit.files.upload(\n file: StringIO.new("https://www.example.com/public-url.jpg"),\n file_name: "file-name.jpg"\n )\nrescue Imagekitio::Errors::APIConnectionError => e\n puts("The server could not be reached")\n puts(e.cause) # an underlying Exception, likely raised within `net/http`\nrescue Imagekitio::Errors::RateLimitError => e\n puts("A 429 status code was received; we should back off a bit.")\nrescue Imagekitio::Errors::APIStatusError => e\n puts("Another non-200-range status code was received")\n puts(e.status)\nend\n```\n\nError codes are as follows:\n\n| Cause | Error Type |\n| ---------------- | -------------------------- |\n| HTTP 400 | `BadRequestError` |\n| HTTP 401 | `AuthenticationError` |\n| HTTP 403 | `PermissionDeniedError` |\n| HTTP 404 | `NotFoundError` |\n| HTTP 409 | `ConflictError` |\n| HTTP 422 | `UnprocessableEntityError` |\n| HTTP 429 | `RateLimitError` |\n| HTTP >= 500 | `InternalServerError` |\n| Other HTTP error | `APIStatusError` |\n| Timeout | `APITimeoutError` |\n| Network error | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\n\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, >=500 Internal errors, and timeouts will all be retried by default.\n\nYou can use the `max_retries` option to configure or disable this:\n\n```ruby\n# Configure the default for all requests:\nimage_kit = Imagekitio::Client.new(\n max_retries: 0 # default is 2\n)\n\n# Or, configure per-request:\nimage_kit.files.upload(\n file: StringIO.new("https://www.example.com/public-url.jpg"),\n file_name: "file-name.jpg",\n request_options: {max_retries: 5}\n)\n```\n\n### Timeouts\n\nBy default, requests will time out after 60 seconds. You can use the timeout option to configure or disable this:\n\n```ruby\n# Configure the default for all requests:\nimage_kit = Imagekitio::Client.new(\n timeout: nil # default is 60\n)\n\n# Or, configure per-request:\nimage_kit.files.upload(\n file: StringIO.new("https://www.example.com/public-url.jpg"),\n file_name: "file-name.jpg",\n request_options: {timeout: 5}\n)\n```\n\nOn timeout, `Imagekitio::Errors::APITimeoutError` is raised.\n\nNote that requests that time out are retried by default.\n\n## Advanced concepts\n\n### BaseModel\n\nAll parameter and response objects inherit from `Imagekitio::Internal::Type::BaseModel`, which provides several conveniences, including:\n\n1. All fields, including unknown ones, are accessible with `obj[:prop]` syntax, and can be destructured with `obj => {prop: prop}` or pattern-matching syntax.\n\n2. Structural equivalence for equality; if two API calls return the same values, comparing the responses with == will return true.\n\n3. Both instances and the classes themselves can be pretty-printed.\n\n4. Helpers such as `#to_h`, `#deep_to_h`, `#to_json`, and `#to_yaml`.\n\n### Making custom or undocumented requests\n\n#### Undocumented properties\n\nYou can send undocumented parameters to any endpoint, and read undocumented response properties, like so:\n\nNote: the `extra_` parameters of the same name overrides the documented parameters.\n\n```ruby\nresponse =\n image_kit.files.upload(\n file: StringIO.new("https://www.example.com/public-url.jpg"),\n file_name: "file-name.jpg",\n request_options: {\n extra_query: {my_query_parameter: value},\n extra_body: {my_body_parameter: value},\n extra_headers: {"my-header": value}\n }\n )\n\nputs(response[:my_undocumented_property])\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` under the `request_options:` parameter when making a request, as seen in the examples above.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints while retaining the benefit of auth, retries, and so on, you can make requests using `client.request`, like so:\n\n```ruby\nresponse = client.request(\n method: :post,\n path: \'/undocumented/endpoint\',\n query: {"dog": "woof"},\n headers: {"useful-header": "interesting-value"},\n body: {"hello": "world"}\n)\n```\n\n### Concurrency & connection pooling\n\nThe `Imagekitio::Client` instances are threadsafe, but are only are fork-safe when there are no in-flight HTTP requests.\n\nEach instance of `Imagekitio::Client` has its own HTTP connection pool with a default size of 99. As such, we recommend instantiating the client once per application in most settings.\n\nWhen all available connections from the pool are checked out, requests wait for a new connection to become available, with queue time counting towards the request timeout.\n\nUnless otherwise specified, other classes in the SDK do not have locks protecting their underlying data structure.\n\n## Sorbet\n\nThis library provides comprehensive [RBI](https://sorbet.org/docs/rbi) definitions, and has no dependency on sorbet-runtime.\n\nYou can provide typesafe request parameters like so:\n\n```ruby\nimage_kit.files.upload(\n file: StringIO.new("https://www.example.com/public-url.jpg"),\n file_name: "file-name.jpg"\n)\n```\n\nOr, equivalently:\n\n```ruby\n# Hashes work, but are not typesafe:\nimage_kit.files.upload(\n file: StringIO.new("https://www.example.com/public-url.jpg"),\n file_name: "file-name.jpg"\n)\n\n# You can also splat a full Params class:\nparams = Imagekitio::FileUploadParams.new(\n file: StringIO.new("https://www.example.com/public-url.jpg"),\n file_name: "file-name.jpg"\n)\nimage_kit.files.upload(**params)\n```\n\n### Enums\n\nSince this library does not depend on `sorbet-runtime`, it cannot provide [`T::Enum`](https://sorbet.org/docs/tenum) instances. Instead, we provide "tagged symbols" instead, which is always a primitive at runtime:\n\n```ruby\n# :all\nputs(Imagekitio::AssetListParams::FileType::ALL)\n\n# Revealed type: `T.all(Imagekitio::AssetListParams::FileType, Symbol)`\nT.reveal_type(Imagekitio::AssetListParams::FileType::ALL)\n```\n\nEnum parameters have a "relaxed" type, so you can either pass in enum constants or their literal value:\n\n```ruby\n# Using the enum constants preserves the tagged type information:\nimage_kit.assets.list(\n file_type: Imagekitio::AssetListParams::FileType::ALL,\n # …\n)\n\n# Literal values are also permissible:\nimage_kit.assets.list(\n file_type: :all,\n # …\n)\n```\n\n## Versioning\n\nThis package follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions. As the library is in initial development and has a major version of `0`, APIs may change at any time.\n\nThis package considers improvements to the (non-runtime) `*.rbi` and `*.rbs` type definitions to be non-breaking changes.\n\n## Requirements\n\nRuby 3.2.0 or higher.\n\n## Contributing\n\nSee [the contributing documentation](https://github.com/imagekit-developer/imagekit-ruby/tree/master/CONTRIBUTING.md).\n',
},
{
- language: 'terraform',
+ language: 'php',
content:
- '# Image Kit Terraform Provider\n\nThe [Image Kit Terraform provider](https://registry.terraform.io/providers/stainless-sdks/imagekit/latest/docs) provides convenient access to\nthe [Image Kit REST API](https://imagekit.io/docs/api-reference) from Terraform.\n\n\n\n## Requirements\n\nThis provider requires Terraform CLI 1.0 or later. You can [install it for your system](https://developer.hashicorp.com/terraform/install)\non Hashicorp\'s website.\n\n## Usage\n\nAdd the following to your `main.tf` file:\n\n\n\n```hcl\n# Declare the provider and version\nterraform {\n required_providers {\n SDK_ProviderTypeName = {\n source = "stainless-sdks/imagekit"\n version = "~> 0.0.1"\n }\n }\n}\n\n# Initialize the provider\nprovider "imagekit" {\n # Your ImageKit private API key (starts with `private_`).\n You can find this in the [ImageKit dashboard](https://imagekit.io/dashboard/developer/api-keys).\n private_key = "My Private Key" # or set IMAGEKIT_PRIVATE_KEY env variable\n # ImageKit uses your API key as username and ignores the password. \n The SDK sets a dummy value. You can ignore this field.\n password = "My Password" # or set OPTIONAL_IMAGEKIT_IGNORES_THIS env variable\n # Your ImageKit webhook secret for verifying webhook signatures (starts with `whsec_`).\n You can find this in the [ImageKit dashboard](https://imagekit.io/dashboard/developer/webhooks).\n Only required if you\'re using webhooks.\n webhook_secret = "My Webhook Secret" # or set IMAGEKIT_WEBHOOK_SECRET env variable\n}\n\n# Configure a resource\nresource "imagekit_account_origin" "example_account_origin" {\n access_key = "AKIAIOSFODNN7EXAMPLE"\n bucket = "product-images"\n name = "US S3 Storage"\n secret_key = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"\n type = "S3"\n base_url_for_canonical_header = "https://cdn.example.com"\n include_canonical_header = false\n prefix = "raw-assets"\n}\n```\n\n\n\nInitialize your project by running `terraform init` in the directory.\n\nAdditional examples can be found in the [./examples](./examples) folder within this repository, and you can\nrefer to the full documentation on [the Terraform Registry](https://registry.terraform.io/providers/stainless-sdks/imagekit/latest/docs).\n\n### Provider Options\nWhen you initialize the provider, the following options are supported. It is recommended to use environment variables for sensitive values like access tokens.\nIf an environment variable is provided, then the option does not need to be set in the terraform source.\n\n| Property | Environment variable | Required | Default value |\n| -------------- | -------------------------------- | -------- | -------------- |\n| private_key | `IMAGEKIT_PRIVATE_KEY` | true | — |\n| webhook_secret | `IMAGEKIT_WEBHOOK_SECRET` | false | — |\n| password | `OPTIONAL_IMAGEKIT_IGNORES_THIS` | false | `"do_not_set"` |\n\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/imagekit-terraform/issues) with questions, bugs, or suggestions.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
+ "# Image Kit PHP API Library\n\nThe Image Kit PHP library provides convenient access to the Image Kit REST API from any PHP 8.1.0+ application.\n\n## Installation\n\n\n```\ncomposer require \"imagekit/imagekit 0.0.1\"\n```\n\n\n## Usage\n\n```php\nfiles->upload(\n file: FileParam::fromString('https://www.example.com/public-url.jpg', filename: uniqid('file-upload-', true)),\n fileName: 'file-name.jpg',\n);\n\nvar_dump($response->videoCodec);\n```",
},
{
- language: 'typescript',
+ language: 'csharp',
content:
- "# Image Kit TypeScript API Library\n\n[)](https://npmjs.org/package/@imagekit/nodejs) \n\nThis library provides convenient access to the Image Kit REST API from server-side TypeScript or JavaScript.\n\n\n\nThe REST API documentation can be found on [imagekit.io](https://imagekit.io/docs/api-reference). The full API of this library can be found in [api.md](api.md).\n\n\n\n## MCP Server\n\nUse the Image Kit MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40imagekit%2Fapi-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBpbWFnZWtpdC9hcGktbWNwIl0sImVudiI6eyJJTUFHRUtJVF9QUklWQVRFX0tFWSI6Ik15IFByaXZhdGUgS2V5IiwiT1BUSU9OQUxfSU1BR0VLSVRfSUdOT1JFU19USElTIjoiTXkgUGFzc3dvcmQiLCJJTUFHRUtJVF9XRUJIT09LX1NFQ1JFVCI6Ik15IFdlYmhvb2sgU2VjcmV0In19)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40imagekit%2Fapi-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40imagekit%2Fapi-mcp%22%5D%2C%22env%22%3A%7B%22IMAGEKIT_PRIVATE_KEY%22%3A%22My%20Private%20Key%22%2C%22OPTIONAL_IMAGEKIT_IGNORES_THIS%22%3A%22My%20Password%22%2C%22IMAGEKIT_WEBHOOK_SECRET%22%3A%22My%20Webhook%20Secret%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n```sh\nnpm install @imagekit/nodejs\n```\n\n\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n\n```js\nimport ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst response = await client.files.upload({\n file: fs.createReadStream('path/to/file'),\n fileName: 'file-name.jpg',\n});\n\nconsole.log(response.videoCodec);\n```\n\n\n\n### Request & Response types\n\nThis library includes TypeScript definitions for all request params and response fields. You may import and use them like so:\n\n\n```ts\nimport ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n password: process.env['OPTIONAL_IMAGEKIT_IGNORES_THIS'], // This is the default and can be omitted\n});\n\nconst params: ImageKit.FileUploadParams = {\n file: fs.createReadStream('path/to/file'),\n fileName: 'file-name.jpg',\n};\nconst response: ImageKit.FileUploadResponse = await client.files.upload(params);\n```\n\nDocumentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.\n\n## File uploads\n\nRequest parameters that correspond to file uploads can be passed in many different forms:\n- `File` (or an object with the same structure)\n- a `fetch` `Response` (or an object with the same structure)\n- an `fs.ReadStream`\n- the return value of our `toFile` helper\n\n```ts\nimport fs from 'fs';\nimport ImageKit, { toFile } from '@imagekit/nodejs';\n\nconst client = new ImageKit();\n\n// If you have access to Node `fs` we recommend using `fs.createReadStream()`:\nawait client.files.upload({ file: fs.createReadStream('/path/to/file'), fileName: 'fileName' });\n\n// Or if you have the web `File` API you can pass a `File` instance:\nawait client.files.upload({ file: new File(['my bytes'], 'file'), fileName: 'fileName' });\n\n// You can also pass a `fetch` `Response`:\nawait client.files.upload({ file: await fetch('https://somesite/file'), fileName: 'fileName' });\n\n// Finally, if none of the above are convenient, you can use our `toFile` helper:\nawait client.files.upload({\n file: await toFile(Buffer.from('my bytes'), 'file'),\n fileName: 'fileName',\n});\nawait client.files.upload({\n file: await toFile(new Uint8Array([0, 1, 2]), 'file'),\n fileName: 'fileName',\n});\n```\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API,\nor if the API returns a non-success status code (i.e., 4xx or 5xx response),\na subclass of `APIError` will be thrown:\n\n\n```ts\nconst response = await client.files\n .upload({ file: fs.createReadStream('path/to/file'), fileName: 'file-name.jpg' })\n .catch(async (err) => {\n if (err instanceof ImageKit.APIError) {\n console.log(err.status); // 400\n console.log(err.name); // BadRequestError\n console.log(err.headers); // {server: 'nginx', ...}\n } else {\n throw err;\n }\n });\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors will all be retried by default.\n\nYou can use the `maxRetries` option to configure or disable this:\n\n\n```js\n// Configure the default for all requests:\nconst client = new ImageKit({\n maxRetries: 0, // default is 2\n});\n\n// Or, configure per-request:\nawait client.files.upload({ file: fs.createReadStream('path/to/file'), fileName: 'file-name.jpg' }, {\n maxRetries: 5,\n});\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default. You can configure this with a `timeout` option:\n\n\n```ts\n// Configure the default for all requests:\nconst client = new ImageKit({\n timeout: 20 * 1000, // 20 seconds (default is 1 minute)\n});\n\n// Override per-request:\nawait client.files.upload({ file: fs.createReadStream('path/to/file'), fileName: 'file-name.jpg' }, {\n timeout: 5 * 1000,\n});\n```\n\nOn timeout, an `APIConnectionTimeoutError` is thrown.\n\nNote that requests which time out will be [retried twice by default](#retries).\n\n\n\n\n\n## Advanced Usage\n\n### Accessing raw Response data (e.g., headers)\n\nThe \"raw\" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.\nThis method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.\n\nYou can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.\nUnlike `.asResponse()` this method consumes the body, returning once it is parsed.\n\n\n```ts\nconst client = new ImageKit();\n\nconst response = await client.files\n .upload({ file: fs.createReadStream('path/to/file'), fileName: 'file-name.jpg' })\n .asResponse();\nconsole.log(response.headers.get('X-My-Header'));\nconsole.log(response.statusText); // access the underlying Response object\n\nconst { data: response, response: raw } = await client.files\n .upload({ file: fs.createReadStream('path/to/file'), fileName: 'file-name.jpg' })\n .withResponse();\nconsole.log(raw.headers.get('X-My-Header'));\nconsole.log(response.videoCodec);\n```\n\n### Logging\n\n> [!IMPORTANT]\n> All log messages are intended for debugging only. The format and content of log messages\n> may change between releases.\n\n#### Log levels\n\nThe log level can be configured in two ways:\n\n1. Via the `IMAGE_KIT_LOG` environment variable\n2. Using the `logLevel` client option (overrides the environment variable if set)\n\n```ts\nimport ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n logLevel: 'debug', // Show all log messages\n});\n```\n\nAvailable log levels, from most to least verbose:\n\n- `'debug'` - Show debug messages, info, warnings, and errors\n- `'info'` - Show info messages, warnings, and errors\n- `'warn'` - Show warnings and errors (default)\n- `'error'` - Show only errors\n- `'off'` - Disable all logging\n\nAt the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.\nSome authentication-related headers are redacted, but sensitive data in request and response bodies\nmay still be visible.\n\n#### Custom logger\n\nBy default, this library logs to `globalThis.console`. You can also provide a custom logger.\nMost logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.\n\nWhen providing a custom logger, the `logLevel` option still controls which messages are emitted, messages\nbelow the configured level will not be sent to your logger.\n\n```ts\nimport ImageKit from '@imagekit/nodejs';\nimport pino from 'pino';\n\nconst logger = pino();\n\nconst client = new ImageKit({\n logger: logger.child({ name: 'ImageKit' }),\n logLevel: 'debug', // Send all messages to pino, allowing it to filter\n});\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.\nOptions on the client, such as retries, will be respected when making these requests.\n\n```ts\nawait client.post('/some/path', {\n body: { some_prop: 'foo' },\n query: { some_query_arg: 'bar' },\n});\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented\nparameter. This library doesn't validate at runtime that the request matches the type, so any extra values you\nsend will be sent as-is.\n\n```ts\nclient.files.upload({\n // ...\n // @ts-expect-error baz is not yet public\n baz: 'undocumented option',\n});\n```\n\nFor requests with the `GET` verb, any extra params will be in the query, all other requests will send the\nextra param in the body.\n\nIf you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may access the response object with `// @ts-expect-error` on\nthe response object, or cast the response object to the requisite type. Like the request params, we do not\nvalidate or strip extra properties from the response from the API.\n\n### Customizing the fetch client\n\nBy default, this library expects a global `fetch` function is defined.\n\nIf you want to use a different `fetch` function, you can either polyfill the global:\n\n```ts\nimport fetch from 'my-fetch';\n\nglobalThis.fetch = fetch;\n```\n\nOr pass it to the client:\n\n```ts\nimport ImageKit from '@imagekit/nodejs';\nimport fetch from 'my-fetch';\n\nconst client = new ImageKit({ fetch });\n```\n\n### Fetch options\n\nIf you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)\n\n```ts\nimport ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n fetchOptions: {\n // `RequestInit` options\n },\n});\n```\n\n#### Configuring proxies\n\nTo modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy\noptions to requests:\n\n
**Node** [[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]\n\n```ts\nimport ImageKit from '@imagekit/nodejs';\nimport * as undici from 'undici';\n\nconst proxyAgent = new undici.ProxyAgent('http://localhost:8888');\nconst client = new ImageKit({\n fetchOptions: {\n dispatcher: proxyAgent,\n },\n});\n```\n\n
**Bun** [[docs](https://bun.sh/guides/http/proxy)]\n\n```ts\nimport ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n fetchOptions: {\n proxy: 'http://localhost:8888',\n },\n});\n```\n\n
**Deno** [[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]\n\n```ts\nimport ImageKit from 'npm:@imagekit/nodejs';\n\nconst httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });\nconst client = new ImageKit({\n fetchOptions: {\n client: httpClient,\n },\n});\n```\n\n## Frequently Asked Questions\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/imagekit-developer/imagekit-nodejs/issues) with questions, bugs, or suggestions.\n\n## Requirements\n\nTypeScript >= 4.9 is supported.\n\nThe following runtimes are supported:\n\n- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)\n- Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.\n- Deno v1.28.0 or higher.\n- Bun 1.0 or later.\n- Cloudflare Workers.\n- Vercel Edge Runtime.\n- Jest 28 or greater with the `\"node\"` environment (`\"jsdom\"` is not supported at this time).\n- Nitro v2.6 or greater.\n\nNote that React Native is not supported at this time.\n\nIf you are interested in other runtime environments, please open or upvote an issue on GitHub.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n",
+ '# Image Kit C# API Library\n\nThe Image Kit C# SDK provides convenient access to the [Image Kit REST API](https://imagekit.io/docs/api-reference) from applications written in C#.\n\n## Installation\n\n```bash\ngit clone git@github.com:stainless-sdks/imagekit-csharp.git\ndotnet add reference imagekit-csharp/src/Imagekit\n```\n\n## Requirements\n\nThis library requires .NET Standard 2.0 or later.\n\n## Usage\n\nSee the [`examples`](examples) directory for complete and runnable examples.\n\n```csharp\nImageKitClient client = new();\n\nFileUploadParams parameters = new()\n{\n File = Encoding.UTF8.GetBytes("https://www.example.com/public-url.jpg"),\n FileName = "file-name.jpg",\n};\n\nvar response = await client.Files.Upload(parameters);\n\nConsole.WriteLine(response);\n```',
},
];
diff --git a/packages/mcp-server/src/methods.ts b/packages/mcp-server/src/methods.ts
index a2a4f930..94f8da06 100644
--- a/packages/mcp-server/src/methods.ts
+++ b/packages/mcp-server/src/methods.ts
@@ -16,24 +16,36 @@ export const sdkMethods: SdkMethod[] = [
httpMethod: 'post',
httpPath: '/v1/customMetadataFields',
},
- {
- clientCallName: 'client.customMetadataFields.update',
- fullyQualifiedName: 'customMetadataFields.update',
- httpMethod: 'patch',
- httpPath: '/v1/customMetadataFields/{id}',
- },
{
clientCallName: 'client.customMetadataFields.list',
fullyQualifiedName: 'customMetadataFields.list',
httpMethod: 'get',
httpPath: '/v1/customMetadataFields',
},
+ {
+ clientCallName: 'client.customMetadataFields.update',
+ fullyQualifiedName: 'customMetadataFields.update',
+ httpMethod: 'patch',
+ httpPath: '/v1/customMetadataFields/{id}',
+ },
{
clientCallName: 'client.customMetadataFields.delete',
fullyQualifiedName: 'customMetadataFields.delete',
httpMethod: 'delete',
httpPath: '/v1/customMetadataFields/{id}',
},
+ {
+ clientCallName: 'client.files.upload',
+ fullyQualifiedName: 'files.upload',
+ httpMethod: 'post',
+ httpPath: '/api/v1/files/upload',
+ },
+ {
+ clientCallName: 'client.files.get',
+ fullyQualifiedName: 'files.get',
+ httpMethod: 'get',
+ httpPath: '/v1/files/{fileId}/details',
+ },
{
clientCallName: 'client.files.update',
fullyQualifiedName: 'files.update',
@@ -52,12 +64,6 @@ export const sdkMethods: SdkMethod[] = [
httpMethod: 'post',
httpPath: '/v1/files/copy',
},
- {
- clientCallName: 'client.files.get',
- fullyQualifiedName: 'files.get',
- httpMethod: 'get',
- httpPath: '/v1/files/{fileId}/details',
- },
{
clientCallName: 'client.files.move',
fullyQualifiedName: 'files.move',
@@ -70,12 +76,6 @@ export const sdkMethods: SdkMethod[] = [
httpMethod: 'put',
httpPath: '/v1/files/rename',
},
- {
- clientCallName: 'client.files.upload',
- fullyQualifiedName: 'files.upload',
- httpMethod: 'post',
- httpPath: '/api/v1/files/upload',
- },
{
clientCallName: 'client.files.bulk.delete',
fullyQualifiedName: 'files.bulk.delete',
@@ -88,36 +88,36 @@ export const sdkMethods: SdkMethod[] = [
httpMethod: 'post',
httpPath: '/v1/files/addTags',
},
- {
- clientCallName: 'client.files.bulk.removeAITags',
- fullyQualifiedName: 'files.bulk.removeAITags',
- httpMethod: 'post',
- httpPath: '/v1/files/removeAITags',
- },
{
clientCallName: 'client.files.bulk.removeTags',
fullyQualifiedName: 'files.bulk.removeTags',
httpMethod: 'post',
httpPath: '/v1/files/removeTags',
},
+ {
+ clientCallName: 'client.files.bulk.removeAITags',
+ fullyQualifiedName: 'files.bulk.removeAITags',
+ httpMethod: 'post',
+ httpPath: '/v1/files/removeAITags',
+ },
{
clientCallName: 'client.files.versions.list',
fullyQualifiedName: 'files.versions.list',
httpMethod: 'get',
httpPath: '/v1/files/{fileId}/versions',
},
- {
- clientCallName: 'client.files.versions.delete',
- fullyQualifiedName: 'files.versions.delete',
- httpMethod: 'delete',
- httpPath: '/v1/files/{fileId}/versions/{versionId}',
- },
{
clientCallName: 'client.files.versions.get',
fullyQualifiedName: 'files.versions.get',
httpMethod: 'get',
httpPath: '/v1/files/{fileId}/versions/{versionId}',
},
+ {
+ clientCallName: 'client.files.versions.delete',
+ fullyQualifiedName: 'files.versions.delete',
+ httpMethod: 'delete',
+ httpPath: '/v1/files/{fileId}/versions/{versionId}',
+ },
{
clientCallName: 'client.files.versions.restore',
fullyQualifiedName: 'files.versions.restore',
@@ -136,36 +136,36 @@ export const sdkMethods: SdkMethod[] = [
httpMethod: 'get',
httpPath: '/v1/metadata',
},
+ {
+ clientCallName: 'client.savedExtensions.list',
+ fullyQualifiedName: 'savedExtensions.list',
+ httpMethod: 'get',
+ httpPath: '/v1/saved-extensions',
+ },
{
clientCallName: 'client.savedExtensions.create',
fullyQualifiedName: 'savedExtensions.create',
httpMethod: 'post',
httpPath: '/v1/saved-extensions',
},
+ {
+ clientCallName: 'client.savedExtensions.get',
+ fullyQualifiedName: 'savedExtensions.get',
+ httpMethod: 'get',
+ httpPath: '/v1/saved-extensions/{id}',
+ },
{
clientCallName: 'client.savedExtensions.update',
fullyQualifiedName: 'savedExtensions.update',
httpMethod: 'patch',
httpPath: '/v1/saved-extensions/{id}',
},
- {
- clientCallName: 'client.savedExtensions.list',
- fullyQualifiedName: 'savedExtensions.list',
- httpMethod: 'get',
- httpPath: '/v1/saved-extensions',
- },
{
clientCallName: 'client.savedExtensions.delete',
fullyQualifiedName: 'savedExtensions.delete',
httpMethod: 'delete',
httpPath: '/v1/saved-extensions/{id}',
},
- {
- clientCallName: 'client.savedExtensions.get',
- fullyQualifiedName: 'savedExtensions.get',
- httpMethod: 'get',
- httpPath: '/v1/saved-extensions/{id}',
- },
{
clientCallName: 'client.assets.list',
fullyQualifiedName: 'assets.list',
@@ -226,24 +226,30 @@ export const sdkMethods: SdkMethod[] = [
httpMethod: 'get',
httpPath: '/v1/accounts/usage',
},
+ {
+ clientCallName: 'client.accounts.origins.list',
+ fullyQualifiedName: 'accounts.origins.list',
+ httpMethod: 'get',
+ httpPath: '/v1/accounts/origins',
+ },
{
clientCallName: 'client.accounts.origins.create',
fullyQualifiedName: 'accounts.origins.create',
httpMethod: 'post',
httpPath: '/v1/accounts/origins',
},
+ {
+ clientCallName: 'client.accounts.origins.get',
+ fullyQualifiedName: 'accounts.origins.get',
+ httpMethod: 'get',
+ httpPath: '/v1/accounts/origins/{id}',
+ },
{
clientCallName: 'client.accounts.origins.update',
fullyQualifiedName: 'accounts.origins.update',
httpMethod: 'put',
httpPath: '/v1/accounts/origins/{id}',
},
- {
- clientCallName: 'client.accounts.origins.list',
- fullyQualifiedName: 'accounts.origins.list',
- httpMethod: 'get',
- httpPath: '/v1/accounts/origins',
- },
{
clientCallName: 'client.accounts.origins.delete',
fullyQualifiedName: 'accounts.origins.delete',
@@ -251,10 +257,10 @@ export const sdkMethods: SdkMethod[] = [
httpPath: '/v1/accounts/origins/{id}',
},
{
- clientCallName: 'client.accounts.origins.get',
- fullyQualifiedName: 'accounts.origins.get',
+ clientCallName: 'client.accounts.urlEndpoints.list',
+ fullyQualifiedName: 'accounts.urlEndpoints.list',
httpMethod: 'get',
- httpPath: '/v1/accounts/origins/{id}',
+ httpPath: '/v1/accounts/url-endpoints',
},
{
clientCallName: 'client.accounts.urlEndpoints.create',
@@ -262,38 +268,32 @@ export const sdkMethods: SdkMethod[] = [
httpMethod: 'post',
httpPath: '/v1/accounts/url-endpoints',
},
+ {
+ clientCallName: 'client.accounts.urlEndpoints.get',
+ fullyQualifiedName: 'accounts.urlEndpoints.get',
+ httpMethod: 'get',
+ httpPath: '/v1/accounts/url-endpoints/{id}',
+ },
{
clientCallName: 'client.accounts.urlEndpoints.update',
fullyQualifiedName: 'accounts.urlEndpoints.update',
httpMethod: 'put',
httpPath: '/v1/accounts/url-endpoints/{id}',
},
- {
- clientCallName: 'client.accounts.urlEndpoints.list',
- fullyQualifiedName: 'accounts.urlEndpoints.list',
- httpMethod: 'get',
- httpPath: '/v1/accounts/url-endpoints',
- },
{
clientCallName: 'client.accounts.urlEndpoints.delete',
fullyQualifiedName: 'accounts.urlEndpoints.delete',
httpMethod: 'delete',
httpPath: '/v1/accounts/url-endpoints/{id}',
},
- {
- clientCallName: 'client.accounts.urlEndpoints.get',
- fullyQualifiedName: 'accounts.urlEndpoints.get',
- httpMethod: 'get',
- httpPath: '/v1/accounts/url-endpoints/{id}',
- },
{
clientCallName: 'client.beta.v2.files.upload',
fullyQualifiedName: 'beta.v2.files.upload',
httpMethod: 'post',
httpPath: '/api/v2/files/upload',
},
- { clientCallName: 'client.webhooks.unsafeUnwrap', fullyQualifiedName: 'webhooks.unsafeUnwrap' },
{ clientCallName: 'client.webhooks.unwrap', fullyQualifiedName: 'webhooks.unwrap' },
+ { clientCallName: 'client.webhooks.unsafeUnwrap', fullyQualifiedName: 'webhooks.unsafeUnwrap' },
];
function allowedMethodsForCodeTool(options: McpOptions | undefined): SdkMethod[] | undefined {
diff --git a/packages/mcp-server/src/options.ts b/packages/mcp-server/src/options.ts
index f1518764..ff817c70 100644
--- a/packages/mcp-server/src/options.ts
+++ b/packages/mcp-server/src/options.ts
@@ -18,7 +18,7 @@ export type McpOptions = {
includeCodeTool?: boolean | undefined;
includeDocsTools?: boolean | undefined;
stainlessApiKey?: string | undefined;
- docsSearchMode?: 'stainless-api' | 'local' | undefined;
+ docsSearchMode?: 'local' | undefined;
docsDir?: string | undefined;
codeAllowHttpGets?: boolean | undefined;
codeAllowedMethods?: string[] | undefined;
@@ -27,7 +27,7 @@ export type McpOptions = {
customInstructionsPath?: string | undefined;
};
-export type McpCodeExecutionMode = 'stainless-sandbox' | 'local';
+export type McpCodeExecutionMode = 'local';
export function parseCLIOptions(): CLIOptions {
const opts = yargs(hideBin(process.argv))
@@ -50,10 +50,10 @@ export function parseCLIOptions(): CLIOptions {
})
.option('code-execution-mode', {
type: 'string',
- choices: ['stainless-sandbox', 'local'],
- default: 'stainless-sandbox',
+ choices: ['local'],
+ default: 'local',
description:
- "Where to run code execution in code tool; 'stainless-sandbox' will execute code in Stainless-hosted sandboxes whereas 'local' will execute code locally on the MCP server machine.",
+ 'The server was generated without access to the Stainless API, so code execution can only run locally on the MCP server machine.',
})
.option('custom-instructions-path', {
type: 'string',
@@ -67,10 +67,10 @@ export function parseCLIOptions(): CLIOptions {
})
.option('docs-search-mode', {
type: 'string',
- choices: ['stainless-api', 'local'],
- default: 'stainless-api',
+ choices: ['local'],
+ default: 'local',
description:
- "Where to search documentation; 'stainless-api' uses the Stainless-hosted search API whereas 'local' uses an in-memory search index built from embedded SDK method data and optional local docs files.",
+ "Documentation search will use an in-memory search index built from embedded SDK method data and optional local docs files; the 'stainless-api' option is unavailable.",
})
.option('log-format', {
type: 'string',
@@ -132,7 +132,7 @@ export function parseCLIOptions(): CLIOptions {
...(includeDocsTools !== undefined && { includeDocsTools }),
debug: !!argv.debug,
stainlessApiKey: argv.stainlessApiKey,
- docsSearchMode: argv.docsSearchMode as 'stainless-api' | 'local' | undefined,
+ docsSearchMode: argv.docsSearchMode as 'local' | undefined,
docsDir: argv.docsDir,
codeAllowHttpGets: argv.codeAllowHttpGets,
codeAllowedMethods: argv.codeAllowedMethods,
diff --git a/packages/mcp-server/src/server.ts b/packages/mcp-server/src/server.ts
index bf22a1cf..eaa4c250 100644
--- a/packages/mcp-server/src/server.ts
+++ b/packages/mcp-server/src/server.ts
@@ -182,7 +182,7 @@ export function selectTools(options?: McpOptions): McpTool[] {
includedTools.push(
codeTool({
blockedMethods: blockedMethodsForCodeTool(options),
- codeExecutionMode: options?.codeExecutionMode ?? 'stainless-sandbox',
+ codeExecutionMode: options?.codeExecutionMode ?? 'local',
}),
);
}
diff --git a/release-please-config.json b/release-please-config.json
index 9b042792..05473e64 100644
--- a/release-please-config.json
+++ b/release-please-config.json
@@ -2,11 +2,11 @@
"packages": {
".": {}
},
- "$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json",
+ "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"include-v-in-tag": true,
"include-component-in-tag": false,
"versioning": "prerelease",
- "prerelease": true,
+ "prerelease": false,
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": false,
"pull-request-header": "Automated Release PR",
diff --git a/scripts/build b/scripts/build
index fe159668..0157eebd 100755
--- a/scripts/build
+++ b/scripts/build
@@ -52,6 +52,6 @@ fi
# build all sub-packages
for dir in packages/*; do
if [ -d "$dir" ]; then
- (cd "$dir" && yarn install && yarn build)
+ (cd "$dir" && yarn install --pure-lockfile && yarn build)
fi
done
diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh
index e169cf10..f2ecc704 100755
--- a/scripts/utils/upload-artifact.sh
+++ b/scripts/utils/upload-artifact.sh
@@ -20,7 +20,7 @@ UPLOAD_RESPONSE=$(curl -v -X PUT \
if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then
echo -e "\033[32mUploaded build to Stainless storage.\033[0m"
- echo -e "\033[32mInstallation: npm install 'https://pkg.stainless.com/s/imagekit-typescript/$SHA'\033[0m"
+ echo -e "\033[32mInstallation: npm install 'https://pkg.stainless.com/s/imagekit-nodejs-staging/$SHA'\033[0m"
else
echo -e "\033[31mFailed to upload artifact.\033[0m"
exit 1
diff --git a/src/client.ts b/src/client.ts
index b3e24eb4..21f5fd6a 100644
--- a/src/client.ts
+++ b/src/client.ts
@@ -116,7 +116,7 @@ export interface ClientOptions {
/**
* Your ImageKit webhook secret for verifying webhook signatures (starts with `whsec_`).
* You can find this in the [ImageKit dashboard](https://imagekit.io/dashboard/developer/webhooks).
- * Only required if you're using webhooks.
+ * Only required if you are using webhooks.
*
*/
webhookSecret?: string | null | undefined;
@@ -876,8 +876,8 @@ export declare namespace ImageKit {
type CustomMetadataFieldListResponse as CustomMetadataFieldListResponse,
type CustomMetadataFieldDeleteResponse as CustomMetadataFieldDeleteResponse,
type CustomMetadataFieldCreateParams as CustomMetadataFieldCreateParams,
- type CustomMetadataFieldUpdateParams as CustomMetadataFieldUpdateParams,
type CustomMetadataFieldListParams as CustomMetadataFieldListParams,
+ type CustomMetadataFieldUpdateParams as CustomMetadataFieldUpdateParams,
};
export {
@@ -891,11 +891,11 @@ export declare namespace ImageKit {
type FileMoveResponse as FileMoveResponse,
type FileRenameResponse as FileRenameResponse,
type FileUploadResponse as FileUploadResponse,
+ type FileUploadParams as FileUploadParams,
type FileUpdateParams as FileUpdateParams,
type FileCopyParams as FileCopyParams,
type FileMoveParams as FileMoveParams,
type FileRenameParams as FileRenameParams,
- type FileUploadParams as FileUploadParams,
};
export {
diff --git a/src/resources/accounts/origins.ts b/src/resources/accounts/origins.ts
index f59a468e..6f756119 100644
--- a/src/resources/accounts/origins.ts
+++ b/src/resources/accounts/origins.ts
@@ -7,6 +7,20 @@ import { RequestOptions } from '../../internal/request-options';
import { path } from '../../internal/utils/path';
export class Origins extends APIResource {
+ /**
+ * **Note:** This API is currently in beta.
+ * Returns an array of all configured origins for the current account.
+ *
+ * @example
+ * ```ts
+ * const originResponses =
+ * await client.accounts.origins.list();
+ * ```
+ */
+ list(options?: RequestOptions): APIPromise {
+ return this._client.get('/v1/accounts/origins', options);
+ }
+
/**
* **Note:** This API is currently in beta.
* Creates a new origin and returns the origin object.
@@ -28,6 +42,21 @@ export class Origins extends APIResource {
return this._client.post('/v1/accounts/origins', { body, ...options });
}
+ /**
+ * **Note:** This API is currently in beta.
+ * Retrieves the origin identified by `id`.
+ *
+ * @example
+ * ```ts
+ * const originResponse = await client.accounts.origins.get(
+ * 'id',
+ * );
+ * ```
+ */
+ get(id: string, options?: RequestOptions): APIPromise {
+ return this._client.get(path`/v1/accounts/origins/${id}`, options);
+ }
+
/**
* **Note:** This API is currently in beta.
* Updates the origin identified by `id` and returns the updated origin object.
@@ -50,20 +79,6 @@ export class Origins extends APIResource {
return this._client.put(path`/v1/accounts/origins/${id}`, { body, ...options });
}
- /**
- * **Note:** This API is currently in beta.
- * Returns an array of all configured origins for the current account.
- *
- * @example
- * ```ts
- * const originResponses =
- * await client.accounts.origins.list();
- * ```
- */
- list(options?: RequestOptions): APIPromise {
- return this._client.get('/v1/accounts/origins', options);
- }
-
/**
* **Note:** This API is currently in beta.
* Permanently removes the origin identified by `id`. If the origin is in use by
@@ -80,21 +95,6 @@ export class Origins extends APIResource {
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
});
}
-
- /**
- * **Note:** This API is currently in beta.
- * Retrieves the origin identified by `id`.
- *
- * @example
- * ```ts
- * const originResponse = await client.accounts.origins.get(
- * 'id',
- * );
- * ```
- */
- get(id: string, options?: RequestOptions): APIPromise {
- return this._client.get(path`/v1/accounts/origins/${id}`, options);
- }
}
/**
diff --git a/src/resources/accounts/url-endpoints.ts b/src/resources/accounts/url-endpoints.ts
index 7bd424c4..371ea3e3 100644
--- a/src/resources/accounts/url-endpoints.ts
+++ b/src/resources/accounts/url-endpoints.ts
@@ -7,6 +7,21 @@ import { RequestOptions } from '../../internal/request-options';
import { path } from '../../internal/utils/path';
export class URLEndpoints extends APIResource {
+ /**
+ * **Note:** This API is currently in beta.
+ * Returns an array of all URL‑endpoints configured including the default
+ * URL-endpoint generated by ImageKit during account creation.
+ *
+ * @example
+ * ```ts
+ * const urlEndpointResponses =
+ * await client.accounts.urlEndpoints.list();
+ * ```
+ */
+ list(options?: RequestOptions): APIPromise {
+ return this._client.get('/v1/accounts/url-endpoints', options);
+ }
+
/**
* **Note:** This API is currently in beta.
* Creates a new URL‑endpoint and returns the resulting object.
@@ -23,6 +38,20 @@ export class URLEndpoints extends APIResource {
return this._client.post('/v1/accounts/url-endpoints', { body, ...options });
}
+ /**
+ * **Note:** This API is currently in beta.
+ * Retrieves the URL‑endpoint identified by `id`.
+ *
+ * @example
+ * ```ts
+ * const urlEndpointResponse =
+ * await client.accounts.urlEndpoints.get('id');
+ * ```
+ */
+ get(id: string, options?: RequestOptions): APIPromise {
+ return this._client.get(path`/v1/accounts/url-endpoints/${id}`, options);
+ }
+
/**
* **Note:** This API is currently in beta.
* Updates the URL‑endpoint identified by `id` and returns the updated object.
@@ -43,21 +72,6 @@ export class URLEndpoints extends APIResource {
return this._client.put(path`/v1/accounts/url-endpoints/${id}`, { body, ...options });
}
- /**
- * **Note:** This API is currently in beta.
- * Returns an array of all URL‑endpoints configured including the default
- * URL-endpoint generated by ImageKit during account creation.
- *
- * @example
- * ```ts
- * const urlEndpointResponses =
- * await client.accounts.urlEndpoints.list();
- * ```
- */
- list(options?: RequestOptions): APIPromise {
- return this._client.get('/v1/accounts/url-endpoints', options);
- }
-
/**
* **Note:** This API is currently in beta.
* Deletes the URL‑endpoint identified by `id`. You cannot delete the default
@@ -74,20 +88,6 @@ export class URLEndpoints extends APIResource {
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
});
}
-
- /**
- * **Note:** This API is currently in beta.
- * Retrieves the URL‑endpoint identified by `id`.
- *
- * @example
- * ```ts
- * const urlEndpointResponse =
- * await client.accounts.urlEndpoints.get('id');
- * ```
- */
- get(id: string, options?: RequestOptions): APIPromise {
- return this._client.get(path`/v1/accounts/url-endpoints/${id}`, options);
- }
}
/**
diff --git a/src/resources/custom-metadata-fields.ts b/src/resources/custom-metadata-fields.ts
index 81081924..489fb5d8 100644
--- a/src/resources/custom-metadata-fields.ts
+++ b/src/resources/custom-metadata-fields.ts
@@ -30,26 +30,6 @@ export class CustomMetadataFields extends APIResource {
return this._client.post('/v1/customMetadataFields', { body, ...options });
}
- /**
- * This API updates the label or schema of an existing custom metadata field.
- *
- * @example
- * ```ts
- * const customMetadataField =
- * await client.customMetadataFields.update('id', {
- * label: 'price',
- * schema: { minValue: 1000, maxValue: 3000 },
- * });
- * ```
- */
- update(
- id: string,
- body: CustomMetadataFieldUpdateParams | null | undefined = {},
- options?: RequestOptions,
- ): APIPromise {
- return this._client.patch(path`/v1/customMetadataFields/${id}`, { body, ...options });
- }
-
/**
* This API returns the array of created custom metadata field objects. By default
* the API returns only non deleted field objects, but you can include deleted
@@ -73,6 +53,26 @@ export class CustomMetadataFields extends APIResource {
return this._client.get('/v1/customMetadataFields', { query, ...options });
}
+ /**
+ * This API updates the label or schema of an existing custom metadata field.
+ *
+ * @example
+ * ```ts
+ * const customMetadataField =
+ * await client.customMetadataFields.update('id', {
+ * label: 'price',
+ * schema: { minValue: 1000, maxValue: 3000 },
+ * });
+ * ```
+ */
+ update(
+ id: string,
+ body: CustomMetadataFieldUpdateParams | null | undefined = {},
+ options?: RequestOptions,
+ ): APIPromise {
+ return this._client.patch(path`/v1/customMetadataFields/${id}`, { body, ...options });
+ }
+
/**
* This API deletes a custom metadata field. Even after deleting a custom metadata
* field, you cannot create any new custom metadata field with the same name.
@@ -245,6 +245,21 @@ export namespace CustomMetadataFieldCreateParams {
}
}
+export interface CustomMetadataFieldListParams {
+ /**
+ * The folder path (e.g., `/path/to/folder`) for which to retrieve applicable
+ * custom metadata fields. Useful for determining path-specific field selections
+ * when the [Path policy](https://imagekit.io/docs/dam/path-policy) feature is in
+ * use.
+ */
+ folderPath?: string;
+
+ /**
+ * Set it to `true` to include deleted field objects in the API response.
+ */
+ includeDeleted?: boolean;
+}
+
export interface CustomMetadataFieldUpdateParams {
/**
* Human readable name of the custom metadata field. This should be unique across
@@ -319,28 +334,13 @@ export namespace CustomMetadataFieldUpdateParams {
}
}
-export interface CustomMetadataFieldListParams {
- /**
- * The folder path (e.g., `/path/to/folder`) for which to retrieve applicable
- * custom metadata fields. Useful for determining path-specific field selections
- * when the [Path policy](https://imagekit.io/docs/dam/path-policy) feature is in
- * use.
- */
- folderPath?: string;
-
- /**
- * Set it to `true` to include deleted field objects in the API response.
- */
- includeDeleted?: boolean;
-}
-
export declare namespace CustomMetadataFields {
export {
type CustomMetadataField as CustomMetadataField,
type CustomMetadataFieldListResponse as CustomMetadataFieldListResponse,
type CustomMetadataFieldDeleteResponse as CustomMetadataFieldDeleteResponse,
type CustomMetadataFieldCreateParams as CustomMetadataFieldCreateParams,
- type CustomMetadataFieldUpdateParams as CustomMetadataFieldUpdateParams,
type CustomMetadataFieldListParams as CustomMetadataFieldListParams,
+ type CustomMetadataFieldUpdateParams as CustomMetadataFieldUpdateParams,
};
}
diff --git a/src/resources/files/bulk.ts b/src/resources/files/bulk.ts
index 35dec26f..f9fb0b23 100644
--- a/src/resources/files/bulk.ts
+++ b/src/resources/files/bulk.ts
@@ -48,41 +48,41 @@ export class Bulk extends APIResource {
}
/**
- * This API removes AITags from multiple files in bulk. A maximum of 50 files can
- * be specified at a time.
+ * This API removes tags from multiple files in bulk. A maximum of 50 files can be
+ * specified at a time.
*
* @example
* ```ts
- * const response = await client.files.bulk.removeAITags({
- * AITags: ['t-shirt', 'round-neck', 'sale2019'],
+ * const response = await client.files.bulk.removeTags({
* fileIds: [
* '598821f949c0a938d57563bd',
* '598821f949c0a938d57563be',
* ],
+ * tags: ['t-shirt', 'round-neck', 'sale2019'],
* });
* ```
*/
- removeAITags(body: BulkRemoveAITagsParams, options?: RequestOptions): APIPromise {
- return this._client.post('/v1/files/removeAITags', { body, ...options });
+ removeTags(body: BulkRemoveTagsParams, options?: RequestOptions): APIPromise {
+ return this._client.post('/v1/files/removeTags', { body, ...options });
}
/**
- * This API removes tags from multiple files in bulk. A maximum of 50 files can be
- * specified at a time.
+ * This API removes AITags from multiple files in bulk. A maximum of 50 files can
+ * be specified at a time.
*
* @example
* ```ts
- * const response = await client.files.bulk.removeTags({
+ * const response = await client.files.bulk.removeAITags({
+ * AITags: ['t-shirt', 'round-neck', 'sale2019'],
* fileIds: [
* '598821f949c0a938d57563bd',
* '598821f949c0a938d57563be',
* ],
- * tags: ['t-shirt', 'round-neck', 'sale2019'],
* });
* ```
*/
- removeTags(body: BulkRemoveTagsParams, options?: RequestOptions): APIPromise {
- return this._client.post('/v1/files/removeTags', { body, ...options });
+ removeAITags(body: BulkRemoveAITagsParams, options?: RequestOptions): APIPromise {
+ return this._client.post('/v1/files/removeAITags', { body, ...options });
}
}
@@ -133,28 +133,28 @@ export interface BulkAddTagsParams {
tags: Array;
}
-export interface BulkRemoveAITagsParams {
+export interface BulkRemoveTagsParams {
/**
- * An array of AITags that you want to remove from the files.
+ * An array of fileIds from which you want to remove tags.
*/
- AITags: Array;
+ fileIds: Array;
/**
- * An array of fileIds from which you want to remove AITags.
+ * An array of tags that you want to remove from the files.
*/
- fileIds: Array;
+ tags: Array;
}
-export interface BulkRemoveTagsParams {
+export interface BulkRemoveAITagsParams {
/**
- * An array of fileIds from which you want to remove tags.
+ * An array of AITags that you want to remove from the files.
*/
- fileIds: Array;
+ AITags: Array;
/**
- * An array of tags that you want to remove from the files.
+ * An array of fileIds from which you want to remove AITags.
*/
- tags: Array;
+ fileIds: Array;
}
export declare namespace Bulk {
@@ -165,7 +165,7 @@ export declare namespace Bulk {
type BulkRemoveTagsResponse as BulkRemoveTagsResponse,
type BulkDeleteParams as BulkDeleteParams,
type BulkAddTagsParams as BulkAddTagsParams,
- type BulkRemoveAITagsParams as BulkRemoveAITagsParams,
type BulkRemoveTagsParams as BulkRemoveTagsParams,
+ type BulkRemoveAITagsParams as BulkRemoveAITagsParams,
};
}
diff --git a/src/resources/files/files.ts b/src/resources/files/files.ts
index ccf97c30..9a66ab9b 100644
--- a/src/resources/files/files.ts
+++ b/src/resources/files/files.ts
@@ -38,6 +38,69 @@ export class Files extends APIResource {
versions: VersionsAPI.Versions = new VersionsAPI.Versions(this._client);
metadata: MetadataAPI.Metadata = new MetadataAPI.Metadata(this._client);
+ /**
+ * ImageKit.io allows you to upload files directly from both the server and client
+ * sides. For server-side uploads, private API key authentication is used. For
+ * client-side uploads, generate a one-time `token`, `signature`, and `expire` from
+ * your secure backend using private API.
+ * [Learn more](/docs/api-reference/upload-file/upload-file#how-to-implement-client-side-file-upload)
+ * about how to implement client-side file upload.
+ *
+ * The [V2 API](/docs/api-reference/upload-file/upload-file-v2) enhances security
+ * by verifying the entire payload using JWT.
+ *
+ * **File size limit** \
+ * On the free plan, the maximum upload file sizes are 25MB for images, audio, and raw
+ * files and 100MB for videos. On the Lite paid plan, these limits increase to 40MB
+ * for images, audio, and raw files and 300MB for videos, whereas on the Pro paid plan,
+ * these limits increase to 50MB for images, audio, and raw files and 2GB for videos.
+ * These limits can be further increased with enterprise plans.
+ *
+ * **Version limit** \
+ * A file can have a maximum of 100 versions.
+ *
+ * **Demo applications**
+ *
+ * - A full-fledged
+ * [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader),
+ * supporting file selections from local storage, URL, Dropbox, Google Drive,
+ * Instagram, and more.
+ * - [Quick start guides](/docs/quick-start-guides) for various frameworks and
+ * technologies.
+ *
+ * @example
+ * ```ts
+ * const response = await client.files.upload({
+ * file: fs.createReadStream('path/to/file'),
+ * fileName: 'fileName',
+ * });
+ * ```
+ */
+ upload(body: FileUploadParams, options?: RequestOptions): APIPromise {
+ const serializedBody = serializeUploadOptions(body);
+
+ return this._client.post(
+ '/api/v1/files/upload',
+ multipartFormRequestOptions(
+ { body: serializedBody, defaultBaseURL: 'https://upload.imagekit.io', ...options },
+ this._client,
+ ),
+ );
+ }
+
+ /**
+ * This API returns an object with details or attributes about the current version
+ * of the file.
+ *
+ * @example
+ * ```ts
+ * const file = await client.files.get('fileId');
+ * ```
+ */
+ get(fileID: string, options?: RequestOptions): APIPromise {
+ return this._client.get(path`/v1/files/${fileID}/details`, options);
+ }
+
/**
* This API updates the details or attributes of the current version of the file.
* You can update `tags`, `customCoordinates`, `customMetadata`, publication
@@ -90,19 +153,6 @@ export class Files extends APIResource {
return this._client.post('/v1/files/copy', { body, ...options });
}
- /**
- * This API returns an object with details or attributes about the current version
- * of the file.
- *
- * @example
- * ```ts
- * const file = await client.files.get('fileId');
- * ```
- */
- get(fileID: string, options?: RequestOptions): APIPromise {
- return this._client.get(path`/v1/files/${fileID}/details`, options);
- }
-
/**
* This will move a file and all its versions from one folder to another.
*
@@ -139,56 +189,6 @@ export class Files extends APIResource {
rename(body: FileRenameParams, options?: RequestOptions): APIPromise {
return this._client.put('/v1/files/rename', { body, ...options });
}
-
- /**
- * ImageKit.io allows you to upload files directly from both the server and client
- * sides. For server-side uploads, private API key authentication is used. For
- * client-side uploads, generate a one-time `token`, `signature`, and `expire` from
- * your secure backend using private API.
- * [Learn more](/docs/api-reference/upload-file/upload-file#how-to-implement-client-side-file-upload)
- * about how to implement client-side file upload.
- *
- * The [V2 API](/docs/api-reference/upload-file/upload-file-v2) enhances security
- * by verifying the entire payload using JWT.
- *
- * **File size limit** \
- * On the free plan, the maximum upload file sizes are 25MB for images, audio, and raw
- * files and 100MB for videos. On the Lite paid plan, these limits increase to 40MB
- * for images, audio, and raw files and 300MB for videos, whereas on the Pro paid plan,
- * these limits increase to 50MB for images, audio, and raw files and 2GB for videos.
- * These limits can be further increased with enterprise plans.
- *
- * **Version limit** \
- * A file can have a maximum of 100 versions.
- *
- * **Demo applications**
- *
- * - A full-fledged
- * [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader),
- * supporting file selections from local storage, URL, Dropbox, Google Drive,
- * Instagram, and more.
- * - [Quick start guides](/docs/quick-start-guides) for various frameworks and
- * technologies.
- *
- * @example
- * ```ts
- * const response = await client.files.upload({
- * file: fs.createReadStream('path/to/file'),
- * fileName: 'fileName',
- * });
- * ```
- */
- upload(body: FileUploadParams, options?: RequestOptions): APIPromise {
- const serializedBody = serializeUploadOptions(body);
-
- return this._client.post(
- '/api/v1/files/upload',
- multipartFormRequestOptions(
- { body: serializedBody, defaultBaseURL: 'https://upload.imagekit.io', ...options },
- this._client,
- ),
- );
- }
}
/**
@@ -1120,155 +1120,6 @@ export namespace FileUploadResponse {
}
}
-export type FileUpdateParams = FileUpdateParams.UpdateFileDetails | FileUpdateParams.ChangePublicationStatus;
-
-export declare namespace FileUpdateParams {
- export interface UpdateFileDetails {
- /**
- * Define an important area in the image in the format `x,y,width,height` e.g.
- * `10,10,100,100`. Send `null` to unset this value.
- */
- customCoordinates?: string | null;
-
- /**
- * A key-value data to be associated with the asset. To unset a key, send `null`
- * value for that key. Before setting any custom metadata on an asset you have to
- * create the field using custom metadata fields API.
- */
- customMetadata?: { [key: string]: unknown };
-
- /**
- * Optional text to describe the contents of the file.
- */
- description?: string;
-
- /**
- * Array of extensions to be applied to the asset. Each extension can be configured
- * with specific parameters based on the extension type.
- */
- extensions?: Shared.Extensions;
-
- /**
- * An array of AITags associated with the file that you want to remove, e.g.
- * `["car", "vehicle", "motorsports"]`.
- *
- * If you want to remove all AITags associated with the file, send a string -
- * "all".
- *
- * Note: The remove operation for `AITags` executes before any of the `extensions`
- * are processed.
- */
- removeAITags?: Array | 'all';
-
- /**
- * An array of tags associated with the file, such as `["tag1", "tag2"]`. Send
- * `null` to unset all tags associated with the file.
- */
- tags?: Array | null;
-
- /**
- * The final status of extensions after they have completed execution will be
- * delivered to this endpoint as a POST request.
- * [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure)
- * about the webhook payload structure.
- */
- webhookUrl?: string;
- }
-
- export interface ChangePublicationStatus {
- /**
- * Configure the publication status of a file and its versions.
- */
- publish?: ChangePublicationStatus.Publish;
- }
-
- export namespace ChangePublicationStatus {
- /**
- * Configure the publication status of a file and its versions.
- */
- export interface Publish {
- /**
- * Set to `true` to publish the file. Set to `false` to unpublish the file.
- */
- isPublished: boolean;
-
- /**
- * Set to `true` to publish/unpublish all versions of the file. Set to `false` to
- * publish/unpublish only the current version of the file.
- */
- includeFileVersions?: boolean;
- }
- }
-}
-
-export interface FileCopyParams {
- /**
- * Full path to the folder you want to copy the above file into.
- */
- destinationPath: string;
-
- /**
- * The full path of the file you want to copy.
- */
- sourceFilePath: string;
-
- /**
- * Option to copy all versions of a file. By default, only the current version of
- * the file is copied. When set to true, all versions of the file will be copied.
- * Default value - `false`.
- */
- includeFileVersions?: boolean;
-}
-
-export interface FileMoveParams {
- /**
- * Full path to the folder you want to move the above file into.
- */
- destinationPath: string;
-
- /**
- * The full path of the file you want to move.
- */
- sourceFilePath: string;
-}
-
-export interface FileRenameParams {
- /**
- * The full path of the file you want to rename.
- */
- filePath: string;
-
- /**
- * The new name of the file. A filename can contain:
- *
- * Alphanumeric Characters: `a-z`, `A-Z`, `0-9` (including Unicode letters, marks,
- * and numerals in other languages). Special Characters: `.`, `_`, and `-`.
- *
- * Any other character, including space, will be replaced by `_`.
- */
- newFileName: string;
-
- /**
- * Option to purge cache for the old file and its versions' URLs.
- *
- * When set to true, it will internally issue a purge cache request on CDN to
- * remove cached content of old file and its versions. This purge request is
- * counted against your monthly purge quota.
- *
- * Note: If the old file were accessible at
- * `https://ik.imagekit.io/demo/old-filename.jpg`, a purge cache request would be
- * issued against `https://ik.imagekit.io/demo/old-filename.jpg*` (with a wildcard
- * at the end). It will remove the file and its versions' URLs and any
- * transformations made using query parameters on this file or its versions.
- * However, the cache for file transformations made using path parameters will
- * persist. You can purge them using the purge API. For more details, refer to the
- * purge API documentation.
- *
- * Default value - `false`
- */
- purgeCache?: boolean;
-}
-
export interface FileUploadParams {
/**
* The API accepts any of the following:
@@ -1572,6 +1423,155 @@ export namespace FileUploadParams {
}
}
+export type FileUpdateParams = FileUpdateParams.UpdateFileDetails | FileUpdateParams.ChangePublicationStatus;
+
+export declare namespace FileUpdateParams {
+ export interface UpdateFileDetails {
+ /**
+ * Define an important area in the image in the format `x,y,width,height` e.g.
+ * `10,10,100,100`. Send `null` to unset this value.
+ */
+ customCoordinates?: string | null;
+
+ /**
+ * A key-value data to be associated with the asset. To unset a key, send `null`
+ * value for that key. Before setting any custom metadata on an asset you have to
+ * create the field using custom metadata fields API.
+ */
+ customMetadata?: { [key: string]: unknown };
+
+ /**
+ * Optional text to describe the contents of the file.
+ */
+ description?: string;
+
+ /**
+ * Array of extensions to be applied to the asset. Each extension can be configured
+ * with specific parameters based on the extension type.
+ */
+ extensions?: Shared.Extensions;
+
+ /**
+ * An array of AITags associated with the file that you want to remove, e.g.
+ * `["car", "vehicle", "motorsports"]`.
+ *
+ * If you want to remove all AITags associated with the file, send a string -
+ * "all".
+ *
+ * Note: The remove operation for `AITags` executes before any of the `extensions`
+ * are processed.
+ */
+ removeAITags?: Array | 'all';
+
+ /**
+ * An array of tags associated with the file, such as `["tag1", "tag2"]`. Send
+ * `null` to unset all tags associated with the file.
+ */
+ tags?: Array | null;
+
+ /**
+ * The final status of extensions after they have completed execution will be
+ * delivered to this endpoint as a POST request.
+ * [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure)
+ * about the webhook payload structure.
+ */
+ webhookUrl?: string;
+ }
+
+ export interface ChangePublicationStatus {
+ /**
+ * Configure the publication status of a file and its versions.
+ */
+ publish?: ChangePublicationStatus.Publish;
+ }
+
+ export namespace ChangePublicationStatus {
+ /**
+ * Configure the publication status of a file and its versions.
+ */
+ export interface Publish {
+ /**
+ * Set to `true` to publish the file. Set to `false` to unpublish the file.
+ */
+ isPublished: boolean;
+
+ /**
+ * Set to `true` to publish/unpublish all versions of the file. Set to `false` to
+ * publish/unpublish only the current version of the file.
+ */
+ includeFileVersions?: boolean;
+ }
+ }
+}
+
+export interface FileCopyParams {
+ /**
+ * Full path to the folder you want to copy the above file into.
+ */
+ destinationPath: string;
+
+ /**
+ * The full path of the file you want to copy.
+ */
+ sourceFilePath: string;
+
+ /**
+ * Option to copy all versions of a file. By default, only the current version of
+ * the file is copied. When set to true, all versions of the file will be copied.
+ * Default value - `false`.
+ */
+ includeFileVersions?: boolean;
+}
+
+export interface FileMoveParams {
+ /**
+ * Full path to the folder you want to move the above file into.
+ */
+ destinationPath: string;
+
+ /**
+ * The full path of the file you want to move.
+ */
+ sourceFilePath: string;
+}
+
+export interface FileRenameParams {
+ /**
+ * The full path of the file you want to rename.
+ */
+ filePath: string;
+
+ /**
+ * The new name of the file. A filename can contain:
+ *
+ * Alphanumeric Characters: `a-z`, `A-Z`, `0-9` (including Unicode letters, marks,
+ * and numerals in other languages). Special Characters: `.`, `_`, and `-`.
+ *
+ * Any other character, including space, will be replaced by `_`.
+ */
+ newFileName: string;
+
+ /**
+ * Option to purge cache for the old file and its versions' URLs.
+ *
+ * When set to true, it will internally issue a purge cache request on CDN to
+ * remove cached content of old file and its versions. This purge request is
+ * counted against your monthly purge quota.
+ *
+ * Note: If the old file were accessible at
+ * `https://ik.imagekit.io/demo/old-filename.jpg`, a purge cache request would be
+ * issued against `https://ik.imagekit.io/demo/old-filename.jpg*` (with a wildcard
+ * at the end). It will remove the file and its versions' URLs and any
+ * transformations made using query parameters on this file or its versions.
+ * However, the cache for file transformations made using path parameters will
+ * persist. You can purge them using the purge API. For more details, refer to the
+ * purge API documentation.
+ *
+ * Default value - `false`
+ */
+ purgeCache?: boolean;
+}
+
Files.Bulk = Bulk;
Files.Versions = Versions;
@@ -1586,11 +1586,11 @@ export declare namespace Files {
type FileMoveResponse as FileMoveResponse,
type FileRenameResponse as FileRenameResponse,
type FileUploadResponse as FileUploadResponse,
+ type FileUploadParams as FileUploadParams,
type FileUpdateParams as FileUpdateParams,
type FileCopyParams as FileCopyParams,
type FileMoveParams as FileMoveParams,
type FileRenameParams as FileRenameParams,
- type FileUploadParams as FileUploadParams,
};
export {
@@ -1601,16 +1601,16 @@ export declare namespace Files {
type BulkRemoveTagsResponse as BulkRemoveTagsResponse,
type BulkDeleteParams as BulkDeleteParams,
type BulkAddTagsParams as BulkAddTagsParams,
- type BulkRemoveAITagsParams as BulkRemoveAITagsParams,
type BulkRemoveTagsParams as BulkRemoveTagsParams,
+ type BulkRemoveAITagsParams as BulkRemoveAITagsParams,
};
export {
Versions as Versions,
type VersionListResponse as VersionListResponse,
type VersionDeleteResponse as VersionDeleteResponse,
- type VersionDeleteParams as VersionDeleteParams,
type VersionGetParams as VersionGetParams,
+ type VersionDeleteParams as VersionDeleteParams,
type VersionRestoreParams as VersionRestoreParams,
};
diff --git a/src/resources/files/index.ts b/src/resources/files/index.ts
index de6d1ad7..f36806ef 100644
--- a/src/resources/files/index.ts
+++ b/src/resources/files/index.ts
@@ -8,8 +8,8 @@ export {
type BulkRemoveTagsResponse,
type BulkDeleteParams,
type BulkAddTagsParams,
- type BulkRemoveAITagsParams,
type BulkRemoveTagsParams,
+ type BulkRemoveAITagsParams,
} from './bulk';
export {
Files,
@@ -22,18 +22,18 @@ export {
type FileMoveResponse,
type FileRenameResponse,
type FileUploadResponse,
+ type FileUploadParams,
type FileUpdateParams,
type FileCopyParams,
type FileMoveParams,
type FileRenameParams,
- type FileUploadParams,
} from './files';
export {
Versions,
type VersionListResponse,
type VersionDeleteResponse,
- type VersionDeleteParams,
type VersionGetParams,
+ type VersionDeleteParams,
type VersionRestoreParams,
} from './versions';
export { type MetadataGetFromURLParams } from './metadata';
diff --git a/src/resources/files/versions.ts b/src/resources/files/versions.ts
index 4cd160bd..7c936b75 100644
--- a/src/resources/files/versions.ts
+++ b/src/resources/files/versions.ts
@@ -19,6 +19,21 @@ export class Versions extends APIResource {
return this._client.get(path`/v1/files/${fileID}/versions`, options);
}
+ /**
+ * This API returns an object with details or attributes of a file version.
+ *
+ * @example
+ * ```ts
+ * const file = await client.files.versions.get('versionId', {
+ * fileId: 'fileId',
+ * });
+ * ```
+ */
+ get(versionID: string, params: VersionGetParams, options?: RequestOptions): APIPromise {
+ const { fileId } = params;
+ return this._client.get(path`/v1/files/${fileId}/versions/${versionID}`, options);
+ }
+
/**
* This API deletes a non-current file version permanently. The API returns an
* empty response.
@@ -42,21 +57,6 @@ export class Versions extends APIResource {
return this._client.delete(path`/v1/files/${fileId}/versions/${versionID}`, options);
}
- /**
- * This API returns an object with details or attributes of a file version.
- *
- * @example
- * ```ts
- * const file = await client.files.versions.get('versionId', {
- * fileId: 'fileId',
- * });
- * ```
- */
- get(versionID: string, params: VersionGetParams, options?: RequestOptions): APIPromise {
- const { fileId } = params;
- return this._client.get(path`/v1/files/${fileId}/versions/${versionID}`, options);
- }
-
/**
* This API restores a file version as the current file version.
*
@@ -82,7 +82,7 @@ export type VersionListResponse = Array;
export interface VersionDeleteResponse {}
-export interface VersionDeleteParams {
+export interface VersionGetParams {
/**
* The unique `fileId` of the uploaded file. `fileId` is returned in list and
* search assets API and upload API.
@@ -90,7 +90,7 @@ export interface VersionDeleteParams {
fileId: string;
}
-export interface VersionGetParams {
+export interface VersionDeleteParams {
/**
* The unique `fileId` of the uploaded file. `fileId` is returned in list and
* search assets API and upload API.
@@ -110,8 +110,8 @@ export declare namespace Versions {
export {
type VersionListResponse as VersionListResponse,
type VersionDeleteResponse as VersionDeleteResponse,
- type VersionDeleteParams as VersionDeleteParams,
type VersionGetParams as VersionGetParams,
+ type VersionDeleteParams as VersionDeleteParams,
type VersionRestoreParams as VersionRestoreParams,
};
}
diff --git a/src/resources/index.ts b/src/resources/index.ts
index cda97941..16187cdf 100644
--- a/src/resources/index.ts
+++ b/src/resources/index.ts
@@ -11,8 +11,8 @@ export {
type CustomMetadataFieldListResponse,
type CustomMetadataFieldDeleteResponse,
type CustomMetadataFieldCreateParams,
- type CustomMetadataFieldUpdateParams,
type CustomMetadataFieldListParams,
+ type CustomMetadataFieldUpdateParams,
} from './custom-metadata-fields';
export {
Files,
@@ -25,11 +25,11 @@ export {
type FileMoveResponse,
type FileRenameResponse,
type FileUploadResponse,
+ type FileUploadParams,
type FileUpdateParams,
type FileCopyParams,
type FileMoveParams,
type FileRenameParams,
- type FileUploadParams,
} from './files/files';
export {
Folders,
diff --git a/src/resources/saved-extensions.ts b/src/resources/saved-extensions.ts
index ff39d734..b8bf687f 100644
--- a/src/resources/saved-extensions.ts
+++ b/src/resources/saved-extensions.ts
@@ -8,6 +8,20 @@ import { RequestOptions } from '../internal/request-options';
import { path } from '../internal/utils/path';
export class SavedExtensions extends APIResource {
+ /**
+ * This API returns an array of all saved extensions for your account. Saved
+ * extensions allow you to save complex extension configurations and reuse them by
+ * referencing them by ID in upload or update file APIs.
+ *
+ * @example
+ * ```ts
+ * const savedExtensions = await client.savedExtensions.list();
+ * ```
+ */
+ list(options?: RequestOptions): APIPromise {
+ return this._client.get('/v1/saved-extensions', options);
+ }
+
/**
* This API creates a new saved extension. Saved extensions allow you to save
* complex extension configurations (like AI tasks) and reuse them by referencing
@@ -39,6 +53,20 @@ export class SavedExtensions extends APIResource {
return this._client.post('/v1/saved-extensions', { body, ...options });
}
+ /**
+ * This API returns details of a specific saved extension by ID.
+ *
+ * @example
+ * ```ts
+ * const savedExtension = await client.savedExtensions.get(
+ * 'id',
+ * );
+ * ```
+ */
+ get(id: string, options?: RequestOptions): APIPromise {
+ return this._client.get(path`/v1/saved-extensions/${id}`, options);
+ }
+
/**
* This API updates an existing saved extension. You can update the name,
* description, or config.
@@ -58,20 +86,6 @@ export class SavedExtensions extends APIResource {
return this._client.patch(path`/v1/saved-extensions/${id}`, { body, ...options });
}
- /**
- * This API returns an array of all saved extensions for your account. Saved
- * extensions allow you to save complex extension configurations and reuse them by
- * referencing them by ID in upload or update file APIs.
- *
- * @example
- * ```ts
- * const savedExtensions = await client.savedExtensions.list();
- * ```
- */
- list(options?: RequestOptions): APIPromise {
- return this._client.get('/v1/saved-extensions', options);
- }
-
/**
* This API deletes a saved extension permanently.
*
@@ -86,20 +100,6 @@ export class SavedExtensions extends APIResource {
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
});
}
-
- /**
- * This API returns details of a specific saved extension by ID.
- *
- * @example
- * ```ts
- * const savedExtension = await client.savedExtensions.get(
- * 'id',
- * );
- * ```
- */
- get(id: string, options?: RequestOptions): APIPromise {
- return this._client.get(path`/v1/saved-extensions/${id}`, options);
- }
}
export type SavedExtensionListResponse = Array;
diff --git a/src/resources/webhooks.ts b/src/resources/webhooks.ts
index be299493..6348265a 100644
--- a/src/resources/webhooks.ts
+++ b/src/resources/webhooks.ts
@@ -6,10 +6,6 @@ import * as FilesAPI from './files/files';
import { Webhook } from 'standardwebhooks';
export class Webhooks extends APIResource {
- unsafeUnwrap(body: string): UnsafeUnwrapWebhookEvent {
- return JSON.parse(body) as UnsafeUnwrapWebhookEvent;
- }
-
unwrap(
body: string,
{ headers, key }: { headers: Record; key?: string },
@@ -22,6 +18,10 @@ export class Webhooks extends APIResource {
}
return JSON.parse(body) as UnwrapWebhookEvent;
}
+
+ unsafeUnwrap(body: string): UnsafeUnwrapWebhookEvent {
+ return JSON.parse(body) as UnsafeUnwrapWebhookEvent;
+ }
}
export interface BaseWebhookEvent {
diff --git a/tests/api-resources/accounts/origins.test.ts b/tests/api-resources/accounts/origins.test.ts
index 2be57f09..24b59dac 100644
--- a/tests/api-resources/accounts/origins.test.ts
+++ b/tests/api-resources/accounts/origins.test.ts
@@ -9,6 +9,18 @@ const client = new ImageKit({
});
describe('resource origins', () => {
+ // Mock server tests are disabled
+ test.skip('list', async () => {
+ const responsePromise = client.accounts.origins.list();
+ const rawResponse = await responsePromise.asResponse();
+ expect(rawResponse).toBeInstanceOf(Response);
+ const response = await responsePromise;
+ expect(response).not.toBeInstanceOf(Response);
+ const dataAndResponse = await responsePromise.withResponse();
+ expect(dataAndResponse.data).toBe(response);
+ expect(dataAndResponse.response).toBe(rawResponse);
+ });
+
// Mock server tests are disabled
test.skip('create: only required params', async () => {
const responsePromise = client.accounts.origins.create({
@@ -41,6 +53,18 @@ describe('resource origins', () => {
});
});
+ // Mock server tests are disabled
+ test.skip('get', async () => {
+ const responsePromise = client.accounts.origins.get('id');
+ const rawResponse = await responsePromise.asResponse();
+ expect(rawResponse).toBeInstanceOf(Response);
+ const response = await responsePromise;
+ expect(response).not.toBeInstanceOf(Response);
+ const dataAndResponse = await responsePromise.withResponse();
+ expect(dataAndResponse.data).toBe(response);
+ expect(dataAndResponse.response).toBe(rawResponse);
+ });
+
// Mock server tests are disabled
test.skip('update: only required params', async () => {
const responsePromise = client.accounts.origins.update('id', {
@@ -73,18 +97,6 @@ describe('resource origins', () => {
});
});
- // Mock server tests are disabled
- test.skip('list', async () => {
- const responsePromise = client.accounts.origins.list();
- const rawResponse = await responsePromise.asResponse();
- expect(rawResponse).toBeInstanceOf(Response);
- const response = await responsePromise;
- expect(response).not.toBeInstanceOf(Response);
- const dataAndResponse = await responsePromise.withResponse();
- expect(dataAndResponse.data).toBe(response);
- expect(dataAndResponse.response).toBe(rawResponse);
- });
-
// Mock server tests are disabled
test.skip('delete', async () => {
const responsePromise = client.accounts.origins.delete('id');
@@ -96,16 +108,4 @@ describe('resource origins', () => {
expect(dataAndResponse.data).toBe(response);
expect(dataAndResponse.response).toBe(rawResponse);
});
-
- // Mock server tests are disabled
- test.skip('get', async () => {
- const responsePromise = client.accounts.origins.get('id');
- const rawResponse = await responsePromise.asResponse();
- expect(rawResponse).toBeInstanceOf(Response);
- const response = await responsePromise;
- expect(response).not.toBeInstanceOf(Response);
- const dataAndResponse = await responsePromise.withResponse();
- expect(dataAndResponse.data).toBe(response);
- expect(dataAndResponse.response).toBe(rawResponse);
- });
});
diff --git a/tests/api-resources/accounts/url-endpoints.test.ts b/tests/api-resources/accounts/url-endpoints.test.ts
index b53af030..ad7fa5a8 100644
--- a/tests/api-resources/accounts/url-endpoints.test.ts
+++ b/tests/api-resources/accounts/url-endpoints.test.ts
@@ -10,8 +10,8 @@ const client = new ImageKit({
describe('resource urlEndpoints', () => {
// Mock server tests are disabled
- test.skip('create: only required params', async () => {
- const responsePromise = client.accounts.urlEndpoints.create({ description: 'My custom URL endpoint' });
+ test.skip('list', async () => {
+ const responsePromise = client.accounts.urlEndpoints.list();
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -22,20 +22,8 @@ describe('resource urlEndpoints', () => {
});
// Mock server tests are disabled
- test.skip('create: required and optional params', async () => {
- const response = await client.accounts.urlEndpoints.create({
- description: 'My custom URL endpoint',
- origins: ['origin-id-1'],
- urlPrefix: 'product-images',
- urlRewriter: { type: 'CLOUDINARY', preserveAssetDeliveryTypes: true },
- });
- });
-
- // Mock server tests are disabled
- test.skip('update: only required params', async () => {
- const responsePromise = client.accounts.urlEndpoints.update('id', {
- description: 'My custom URL endpoint',
- });
+ test.skip('create: only required params', async () => {
+ const responsePromise = client.accounts.urlEndpoints.create({ description: 'My custom URL endpoint' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -46,8 +34,8 @@ describe('resource urlEndpoints', () => {
});
// Mock server tests are disabled
- test.skip('update: required and optional params', async () => {
- const response = await client.accounts.urlEndpoints.update('id', {
+ test.skip('create: required and optional params', async () => {
+ const response = await client.accounts.urlEndpoints.create({
description: 'My custom URL endpoint',
origins: ['origin-id-1'],
urlPrefix: 'product-images',
@@ -56,8 +44,8 @@ describe('resource urlEndpoints', () => {
});
// Mock server tests are disabled
- test.skip('list', async () => {
- const responsePromise = client.accounts.urlEndpoints.list();
+ test.skip('get', async () => {
+ const responsePromise = client.accounts.urlEndpoints.get('id');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -68,8 +56,10 @@ describe('resource urlEndpoints', () => {
});
// Mock server tests are disabled
- test.skip('delete', async () => {
- const responsePromise = client.accounts.urlEndpoints.delete('id');
+ test.skip('update: only required params', async () => {
+ const responsePromise = client.accounts.urlEndpoints.update('id', {
+ description: 'My custom URL endpoint',
+ });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -80,8 +70,18 @@ describe('resource urlEndpoints', () => {
});
// Mock server tests are disabled
- test.skip('get', async () => {
- const responsePromise = client.accounts.urlEndpoints.get('id');
+ test.skip('update: required and optional params', async () => {
+ const response = await client.accounts.urlEndpoints.update('id', {
+ description: 'My custom URL endpoint',
+ origins: ['origin-id-1'],
+ urlPrefix: 'product-images',
+ urlRewriter: { type: 'CLOUDINARY', preserveAssetDeliveryTypes: true },
+ });
+ });
+
+ // Mock server tests are disabled
+ test.skip('delete', async () => {
+ const responsePromise = client.accounts.urlEndpoints.delete('id');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
diff --git a/tests/api-resources/custom-metadata-fields.test.ts b/tests/api-resources/custom-metadata-fields.test.ts
index 52e39794..e5731d2f 100644
--- a/tests/api-resources/custom-metadata-fields.test.ts
+++ b/tests/api-resources/custom-metadata-fields.test.ts
@@ -44,8 +44,8 @@ describe('resource customMetadataFields', () => {
});
// Mock server tests are disabled
- test.skip('update', async () => {
- const responsePromise = client.customMetadataFields.update('id');
+ test.skip('list', async () => {
+ const responsePromise = client.customMetadataFields.list();
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -56,31 +56,19 @@ describe('resource customMetadataFields', () => {
});
// Mock server tests are disabled
- test.skip('update: request options and params are passed correctly', async () => {
+ test.skip('list: request options and params are passed correctly', async () => {
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
await expect(
- client.customMetadataFields.update(
- 'id',
- {
- label: 'price',
- schema: {
- defaultValue: [true, 10, 'Hello'],
- isValueRequired: true,
- maxLength: 0,
- maxValue: 3000,
- minLength: 0,
- minValue: 1000,
- selectOptions: ['small', 'medium', 'large', 30, 40, true],
- },
- },
+ client.customMetadataFields.list(
+ { folderPath: 'folderPath', includeDeleted: true },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(ImageKit.NotFoundError);
});
// Mock server tests are disabled
- test.skip('list', async () => {
- const responsePromise = client.customMetadataFields.list();
+ test.skip('update', async () => {
+ const responsePromise = client.customMetadataFields.update('id');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -91,11 +79,23 @@ describe('resource customMetadataFields', () => {
});
// Mock server tests are disabled
- test.skip('list: request options and params are passed correctly', async () => {
+ test.skip('update: request options and params are passed correctly', async () => {
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
await expect(
- client.customMetadataFields.list(
- { folderPath: 'folderPath', includeDeleted: true },
+ client.customMetadataFields.update(
+ 'id',
+ {
+ label: 'price',
+ schema: {
+ defaultValue: [true, 10, 'Hello'],
+ isValueRequired: true,
+ maxLength: 0,
+ maxValue: 3000,
+ minLength: 0,
+ minValue: 1000,
+ selectOptions: ['small', 'medium', 'large', 30, 40, true],
+ },
+ },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(ImageKit.NotFoundError);
diff --git a/tests/api-resources/files/bulk.test.ts b/tests/api-resources/files/bulk.test.ts
index 1c417b90..66eb66bc 100644
--- a/tests/api-resources/files/bulk.test.ts
+++ b/tests/api-resources/files/bulk.test.ts
@@ -54,10 +54,10 @@ describe('resource bulk', () => {
});
// Mock server tests are disabled
- test.skip('removeAITags: only required params', async () => {
- const responsePromise = client.files.bulk.removeAITags({
- AITags: ['t-shirt', 'round-neck', 'sale2019'],
+ test.skip('removeTags: only required params', async () => {
+ const responsePromise = client.files.bulk.removeTags({
fileIds: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'],
+ tags: ['t-shirt', 'round-neck', 'sale2019'],
});
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
@@ -69,18 +69,18 @@ describe('resource bulk', () => {
});
// Mock server tests are disabled
- test.skip('removeAITags: required and optional params', async () => {
- const response = await client.files.bulk.removeAITags({
- AITags: ['t-shirt', 'round-neck', 'sale2019'],
+ test.skip('removeTags: required and optional params', async () => {
+ const response = await client.files.bulk.removeTags({
fileIds: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'],
+ tags: ['t-shirt', 'round-neck', 'sale2019'],
});
});
// Mock server tests are disabled
- test.skip('removeTags: only required params', async () => {
- const responsePromise = client.files.bulk.removeTags({
+ test.skip('removeAITags: only required params', async () => {
+ const responsePromise = client.files.bulk.removeAITags({
+ AITags: ['t-shirt', 'round-neck', 'sale2019'],
fileIds: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'],
- tags: ['t-shirt', 'round-neck', 'sale2019'],
});
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
@@ -92,10 +92,10 @@ describe('resource bulk', () => {
});
// Mock server tests are disabled
- test.skip('removeTags: required and optional params', async () => {
- const response = await client.files.bulk.removeTags({
+ test.skip('removeAITags: required and optional params', async () => {
+ const response = await client.files.bulk.removeAITags({
+ AITags: ['t-shirt', 'round-neck', 'sale2019'],
fileIds: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'],
- tags: ['t-shirt', 'round-neck', 'sale2019'],
});
});
});
diff --git a/tests/api-resources/files/files.test.ts b/tests/api-resources/files/files.test.ts
index aeb90697..c3110bb4 100644
--- a/tests/api-resources/files/files.test.ts
+++ b/tests/api-resources/files/files.test.ts
@@ -9,113 +9,6 @@ const client = new ImageKit({
});
describe('resource files', () => {
- // Mock server tests are disabled
- test.skip('update', async () => {
- const responsePromise = client.files.update('fileId', {});
- const rawResponse = await responsePromise.asResponse();
- expect(rawResponse).toBeInstanceOf(Response);
- const response = await responsePromise;
- expect(response).not.toBeInstanceOf(Response);
- const dataAndResponse = await responsePromise.withResponse();
- expect(dataAndResponse.data).toBe(response);
- expect(dataAndResponse.response).toBe(rawResponse);
- });
-
- // Mock server tests are disabled
- test.skip('delete', async () => {
- const responsePromise = client.files.delete('fileId');
- const rawResponse = await responsePromise.asResponse();
- expect(rawResponse).toBeInstanceOf(Response);
- const response = await responsePromise;
- expect(response).not.toBeInstanceOf(Response);
- const dataAndResponse = await responsePromise.withResponse();
- expect(dataAndResponse.data).toBe(response);
- expect(dataAndResponse.response).toBe(rawResponse);
- });
-
- // Mock server tests are disabled
- test.skip('copy: only required params', async () => {
- const responsePromise = client.files.copy({
- destinationPath: '/folder/to/copy/into/',
- sourceFilePath: '/path/to/file.jpg',
- });
- const rawResponse = await responsePromise.asResponse();
- expect(rawResponse).toBeInstanceOf(Response);
- const response = await responsePromise;
- expect(response).not.toBeInstanceOf(Response);
- const dataAndResponse = await responsePromise.withResponse();
- expect(dataAndResponse.data).toBe(response);
- expect(dataAndResponse.response).toBe(rawResponse);
- });
-
- // Mock server tests are disabled
- test.skip('copy: required and optional params', async () => {
- const response = await client.files.copy({
- destinationPath: '/folder/to/copy/into/',
- sourceFilePath: '/path/to/file.jpg',
- includeFileVersions: false,
- });
- });
-
- // Mock server tests are disabled
- test.skip('get', async () => {
- const responsePromise = client.files.get('fileId');
- const rawResponse = await responsePromise.asResponse();
- expect(rawResponse).toBeInstanceOf(Response);
- const response = await responsePromise;
- expect(response).not.toBeInstanceOf(Response);
- const dataAndResponse = await responsePromise.withResponse();
- expect(dataAndResponse.data).toBe(response);
- expect(dataAndResponse.response).toBe(rawResponse);
- });
-
- // Mock server tests are disabled
- test.skip('move: only required params', async () => {
- const responsePromise = client.files.move({
- destinationPath: '/folder/to/move/into/',
- sourceFilePath: '/path/to/file.jpg',
- });
- const rawResponse = await responsePromise.asResponse();
- expect(rawResponse).toBeInstanceOf(Response);
- const response = await responsePromise;
- expect(response).not.toBeInstanceOf(Response);
- const dataAndResponse = await responsePromise.withResponse();
- expect(dataAndResponse.data).toBe(response);
- expect(dataAndResponse.response).toBe(rawResponse);
- });
-
- // Mock server tests are disabled
- test.skip('move: required and optional params', async () => {
- const response = await client.files.move({
- destinationPath: '/folder/to/move/into/',
- sourceFilePath: '/path/to/file.jpg',
- });
- });
-
- // Mock server tests are disabled
- test.skip('rename: only required params', async () => {
- const responsePromise = client.files.rename({
- filePath: '/path/to/file.jpg',
- newFileName: 'newFileName.jpg',
- });
- const rawResponse = await responsePromise.asResponse();
- expect(rawResponse).toBeInstanceOf(Response);
- const response = await responsePromise;
- expect(response).not.toBeInstanceOf(Response);
- const dataAndResponse = await responsePromise.withResponse();
- expect(dataAndResponse.data).toBe(response);
- expect(dataAndResponse.response).toBe(rawResponse);
- });
-
- // Mock server tests are disabled
- test.skip('rename: required and optional params', async () => {
- const response = await client.files.rename({
- filePath: '/path/to/file.jpg',
- newFileName: 'newFileName.jpg',
- purgeCache: true,
- });
- });
-
// Mock server tests are disabled
test.skip('upload: only required params', async () => {
const responsePromise = client.files.upload({
@@ -220,4 +113,111 @@ describe('resource files', () => {
webhookUrl: 'https://example.com',
});
});
+
+ // Mock server tests are disabled
+ test.skip('get', async () => {
+ const responsePromise = client.files.get('fileId');
+ const rawResponse = await responsePromise.asResponse();
+ expect(rawResponse).toBeInstanceOf(Response);
+ const response = await responsePromise;
+ expect(response).not.toBeInstanceOf(Response);
+ const dataAndResponse = await responsePromise.withResponse();
+ expect(dataAndResponse.data).toBe(response);
+ expect(dataAndResponse.response).toBe(rawResponse);
+ });
+
+ // Mock server tests are disabled
+ test.skip('update', async () => {
+ const responsePromise = client.files.update('fileId', {});
+ const rawResponse = await responsePromise.asResponse();
+ expect(rawResponse).toBeInstanceOf(Response);
+ const response = await responsePromise;
+ expect(response).not.toBeInstanceOf(Response);
+ const dataAndResponse = await responsePromise.withResponse();
+ expect(dataAndResponse.data).toBe(response);
+ expect(dataAndResponse.response).toBe(rawResponse);
+ });
+
+ // Mock server tests are disabled
+ test.skip('delete', async () => {
+ const responsePromise = client.files.delete('fileId');
+ const rawResponse = await responsePromise.asResponse();
+ expect(rawResponse).toBeInstanceOf(Response);
+ const response = await responsePromise;
+ expect(response).not.toBeInstanceOf(Response);
+ const dataAndResponse = await responsePromise.withResponse();
+ expect(dataAndResponse.data).toBe(response);
+ expect(dataAndResponse.response).toBe(rawResponse);
+ });
+
+ // Mock server tests are disabled
+ test.skip('copy: only required params', async () => {
+ const responsePromise = client.files.copy({
+ destinationPath: '/folder/to/copy/into/',
+ sourceFilePath: '/path/to/file.jpg',
+ });
+ const rawResponse = await responsePromise.asResponse();
+ expect(rawResponse).toBeInstanceOf(Response);
+ const response = await responsePromise;
+ expect(response).not.toBeInstanceOf(Response);
+ const dataAndResponse = await responsePromise.withResponse();
+ expect(dataAndResponse.data).toBe(response);
+ expect(dataAndResponse.response).toBe(rawResponse);
+ });
+
+ // Mock server tests are disabled
+ test.skip('copy: required and optional params', async () => {
+ const response = await client.files.copy({
+ destinationPath: '/folder/to/copy/into/',
+ sourceFilePath: '/path/to/file.jpg',
+ includeFileVersions: false,
+ });
+ });
+
+ // Mock server tests are disabled
+ test.skip('move: only required params', async () => {
+ const responsePromise = client.files.move({
+ destinationPath: '/folder/to/move/into/',
+ sourceFilePath: '/path/to/file.jpg',
+ });
+ const rawResponse = await responsePromise.asResponse();
+ expect(rawResponse).toBeInstanceOf(Response);
+ const response = await responsePromise;
+ expect(response).not.toBeInstanceOf(Response);
+ const dataAndResponse = await responsePromise.withResponse();
+ expect(dataAndResponse.data).toBe(response);
+ expect(dataAndResponse.response).toBe(rawResponse);
+ });
+
+ // Mock server tests are disabled
+ test.skip('move: required and optional params', async () => {
+ const response = await client.files.move({
+ destinationPath: '/folder/to/move/into/',
+ sourceFilePath: '/path/to/file.jpg',
+ });
+ });
+
+ // Mock server tests are disabled
+ test.skip('rename: only required params', async () => {
+ const responsePromise = client.files.rename({
+ filePath: '/path/to/file.jpg',
+ newFileName: 'newFileName.jpg',
+ });
+ const rawResponse = await responsePromise.asResponse();
+ expect(rawResponse).toBeInstanceOf(Response);
+ const response = await responsePromise;
+ expect(response).not.toBeInstanceOf(Response);
+ const dataAndResponse = await responsePromise.withResponse();
+ expect(dataAndResponse.data).toBe(response);
+ expect(dataAndResponse.response).toBe(rawResponse);
+ });
+
+ // Mock server tests are disabled
+ test.skip('rename: required and optional params', async () => {
+ const response = await client.files.rename({
+ filePath: '/path/to/file.jpg',
+ newFileName: 'newFileName.jpg',
+ purgeCache: true,
+ });
+ });
});
diff --git a/tests/api-resources/files/versions.test.ts b/tests/api-resources/files/versions.test.ts
index 873ec8cc..fb5a83a3 100644
--- a/tests/api-resources/files/versions.test.ts
+++ b/tests/api-resources/files/versions.test.ts
@@ -22,8 +22,8 @@ describe('resource versions', () => {
});
// Mock server tests are disabled
- test.skip('delete: only required params', async () => {
- const responsePromise = client.files.versions.delete('versionId', { fileId: 'fileId' });
+ test.skip('get: only required params', async () => {
+ const responsePromise = client.files.versions.get('versionId', { fileId: 'fileId' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -34,13 +34,13 @@ describe('resource versions', () => {
});
// Mock server tests are disabled
- test.skip('delete: required and optional params', async () => {
- const response = await client.files.versions.delete('versionId', { fileId: 'fileId' });
+ test.skip('get: required and optional params', async () => {
+ const response = await client.files.versions.get('versionId', { fileId: 'fileId' });
});
// Mock server tests are disabled
- test.skip('get: only required params', async () => {
- const responsePromise = client.files.versions.get('versionId', { fileId: 'fileId' });
+ test.skip('delete: only required params', async () => {
+ const responsePromise = client.files.versions.delete('versionId', { fileId: 'fileId' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -51,8 +51,8 @@ describe('resource versions', () => {
});
// Mock server tests are disabled
- test.skip('get: required and optional params', async () => {
- const response = await client.files.versions.get('versionId', { fileId: 'fileId' });
+ test.skip('delete: required and optional params', async () => {
+ const response = await client.files.versions.delete('versionId', { fileId: 'fileId' });
});
// Mock server tests are disabled
diff --git a/tests/api-resources/saved-extensions.test.ts b/tests/api-resources/saved-extensions.test.ts
index 5b4a731e..cc2882c9 100644
--- a/tests/api-resources/saved-extensions.test.ts
+++ b/tests/api-resources/saved-extensions.test.ts
@@ -9,6 +9,18 @@ const client = new ImageKit({
});
describe('resource savedExtensions', () => {
+ // Mock server tests are disabled
+ test.skip('list', async () => {
+ const responsePromise = client.savedExtensions.list();
+ const rawResponse = await responsePromise.asResponse();
+ expect(rawResponse).toBeInstanceOf(Response);
+ const response = await responsePromise;
+ expect(response).not.toBeInstanceOf(Response);
+ const dataAndResponse = await responsePromise.withResponse();
+ expect(dataAndResponse.data).toBe(response);
+ expect(dataAndResponse.response).toBe(rawResponse);
+ });
+
// Mock server tests are disabled
test.skip('create: only required params', async () => {
const responsePromise = client.savedExtensions.create({
@@ -43,8 +55,8 @@ describe('resource savedExtensions', () => {
});
// Mock server tests are disabled
- test.skip('update', async () => {
- const responsePromise = client.savedExtensions.update('id', {});
+ test.skip('get', async () => {
+ const responsePromise = client.savedExtensions.get('id');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -55,8 +67,8 @@ describe('resource savedExtensions', () => {
});
// Mock server tests are disabled
- test.skip('list', async () => {
- const responsePromise = client.savedExtensions.list();
+ test.skip('update', async () => {
+ const responsePromise = client.savedExtensions.update('id', {});
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -77,16 +89,4 @@ describe('resource savedExtensions', () => {
expect(dataAndResponse.data).toBe(response);
expect(dataAndResponse.response).toBe(rawResponse);
});
-
- // Mock server tests are disabled
- test.skip('get', async () => {
- const responsePromise = client.savedExtensions.get('id');
- const rawResponse = await responsePromise.asResponse();
- expect(rawResponse).toBeInstanceOf(Response);
- const response = await responsePromise;
- expect(response).not.toBeInstanceOf(Response);
- const dataAndResponse = await responsePromise.withResponse();
- expect(dataAndResponse.data).toBe(response);
- expect(dataAndResponse.response).toBe(rawResponse);
- });
});
diff --git a/yarn.lock b/yarn.lock
index 885a4bbb..a2134ae4 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1220,9 +1220,9 @@ baseline-browser-mapping@^2.9.0:
integrity sha512-B0xUquLkiGLgHhpPBqvl7GWegWBUNuujQ6kXd/r1U38ElPT6Ok8KZ8e+FpUGEc2ZoRQUzq/aUnaKFc/svWUGSg==
brace-expansion@^2.0.2:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.1.0.tgz#4f41a41190216ee36067ec381526fe9539c4f0ae"
- integrity sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.1.1.tgz#c68b1c4111c76aae3a6fba55d496cee10c39dad8"
+ integrity sha512-WR1cURNjuvBLMZBMbqM0UoE+WAfdUcEV1ccD8PVBVOI+Z3ND4+SZbN8RsfT2bMuG1qwz5RFvPukSZm5fF2D5eA==
dependencies:
balanced-match "^1.0.0"