diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b21c8f2..f0dbdd45 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/retell-python' && '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 @@ -44,7 +44,7 @@ jobs: permissions: contents: read id-token: write - runs-on: ${{ github.repository == 'stainless-sdks/retell-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: 'ubuntu-latest' steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -64,7 +64,7 @@ jobs: - name: Get GitHub OIDC Token if: |- - github.repository == 'stainless-sdks/retell-python' && + github.repository == 'RetellAI/retell-python-sdk-staging' && !startsWith(github.ref, 'refs/heads/stl/') id: github-oidc uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 @@ -73,7 +73,7 @@ jobs: - name: Upload tarball if: |- - github.repository == 'stainless-sdks/retell-python' && + github.repository == 'RetellAI/retell-python-sdk-staging' && !startsWith(github.ref, 'refs/heads/stl/') env: URL: https://pkg.stainless.com/s @@ -84,7 +84,7 @@ jobs: test: timeout-minutes: 10 name: test - runs-on: ${{ github.repository == 'stainless-sdks/retell-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: 'ubuntu-latest' if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 16debdb2..6dbc4dc6 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -1,8 +1,10 @@ name: Release Please + on: push: branches: - main + workflow_dispatch: permissions: contents: write @@ -10,8 +12,9 @@ permissions: jobs: release-please: - if: github.repository == 'RetellAI/retell-python-sdk' + name: release please runs-on: ubuntu-latest + if: github.repository == 'RetellAI/retell-python-sdk' steps: - uses: googleapis/release-please-action@5c625bfb5d1ff62eadeeb3772007f7f66fdcf071 # v4.4.1 diff --git a/.github/workflows/stlc-auto-merge.yml b/.github/workflows/stlc-auto-merge.yml new file mode 100644 index 00000000..fd58d774 --- /dev/null +++ b/.github/workflows/stlc-auto-merge.yml @@ -0,0 +1,105 @@ +name: Auto-merge SDK release PRs + +on: + pull_request_target: + types: [opened, synchronize, reopened, ready_for_review] + branches: [main] + workflow_run: + workflows: ['CI', 'Release Doctor'] + types: [completed] + workflow_dispatch: + inputs: + pr_number: + description: 'Optional PR number to evaluate' + required: false + +permissions: + contents: write + pull-requests: write + checks: read + statuses: read + actions: read + +jobs: + auto-merge: + if: github.repository == 'RetellAI/retell-python-sdk' + runs-on: ubuntu-latest + env: + GH_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN }} + REPO: ${{ github.repository }} + steps: + - name: Merge qualifying green PRs + shell: bash + run: | + set -euo pipefail + + pr_numbers=() + if [ "${{ github.event_name }}" = "pull_request_target" ]; then + pr_numbers+=("${{ github.event.pull_request.number }}") + elif [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -n "${{ inputs.pr_number }}" ]; then + pr_numbers+=("${{ inputs.pr_number }}") + else + while IFS= read -r number; do + pr_numbers+=("$number") + done < <(gh pr list --repo "$REPO" --base main --state open --json number --jq '.[].number') + fi + + for pr in "${pr_numbers[@]}"; do + echo "Evaluating PR #$pr" + pr_json=$(gh pr view "$pr" --repo "$REPO" --json title,isDraft,headRefName,headRefOid,headRepository,isCrossRepository,baseRefName,mergeStateStatus) + title=$(jq -r '.title' <<<"$pr_json") + is_draft=$(jq -r '.isDraft' <<<"$pr_json") + head_ref=$(jq -r '.headRefName' <<<"$pr_json") + head_sha=$(jq -r '.headRefOid' <<<"$pr_json") + head_repo=$(jq -r '.headRepository.nameWithOwner // ""' <<<"$pr_json") + is_cross_repository=$(jq -r '.isCrossRepository' <<<"$pr_json") + base_ref=$(jq -r '.baseRefName' <<<"$pr_json") + + if [ "$base_ref" != "main" ] || [ "$is_draft" = "true" ]; then + echo "Skipping PR #$pr: not a ready PR to main." + continue + fi + + if [ "$is_cross_repository" = "true" ] || [ "$head_repo" != "$REPO" ]; then + echo "Skipping PR #$pr: head branch is not in $REPO." + continue + fi + + merge_flag="" + if [ "$head_ref" = "stainless-release" ] && [ "$title" = "Release SDK updates" ]; then + merge_flag="--merge" + elif [[ "$head_ref" == release-please--* ]] && [[ "$title" == release:* ]]; then + merge_flag="--squash" + else + echo "Skipping PR #$pr: not an automated SDK release PR." + continue + fi + + check_runs=$(gh api "/repos/$REPO/commits/$head_sha/check-runs?per_page=100") + check_count=$(jq '.total_count' <<<"$check_runs") + if [ "$check_count" -eq 0 ]; then + echo "Skipping PR #$pr: no check runs found yet." + continue + fi + + bad_checks=$(jq '[.check_runs[] | select(.status != "completed" or (.conclusion != "success" and .conclusion != "neutral" and .conclusion != "skipped"))] | length' <<<"$check_runs") + if [ "$bad_checks" -ne 0 ]; then + echo "Skipping PR #$pr: checks are pending or failed." + continue + fi + + statuses=$(gh api "/repos/$REPO/commits/$head_sha/status") + status_count=$(jq '.total_count' <<<"$statuses") + status_state=$(jq -r '.state' <<<"$statuses") + if [ "$status_count" -gt 0 ] && [ "$status_state" != "success" ]; then + echo "Skipping PR #$pr: commit statuses are $status_state." + continue + fi + + echo "Merging PR #$pr with ${merge_flag}." + if gh pr merge "$pr" --repo "$REPO" "$merge_flag" --delete-branch --match-head-commit "$head_sha"; then + echo "Merged PR #$pr." + else + echo "Skipping PR #$pr: GitHub did not consider it mergeable yet." + fi + done diff --git a/.github/workflows/stlc-promote.yml b/.github/workflows/stlc-promote.yml deleted file mode 100644 index 2344e043..00000000 --- a/.github/workflows/stlc-promote.yml +++ /dev/null @@ -1,104 +0,0 @@ -name: Promote SDKs - -on: - push: - branches: [main] - -permissions: - contents: read - -jobs: - promote: - if: github.repository == 'RetellAI/retell-python-sdk-staging' - runs-on: ubuntu-latest - env: - PRODUCTION_REPO: RetellAI/retell-python-sdk - GH_TOKEN: ${{ secrets.PRODUCTION_REPO_TOKEN }} - steps: - - name: Check out staging - uses: actions/checkout@v6 - 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 main - - - name: Check if production is already in sync - id: diff - run: | - STAGING_SHA=$(git rev-parse origin/main) - PRODUCTION_SHA=$(git rev-parse production/main) - 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: Preserve production-owned files - if: steps.diff.outputs.synced == 'false' - run: | - git config user.name "stlc-bot" - git config user.email "stlc-bot@users.noreply.github.com" - git switch --force-create stainless-release origin/main - - git rm -r -f --ignore-unmatch .github/workflows - git checkout production/main -- .github/workflows - git rm -f --ignore-unmatch .github/workflows/stlc-promote.yml - - for release_path in \ - .release-please-manifest.json \ - CHANGELOG.md \ - pyproject.toml \ - src/retell/_version.py - do - if git cat-file -e "production/main:${release_path}" 2>/dev/null; then - git checkout production/main -- "${release_path}" - else - git rm -f --ignore-unmatch "${release_path}" - fi - done - - if ! git diff --quiet HEAD -- \ - .github/workflows \ - .release-please-manifest.json \ - CHANGELOG.md \ - pyproject.toml \ - src/retell/_version.py - then - git add \ - .github/workflows \ - .release-please-manifest.json \ - CHANGELOG.md \ - pyproject.toml \ - src/retell/_version.py - git commit -m "chore: preserve production workflow files" - fi - - - name: Push release branch on production - if: steps.diff.outputs.synced == 'false' - run: git push production HEAD: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 main \ - --head stainless-release \ - --title "Release SDK updates" \ - --body "$(git log --oneline production/main..HEAD)" - else - echo "Release PR #${EXISTING_PR} already exists. Force-push has updated it." - fi diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e30834d7..eff7a466 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "5.43.0" + ".": "5.46.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index e37f60a1..2cdb01da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,91 @@ # Changelog +## [5.46.0](https://github.com/RetellAI/retell-python-sdk/compare/v5.45.3...v5.46.0) (2026-06-03) + + +### Features + +* **api:** api update ([e8599c9](https://github.com/RetellAI/retell-python-sdk/commit/e8599c933355aef8b1ec14e264cc151be3d742fe)) + + +### Chores + +* preserve production workflow files ([02fb027](https://github.com/RetellAI/retell-python-sdk/commit/02fb027422e35b17bc2b849b4f071891ed568240)) + +## [5.45.3](https://github.com/RetellAI/retell-python-sdk/compare/v5.45.2...v5.45.3) (2026-06-01) + + +### Chores + +* preserve production workflow files ([796a30b](https://github.com/RetellAI/retell-python-sdk/commit/796a30b644e349ffd5ca2115e150905c9b16ae06)) + +## [5.45.2](https://github.com/RetellAI/retell-python-sdk/compare/v5.45.1...v5.45.2) (2026-06-01) + + +### Chores + +* preserve production workflow files ([2873729](https://github.com/RetellAI/retell-python-sdk/commit/28737294ed63d5f974ff3dc930db9a7fb2ec50b3)) + + +### Documentation + +* fix OpenAPI phone number description typo ([967f88b](https://github.com/RetellAI/retell-python-sdk/commit/967f88bbb7fd117fc24a8cd9c7c8416eaa6ba51a)) + +## [5.45.1](https://github.com/RetellAI/retell-python-sdk/compare/v5.45.0...v5.45.1) (2026-05-30) + + +### Bug Fixes + +* **api:** clarify inbound webhook description ([9638b62](https://github.com/RetellAI/retell-python-sdk/commit/9638b626e6f5d406423c888bb0395c45327673fb)) + + +### Chores + +* preserve production workflow files ([4bed949](https://github.com/RetellAI/retell-python-sdk/commit/4bed9492d6abaa99b1bb5c45d8ebb2d46cecc8b4)) + +## [5.45.0](https://github.com/RetellAI/retell-python-sdk/compare/v5.44.1...v5.45.0) (2026-05-29) + + +### Features + +* **api:** api update ([2f12990](https://github.com/RetellAI/retell-python-sdk/commit/2f12990411eddc2e1d584266b5787e9a38f54ae1)) + + +### Chores + +* preserve production workflow files ([8e839ba](https://github.com/RetellAI/retell-python-sdk/commit/8e839bae64ec3a2b4e61a196ca772c6695014dfc)) + +## [5.44.1](https://github.com/RetellAI/retell-python-sdk/compare/v5.44.0...v5.44.1) (2026-05-29) + + +### Chores + +* restore stlc auto-merge triggers ([5f38f95](https://github.com/RetellAI/retell-python-sdk/commit/5f38f95c5a65f79aedc16da6277c8800f4d05ffc)) + +## 5.44.0 (2026-05-29) + +Full Changelog: [v5.43.1...v5.44.0](https://github.com/RetellAI/retell-python-sdk/compare/v5.43.1...v5.44.0) + +### Features + +* **api:** api update ([a559d90](https://github.com/RetellAI/retell-python-sdk/commit/a559d9031cc2e111ae02a19ce988b8042c137526)) + + +### Chores + +* disable stlc auto-merge workflow ([83fc966](https://github.com/RetellAI/retell-python-sdk/commit/83fc96699b82d56652355396723f52caeb837842)) + +## 5.43.1 (2026-05-29) + +Full Changelog: [v5.43.0...v5.43.1](https://github.com/RetellAI/retell-python-sdk/compare/v5.43.0...v5.43.1) + +### Chores + +* add release-please workflow ([2ded49b](https://github.com/RetellAI/retell-python-sdk/commit/2ded49be02e1471bef0968f422c1cbf19314119b)) +* add SDK auto-merge workflow ([0966b89](https://github.com/RetellAI/retell-python-sdk/commit/0966b89b08dcb1ab507511b480270961bf8332b0)) +* harden SDK auto-merge workflow ([be57a3f](https://github.com/RetellAI/retell-python-sdk/commit/be57a3f70524d1f4bad69b37b73b383efb4c48d6)) +* restrict SDK auto-merge to same-repo branches ([4644075](https://github.com/RetellAI/retell-python-sdk/commit/4644075b17cc17443e67bc8fafa3ffe8e0e65e85)) + ## 5.43.0 (2026-05-28) Full Changelog: [v5.42.0...v5.43.0](https://github.com/RetellAI/retell-python-sdk/compare/v5.42.0...v5.43.0) diff --git a/pyproject.toml b/pyproject.toml index 0e3f0751..b4623c79 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "retell-sdk" -version = "5.43.0" +version = "5.46.0" description = "The official Python library for the retell API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/retell/_version.py b/src/retell/_version.py index a74ec2af..f97d2a61 100644 --- a/src/retell/_version.py +++ b/src/retell/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "retell" -__version__ = "5.43.0" # x-release-please-version +__version__ = "5.46.0" # x-release-please-version diff --git a/src/retell/types/call_list_params.py b/src/retell/types/call_list_params.py index 5eaed579..42ce78e8 100644 --- a/src/retell/types/call_list_params.py +++ b/src/retell/types/call_list_params.py @@ -13,6 +13,8 @@ "FilterCriteriaAgent", "FilterCriteriaBatchCallID", "FilterCriteriaCallID", + "FilterCriteriaCallIDStringFilter", + "FilterCriteriaCallIDEnumFilter", "FilterCriteriaCallStatus", "FilterCriteriaCallSuccessful", "FilterCriteriaCallType", @@ -112,9 +114,7 @@ class FilterCriteriaBatchCallID(TypedDict, total=False): value: Required[str] -class FilterCriteriaCallID(TypedDict, total=False): - """Filter by call ID.""" - +class FilterCriteriaCallIDStringFilter(TypedDict, total=False): op: Required[Literal["eq", "ne", "sw", "ew", "co"]] """eq: equal, ne: not equal, sw: starts with, ew: ends with, co: contains""" @@ -123,6 +123,18 @@ class FilterCriteriaCallID(TypedDict, total=False): value: Required[str] +class FilterCriteriaCallIDEnumFilter(TypedDict, total=False): + op: Required[Literal["in"]] + """in: value is one of the listed values""" + + type: Required[Literal["enum"]] + + value: Required[SequenceNotStr[str]] + + +FilterCriteriaCallID: TypeAlias = Union[FilterCriteriaCallIDStringFilter, FilterCriteriaCallIDEnumFilter] + + class FilterCriteriaCallStatus(TypedDict, total=False): op: Required[Literal["in"]] """in: value is one of the listed values"""