Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 8 additions & 4 deletions .github/workflows/initiate_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@ jobs:
with:
fetch-depth: 0

- name: Update composer.json and push release branch
- name: Update version in composer.json and Constant.php
env:
VERSION: ${{ github.event.inputs.version }}
run: |
sed -i 's/"version": ".*"/"version": "'$VERSION'"/' composer.json
# Update composer.json
sed -i 's/"version": ".*"/"version": "v'$VERSION'"/' composer.json
# Update Constant.php (remove 'v' prefix for constant)
sed -i "s/const VERSION = '.*'/const VERSION = '$VERSION'/" src/Constant.php
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git checkout -q -b "release-$VERSION"
git add composer.json
git add composer.json src/Constant.php
git commit -am "chore(release): $VERSION"
git push -q -u origin "release-$VERSION"

Expand All @@ -40,4 +43,5 @@ jobs:
Once this is merged, another job will kick off automatically and publish the package.

## Changes
- Updated version in composer.json to ${{ github.event.inputs.version }}"
- Updated version in composer.json to v${{ github.event.inputs.version }}
- Updated version in Constant.php to ${{ github.event.inputs.version }}"
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test-specific: ## Run a specific test (usage: make test-specific TEST=TestClassN

lint: ## Run all available code quality checks
@echo "🔍 Running PHPStan static analysis..."
./vendor/bin/phpstan analyse
./vendor/bin/phpstan analyse --memory-limit=512M
@echo "✅ PHPStan analysis complete"
@if [ -f "./vendor/bin/php-cs-fixer" ]; then \
echo ""; \
Expand All @@ -44,14 +44,14 @@ lint-fix: ## Run linting and fix issues automatically
echo ""; \
fi
@echo "🔍 Running PHPStan analysis..."
./vendor/bin/phpstan analyse
./vendor/bin/phpstan analyse --memory-limit=512M
@echo "✅ Linting complete"

phpstan: ## Run PHPStan static analysis only
./vendor/bin/phpstan analyse
./vendor/bin/phpstan analyse --memory-limit=512M

phpstan-baseline: ## Generate PHPStan baseline (ignore current errors)
./vendor/bin/phpstan analyse --generate-baseline
./vendor/bin/phpstan analyse --generate-baseline --memory-limit=512M

phpstan-clear-cache: ## Clear PHPStan cache
./vendor/bin/phpstan clear-result-cache
Expand Down
2 changes: 1 addition & 1 deletion generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fi
# Run PHPStan to check for any issues
if [ -f "phpstan.neon" ]; then
echo "Running PHPStan analysis..."
./vendor/bin/phpstan analyse --no-progress || echo "PHPStan completed with warnings"
./vendor/bin/phpstan analyse --no-progress --memory-limit=512M || echo "PHPStan completed with warnings"
fi

