Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "7.4.0"
".": "7.5.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 47
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-63aff1629530786015da3c86131afa8a9b60545d488884b77641f1d4b89c6e9d.yml
openapi_spec_hash: 586d357bd7e5217d240a99e0d83c6d1f
config_hash: 47cb702ee2cb52c58d803ae39ade9b44
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-d73a37dc3426586109bd153f02c6a605036b6a7396bba5173d013468c5291ce6.yml
openapi_spec_hash: c193c6e557ff477481ec8d5ac8a0c96e
config_hash: 32b155378f65c234d3abeb18519fb3cd
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Changelog

## 7.5.0 (2026-04-10)

Full Changelog: [v7.4.0...v7.5.0](https://github.com/imagekit-developer/imagekit-nodejs/compare/v7.4.0...v7.5.0)

### Features

* **api:** dam related webhook events ([d2bc9ce](https://github.com/imagekit-developer/imagekit-nodejs/commit/d2bc9ce8f62be8c4da65f655b8113a0bca685c37))
* **api:** fix spec indentation ([79ae799](https://github.com/imagekit-developer/imagekit-nodejs/commit/79ae799823f2dcdde7eece7fc0588916e453537e))
* **api:** indentation fix ([65c6eec](https://github.com/imagekit-developer/imagekit-nodejs/commit/65c6eec03f5907dedd73500eeba8f9aa0de1f66c))
* **api:** merge with main to bring back missing parameters ([bd6474f](https://github.com/imagekit-developer/imagekit-nodejs/commit/bd6474f9af40cae66818a260f21087d4e19f76af))
* **api:** update webhook event names and remove DAM prefix ([a86f04c](https://github.com/imagekit-developer/imagekit-nodejs/commit/a86f04c6c187b3bedced5146a5ca717eccc8492e))
* **docs:** simplify authentication parameters example in README ([c14843b](https://github.com/imagekit-developer/imagekit-nodejs/commit/c14843b8e77bc24a871ed594962105fbfa7fa38a))


### Bug Fixes

* **api:** rename DamFile events to File for consistency ([24b7f4b](https://github.com/imagekit-developer/imagekit-nodejs/commit/24b7f4b33977691dadbed303fd10acd532dcd5c1))


### Chores

* **internal:** codegen related update ([e2cf4dc](https://github.com/imagekit-developer/imagekit-nodejs/commit/e2cf4dcd2be96f3d7d60244e40592aa94f393e8c))
* **internal:** fix MCP server import ordering ([31100e2](https://github.com/imagekit-developer/imagekit-nodejs/commit/31100e2ee17426153efea46f8787d2cfb5e2a9ee))
* **internal:** show error causes in MCP servers when running in local mode ([7f1ff53](https://github.com/imagekit-developer/imagekit-nodejs/commit/7f1ff53ef5fedeb78fd73571664789c858133351))
* **mcp-server:** increase local docs search result count from 5 to 10 ([35dc080](https://github.com/imagekit-developer/imagekit-nodejs/commit/35dc080ca7ef76d09db5152fbc8e3af285581822))

## 7.4.0 (2026-04-06)

Full Changelog: [v7.3.0...v7.4.0](https://github.com/imagekit-developer/imagekit-nodejs/compare/v7.3.0...v7.4.0)
Expand Down
5 changes: 5 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ Methods:
Types:

- <code><a href="./src/resources/webhooks.ts">BaseWebhookEvent</a></code>
- <code><a href="./src/resources/webhooks.ts">FileCreateEvent</a></code>
- <code><a href="./src/resources/webhooks.ts">FileDeleteEvent</a></code>
- <code><a href="./src/resources/webhooks.ts">FileUpdateEvent</a></code>
- <code><a href="./src/resources/webhooks.ts">FileVersionCreateEvent</a></code>
- <code><a href="./src/resources/webhooks.ts">FileVersionDeleteEvent</a></code>
- <code><a href="./src/resources/webhooks.ts">UploadPostTransformErrorEvent</a></code>
- <code><a href="./src/resources/webhooks.ts">UploadPostTransformSuccessEvent</a></code>
- <code><a href="./src/resources/webhooks.ts">UploadPreTransformErrorEvent</a></code>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@imagekit/nodejs",
"version": "7.4.0",
"version": "7.5.0",
"description": "Offical NodeJS SDK for ImageKit.io integration",
"author": "Image Kit <developer@imagekit.io>",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"dxt_version": "0.2",
"name": "@imagekit/api-mcp",
"version": "7.4.0",
"version": "7.5.0",
"description": "The official MCP Server for the Image Kit API",
"author": {
"name": "Image Kit",
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@imagekit/api-mcp",
"version": "7.4.0",
"version": "7.5.0",
"description": "The official MCP Server for the Image Kit API",
"author": "Image Kit <developer@imagekit.io>",
"types": "dist/index.d.ts",
Expand Down
3 changes: 2 additions & 1 deletion packages/mcp-server/src/code-tool-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ function makeSdkProxy<T extends object>(obj: T, { path, isBelievedBad = false }:

function parseError(code: string, error: unknown): string | undefined {
if (!(error instanceof Error)) return;
const message = error.name ? `${error.name}: ${error.message}` : error.message;
const cause = error.cause instanceof Error ? `: ${error.cause.message}` : '';
const message = error.name ? `${error.name}: ${error.message}${cause}` : `${error.message}${cause}`;
try {
// Deno uses V8; the first "<anonymous>:LINE:COLUMN" is the top of stack.
const lineNumber = error.stack?.match(/<anonymous>:([0-9]+):[0-9]+/)?.[1];
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/src/docs-search-tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async function searchLocal(args: Record<string, unknown>): Promise<unknown> {
query,
language,
detail,
maxResults: 5,
maxResults: 10,
}).results;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/src/instructions.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import fs from 'fs/promises';
import { readEnv } from './util';
import { getLogger } from './logger';
import { readEnv } from './util';

const INSTRUCTIONS_CACHE_TTL_MS = 15 * 60 * 1000; // 15 minutes

Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const newMcpServer = async ({
new McpServer(
{
name: 'imagekit_nodejs_api',
version: '7.4.0',
version: '7.5.0',
},
{
instructions: await getInstructions({ stainlessApiKey, customInstructionsPath }),
Expand Down
4 changes: 2 additions & 2 deletions packages/mcp-server/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

export const readEnv = (env: string): string | undefined => {
if (typeof (globalThis as any).process !== 'undefined') {
return (globalThis as any).process.env?.[env]?.trim();
return (globalThis as any).process.env?.[env]?.trim() || undefined;
} else if (typeof (globalThis as any).Deno !== 'undefined') {
return (globalThis as any).Deno.env?.get?.(env)?.trim();
return (globalThis as any).Deno.env?.get?.(env)?.trim() || undefined;
}
return;
};
Expand Down
10 changes: 10 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ import {
} from './resources/saved-extensions';
import {
BaseWebhookEvent,
FileCreateEvent,
FileDeleteEvent,
FileUpdateEvent,
FileVersionCreateEvent,
FileVersionDeleteEvent,
UnsafeUnwrapWebhookEvent,
UnwrapWebhookEvent,
UploadPostTransformErrorEvent,
Expand Down Expand Up @@ -917,6 +922,11 @@ export declare namespace ImageKit {
export {
Webhooks as Webhooks,
type BaseWebhookEvent as BaseWebhookEvent,
type FileCreateEvent as FileCreateEvent,
type FileDeleteEvent as FileDeleteEvent,
type FileUpdateEvent as FileUpdateEvent,
type FileVersionCreateEvent as FileVersionCreateEvent,
type FileVersionDeleteEvent as FileVersionDeleteEvent,
type UploadPostTransformErrorEvent as UploadPostTransformErrorEvent,
type UploadPostTransformSuccessEvent as UploadPostTransformSuccessEvent,
type UploadPreTransformErrorEvent as UploadPreTransformErrorEvent,
Expand Down
4 changes: 2 additions & 2 deletions src/internal/utils/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
*/
export const readEnv = (env: string): string | undefined => {
if (typeof (globalThis as any).process !== 'undefined') {
return (globalThis as any).process.env?.[env]?.trim() ?? undefined;
return (globalThis as any).process.env?.[env]?.trim() || undefined;
}
if (typeof (globalThis as any).Deno !== 'undefined') {
return (globalThis as any).Deno.env?.get?.(env)?.trim();
return (globalThis as any).Deno.env?.get?.(env)?.trim() || undefined;
}
return undefined;
};
5 changes: 5 additions & 0 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ export {
export {
Webhooks,
type BaseWebhookEvent,
type FileCreateEvent,
type FileDeleteEvent,
type FileUpdateEvent,
type FileVersionCreateEvent,
type FileVersionDeleteEvent,
type UploadPostTransformErrorEvent,
type UploadPostTransformSuccessEvent,
type UploadPreTransformErrorEvent,
Expand Down
136 changes: 134 additions & 2 deletions src/resources/webhooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,123 @@ export interface BaseWebhookEvent {
type: string;
}

/**
* Triggered when a file is created.
*/
export interface FileCreateEvent extends BaseWebhookEvent {
/**
* Timestamp of when the event occurred in ISO8601 format.
*/
created_at: string;

/**
* Object containing details of a file or file version.
*/
data: FilesAPI.File;

/**
* Type of the webhook event.
*/
type: 'file.created';
}

/**
* Triggered when a file is deleted.
*/
export interface FileDeleteEvent extends BaseWebhookEvent {
/**
* Timestamp of when the event occurred in ISO8601 format.
*/
created_at: string;

data: FileDeleteEvent.Data;

/**
* Type of the webhook event.
*/
type: 'file.deleted';
}

export namespace FileDeleteEvent {
export interface Data {
/**
* The unique `fileId` of the deleted file.
*/
fileId: string;
}
}

/**
* Triggered when a file is updated.
*/
export interface FileUpdateEvent extends BaseWebhookEvent {
/**
* Timestamp of when the event occurred in ISO8601 format.
*/
created_at: string;

/**
* Object containing details of a file or file version.
*/
data: FilesAPI.File;

/**
* Type of the webhook event.
*/
type: 'file.updated';
}

/**
* Triggered when a file version is created.
*/
export interface FileVersionCreateEvent extends BaseWebhookEvent {
/**
* Timestamp of when the event occurred in ISO8601 format.
*/
created_at: string;

/**
* Object containing details of a file or file version.
*/
data: FilesAPI.File;

/**
* Type of the webhook event.
*/
type: 'file-version.created';
}

/**
* Triggered when a file version is deleted.
*/
export interface FileVersionDeleteEvent extends BaseWebhookEvent {
/**
* Timestamp of when the event occurred in ISO8601 format.
*/
created_at: string;

data: FileVersionDeleteEvent.Data;

/**
* Type of the webhook event.
*/
type: 'file-version.deleted';
}

export namespace FileVersionDeleteEvent {
export interface Data {
/**
* The unique `fileId` of the deleted file.
*/
fileId: string;

/**
* The unique `versionId` of the deleted file version.
*/
versionId: string;
}
}

/**
* Triggered when a post-transformation fails. The original file remains available,
* but the requested transformation could not be generated.
Expand Down Expand Up @@ -1040,7 +1157,12 @@ export type UnsafeUnwrapWebhookEvent =
| UploadPreTransformSuccessEvent
| UploadPreTransformErrorEvent
| UploadPostTransformSuccessEvent
| UploadPostTransformErrorEvent;
| UploadPostTransformErrorEvent
| FileCreateEvent
| FileUpdateEvent
| FileDeleteEvent
| FileVersionCreateEvent
| FileVersionDeleteEvent;

/**
* Triggered when a new video transformation request is accepted for processing.
Expand All @@ -1054,11 +1176,21 @@ export type UnwrapWebhookEvent =
| UploadPreTransformSuccessEvent
| UploadPreTransformErrorEvent
| UploadPostTransformSuccessEvent
| UploadPostTransformErrorEvent;
| UploadPostTransformErrorEvent
| FileCreateEvent
| FileUpdateEvent
| FileDeleteEvent
| FileVersionCreateEvent
| FileVersionDeleteEvent;

export declare namespace Webhooks {
export {
type BaseWebhookEvent as BaseWebhookEvent,
type FileCreateEvent as FileCreateEvent,
type FileDeleteEvent as FileDeleteEvent,
type FileUpdateEvent as FileUpdateEvent,
type FileVersionCreateEvent as FileVersionCreateEvent,
type FileVersionDeleteEvent as FileVersionDeleteEvent,
type UploadPostTransformErrorEvent as UploadPostTransformErrorEvent,
type UploadPostTransformSuccessEvent as UploadPostTransformSuccessEvent,
type UploadPreTransformErrorEvent as UploadPreTransformErrorEvent,
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '7.4.0'; // x-release-please-version
export const VERSION = '7.5.0'; // x-release-please-version
Loading