Skip to content

Conversation

@swaroopAkkineniWorkos
Copy link
Contributor

@swaroopAkkineniWorkos swaroopAkkineniWorkos commented Feb 1, 2026

Description

Adding in the following Audit Log endpoints:

@swaroopAkkineniWorkos swaroopAkkineniWorkos changed the title init Update Node SDK to ensure that all audit-log api's are in it Feb 1, 2026
@swaroopAkkineniWorkos
Copy link
Contributor Author

@greptile review

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

16 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@workos workos deleted a comment from greptile-apps bot Feb 1, 2026
@swaroopAkkineniWorkos
Copy link
Contributor Author

@greptile re-review plz

@workos workos deleted a comment from greptile-apps bot Feb 1, 2026
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@workos workos deleted a comment from greptile-apps bot Feb 1, 2026
@swaroopAkkineniWorkos
Copy link
Contributor Author

@greptile re-review plz

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@workos workos deleted a comment from greptile-apps bot Feb 1, 2026
@swaroopAkkineniWorkos
Copy link
Contributor Author

@greptile re-review plz

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 1, 2026

Greptile Overview

Greptile Summary

This PR adds the List Schemas endpoint to the Audit Logs API, allowing users to retrieve all schemas for a specific audit log action with pagination support.

Key changes:

  • Added listSchemas() method in AuditLogs class that accepts an action identifier and pagination options
  • Created TypeScript interfaces for API responses and deserialized schema objects
  • Implemented deserializeListedAuditLogSchema() serializer to convert snake_case API responses to camelCase SDK format
  • Added comprehensive test coverage including success cases, pagination parameters, and error scenarios
  • Follows existing SDK patterns using fetchAndDeserialize and AutoPaginatable for consistent pagination behavior

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation follows established patterns in the codebase, includes comprehensive test coverage (success cases, pagination, and error handling), properly handles type conversions between API and SDK formats, and introduces no security vulnerabilities. The changes are well-structured, additive (no breaking changes), and align with the WorkOS API documentation.
  • No files require special attention

Important Files Changed

Filename Overview
src/audit-logs/audit-logs.ts Added listSchemas method for retrieving audit log schemas with pagination support
src/audit-logs/interfaces/list-audit-log-schemas.interface.ts Defined TypeScript interfaces for list schemas API response and deserialized format
src/audit-logs/serializers/list-audit-log-schema.serializer.ts Implemented deserializer to transform API response format to SDK format with camelCase properties
src/audit-logs/audit-logs.spec.ts Added comprehensive tests for listSchemas covering success cases, pagination, and error handling

Sequence Diagram

sequenceDiagram
    participant Client
    participant AuditLogs
    participant WorkOS
    participant API as WorkOS API
    
    Client->>AuditLogs: listSchemas({action, ...paginationOptions})
    AuditLogs->>AuditLogs: Extract action from options
    AuditLogs->>AuditLogs: Build endpoint: /audit_logs/actions/{action}/schemas
    AuditLogs->>WorkOS: fetchAndDeserialize(endpoint, deserializeListedAuditLogSchema, paginationOptions)
    WorkOS->>API: GET /audit_logs/actions/{action}/schemas
    API-->>WorkOS: ListResponse<ListAuditLogSchemaItemResponse>
    WorkOS->>WorkOS: deserializeList(data, deserializeListedAuditLogSchema)
    loop For each schema in response
        WorkOS->>WorkOS: deserializeListedAuditLogSchema()
        WorkOS->>WorkOS: Convert created_at to createdAt
        WorkOS->>WorkOS: deserializeMetadata for targets, actor, metadata
    end
    WorkOS-->>AuditLogs: List<ListedAuditLogSchema>
    AuditLogs->>AuditLogs: Create AutoPaginatable wrapper
    AuditLogs-->>Client: AutoPaginatable<ListedAuditLogSchema>
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants