Skip to content

feat(generated)!: SDK surface change: Parameter type changed for "rangeStart" on "AuditLogs.createExport"#411

Merged
workos-sdk-automation[bot] merged 3 commits into
mainfrom
oagen/batch-08085e9d
Jul 1, 2026
Merged

feat(generated)!: SDK surface change: Parameter type changed for "rangeStart" on "AuditLogs.createExport"#411
workos-sdk-automation[bot] merged 3 commits into
mainfrom
oagen/batch-08085e9d

Conversation

@workos-sdk-automation

@workos-sdk-automation workos-sdk-automation Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

feat(audit_logs)!: SDK surface change: Parameter type changed for "rangeStart" on "AuditLogs.createExport"

  • SDK surface change: Parameter type changed for "rangeStart" on "AuditLogs.createExport".

Triggered by workos/openapi-spec@704603f

BEGIN_COMMIT_OVERRIDE
feat(audit_logs)!: SDK surface change: Parameter type changed for "rangeStart" on "AuditLogs.createExport" (#411)
END_COMMIT_OVERRIDE

@workos-sdk-automation workos-sdk-automation Bot requested a review from a team as a code owner July 1, 2026 18:19
@workos-sdk-automation workos-sdk-automation Bot added the autogenerated Autogenerated code or content label Jul 1, 2026
@workos-sdk-automation workos-sdk-automation Bot requested a review from a team as a code owner July 1, 2026 18:19
@workos-sdk-automation workos-sdk-automation Bot requested a review from nicknisi July 1, 2026 18:19
@greptile-apps

greptile-apps Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR updates the generated PHP SDK surface for audit logs, admin portal links, user management, and role assignments. The main changes are:

  • Changes audit log export range inputs to DateTimeImmutable and serializes them as RFC3339 timestamps.
  • Adds the expired audit log export state and new webhook event enum values.
  • Removes intent_options from generated portal link request/resource shapes.
  • Adds user role assignment source metadata resources and fixtures.
  • Adds User Management support for max_age, listing CORS origins, listing redirect URIs, and formatting user API key expiration timestamps.
  • Refreshes generated fixtures and service tests for the updated API surface.

Confidence Score: 5/5

Safe to merge with low risk.

Generated SDK surface changes are matched by resource serialization updates and test fixture coverage. No correctness or security issues were identified in the changed paths.

No files require special attention.

T-Rex T-Rex Logs

What T-Rex did

  • Ran tests to exercise the export creation flow, observed initial input validation failures (TypeError for DateTimeImmutable inputs and ValueError for expired state) and later verified a successful HTTP path with a mocked 200 OK response, including posting to /audit_logs/exports and proper deserialization of creation ranges.
  • Ran tests around the user-management and role-assignment flows; observed base validation issues for maxAge, listCorsOrigins, listRedirectUris, and generateMagicAuthChallenge; after validation, confirmed 200 OK probe results for max_age=0 and the CORS/redirect URI GET paths, with role-assignment source present, AdminPortal body without intent_options, and an ERROR ReflectionException about generateMagicAuthChallenge.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
lib/Service/AuditLogs.php Changed createExport range parameters to DateTimeImmutable and formats request timestamps.
lib/Resource/AuditLogExportCreation.php Changed export creation range fields to DateTimeImmutable and serializes them as RFC3339 timestamps.
lib/Service/UserManagement.php Added max_age authorization URL support, list endpoints for CORS origins and redirect URIs, and timestamp formatting for user API key expiration.
lib/Resource/UserRoleAssignment.php Added the generated source property to user role assignments and serialization.
tests/Service/AuditLogsTest.php Updated createExport test expectations for DateTimeImmutable inputs and formatted timestamps.
tests/Service/UserManagementTest.php Added tests for max_age, list CORS origins, list redirect URIs, and pagination boundary coverage using the new fixtures.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant App as SDK Consumer
participant SDK as workos-php Services
participant API as WorkOS API

App->>SDK: AuditLogs.createExport(DateTimeImmutable rangeStart, rangeEnd)
SDK->>SDK: format timestamps as RFC3339_EXTENDED
SDK->>API: POST audit_logs/exports
API-->>SDK: AuditLogExport(state may be expired)
SDK-->>App: AuditLogExport resource

App->>SDK: UserManagement.listCorsOrigins/listRedirectUris
SDK->>API: GET user_management/cors_origins or redirect_uris
API-->>SDK: Paginated response
SDK-->>App: PaginatedResponse resources
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant App as SDK Consumer
participant SDK as workos-php Services
participant API as WorkOS API

App->>SDK: AuditLogs.createExport(DateTimeImmutable rangeStart, rangeEnd)
SDK->>SDK: format timestamps as RFC3339_EXTENDED
SDK->>API: POST audit_logs/exports
API-->>SDK: AuditLogExport(state may be expired)
SDK-->>App: AuditLogExport resource

App->>SDK: UserManagement.listCorsOrigins/listRedirectUris
SDK->>API: GET user_management/cors_origins or redirect_uris
API-->>SDK: Paginated response
SDK-->>App: PaginatedResponse resources
Loading

Comments Outside Diff (2)

  1. General comment

    P1 generateMagicAuthChallenge SDK method is missing in head

    • Bug
      • The validation objective claims the generated SDK surface includes UserManagement.generateMagicAuthChallenge with DateTimeImmutable expiresAt request-body formatting. Executing the public SDK surface on head failed at reflection with Method WorkOS\Service\UserManagement::generateMagicAuthChallenge() does not exist, so users cannot call this claimed method or serialize expiresAt through it.
    • Cause
      • The generated lib/Service/UserManagement.php in head still contains createMagicAuth/getMagicAuth, but no generateMagicAuthChallenge method.
    • Fix
      • Regenerate or add the generateMagicAuthChallenge public method to UserManagement, including the DateTimeImmutable $expiresAt parameter and expected request body serialization, plus response hydration/tests.

    T-Rex Ran code and verified through T-Rex

  2. General comment

    P1 Claimed user-role-assignment webhook event enum cases are not present

    • Bug
      • The validation objective asks to verify new CreateWebhookEndpointEvents cases are accepted. The head runtime enum enumeration completed with status 200 OK, but wanted_present was empty for the probed user_role_assignment.created, user_role_assignment.deleted, and user_role_assignment.updated values, matching base behavior for these values.
    • Cause
      • lib/Resource/CreateWebhookEndpointEvents.php in head does not define the user-role-assignment webhook event enum values probed for this surface change.
    • Fix
      • Add/regenerate the missing user-role-assignment webhook event cases in CreateWebhookEndpointEvents with the correct API string values, and add generated tests covering acceptance.

    T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "chore(generated): add release notes frag..." | Re-trigger Greptile

@workos-sdk-automation workos-sdk-automation Bot merged commit 6d966dc into main Jul 1, 2026
8 checks passed
@workos-sdk-automation workos-sdk-automation Bot deleted the oagen/batch-08085e9d branch July 1, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autogenerated Autogenerated code or content

Development

Successfully merging this pull request may close these issues.

0 participants