Skip to content

Commit 21d08b8

Browse files
authored
Merge pull request #15 from imagekit-developer/release-please--branches--master--changes--next
release: 2.2.0
2 parents 1a0236a + 6e8c52d commit 21d08b8

10 files changed

Lines changed: 91 additions & 23 deletions

File tree

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "2.1.1"
2+
".": "2.2.0"
33
}

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 48
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-84f0d75048a9268981a84800b4190e3691997ce57dcfc0876f38a5b3fce6bacd.yml
3-
openapi_spec_hash: 35607d4e850c8a60524223ff632c83bb
4-
config_hash: aeb6eb949d73382270bbd8bbf2e4cf2a
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-13fc3d7cafdea492f62eef7c1d63424d6d9d8adbff74b9f6ca6fd3fc12a36840.yml
3+
openapi_spec_hash: a1fe6fa48207791657a1ea2d60a6dfcc
4+
config_hash: 47cb702ee2cb52c58d803ae39ade9b44

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## 2.2.0 (2026-02-02)
4+
5+
Full Changelog: [v2.1.1...v2.2.0](https://github.com/imagekit-developer/imagekit-go/compare/v2.1.1...v2.2.0)
6+
7+
### Features
8+
9+
* **api:** add customMetadata property to folder schema ([71fcd55](https://github.com/imagekit-developer/imagekit-go/commit/71fcd554cadcbc4981b57078a2ab9c2fbe72be51))
10+
* **client:** add a convenient param.SetJSON helper ([7db0b48](https://github.com/imagekit-developer/imagekit-go/commit/7db0b4829c864151bda74f002c122f8a018118a0))
11+
12+
13+
### Bug Fixes
14+
15+
* **api:** add missing embeddedMetadata and video properties to FileDetails ([b0e6909](https://github.com/imagekit-developer/imagekit-go/commit/b0e69096abac1ceba154150495cc2ae508ba63a0))
16+
* **docs:** fix mcp installation instructions for remote servers ([f3875dd](https://github.com/imagekit-developer/imagekit-go/commit/f3875dddc1017d0db1ac2f3a86bd905bb941353d))
17+
* **tests:** update subtitle references to use plural form ([7d180b7](https://github.com/imagekit-developer/imagekit-go/commit/7d180b758a232951e4b5c918c9dcc47aa11e99ab))
18+
319
## 2.1.1 (2026-01-20)
420

521
Full Changelog: [v2.1.0...v2.1.1](https://github.com/imagekit-developer/imagekit-go/compare/v2.1.0...v2.1.1)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Or to pin the version:
5959
<!-- x-release-please-start-version -->
6060

6161
```sh
62-
go get -u 'github.com/imagekit-developer/imagekit-go/v2@v2.1.1'
62+
go get -u 'github.com/imagekit-developer/imagekit-go/v2@v2.2.0'
6363
```
6464

6565
<!-- x-release-please-end -->

asset.go

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,22 @@ func (r *AssetService) List(ctx context.Context, query AssetListParams, opts ...
5656
// Use the methods beginning with 'As' to cast the union to one of its variants.
5757
type AssetListResponseUnion struct {
5858
// This field is from variant [File].
59-
AITags []FileAITag `json:"AITags"`
60-
CreatedAt time.Time `json:"createdAt"`
59+
AITags []FileAITag `json:"AITags"`
6160
// This field is from variant [File].
62-
CustomCoordinates string `json:"customCoordinates"`
61+
AudioCodec string `json:"audioCodec"`
62+
// This field is from variant [File].
63+
BitRate int64 `json:"bitRate"`
64+
CreatedAt time.Time `json:"createdAt"`
6365
// This field is from variant [File].
64-
CustomMetadata map[string]any `json:"customMetadata"`
66+
CustomCoordinates string `json:"customCoordinates"`
67+
CustomMetadata any `json:"customMetadata"`
6568
// This field is from variant [File].
6669
Description string `json:"description"`
6770
// This field is from variant [File].
71+
Duration int64 `json:"duration"`
72+
// This field is from variant [File].
73+
EmbeddedMetadata map[string]any `json:"embeddedMetadata"`
74+
// This field is from variant [File].
6875
FileID string `json:"fileId"`
6976
// This field is from variant [File].
7077
FilePath string `json:"filePath"`
@@ -97,17 +104,23 @@ type AssetListResponseUnion struct {
97104
// This field is from variant [File].
98105
VersionInfo FileVersionInfo `json:"versionInfo"`
99106
// This field is from variant [File].
107+
VideoCodec string `json:"videoCodec"`
108+
// This field is from variant [File].
100109
Width float64 `json:"width"`
101110
// This field is from variant [Folder].
102111
FolderID string `json:"folderId"`
103112
// This field is from variant [Folder].
104113
FolderPath string `json:"folderPath"`
105114
JSON struct {
106115
AITags respjson.Field
116+
AudioCodec respjson.Field
117+
BitRate respjson.Field
107118
CreatedAt respjson.Field
108119
CustomCoordinates respjson.Field
109120
CustomMetadata respjson.Field
110121
Description respjson.Field
122+
Duration respjson.Field
123+
EmbeddedMetadata respjson.Field
111124
FileID respjson.Field
112125
FilePath respjson.Field
113126
FileType respjson.Field
@@ -125,6 +138,7 @@ type AssetListResponseUnion struct {
125138
UpdatedAt respjson.Field
126139
URL respjson.Field
127140
VersionInfo respjson.Field
141+
VideoCodec respjson.Field
128142
Width respjson.Field
129143
FolderID respjson.Field
130144
FolderPath respjson.Field

file.go

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ func (r *FileService) Upload(ctx context.Context, body FileUploadParams, opts ..
169169
type File struct {
170170
// An array of tags assigned to the file by auto tagging.
171171
AITags []FileAITag `json:"AITags,nullable"`
172+
// The audio codec used in the video (only for video/audio).
173+
AudioCodec string `json:"audioCodec"`
174+
// The bit rate of the video in kbps (only for video).
175+
BitRate int64 `json:"bitRate"`
172176
// Date and time when the file was uploaded. The date and time is in ISO8601
173177
// format.
174178
CreatedAt time.Time `json:"createdAt" format:"date-time"`
@@ -179,6 +183,11 @@ type File struct {
179183
// Optional text to describe the contents of the file. Can be set by the user or
180184
// the ai-auto-description extension.
181185
Description string `json:"description"`
186+
// The duration of the video in seconds (only for video).
187+
Duration int64 `json:"duration"`
188+
// Consolidated embedded metadata associated with the file. It includes exif, iptc,
189+
// and xmp data.
190+
EmbeddedMetadata map[string]any `json:"embeddedMetadata"`
182191
// Unique identifier of the asset.
183192
FileID string `json:"fileId"`
184193
// Path of the file. This is the path you would use in the URL to access the file.
@@ -227,15 +236,21 @@ type File struct {
227236
URL string `json:"url" format:"uri"`
228237
// An object with details of the file version.
229238
VersionInfo FileVersionInfo `json:"versionInfo"`
239+
// The video codec used in the video (only for video).
240+
VideoCodec string `json:"videoCodec"`
230241
// Width of the file.
231242
Width float64 `json:"width"`
232243
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
233244
JSON struct {
234245
AITags respjson.Field
246+
AudioCodec respjson.Field
247+
BitRate respjson.Field
235248
CreatedAt respjson.Field
236249
CustomCoordinates respjson.Field
237250
CustomMetadata respjson.Field
238251
Description respjson.Field
252+
Duration respjson.Field
253+
EmbeddedMetadata respjson.Field
239254
FileID respjson.Field
240255
FilePath respjson.Field
241256
FileType respjson.Field
@@ -253,6 +268,7 @@ type File struct {
253268
UpdatedAt respjson.Field
254269
URL respjson.Field
255270
VersionInfo respjson.Field
271+
VideoCodec respjson.Field
256272
Width respjson.Field
257273
ExtraFields map[string]respjson.Field
258274
raw string
@@ -591,6 +607,9 @@ type Folder struct {
591607
// Date and time when the folder was created. The date and time is in ISO8601
592608
// format.
593609
CreatedAt time.Time `json:"createdAt" format:"date-time"`
610+
// An object with custom metadata for the folder. Returns empty object if no custom
611+
// metadata is set.
612+
CustomMetadata map[string]any `json:"customMetadata"`
594613
// Unique identifier of the asset.
595614
FolderID string `json:"folderId"`
596615
// Path of the folder. This is the path you would use in the URL to access the
@@ -609,14 +628,15 @@ type Folder struct {
609628
UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
610629
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
611630
JSON struct {
612-
CreatedAt respjson.Field
613-
FolderID respjson.Field
614-
FolderPath respjson.Field
615-
Name respjson.Field
616-
Type respjson.Field
617-
UpdatedAt respjson.Field
618-
ExtraFields map[string]respjson.Field
619-
raw string
631+
CreatedAt respjson.Field
632+
CustomMetadata respjson.Field
633+
FolderID respjson.Field
634+
FolderPath respjson.Field
635+
Name respjson.Field
636+
Type respjson.Field
637+
UpdatedAt respjson.Field
638+
ExtraFields map[string]respjson.Field
639+
raw string
620640
} `json:"-"`
621641
}
622642

internal/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
package internal
44

5-
const PackageVersion = "2.1.1" // x-release-please-version
5+
const PackageVersion = "2.2.0" // x-release-please-version

lib/helper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ func (r *HelperService) processOverlay(overlay shared.OverlayUnionParam) string
569569
encoding = "auto"
570570
}
571571

572-
entries = append(entries, "l-subtitle")
572+
entries = append(entries, "l-subtitles")
573573
entries = append(entries, processInputPath(subtitleOverlay.Input, encoding))
574574
baseOverlay = &subtitleOverlay.BaseOverlayParam
575575

packages/param/param.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,19 @@ func Override[T ParamStruct, PtrT InferPtr[T]](v any) T {
4141
return *pt
4242
}
4343

44+
// SetJSON configures a param struct to serialize with the provided raw JSON data.
45+
// Use this when you have existing JSON that you want to send as request parameters.
46+
//
47+
// var req example.NewUserParams
48+
// var rawJSON = []byte(`{"name": "...", "age": 40}`)
49+
// param.SetJSON(rawJSON, &req)
50+
// res, err := client.Users.New(ctx, req)
51+
//
52+
// Note: The struct's existing fields will be ignored; only the provided JSON is serialized.
53+
func SetJSON(rawJSON []byte, ptr anyParamStruct) {
54+
ptr.setMetadata(json.RawMessage(rawJSON))
55+
}
56+
4457
// IsOmitted returns true if v is the zero value of its type.
4558
//
4659
// If IsOmitted is true, and the field uses a `json:"...,omitzero"` tag,
@@ -91,6 +104,11 @@ type ParamStruct interface {
91104
extraFields() map[string]any
92105
}
93106

107+
// A pointer to ParamStruct
108+
type anyParamStruct interface {
109+
setMetadata(any)
110+
}
111+
94112
// This is an implementation detail and should never be explicitly set.
95113
type InferPtr[T ParamStruct] interface {
96114
setMetadata(any)

tests/helper_overlay_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ func TestOverlayTransformations(t *testing.T) {
256256
Transformation: transformation,
257257
})
258258

259-
expected := "https://ik.imagekit.io/test_url_endpoint/tr:l-subtitle,i-subtitle.srt,l-end/base-video.mp4"
259+
expected := "https://ik.imagekit.io/test_url_endpoint/tr:l-subtitles,i-subtitle.srt,l-end/base-video.mp4"
260260
if url != expected {
261261
t.Errorf("Expected %s, got %s", expected, url)
262262
}
@@ -461,7 +461,7 @@ func TestOverlayTransformations(t *testing.T) {
461461
Transformation: transformation,
462462
})
463463

464-
expected := "https://ik.imagekit.io/test_url_endpoint/tr:l-text,i-Every%20thing,lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,w-bw_mul_0.5,fs-20,ff-Arial,co-0000ff,ia-left,pa-5,al-7,tg-b,bg-red,r-10,rt-N45,fl-h,lh-20,l-end:l-image,i-logo.png,lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,w-bw_mul_0.5,h-bh_mul_0.5,rt-N45,fl-h,l-text,i-Nested%20text%20overlay,l-end,l-end:l-video,i-play-pause-loop.mp4,lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,w-bw_mul_0.5,h-bh_mul_0.5,rt-N45,fl-h,l-end:l-subtitle,i-subtitle.srt,lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,bg-red,co-0000ff,ff-Arial,fol-2_A1CCDD50,fsh-A1CCDD_3,l-end:l-image,i-ik_canvas,bg-FF0000,lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,w-bw_mul_0.5,h-bh_mul_0.5,al-0.5,bg-red,e-gradient,r-max,l-end/base-image.jpg"
464+
expected := "https://ik.imagekit.io/test_url_endpoint/tr:l-text,i-Every%20thing,lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,w-bw_mul_0.5,fs-20,ff-Arial,co-0000ff,ia-left,pa-5,al-7,tg-b,bg-red,r-10,rt-N45,fl-h,lh-20,l-end:l-image,i-logo.png,lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,w-bw_mul_0.5,h-bh_mul_0.5,rt-N45,fl-h,l-text,i-Nested%20text%20overlay,l-end,l-end:l-video,i-play-pause-loop.mp4,lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,w-bw_mul_0.5,h-bh_mul_0.5,rt-N45,fl-h,l-end:l-subtitles,i-subtitle.srt,lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,bg-red,co-0000ff,ff-Arial,fol-2_A1CCDD50,fsh-A1CCDD_3,l-end:l-image,i-ik_canvas,bg-FF0000,lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,w-bw_mul_0.5,h-bh_mul_0.5,al-0.5,bg-red,e-gradient,r-max,l-end/base-image.jpg"
465465
if url != expected {
466466
t.Errorf("Expected %s, got %s", expected, url)
467467
}
@@ -777,7 +777,7 @@ func TestOverlayEncoding(t *testing.T) {
777777
Transformation: transformation,
778778
})
779779

780-
expected := "https://ik.imagekit.io/demo/tr:l-subtitle,i-sub.srt,l-end/sample.mp4"
780+
expected := "https://ik.imagekit.io/demo/tr:l-subtitles,i-sub.srt,l-end/sample.mp4"
781781
if url != expected {
782782
t.Errorf("Expected %s, got %s", expected, url)
783783
}
@@ -803,7 +803,7 @@ func TestOverlayEncoding(t *testing.T) {
803803
Transformation: transformation,
804804
})
805805

806-
expected := "https://ik.imagekit.io/demo/tr:l-subtitle,ie-c3ViLnNydA%3D%3D,l-end/sample.mp4"
806+
expected := "https://ik.imagekit.io/demo/tr:l-subtitles,ie-c3ViLnNydA%3D%3D,l-end/sample.mp4"
807807
if url != expected {
808808
t.Errorf("Expected %s, got %s", expected, url)
809809
}

0 commit comments

Comments
 (0)