# Update composer autoloader for new classes
Expand Down
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ parameters:
level: 8
paths:
- src
memoryLimitFile: 512M
ignoreErrors:
# Add any specific errors to ignore here
-
Expand Down
4 changes: 3 additions & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
class Client
{
use CommonTrait;

private string $apiKey;
private string $apiSecret;
private string $baseUrl;
Expand Down Expand Up @@ -54,7 +55,8 @@ public function __construct(
$this->defaultHeaders = [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'User-Agent' => 'getstream-php-sdk/1.0.0',
'User-Agent' => 'getstream-php-sdk/' . Constant::VERSION,
'x-stream-client' => 'stream-php-client-' . Constant::VERSION,
];
}

Expand Down
11 changes: 11 additions & 0 deletions src/Constant.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

declare(strict_types=1);

namespace GetStream;

class Constant
{
const VERSION = '1.0.0';
}

66 changes: 56 additions & 10 deletions src/Generated/FeedsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -1213,19 +1213,34 @@ public function createFeedsBatch(GeneratedModels\CreateFeedsBatchRequest $reques
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\CreateFeedsBatchResponse::class);
}
/**
* Retrieves capabilities for multiple feeds in a single request. Useful for batch processing when activities are added to feeds.
* Delete multiple feeds by their IDs. All feeds must exist. This endpoint is server-side only.
*
*
* @param GeneratedModels\OwnCapabilitiesBatchRequest $requestData
* @return StreamResponse<GeneratedModels\OwnCapabilitiesBatchResponse>
* @param GeneratedModels\DeleteFeedsBatchRequest $requestData
* @return StreamResponse<GeneratedModels\DeleteFeedsBatchResponse>
* @throws StreamException
*/
public function ownCapabilitiesBatch(GeneratedModels\OwnCapabilitiesBatchRequest $requestData): StreamResponse {
$path = '/api/v2/feeds/feeds/own_capabilities/batch';
public function deleteFeedsBatch(GeneratedModels\DeleteFeedsBatchRequest $requestData): StreamResponse {
$path = '/api/v2/feeds/feeds/delete';

$queryParams = [];
// Use the provided request data array directly
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\OwnCapabilitiesBatchResponse::class);
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\DeleteFeedsBatchResponse::class);
}
/**
* Retrieves own_follows, own_capabilities, and/or own_membership for multiple feeds in a single request. If fields are not specified, all three fields are returned.
*
*
* @param GeneratedModels\OwnBatchRequest $requestData
* @return StreamResponse<GeneratedModels\OwnBatchResponse>
* @throws StreamException
*/
public function ownBatch(GeneratedModels\OwnBatchRequest $requestData): StreamResponse {
$path = '/api/v2/feeds/feeds/own/batch';

$queryParams = [];
// Use the provided request data array directly
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\OwnBatchResponse::class);
}
/**
* Query feeds with filter query
Expand Down Expand Up @@ -1337,6 +1352,21 @@ public function followBatch(GeneratedModels\FollowBatchRequest $requestData): St
// Use the provided request data array directly
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\FollowBatchResponse::class);
}
/**
* Creates or updates multiple follows at once. Does not return an error if follows already exist. Broadcasts FollowAddedEvent only for newly created follows.
*
*
* @param GeneratedModels\FollowBatchRequest $requestData
* @return StreamResponse<GeneratedModels\FollowBatchResponse>
* @throws StreamException
*/
public function getOrCreateFollows(GeneratedModels\FollowBatchRequest $requestData): StreamResponse {
$path = '/api/v2/feeds/follows/batch/upsert';

$queryParams = [];
// Use the provided request data array directly
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\FollowBatchResponse::class);
}
/**
* Query follows based on filters with pagination and sorting options
*
Expand Down Expand Up @@ -1481,20 +1511,36 @@ public function unfollowBatch(GeneratedModels\UnfollowBatchRequest $requestData)
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\UnfollowBatchResponse::class);
}
/**
* Delete all activities, reactions, comments, and bookmarks for a user
* Removes multiple follows and broadcasts FollowRemovedEvent for each. Does not return an error if follows don't exist.
*
*
* @param GeneratedModels\UnfollowBatchRequest $requestData
* @return StreamResponse<GeneratedModels\UnfollowBatchResponse>
* @throws StreamException
*/
public function getOrCreateUnfollows(GeneratedModels\UnfollowBatchRequest $requestData): StreamResponse {
$path = '/api/v2/feeds/unfollow/batch/upsert';

$queryParams = [];
// Use the provided request data array directly
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\UnfollowBatchResponse::class);
}
/**
* Delete all feed data for a user including: feeds, activities, follows, comments, feed reactions, bookmark folders, bookmarks, and collections owned by the user
*
*
* @param string $userID
* @param GeneratedModels\DeleteFeedUserDataRequest $requestData
* @return StreamResponse<GeneratedModels\DeleteFeedUserDataResponse>
* @throws StreamException
*/
public function deleteFeedUserData(string $userID): StreamResponse {
public function deleteFeedUserData(string $userID, GeneratedModels\DeleteFeedUserDataRequest $requestData): StreamResponse {
$path = '/api/v2/feeds/users/{user_id}/delete';
$path = str_replace('{user_id}', (string) $userID, $path);

$queryParams = [];
$requestData = null;
return StreamResponse::fromJson($this->makeRequest('DELETE', $path, $queryParams, $requestData), GeneratedModels\DeleteFeedUserDataResponse::class);
// Use the provided request data array directly
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\DeleteFeedUserDataResponse::class);
}
/**
* Export all feed data for a user including: user profile, feeds, activities, follows, comments, feed reactions, bookmark folders, bookmarks, and collections owned by the user
Expand Down
14 changes: 11 additions & 3 deletions src/GeneratedModels/AIImageConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,27 @@
declare(strict_types=1);

namespace GetStream\GeneratedModels;

use JsonSerializable;
/**
*
*
* @property bool|null $async
* @property bool|null $enabled
* @property array<OCRRule>|null $ocrRules
* @property array<AWSRekognitionRule>|null $rules
*/
class AIImageConfig extends BaseModel
{
public function __construct(
public ?bool $async = null,
public ?bool $enabled = null,
/** @var array<OCRRule>|null */
#[ArrayOf(OCRRule::class)]
public ?array $ocrRules = null,
/** @var array<AWSRekognitionRule>|null */
#[ArrayOf(AWSRekognitionRule::class)]
public ?array $rules = null,
) {}
) {
}

