Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "5.1.0"
".": "5.1.1"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 81
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-3fc1c86b4a83a16393aaf17d1fb3ac6098d30dd057ba872973b57285a7a3f0d0.yml
openapi_spec_hash: 02a545d217b13399f311e99561f9de1d
config_hash: 0789c3cddc625bb9712b3bded274ab6c
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-b3852cdd1020811766572923d26a6c95f4a538bf4c7268462b6ba39f34480b3e.yml
openapi_spec_hash: b2e2f2357342e9a6b16a591d0b946e38
config_hash: 6f072c60adb74a68d27be5a0e5ea3124
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## 5.1.1 (2026-02-20)

Full Changelog: [v5.1.0...v5.1.1](https://github.com/trycourier/courier-php/compare/v5.1.0...v5.1.1)

### Bug Fixes

* **api:** remove brand field from ElementalContent ([e7b32eb](https://github.com/trycourier/courier-php/commit/e7b32ebc7928583bcc92a33d83056b31d465652e))


### Chores

* **internal:** remove mock server code ([0e4932e](https://github.com/trycourier/courier-php/commit/0e4932ea8282a21d9fe88f582aee42088b7cec6f))
* update mock server docs ([6541bd1](https://github.com/trycourier/courier-php/commit/6541bd14ef424dec7fb51f9d0acc5ab70b64618d))


### Documentation

* add AUTO-GENERATED-OVERVIEW markers for README sync ([97bfbe3](https://github.com/trycourier/courier-php/commit/97bfbe3ce0efbcf14d6f0c54b1cfbd809a5f6eab))
* sync README from mintlify-docs (2026-02-20 18:11 UTC) ([9e9e06f](https://github.com/trycourier/courier-php/commit/9e9e06fdb360f1a42ded040073a4363754bbab5e))
* sync README from mintlify-docs (2026-02-20 18:36 UTC) ([af795ee](https://github.com/trycourier/courier-php/commit/af795ee277e7abce3c4b764d45e31badbf98d7dc))

## 5.1.0 (2026-02-06)

Full Changelog: [v5.0.2...v5.1.0](https://github.com/trycourier/courier-php/compare/v5.0.2...v5.1.0)
Expand Down
41 changes: 0 additions & 41 deletions scripts/mock

This file was deleted.

46 changes: 0 additions & 46 deletions scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,6 @@ set -e

cd "$(dirname "$0")/.."

RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
NC='\033[0m' # No Color

function prism_is_running() {
curl --silent "http://localhost:4010" >/dev/null 2>&1
}

kill_server_on_port() {
pids=$(lsof -t -i tcp:"$1" || echo "")
if [ "$pids" != "" ]; then
kill "$pids"
echo "Stopped $pids."
fi
}

function is_overriding_api_base_url() {
[ -n "$TEST_API_BASE_URL" ]
}

if ! is_overriding_api_base_url && ! prism_is_running ; then
# When we exit this script, make sure to kill the background mock server process
trap 'kill_server_on_port 4010' EXIT

# Start the dev server
./scripts/mock --daemon
fi

if is_overriding_api_base_url ; then
echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}"
echo
elif ! prism_is_running ; then
echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server"
echo -e "running against your OpenAPI spec."
echo
echo -e "To run the server, pass in the path or url of your OpenAPI"
echo -e "spec to the prism command:"
echo
echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}"
echo

exit 1
else
echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}"
echo
fi

exec -- ./vendor/bin/pest --colors=always
23 changes: 3 additions & 20 deletions src/ElementalContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Courier;

use Courier\Core\Attributes\Optional;
use Courier\Core\Attributes\Required;
use Courier\Core\Concerns\SdkModel;
use Courier\Core\Contracts\BaseModel;
Expand All @@ -14,7 +13,7 @@
* @phpstan-import-type ElementalNodeShape from \Courier\ElementalNode
*
* @phpstan-type ElementalContentShape = array{
* elements: list<ElementalNodeShape>, version: string, brand?: string|null
* elements: list<ElementalNodeShape>, version: string
* }
*/
final class ElementalContent implements BaseModel
Expand All @@ -32,9 +31,6 @@ final class ElementalContent implements BaseModel
#[Required]
public string $version;

#[Optional(nullable: true)]
public ?string $brand;

/**
* `new ElementalContent()` is missing required properties by the API.
*
Expand All @@ -61,18 +57,13 @@ public function __construct()
*
* @param list<ElementalNodeShape> $elements
*/
public static function with(
array $elements,
string $version,
?string $brand = null
): self {
public static function with(array $elements, string $version): self
{
$self = new self;

$self['elements'] = $elements;
$self['version'] = $version;

null !== $brand && $self['brand'] = $brand;

return $self;
}

Expand All @@ -97,12 +88,4 @@ public function withVersion(string $version): self

return $self;
}

public function withBrand(?string $brand): self
{
$self = clone $this;
$self['brand'] = $brand;

return $self;
}
}
2 changes: 1 addition & 1 deletion src/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
namespace Courier;

// x-release-please-start-version
const VERSION = '5.1.0';
const VERSION = '5.1.1';
// x-release-please-end
10 changes: 5 additions & 5 deletions tests/Services/AudiencesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected function setUp(): void
public function testRetrieve(): void
{
if (UnsupportedMockTests::$skip) {
$this->markTestSkipped('Prism tests are disabled');
$this->markTestSkipped('Mock server tests are disabled');
}

$result = $this->client->audiences->retrieve('audience_id');
Expand All @@ -48,7 +48,7 @@ public function testRetrieve(): void
public function testUpdate(): void
{
if (UnsupportedMockTests::$skip) {
$this->markTestSkipped('Prism tests are disabled');
$this->markTestSkipped('Mock server tests are disabled');
}

$result = $this->client->audiences->update('audience_id');
Expand All @@ -61,7 +61,7 @@ public function testUpdate(): void
public function testList(): void
{
if (UnsupportedMockTests::$skip) {
$this->markTestSkipped('Prism tests are disabled');
$this->markTestSkipped('Mock server tests are disabled');
}

$result = $this->client->audiences->list();
Expand All @@ -74,7 +74,7 @@ public function testList(): void
public function testDelete(): void
{
if (UnsupportedMockTests::$skip) {
$this->markTestSkipped('Prism tests are disabled');
$this->markTestSkipped('Mock server tests are disabled');
}

$result = $this->client->audiences->delete('audience_id');
Expand All @@ -87,7 +87,7 @@ public function testDelete(): void
public function testListMembers(): void
{
if (UnsupportedMockTests::$skip) {
$this->markTestSkipped('Prism tests are disabled');
$this->markTestSkipped('Mock server tests are disabled');
}

$result = $this->client->audiences->listMembers('audience_id');
Expand Down
4 changes: 2 additions & 2 deletions tests/Services/AuditEventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected function setUp(): void
public function testRetrieve(): void
{
if (UnsupportedMockTests::$skip) {
$this->markTestSkipped('Prism tests are disabled');
$this->markTestSkipped('Mock server tests are disabled');
}

$result = $this->client->auditEvents->retrieve('audit-event-id');
Expand All @@ -46,7 +46,7 @@ public function testRetrieve(): void
public function testList(): void
{
if (UnsupportedMockTests::$skip) {
$this->markTestSkipped('Prism tests are disabled');
$this->markTestSkipped('Mock server tests are disabled');
}

$result = $this->client->auditEvents->list();
Expand Down
4 changes: 2 additions & 2 deletions tests/Services/AuthTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected function setUp(): void
public function testIssueToken(): void
{
if (UnsupportedMockTests::$skip) {
$this->markTestSkipped('Prism tests are disabled');
$this->markTestSkipped('Mock server tests are disabled');
}

$result = $this->client->auth->issueToken(
Expand All @@ -48,7 +48,7 @@ public function testIssueToken(): void
public function testIssueTokenWithOptionalParams(): void
{
if (UnsupportedMockTests::$skip) {
$this->markTestSkipped('Prism tests are disabled');
$this->markTestSkipped('Mock server tests are disabled');
}

$result = $this->client->auth->issueToken(
Expand Down
8 changes: 4 additions & 4 deletions tests/Services/Automations/InvokeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected function setUp(): void
public function testInvokeAdHoc(): void
{
if (UnsupportedMockTests::$skip) {
$this->markTestSkipped('Prism tests are disabled');
$this->markTestSkipped('Mock server tests are disabled');
}

$result = $this->client->automations->invoke->invokeAdHoc(
Expand All @@ -47,7 +47,7 @@ public function testInvokeAdHoc(): void
public function testInvokeAdHocWithOptionalParams(): void
{
if (UnsupportedMockTests::$skip) {
$this->markTestSkipped('Prism tests are disabled');
$this->markTestSkipped('Mock server tests are disabled');
}

$result = $this->client->automations->invoke->invokeAdHoc(
Expand Down Expand Up @@ -84,7 +84,7 @@ public function testInvokeAdHocWithOptionalParams(): void
public function testInvokeByTemplate(): void
{
if (UnsupportedMockTests::$skip) {
$this->markTestSkipped('Prism tests are disabled');
$this->markTestSkipped('Mock server tests are disabled');
}

$result = $this->client->automations->invoke->invokeByTemplate(
Expand All @@ -100,7 +100,7 @@ public function testInvokeByTemplate(): void
public function testInvokeByTemplateWithOptionalParams(): void
{
if (UnsupportedMockTests::$skip) {
$this->markTestSkipped('Prism tests are disabled');
$this->markTestSkipped('Mock server tests are disabled');
}

$result = $this->client->automations->invoke->invokeByTemplate(
Expand Down
2 changes: 1 addition & 1 deletion tests/Services/AutomationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected function setUp(): void
public function testList(): void
{
if (UnsupportedMockTests::$skip) {
$this->markTestSkipped('Prism tests are disabled');
$this->markTestSkipped('Mock server tests are disabled');
}

$result = $this->client->automations->list();
Expand Down
14 changes: 7 additions & 7 deletions tests/Services/BrandsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected function setUp(): void
public function testCreate(): void
{
if (UnsupportedMockTests::$skip) {
$this->markTestSkipped('Prism tests are disabled');
$this->markTestSkipped('Mock server tests are disabled');
}

$result = $this->client->brands->create(name: 'name');
Expand All @@ -46,7 +46,7 @@ public function testCreate(): void
public function testCreateWithOptionalParams(): void
{
if (UnsupportedMockTests::$skip) {
$this->markTestSkipped('Prism tests are disabled');
$this->markTestSkipped('Mock server tests are disabled');
}

$result = $this->client->brands->create(
Expand Down Expand Up @@ -106,7 +106,7 @@ public function testCreateWithOptionalParams(): void
public function testRetrieve(): void
{
if (UnsupportedMockTests::$skip) {
$this->markTestSkipped('Prism tests are disabled');
$this->markTestSkipped('Mock server tests are disabled');
}

$result = $this->client->brands->retrieve('brand_id');
Expand All @@ -119,7 +119,7 @@ public function testRetrieve(): void
public function testUpdate(): void
{
if (UnsupportedMockTests::$skip) {
$this->markTestSkipped('Prism tests are disabled');
$this->markTestSkipped('Mock server tests are disabled');
}

$result = $this->client->brands->update('brand_id', name: 'name');
Expand All @@ -132,7 +132,7 @@ public function testUpdate(): void
public function testUpdateWithOptionalParams(): void
{
if (UnsupportedMockTests::$skip) {
$this->markTestSkipped('Prism tests are disabled');
$this->markTestSkipped('Mock server tests are disabled');
}

$result = $this->client->brands->update(
Expand Down Expand Up @@ -192,7 +192,7 @@ public function testUpdateWithOptionalParams(): void
public function testList(): void
{
if (UnsupportedMockTests::$skip) {
$this->markTestSkipped('Prism tests are disabled');
$this->markTestSkipped('Mock server tests are disabled');
}

$result = $this->client->brands->list();
Expand All @@ -205,7 +205,7 @@ public function testList(): void
public function testDelete(): void
{
if (UnsupportedMockTests::$skip) {
$this->markTestSkipped('Prism tests are disabled');
$this->markTestSkipped('Mock server tests are disabled');
}

$result = $this->client->brands->delete('brand_id');
Expand Down
Loading
Loading