Skip to content

Commit 7ceaf20

Browse files
authored
Merge pull request #56 from moderation-api/speakeasy/regenerate
feat!: regenerate SDK from the OpenAPI spec (Speakeasy)
2 parents 47d1e96 + 61f7b8d commit 7ceaf20

1,404 files changed

Lines changed: 51507 additions & 68902 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitattributes‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This allows generated code to be indexed correctly
2+
*.rb linguist-generated=false

‎.github/workflows/ci.yml‎

Lines changed: 13 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,24 @@
1+
# Maintained in moderation-api/sdk-generator (custom/ruby). Edits here are overwritten.
12
name: CI
23
on:
34
push:
4-
branches:
5-
- '**'
6-
- '!integrated/**'
7-
- '!stl-preview-head/**'
8-
- '!stl-preview-base/**'
9-
- '!generated'
10-
- '!codegen/**'
11-
- 'codegen/stl/**'
5+
branches: [main]
126
pull_request:
13-
branches-ignore:
14-
- 'stl-preview-head/**'
15-
- 'stl-preview-base/**'
7+
8+
permissions:
9+
contents: read
1610

1711
jobs:
1812
build:
19-
timeout-minutes: 10
20-
name: build
21-
permissions:
22-
contents: read
23-
id-token: write
24-
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
25-
if: |-
26-
github.repository == 'stainless-sdks/moderation-api-ruby' &&
27-
(github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
13+
runs-on: ubuntu-latest
2814
steps:
2915
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
30-
- name: Set up Ruby
31-
uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0
16+
- uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0
3217
with:
18+
ruby-version: "3.2"
3319
bundler-cache: false
34-
- run: |-
35-
bundle install
36-
37-
- name: Get GitHub OIDC Token
38-
if: |-
39-
github.repository == 'stainless-sdks/moderation-api-ruby' &&
40-
!startsWith(github.ref, 'refs/heads/stl/')
41-
id: github-oidc
42-
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
43-
with:
44-
script: core.setOutput('github_token', await core.getIDToken());
45-
46-
- name: Build and upload gem artifacts
47-
if: |-
48-
github.repository == 'stainless-sdks/moderation-api-ruby' &&
49-
!startsWith(github.ref, 'refs/heads/stl/')
50-
env:
51-
URL: https://pkg.stainless.com/s
52-
AUTH: ${{ steps.github-oidc.outputs.github_token }}
53-
SHA: ${{ github.sha }}
54-
PACKAGE_NAME: moderation_api
55-
run: ./scripts/utils/upload-artifact.sh
56-
lint:
57-
timeout-minutes: 10
58-
name: lint
59-
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
60-
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
61-
62-
steps:
63-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
64-
- name: Set up Ruby
65-
uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0
66-
with:
67-
bundler-cache: false
68-
- run: |-
69-
bundle install
70-
71-
- name: Run lints
72-
run: ./scripts/lint
73-
test:
74-
timeout-minutes: 10
75-
name: test
76-
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
77-
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
78-
steps:
79-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
80-
- name: Set up Ruby
81-
uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0
82-
with:
83-
bundler-cache: false
84-
- run: |-
85-
bundle install
86-
87-
- name: Run tests
88-
run: ./scripts/test
20+
- run: bundle install
21+
- run: bundle exec rubocop --format github
22+
- run: gem build moderation_api.gemspec
23+
- name: Load the gem
24+
run: bundle exec ruby -Ilib -e 'require "moderation_api"; require "moderation_api/webhook_signature"; ModerationApi::ModerationApi; ModerationApi::WebhookSignature'

‎.github/workflows/publish-gem.yml‎

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
1-
# This workflow is triggered when a GitHub release is created.
2-
# It can also be run manually to re-publish to rubygems.org in case it failed for some reason.
3-
# You can run this workflow by navigating to https://www.github.com/moderation-api/sdk-ruby/actions/workflows/publish-gem.yml
1+
# Maintained in moderation-api/sdk-generator (custom/ruby). Edits here are overwritten.
42
name: Publish Gem
53
on:
6-
workflow_dispatch:
7-
84
release:
95
types: [published]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
1010

1111
jobs:
1212
publish:
13-
name: publish
1413
runs-on: ubuntu-latest
15-
1614
steps:
1715
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
18-
- name: Set up Ruby
19-
uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0
16+
- uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0
2017
with:
21-
bundler-cache: false
22-
- run: |-
23-
bundle install
24-
25-
- name: Publish to RubyGems.org
18+
ruby-version: "3.2"
19+
- name: Check the release tag matches the gem version
20+
if: github.event_name == 'release'
2621
run: |
27-
bash ./bin/publish-gem
22+
version=$(ruby -e 'puts Gem::Specification.load("moderation_api.gemspec").version')
23+
if [ "${GITHUB_REF_NAME#v}" != "$version" ]; then
24+
echo "::error::Release tag $GITHUB_REF_NAME does not match gem version $version"
25+
exit 1
26+
fi
27+
- run: gem build moderation_api.gemspec
28+
- run: gem push moderation_api-*.gem
2829
env:
29-
# `RUBYGEMS_HOST` is only required for private gem repositories, not https://rubygems.org
30-
RUBYGEMS_HOST: ${{ secrets.MODERATION_API_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }}
3130
GEM_HOST_API_KEY: ${{ secrets.MODERATION_API_GEM_HOST_API_KEY || secrets.GEM_HOST_API_KEY }}

‎.github/workflows/release-doctor.yml‎

Lines changed: 0 additions & 22 deletions
This file was deleted.

‎.gitignore‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
*.gem
2-
.idea/
3-
.ignore
4-
.prism.log
5-
.stdy.log
6-
.ruby-lsp/
7-
.yardoc/
8-
bin/tapioca
9-
Brewfile.lock.json
10-
doc/
11-
sorbet/tapioca/*
2+
.rbenv-gemsets
3+
.DS_Store
4+
**/.speakeasy/temp/
5+
**/.speakeasy/logs/
6+
.speakeasy/reports
7+
bin/
8+
sorbet/rbi
9+
.env
10+
.env.local

‎.release-please-manifest.json‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎.rubocop-strict.yml‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
inherit_from: .rubocop.yml
2+
3+
# Re-enable Style/StringLiterals for strict linting (e.g. internal CI).
4+
# The base .rubocop.yml disables this rule so customers with single-quote
5+
# conventions aren't broken. Use RUBOCOP_OPTS="--config .rubocop-strict.yml"
6+
# to opt in to enforcement.
7+
Style/StringLiterals:
8+
Enabled: true
9+
EnforcedStyle: double_quotes
10+
Exclude:
11+
- Gemfile
12+
- "*.gemspec"
13+
- lib/crystalline.rb
14+
- lib/crystalline/**/*
15+
- lib/**/sdk_hooks/**/*
16+
- sorbet/**/*

0 commit comments

Comments
 (0)