// BaseModel automatically handles jsonSerialize(), toArray(), and fromJson() using constructor types!
// Use #[JsonKey('user_id')] to override field names if needed.
Expand Down
15 changes: 12 additions & 3 deletions src/GeneratedModels/AITextConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,29 @@
declare(strict_types=1);

namespace GetStream\GeneratedModels;

use JsonSerializable;
/**
*
*
* @property bool|null $async
* @property bool|null $enabled
* @property string|null $profile
* @property array<BodyguardRule>|null $rules
* @property array<BodyguardSeverityRule>|null $severityRules
*/
class AITextConfig extends BaseModel
{
public function __construct(
public ?bool $async = null,
public ?bool $enabled = null,
public ?string $profile = null,
/** @var array<BodyguardRule>|null */
#[ArrayOf(BodyguardRule::class)]
public ?array $rules = null,
/** @var array<BodyguardSeverityRule>|null */
#[ArrayOf(BodyguardSeverityRule::class)]
public ?array $severityRules = null,
) {}
) {
}

// BaseModel automatically handles jsonSerialize(), toArray(), and fromJson() using constructor types!
// Use #[JsonKey('user_id')] to override field names if needed.
Expand Down
11 changes: 8 additions & 3 deletions src/GeneratedModels/AIVideoConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,23 @@
declare(strict_types=1);

namespace GetStream\GeneratedModels;

use JsonSerializable;
/**
*
*
* @property bool|null $async
* @property bool|null $enabled
* @property array<AWSRekognitionRule>|null $rules
*/
class AIVideoConfig extends BaseModel
{
public function __construct(
public ?bool $async = null,
public ?bool $enabled = null,
/** @var array<AWSRekognitionRule>|null */
#[ArrayOf(AWSRekognitionRule::class)]
public ?array $rules = null,
) {}
) {
}

// BaseModel automatically handles jsonSerialize(), toArray(), and fromJson() using constructor types!
// Use #[JsonKey('user_id')] to override field names if needed.
Expand Down
30 changes: 19 additions & 11 deletions src/GeneratedModels/APIError.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,31 @@
declare(strict_types=1);

namespace GetStream\GeneratedModels;

use JsonSerializable;
/**
*
*
* @property int $code
* @property string $duration
* @property string $message
* @property string $moreInfo
* @property int $statusCode
* @property array $details
* @property bool|null $unrecoverable
* @property array|null $exceptionFields
*/
class APIError extends BaseModel
{
public function __construct(
public ?int $code = null, // API error code
public ?string $duration = null, // Request duration
public ?string $message = null, // Message describing an error
public ?string $moreInfo = null, // URL with additional information
public ?int $statusCode = null, // Response HTTP status code
public ?array $details = null, // Additional error-specific information
public ?bool $unrecoverable = null, // Flag that indicates if the error is unrecoverable, requests that return unrecoverable errors should not be retried, this error only applies to the request that caused it
public ?array $exceptionFields = null, // Additional error info
) {}
public ?int $code = null, // API error code
public ?string $duration = null, // Request duration
public ?string $message = null, // Message describing an error
public ?string $moreInfo = null, // URL with additional information
public ?int $statusCode = null, // Response HTTP status code
public ?array $details = null, // Additional error-specific information
public ?bool $unrecoverable = null, // Flag that indicates if the error is unrecoverable, requests that return unrecoverable errors should not be retried, this error only applies to the request that caused it
public ?array $exceptionFields = null, // Additional error info
) {
}

// BaseModel automatically handles jsonSerialize(), toArray(), and fromJson() using constructor types!
// Use #[JsonKey('user_id')] to override field names if needed.
Expand Down
16 changes: 13 additions & 3 deletions src/GeneratedModels/APNConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,19 @@
declare(strict_types=1);

namespace GetStream\GeneratedModels;

use JsonSerializable;
/**
*
*
* @property string|null $authKey
* @property string|null $authType
* @property string|null $bundleID
* @property bool|null $development
* @property bool|null $disabled
* @property string|null $host
* @property string|null $keyID
* @property string|null $notificationTemplate
* @property string|null $p12Cert
* @property string|null $teamID
*/
class APNConfig extends BaseModel
{
Expand All @@ -21,7 +30,8 @@ public function __construct(
public ?string $notificationTemplate = null,
public ?string $p12Cert = null,
public ?string $teamID = null,
) {}
) {
}

// BaseModel automatically handles jsonSerialize(), toArray(), and fromJson() using constructor types!
// Use #[JsonKey('user_id')] to override field names if needed.
Expand Down
Loading