Skip to content

Conversation

@swaroopAkkineniWorkos
Copy link
Contributor

@swaroopAkkineniWorkos swaroopAkkineniWorkos commented Feb 1, 2026

@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

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

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

@greptile re-review plz

@swaroopAkkineniWorkos
Copy link
Contributor Author

@claude can you review and ensure it complies with the listSchema api

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 2, 2026

Greptile Overview

Greptile Summary

This PR adds the listSchemas endpoint to the Audit Logs API, completing the audit log schema management functionality. The implementation properly handles pagination and follows existing SDK patterns.

Key Changes

  • Added listSchemas() method to AuditLogs class with pagination support via AutoPaginatable
  • Renamed create-audit-log-schema-options.interface.ts to audit-log-schema.interface.ts and consolidated schema-related types
  • Made actor field properly optional in both AuditLogSchema and AuditLogSchemaResponse interfaces
  • Renamed CreateAuditLogSchemaResponse to AuditLogSchemaResponse for better consistency
  • Updated deserializer to handle optional actor field correctly
  • Added comprehensive test coverage including pagination, error handling, and edge cases

Confidence Score: 5/5

  • This PR is safe to merge with no issues found
  • The implementation follows established patterns in the codebase, includes comprehensive test coverage, properly handles edge cases (optional fields, pagination), and introduces no security concerns or breaking changes
  • No files require special attention

Important Files Changed

Filename Overview
src/audit-logs/audit-logs.ts Added listSchemas method following existing patterns with proper pagination support
src/audit-logs/interfaces/audit-log-schema.interface.ts Renamed from create-audit-log-schema-options.interface.ts, made actor field properly optional, and renamed response type
src/audit-logs/serializers/create-audit-log-schema.serializer.ts Updated deserializeAuditLogSchema to handle optional actor field correctly

Sequence Diagram

sequenceDiagram
    participant Client
    participant AuditLogs
    participant WorkOS
    participant API as WorkOS API
    participant Deserializer

    Client->>AuditLogs: listSchemas(options)
    Note over AuditLogs: Extract action from options<br/>Build endpoint URL
    AuditLogs->>WorkOS: fetchAndDeserialize(endpoint, deserializeFn, paginationOptions)
    WorkOS->>API: GET /audit_logs/actions/{action}/schemas?order=desc&limit=...
    API-->>WorkOS: ListResponse<AuditLogSchemaResponse>
    WorkOS->>Deserializer: deserializeList(data, deserializeAuditLogSchema)
    loop For each schema in response
        Deserializer->>Deserializer: deserializeAuditLogSchema(schema)
        Note over Deserializer: Convert metadata from<br/>{properties: {key: {type: 'string'}}}<br/>to {key: 'string'}
        Note over Deserializer: Handle optional actor field
    end
    Deserializer-->>WorkOS: List<AuditLogSchema>
    WorkOS-->>AuditLogs: List<AuditLogSchema>
    AuditLogs->>AuditLogs: new AutoPaginatable(list, fetchFn, options)
    AuditLogs-->>Client: AutoPaginatable<AuditLogSchema>
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.

3 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@swaroopAkkineniWorkos swaroopAkkineniWorkos marked this pull request as ready for review February 2, 2026 15:22
@swaroopAkkineniWorkos swaroopAkkineniWorkos requested a review from a team as a code owner February 2, 2026 15:22
@swaroopAkkineniWorkos swaroopAkkineniWorkos requested review from a team, PavanKulkarni, ajworkos, atainter, csrbarber, katie-west, kendallstrautman and mattgd and removed request for a team February 2, 2026 15:22
@swaroopAkkineniWorkos swaroopAkkineniWorkos added the enhancement New feature or request label Feb 2, 2026
@swaroopAkkineniWorkos swaroopAkkineniWorkos changed the title Update Node SDK to ensure that all audit-log api's are in it Update Node SDK to include auditlogs.listSchemas Feb 2, 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.

3 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

}

export interface CreateAuditLogSchemaResponse {
export interface AuditLogSchemaResponse {
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is exported publicly, this would be a breaking change. Perhaps we can alias CreateAuditLogSchemaResponse to AuditLogSchemaResponse and mark CreateAuditLogSchemaResponse as deprecated?

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

Labels

enhancement New feature or request

Development

Successfully merging this pull request may close these issues.

3 participants