Skip to content

Commit 36ffaac

Browse files
authored
Merge pull request #49 from moderation-api/speakeasy/regenerate
feat!: regenerate SDK from the OpenAPI spec (Speakeasy)
2 parents 25d0941 + 4bb0409 commit 36ffaac

1,299 files changed

Lines changed: 37815 additions & 62161 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 & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,2 @@
1-
*.php diff=php
2-
3-
/.github export-ignore
4-
/bin export-ignore
5-
/scripts export-ignore
6-
/tests export-ignore
7-
8-
/.gitattributes export-ignore
9-
/.gitignore export-ignore
10-
/.php-cs-fixer.dist.php export-ignore
11-
/.phpactor.json export-ignore
12-
/.release-please-manifest.json export-ignore
13-
/.stats.yml export-ignore
14-
/phpstan.dist.neon export-ignore
15-
/phpunit.xml.dist export-ignore
16-
/release-please-config.json export-ignore
1+
# This allows generated code to be indexed correctly
2+
*.php linguist-generated=false

‎.github/workflows/ci.yml‎

Lines changed: 20 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,29 @@
1+
# Maintained in moderation-api/sdk-generator (custom/php). 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/**'
167

17-
jobs:
18-
lint:
19-
timeout-minutes: 10
20-
name: lint
21-
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
22-
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
23-
24-
steps:
25-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26-
27-
- name: Set up PHP
28-
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0
29-
with:
30-
php-version: '8.3'
8+
permissions:
9+
contents: read
3110

32-
- name: Run Bootstrap
33-
run: ./scripts/bootstrap
34-
35-
- name: Run lints
36-
run: ./scripts/lint
37-
test:
38-
timeout-minutes: 10
39-
name: test
40-
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
41-
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
4214
steps:
4315
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
44-
45-
- name: Set up PHP
46-
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0
16+
- uses: shivammathur/setup-php@v2
4717
with:
48-
php-version: '8.3'
49-
50-
- name: Run bootstrap
51-
run: ./scripts/bootstrap
52-
53-
- name: Run tests
54-
run: ./scripts/test
18+
php-version: "8.2"
19+
- run: composer install --no-interaction --no-progress
20+
- name: Static analysis
21+
run: |
22+
set -o pipefail
23+
if ! vendor/bin/phpstan analyse --level=5 --memory-limit=2g --no-progress --error-format=raw > phpstan.txt 2>&1; then
24+
head -n 40 phpstan.txt | sed 's/^/::error title=phpstan::/'
25+
exit 1
26+
fi
27+
- name: Load the package
28+
run: |
29+
php -r 'require "vendor/autoload.php"; foreach (["ModerationApi\\ModerationApi", "ModerationApi\\WebhookSignature"] as $c) { if (!class_exists($c)) { fwrite(STDERR, "missing $c\n"); exit(1); } }'
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1+
# Maintained in moderation-api/sdk-generator (custom/php). Edits here are overwritten.
2+
# Packagist reads the version from the release tag.
13
name: Publish Packagist
24
on:
3-
workflow_dispatch:
4-
55
release:
66
types: [published]
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
711

812
jobs:
913
publish:
10-
name: publish
1114
runs-on: ubuntu-latest
12-
1315
steps:
14-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
15-
16-
- name: Publish to Packagist
16+
- name: Tell Packagist to update
1717
run: |-
1818
curl --fail-with-body -X POST -H 'Content-Type: application/json' "https://packagist.org/api/update-package?username=${PACKAGIST_USERNAME}&apiToken=${PACKAGIST_SAFE_KEY}" -d '{"repository":"https://github.com/moderation-api/sdk-php"}'
1919
env:
2020
PACKAGIST_USERNAME: ${{ secrets.MODERATION_API_PACKAGIST_USERNAME || secrets.PACKAGIST_USERNAME }}
21-
PACKAGIST_SAFE_KEY: ${{ secrets.MODERATION_API_PACKAGIST_SAFE_KEY || secrets.PACKAGIST_SAFE_KEY }}
21+
PACKAGIST_SAFE_KEY: ${{ secrets.MODERATION_API_PACKAGIST_SAFE_KEY || secrets.PACKAGIST_SAFE_KEY }}

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

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

‎.gitignore‎

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
docs/
2-
.idea/
3-
.php-cs-fixer.cache
4-
.php-cs-fixer.php
5-
.phpunit.cache
6-
phpunit.xml
7-
playground/
8-
*.swo
9-
*.swp
10-
vendor/
11-
12-
# do not edit! excludes generated files used internally
13-
.artifacts/
1+
composer.lock
2+
vendor
3+
.DS_Store
4+
.DS_Store
5+
**/.speakeasy/temp/
6+
**/.speakeasy/logs/
7+
.env
8+
.env.local

‎.php-cs-fixer.dist.php‎

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

‎.phpactor.json‎

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

‎.release-please-manifest.json‎

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

0 commit comments

Comments
 (0)