Skip to content

Commit 8cc2bdd

Browse files
authored
Merge pull request #148 from imagekit-developer/stainless/release
Release SDK updates
2 parents 1ac9c36 + f2acf20 commit 8cc2bdd

40 files changed

Lines changed: 1091 additions & 1627 deletions
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"features": {
3+
"ghcr.io/devcontainers/features/node:1": {
4+
"version": "1.7.1",
5+
"resolved": "ghcr.io/devcontainers/features/node@sha256:8c0de46939b61958041700ee89e3493f3b2e4131a06dc46b4d9423427d06e5f6",
6+
"integrity": "sha256:8c0de46939b61958041700ee89e3493f3b2e4131a06dc46b4d9423427d06e5f6"
7+
}
8+
}
9+
}

.github/workflows/ci.yml

Lines changed: 2 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
lint:
1919
timeout-minutes: 10
2020
name: lint
21-
runs-on: ${{ github.repository == 'stainless-sdks/imagekit-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
21+
runs-on: ubuntu-latest
2222
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
2323
steps:
2424
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -37,7 +37,7 @@ jobs:
3737
build:
3838
timeout-minutes: 5
3939
name: build
40-
runs-on: ${{ github.repository == 'stainless-sdks/imagekit-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
40+
runs-on: ubuntu-latest
4141
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
4242
permissions:
4343
contents: read
@@ -55,54 +55,3 @@ jobs:
5555

5656
- name: Check build
5757
run: ./scripts/build
58-
59-
- name: Get GitHub OIDC Token
60-
if: |-
61-
github.repository == 'stainless-sdks/imagekit-typescript' &&
62-
!startsWith(github.ref, 'refs/heads/stl/')
63-
id: github-oidc
64-
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
65-
with:
66-
script: core.setOutput('github_token', await core.getIDToken());
67-
68-
- name: Upload tarball
69-
if: |-
70-
github.repository == 'stainless-sdks/imagekit-typescript' &&
71-
!startsWith(github.ref, 'refs/heads/stl/')
72-
env:
73-
URL: https://pkg.stainless.com/s
74-
AUTH: ${{ steps.github-oidc.outputs.github_token }}
75-
SHA: ${{ github.sha }}
76-
run: ./scripts/utils/upload-artifact.sh
77-
78-
- name: Upload MCP Server tarball
79-
if: |-
80-
github.repository == 'stainless-sdks/imagekit-typescript' &&
81-
!startsWith(github.ref, 'refs/heads/stl/')
82-
env:
83-
URL: https://pkg.stainless.com/s?subpackage=mcp-server
84-
AUTH: ${{ steps.github-oidc.outputs.github_token }}
85-
SHA: ${{ github.sha }}
86-
BASE_PATH: packages/mcp-server
87-
run: ./scripts/utils/upload-artifact.sh
88-
test:
89-
timeout-minutes: 10
90-
name: test
91-
runs-on: ${{ github.repository == 'stainless-sdks/imagekit-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
92-
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
93-
steps:
94-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
95-
96-
- name: Set up Node
97-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
98-
with:
99-
node-version: '22'
100-
101-
- name: Bootstrap
102-
run: ./scripts/bootstrap
103-
104-
- name: Build
105-
run: ./scripts/build
106-
107-
- name: Run tests
108-
run: ./scripts/test

.github/workflows/release-doctor.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ jobs:
1818
run: |
1919
bash ./bin/check-release-environment
2020
env:
21+
RELEASE_PLEASE_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN }}
2122
NPM_TOKEN: ${{ secrets.IMAGE_KIT_NPM_TOKEN || secrets.NPM_TOKEN }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Release Please
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
release-please:
13+
if: github.repository == 'imagekit-developer/imagekit-nodejs'
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: googleapis/release-please-action@5c625bfb5d1ff62eadeeb3772007f7f66fdcf071 # v4.4.1
18+
id: release
19+
with:
20+
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}

.github/workflows/stlc-promote.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Promote SDKs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
promote:
12+
runs-on: ubuntu-latest
13+
env:
14+
PRODUCTION_REPO: imagekit-developer/imagekit-nodejs
15+
PRODUCTION_BRANCH: master
16+
GH_TOKEN: ${{ secrets.SDK_WRITE_TOKEN }}
17+
steps:
18+
- name: Check out staging
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
persist-credentials: false
23+
24+
- name: Fetch production main
25+
run: |
26+
git remote add production \
27+
"https://x-access-token:${GH_TOKEN}@github.com/${PRODUCTION_REPO}.git"
28+
git fetch production "${PRODUCTION_BRANCH}"
29+
30+
- name: Check if production is already in sync
31+
id: diff
32+
run: |
33+
STAGING_SHA=$(git rev-parse origin/main)
34+
PRODUCTION_SHA=$(git rev-parse production/${PRODUCTION_BRANCH})
35+
if [ "$STAGING_SHA" = "$PRODUCTION_SHA" ]; then
36+
echo "Production is already at $STAGING_SHA. Nothing to release."
37+
echo "synced=true" >> "$GITHUB_OUTPUT"
38+
else
39+
echo "synced=false" >> "$GITHUB_OUTPUT"
40+
fi
41+
42+
- name: Push staging main to the release branch on production
43+
if: steps.diff.outputs.synced == 'false'
44+
run: |
45+
git push production origin/main:refs/heads/stainless/release --force
46+
47+
- name: Open or update the release PR on production
48+
if: steps.diff.outputs.synced == 'false'
49+
run: |
50+
EXISTING_PR=$(gh pr list \
51+
--repo "${PRODUCTION_REPO}" \
52+
--head stainless/release \
53+
--state open \
54+
--json number \
55+
--jq '.[0].number')
56+
if [ -z "${EXISTING_PR}" ]; then
57+
gh pr create \
58+
--repo "${PRODUCTION_REPO}" \
59+
--base "${PRODUCTION_BRANCH}" \
60+
--head stainless/release \
61+
--title "Release SDK updates" \
62+
--body "$(git log --oneline production/${PRODUCTION_BRANCH}..origin/main)"
63+
else
64+
echo "Release PR #${EXISTING_PR} already exists. Force-push has updated it."
65+
fi
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Sync Release-As from release PR title
2+
3+
on:
4+
pull_request:
5+
types: [edited]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
sync:
12+
if: >-
13+
github.event.pull_request.base.ref == 'master' &&
14+
startsWith(github.event.pull_request.head.ref, 'release-please--') &&
15+
github.event.changes.title != null
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Extract versions from old and new title
19+
id: parse
20+
env:
21+
NEW_TITLE: ${{ github.event.pull_request.title }}
22+
OLD_TITLE: ${{ github.event.changes.title.from }}
23+
run: |
24+
# Anchored on pull-request-title-pattern "release: ${version}" from release-please-config.json.
25+
extract() {
26+
echo "$1" | grep -oE '^release:[[:space:]]+v?[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?' \
27+
| sed -E 's/^release:[[:space:]]+v?//'
28+
}
29+
NEW_VERSION=$(extract "$NEW_TITLE")
30+
OLD_VERSION=$(extract "$OLD_TITLE")
31+
echo "old=$OLD_VERSION"
32+
echo "new=$NEW_VERSION"
33+
if [ -z "$NEW_VERSION" ]; then
34+
echo "::notice::No semver in new title; nothing to do."
35+
echo "skip=true" >> "$GITHUB_OUTPUT"
36+
exit 0
37+
fi
38+
if [ "$NEW_VERSION" = "$OLD_VERSION" ]; then
39+
echo "::notice::Version unchanged ($NEW_VERSION); not pushing."
40+
echo "skip=true" >> "$GITHUB_OUTPUT"
41+
exit 0
42+
fi
43+
echo "version=$NEW_VERSION" >> "$GITHUB_OUTPUT"
44+
45+
- name: Check out master
46+
if: steps.parse.outputs.skip != 'true'
47+
uses: actions/checkout@v6
48+
with:
49+
ref: master
50+
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
51+
fetch-depth: 1
52+
53+
- name: Push empty Release-As commit
54+
if: steps.parse.outputs.skip != 'true'
55+
env:
56+
VERSION: ${{ steps.parse.outputs.version }}
57+
run: |
58+
git config user.name "release-as-bot"
59+
git config user.email "release-as-bot@users.noreply.github.com"
60+
git commit --allow-empty -m "chore: pin next release
61+
62+
Release-As: ${VERSION}"
63+
git push origin master

.stats.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
11
configured_endpoints: 47
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-01267e4c07ec30011b8445babed88fbd2133b65198f42d0310b7ab39c74751d4.yml
3-
openapi_spec_hash: 7c103e2dff0edcbeea82057e62f58d4d
4-
config_hash: 7ef70b333059ca21bef0f0a6d4cbb282

api.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ Types:
3535
Methods:
3636

3737
- <code title="post /v1/customMetadataFields">client.customMetadataFields.<a href="./src/resources/custom-metadata-fields.ts">create</a>({ ...params }) -> CustomMetadataField</code>
38-
- <code title="patch /v1/customMetadataFields/{id}">client.customMetadataFields.<a href="./src/resources/custom-metadata-fields.ts">update</a>(id, { ...params }) -> CustomMetadataField</code>
3938
- <code title="get /v1/customMetadataFields">client.customMetadataFields.<a href="./src/resources/custom-metadata-fields.ts">list</a>({ ...params }) -> CustomMetadataFieldListResponse</code>
39+
- <code title="patch /v1/customMetadataFields/{id}">client.customMetadataFields.<a href="./src/resources/custom-metadata-fields.ts">update</a>(id, { ...params }) -> CustomMetadataField</code>
4040
- <code title="delete /v1/customMetadataFields/{id}">client.customMetadataFields.<a href="./src/resources/custom-metadata-fields.ts">delete</a>(id) -> CustomMetadataFieldDeleteResponse</code>
4141

4242
# Files
@@ -55,13 +55,13 @@ Types:
5555

5656
Methods:
5757

58+
- <code title="post /api/v1/files/upload">client.files.<a href="./src/resources/files/files.ts">upload</a>({ ...params }) -> FileUploadResponse</code>
59+
- <code title="get /v1/files/{fileId}/details">client.files.<a href="./src/resources/files/files.ts">get</a>(fileID) -> File</code>
5860
- <code title="patch /v1/files/{fileId}/details">client.files.<a href="./src/resources/files/files.ts">update</a>(fileID, { ...params }) -> FileUpdateResponse</code>
5961
- <code title="delete /v1/files/{fileId}">client.files.<a href="./src/resources/files/files.ts">delete</a>(fileID) -> void</code>
6062
- <code title="post /v1/files/copy">client.files.<a href="./src/resources/files/files.ts">copy</a>({ ...params }) -> FileCopyResponse</code>
61-
- <code title="get /v1/files/{fileId}/details">client.files.<a href="./src/resources/files/files.ts">get</a>(fileID) -> File</code>
6263
- <code title="post /v1/files/move">client.files.<a href="./src/resources/files/files.ts">move</a>({ ...params }) -> FileMoveResponse</code>
6364
- <code title="put /v1/files/rename">client.files.<a href="./src/resources/files/files.ts">rename</a>({ ...params }) -> FileRenameResponse</code>
64-
- <code title="post /api/v1/files/upload">client.files.<a href="./src/resources/files/files.ts">upload</a>({ ...params }) -> FileUploadResponse</code>
6565

6666
## Bulk
6767

@@ -76,8 +76,8 @@ Methods:
7676

7777
- <code title="post /v1/files/batch/deleteByFileIds">client.files.bulk.<a href="./src/resources/files/bulk.ts">delete</a>({ ...params }) -> BulkDeleteResponse</code>
7878
- <code title="post /v1/files/addTags">client.files.bulk.<a href="./src/resources/files/bulk.ts">addTags</a>({ ...params }) -> BulkAddTagsResponse</code>
79-
- <code title="post /v1/files/removeAITags">client.files.bulk.<a href="./src/resources/files/bulk.ts">removeAITags</a>({ ...params }) -> BulkRemoveAITagsResponse</code>
8079
- <code title="post /v1/files/removeTags">client.files.bulk.<a href="./src/resources/files/bulk.ts">removeTags</a>({ ...params }) -> BulkRemoveTagsResponse</code>
80+
- <code title="post /v1/files/removeAITags">client.files.bulk.<a href="./src/resources/files/bulk.ts">removeAITags</a>({ ...params }) -> BulkRemoveAITagsResponse</code>
8181

8282
## Versions
8383

@@ -89,8 +89,8 @@ Types:
8989
Methods:
9090

9191
- <code title="get /v1/files/{fileId}/versions">client.files.versions.<a href="./src/resources/files/versions.ts">list</a>(fileID) -> VersionListResponse</code>
92-
- <code title="delete /v1/files/{fileId}/versions/{versionId}">client.files.versions.<a href="./src/resources/files/versions.ts">delete</a>(versionID, { ...params }) -> VersionDeleteResponse</code>
9392
- <code title="get /v1/files/{fileId}/versions/{versionId}">client.files.versions.<a href="./src/resources/files/versions.ts">get</a>(versionID, { ...params }) -> File</code>
93+
- <code title="delete /v1/files/{fileId}/versions/{versionId}">client.files.versions.<a href="./src/resources/files/versions.ts">delete</a>(versionID, { ...params }) -> VersionDeleteResponse</code>
9494
- <code title="put /v1/files/{fileId}/versions/{versionId}/restore">client.files.versions.<a href="./src/resources/files/versions.ts">restore</a>(versionID, { ...params }) -> File</code>
9595

9696
## Metadata
@@ -108,11 +108,11 @@ Types:
108108

109109
Methods:
110110

111+
- <code title="get /v1/saved-extensions">client.savedExtensions.<a href="./src/resources/saved-extensions.ts">list</a>() -> SavedExtensionListResponse</code>
111112
- <code title="post /v1/saved-extensions">client.savedExtensions.<a href="./src/resources/saved-extensions.ts">create</a>({ ...params }) -> SavedExtension</code>
113+
- <code title="get /v1/saved-extensions/{id}">client.savedExtensions.<a href="./src/resources/saved-extensions.ts">get</a>(id) -> SavedExtension</code>
112114
- <code title="patch /v1/saved-extensions/{id}">client.savedExtensions.<a href="./src/resources/saved-extensions.ts">update</a>(id, { ...params }) -> SavedExtension</code>
113-
- <code title="get /v1/saved-extensions">client.savedExtensions.<a href="./src/resources/saved-extensions.ts">list</a>() -> SavedExtensionListResponse</code>
114115
- <code title="delete /v1/saved-extensions/{id}">client.savedExtensions.<a href="./src/resources/saved-extensions.ts">delete</a>(id) -> void</code>
115-
- <code title="get /v1/saved-extensions/{id}">client.savedExtensions.<a href="./src/resources/saved-extensions.ts">get</a>(id) -> SavedExtension</code>
116116

117117
# Assets
118118

@@ -188,11 +188,11 @@ Types:
188188

189189
Methods:
190190

191+
- <code title="get /v1/accounts/origins">client.accounts.origins.<a href="./src/resources/accounts/origins.ts">list</a>() -> OriginListResponse</code>
191192
- <code title="post /v1/accounts/origins">client.accounts.origins.<a href="./src/resources/accounts/origins.ts">create</a>({ ...params }) -> OriginResponse</code>
193+
- <code title="get /v1/accounts/origins/{id}">client.accounts.origins.<a href="./src/resources/accounts/origins.ts">get</a>(id) -> OriginResponse</code>
192194
- <code title="put /v1/accounts/origins/{id}">client.accounts.origins.<a href="./src/resources/accounts/origins.ts">update</a>(id, { ...params }) -> OriginResponse</code>
193-
- <code title="get /v1/accounts/origins">client.accounts.origins.<a href="./src/resources/accounts/origins.ts">list</a>() -> OriginListResponse</code>
194195
- <code title="delete /v1/accounts/origins/{id}">client.accounts.origins.<a href="./src/resources/accounts/origins.ts">delete</a>(id) -> void</code>
195-
- <code title="get /v1/accounts/origins/{id}">client.accounts.origins.<a href="./src/resources/accounts/origins.ts">get</a>(id) -> OriginResponse</code>
196196

197197
## URLEndpoints
198198

@@ -204,11 +204,11 @@ Types:
204204

205205
Methods:
206206

207+
- <code title="get /v1/accounts/url-endpoints">client.accounts.urlEndpoints.<a href="./src/resources/accounts/url-endpoints.ts">list</a>() -> URLEndpointListResponse</code>
207208
- <code title="post /v1/accounts/url-endpoints">client.accounts.urlEndpoints.<a href="./src/resources/accounts/url-endpoints.ts">create</a>({ ...params }) -> URLEndpointResponse</code>
209+
- <code title="get /v1/accounts/url-endpoints/{id}">client.accounts.urlEndpoints.<a href="./src/resources/accounts/url-endpoints.ts">get</a>(id) -> URLEndpointResponse</code>
208210
- <code title="put /v1/accounts/url-endpoints/{id}">client.accounts.urlEndpoints.<a href="./src/resources/accounts/url-endpoints.ts">update</a>(id, { ...params }) -> URLEndpointResponse</code>
209-
- <code title="get /v1/accounts/url-endpoints">client.accounts.urlEndpoints.<a href="./src/resources/accounts/url-endpoints.ts">list</a>() -> URLEndpointListResponse</code>
210211
- <code title="delete /v1/accounts/url-endpoints/{id}">client.accounts.urlEndpoints.<a href="./src/resources/accounts/url-endpoints.ts">delete</a>(id) -> void</code>
211-
- <code title="get /v1/accounts/url-endpoints/{id}">client.accounts.urlEndpoints.<a href="./src/resources/accounts/url-endpoints.ts">get</a>(id) -> URLEndpointResponse</code>
212212

213213
# Beta
214214

@@ -246,5 +246,5 @@ Types:
246246

247247
Methods:
248248

249-
- <code>client.webhooks.<a href="./src/resources/webhooks.ts">unsafeUnwrap</a>(body) -> void</code>
250249
- <code>client.webhooks.<a href="./src/resources/webhooks.ts">unwrap</a>(body) -> void</code>
250+
- <code>client.webhooks.<a href="./src/resources/webhooks.ts">unsafeUnwrap</a>(body) -> void</code>

bin/check-release-environment

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
errors=()
44

5+
if [ -z "${RELEASE_PLEASE_TOKEN}" ]; then
6+
errors+=("The RELEASE_PLEASE_TOKEN secret has not been set. Create a fine-grained GitHub PAT and add it as a repository secret.")
7+
fi
8+
59
if [ -z "${NPM_TOKEN}" ]; then
610
errors+=("The NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
711
fi

packages/mcp-server/cloudflare-worker/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const serverConfig: ServerConfig = {
5151
// key: 'webhookSecret',
5252
// label: 'Webhook Secret',
5353
// description:
54-
// "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",
54+
// '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',
5555
// required: false,
5656
// default: null,
5757
// placeholder: 'My Webhook Secret',

0 commit comments

Comments
 (0)