From 74d18194a5e360dcb68810b04c6cf78895e262ab Mon Sep 17 00:00:00 2001 From: "Garen J. Torikian" Date: Mon, 20 Apr 2026 14:21:11 -0400 Subject: [PATCH 1/2] feat: add group, pipes, and authorization additive API support --- ...egrationAccessTokenResponseAccessToken.php | 55 ++++++++++++++++++ ...ataIntegrationAccessTokenResponseError.php | 13 +++++ lib/Resource/Group.php | 56 +++++++++++++++++++ lib/Resource/GroupCreated.php | 50 +++++++++++++++++ lib/Resource/GroupDeleted.php | 50 +++++++++++++++++ lib/Resource/GroupMemberAdded.php | 50 +++++++++++++++++ lib/Resource/GroupMemberAddedData.php | 37 ++++++++++++ lib/Resource/GroupMemberRemoved.php | 50 +++++++++++++++++ lib/Resource/GroupMemberRemovedData.php | 37 ++++++++++++ lib/Resource/GroupUpdated.php | 50 +++++++++++++++++ lib/Service/PasswordHashed.php | 16 ++++++ lib/Service/PasswordPlaintext.php | 15 +++++ lib/Service/RoleMultiple.php | 15 +++++ lib/Service/RoleSingle.php | 15 +++++ ...on_access_token_response_access_token.json | 10 ++++ tests/Fixtures/group.json | 9 +++ tests/Fixtures/group_created.json | 35 ++++++++++++ tests/Fixtures/group_deleted.json | 35 ++++++++++++ tests/Fixtures/group_member_added.json | 30 ++++++++++ tests/Fixtures/group_member_added_data.json | 4 ++ tests/Fixtures/group_member_removed.json | 30 ++++++++++ tests/Fixtures/group_member_removed_data.json | 4 ++ tests/Fixtures/group_updated.json | 35 ++++++++++++ 23 files changed, 701 insertions(+) create mode 100644 lib/Resource/DataIntegrationAccessTokenResponseAccessToken.php create mode 100644 lib/Resource/DataIntegrationAccessTokenResponseError.php create mode 100644 lib/Resource/Group.php create mode 100644 lib/Resource/GroupCreated.php create mode 100644 lib/Resource/GroupDeleted.php create mode 100644 lib/Resource/GroupMemberAdded.php create mode 100644 lib/Resource/GroupMemberAddedData.php create mode 100644 lib/Resource/GroupMemberRemoved.php create mode 100644 lib/Resource/GroupMemberRemovedData.php create mode 100644 lib/Resource/GroupUpdated.php create mode 100644 lib/Service/PasswordHashed.php create mode 100644 lib/Service/PasswordPlaintext.php create mode 100644 lib/Service/RoleMultiple.php create mode 100644 lib/Service/RoleSingle.php create mode 100644 tests/Fixtures/data_integration_access_token_response_access_token.json create mode 100644 tests/Fixtures/group.json create mode 100644 tests/Fixtures/group_created.json create mode 100644 tests/Fixtures/group_deleted.json create mode 100644 tests/Fixtures/group_member_added.json create mode 100644 tests/Fixtures/group_member_added_data.json create mode 100644 tests/Fixtures/group_member_removed.json create mode 100644 tests/Fixtures/group_member_removed_data.json create mode 100644 tests/Fixtures/group_updated.json diff --git a/lib/Resource/DataIntegrationAccessTokenResponseAccessToken.php b/lib/Resource/DataIntegrationAccessTokenResponseAccessToken.php new file mode 100644 index 00000000..20a8e131 --- /dev/null +++ b/lib/Resource/DataIntegrationAccessTokenResponseAccessToken.php @@ -0,0 +1,55 @@ + + */ + public array $scopes, + /** + * If the integration has requested scopes that aren't present on the access token, they're listed here. + * @var array + */ + public array $missingScopes, + ) { + } + + public static function fromArray(array $data): self + { + return new self( + object: $data['object'], + accessToken: $data['access_token'], + expiresAt: $data['expires_at'] ?? null, + scopes: $data['scopes'], + missingScopes: $data['missing_scopes'], + ); + } + + public function toArray(): array + { + return [ + 'object' => $this->object, + 'access_token' => $this->accessToken, + 'expires_at' => $this->expiresAt, + 'scopes' => $this->scopes, + 'missing_scopes' => $this->missingScopes, + ]; + } +} diff --git a/lib/Resource/DataIntegrationAccessTokenResponseError.php b/lib/Resource/DataIntegrationAccessTokenResponseError.php new file mode 100644 index 00000000..5fa21df5 --- /dev/null +++ b/lib/Resource/DataIntegrationAccessTokenResponseError.php @@ -0,0 +1,13 @@ + $this->object, + 'id' => $this->id, + 'organization_id' => $this->organizationId, + 'name' => $this->name, + 'description' => $this->description, + 'created_at' => $this->createdAt->format(\DateTimeInterface::RFC3339_EXTENDED), + 'updated_at' => $this->updatedAt->format(\DateTimeInterface::RFC3339_EXTENDED), + ]; + } +} diff --git a/lib/Resource/GroupCreated.php b/lib/Resource/GroupCreated.php new file mode 100644 index 00000000..53cf5eae --- /dev/null +++ b/lib/Resource/GroupCreated.php @@ -0,0 +1,50 @@ + $this->id, + 'event' => $this->event, + 'data' => $this->data->toArray(), + 'created_at' => $this->createdAt->format(\DateTimeInterface::RFC3339_EXTENDED), + 'object' => $this->object, + 'context' => $this->context?->toArray(), + ]; + } +} diff --git a/lib/Resource/GroupDeleted.php b/lib/Resource/GroupDeleted.php new file mode 100644 index 00000000..eecd6389 --- /dev/null +++ b/lib/Resource/GroupDeleted.php @@ -0,0 +1,50 @@ + $this->id, + 'event' => $this->event, + 'data' => $this->data->toArray(), + 'created_at' => $this->createdAt->format(\DateTimeInterface::RFC3339_EXTENDED), + 'object' => $this->object, + 'context' => $this->context?->toArray(), + ]; + } +} diff --git a/lib/Resource/GroupMemberAdded.php b/lib/Resource/GroupMemberAdded.php new file mode 100644 index 00000000..618036e4 --- /dev/null +++ b/lib/Resource/GroupMemberAdded.php @@ -0,0 +1,50 @@ + $this->id, + 'event' => $this->event, + 'data' => $this->data->toArray(), + 'created_at' => $this->createdAt->format(\DateTimeInterface::RFC3339_EXTENDED), + 'object' => $this->object, + 'context' => $this->context?->toArray(), + ]; + } +} diff --git a/lib/Resource/GroupMemberAddedData.php b/lib/Resource/GroupMemberAddedData.php new file mode 100644 index 00000000..ed4bc0fe --- /dev/null +++ b/lib/Resource/GroupMemberAddedData.php @@ -0,0 +1,37 @@ + $this->groupId, + 'organization_membership_id' => $this->organizationMembershipId, + ]; + } +} diff --git a/lib/Resource/GroupMemberRemoved.php b/lib/Resource/GroupMemberRemoved.php new file mode 100644 index 00000000..e8ef16c7 --- /dev/null +++ b/lib/Resource/GroupMemberRemoved.php @@ -0,0 +1,50 @@ + $this->id, + 'event' => $this->event, + 'data' => $this->data->toArray(), + 'created_at' => $this->createdAt->format(\DateTimeInterface::RFC3339_EXTENDED), + 'object' => $this->object, + 'context' => $this->context?->toArray(), + ]; + } +} diff --git a/lib/Resource/GroupMemberRemovedData.php b/lib/Resource/GroupMemberRemovedData.php new file mode 100644 index 00000000..34c27e51 --- /dev/null +++ b/lib/Resource/GroupMemberRemovedData.php @@ -0,0 +1,37 @@ + $this->groupId, + 'organization_membership_id' => $this->organizationMembershipId, + ]; + } +} diff --git a/lib/Resource/GroupUpdated.php b/lib/Resource/GroupUpdated.php new file mode 100644 index 00000000..fec7b1c2 --- /dev/null +++ b/lib/Resource/GroupUpdated.php @@ -0,0 +1,50 @@ + $this->id, + 'event' => $this->event, + 'data' => $this->data->toArray(), + 'created_at' => $this->createdAt->format(\DateTimeInterface::RFC3339_EXTENDED), + 'object' => $this->object, + 'context' => $this->context?->toArray(), + ]; + } +} diff --git a/lib/Service/PasswordHashed.php b/lib/Service/PasswordHashed.php new file mode 100644 index 00000000..5e9d392d --- /dev/null +++ b/lib/Service/PasswordHashed.php @@ -0,0 +1,16 @@ + Date: Mon, 20 Apr 2026 14:30:51 -0400 Subject: [PATCH 2/2] fix core array issue --- lib/Service/RoleMultiple.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Service/RoleMultiple.php b/lib/Service/RoleMultiple.php index 42458632..98deca3a 100644 --- a/lib/Service/RoleMultiple.php +++ b/lib/Service/RoleMultiple.php @@ -9,7 +9,7 @@ class RoleMultiple { public function __construct( - public readonly string $slugs, + public readonly array $slugs, ) { } }