Skip to content

feat: adding webhook config#189

Merged
pengying merged 2 commits intomainfrom
02-12-feat_adding_webhook_config
Feb 19, 2026
Merged

feat: adding webhook config#189
pengying merged 2 commits intomainfrom
02-12-feat_adding_webhook_config

Conversation

@pengying
Copy link
Contributor

@pengying pengying commented Feb 12, 2026

TL;DR

Updated Stainless configuration to prepare for SDK publishing across multiple languages with proper package naming and repository references.

What changed?

  • Changed organization name from "grid" to "Lightspark Grid"

  • Updated TypeScript configuration:

    • Changed package name to "@lightsparkdev/grid"
    • Added production repository reference to lightsparkdev/grid-js-sdk
    • Configured NPM and JSR publishing with OIDC authentication
    • Added MCP server options with "@lightsparkdev/grid-mcp" package
  • Updated Kotlin configuration:

    • Changed reverse domain to "com.lightspark.grid"
    • Added production repository reference
    • Configured Maven publishing via Sonatype
  • Added Python configuration:

    • Set package name to "grid"
    • Configured PyPI publishing (disabled for now)
  • Simplified model references by commenting out unused schemas

  • Updated external account models with more consistent naming

  • Added webhook unwrapping functionality

  • Moved webhook test endpoint to sandbox resource

  • Updated environment variable names to use GRID_CLIENT_ID and GRID_CLIENT_SECRET

  • Fixed OpenAPI transformations to properly handle type discriminators

How to test?

  1. Verify the configuration changes by running Stainless generation
  2. Ensure the generated SDKs have the correct package names and structure
  3. Test webhook unwrapping functionality
  4. Verify environment variable references work correctly

Why make this change?

This change prepares the Grid API SDKs for proper publishing across multiple language ecosystems with consistent naming and structure. It improves the developer experience by providing better organized packages and fixing type discriminator issues that could cause compilation problems. The configuration now properly reflects the Lightspark branding and repository structure, making it ready for production use.

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@pengying pengying marked this pull request as ready for review February 12, 2026 21:24
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 12, 2026

Greptile Summary

This PR configures multi-language SDK generation with proper package naming (@lightsparkdev/grid for TypeScript, com.lightspark.grid for Kotlin, grid for Python), production repository references, and publishing setup. Key changes include:

  • Added TypeScript MCP server configuration with OIDC authentication for NPM publishing
  • Added Kotlin Maven publishing via Sonatype portal
  • Added Python target with PyPI publishing disabled (preparation for future enablement)
  • Updated environment variables from GRID_USERNAME/GRID_PASSWORD to GRID_CLIENT_ID/GRID_CLIENT_SECRET and GRID_WEBHOOK_SIGNATURE to GRID_WEBHOOK_PUBKEY
  • Added webhook unwrapping functionality with type discriminator
  • Moved webhook test endpoint from webhooks.send_test() to sandbox.send_test_webhook()
  • Refactored OpenAPI transformations to remove discriminator properties from base schemas (instead of variants) to fix allOf type conflicts
  • Added transformations to remove now-empty base schema $refs that would cause TypeScript compilation errors

The transformation strategy shift (removing discriminators from base schemas rather than variants) resolves the type conflicts more elegantly but differs from the previous pattern, which was already flagged in previous review threads.

Confidence Score: 4/5

  • This PR is safe to merge with low risk
  • Configuration changes are comprehensive and well-documented. The OpenAPI transformations follow a clear strategy to resolve type discriminator conflicts. Previous threads raised valid concerns about the transformation pattern, but the approach appears intentional. The environment variable renaming could cause runtime issues if not properly coordinated with deployment configuration.
  • Verify that environment variables GRID_CLIENT_ID, GRID_CLIENT_SECRET, and GRID_WEBHOOK_PUBKEY are properly configured in all deployment environments before merging

Important Files Changed

Filename Overview
.stainless/stainless.yml Comprehensive SDK configuration update adding Python support, updating package names to @lightsparkdev namespace, configuring multi-language publishing, adding webhook unwrapping, and refactoring OpenAPI transformations to fix type discriminator conflicts

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Stainless Configuration] --> B[Multi-Language SDK Generation]
    B --> C[TypeScript SDK]
    B --> D[Kotlin SDK]
    B --> E[Python SDK]
    
    C --> C1[Package: @lightsparkdev/grid]
    C --> C2[NPM Publishing via OIDC]
    C --> C3[Repo: grid-js-sdk]
    C --> C4[MCP Server: @lightsparkdev/grid-mcp]
    
    D --> D1[Package: com.lightspark.grid]
    D --> D2[Maven via Sonatype Portal]
    D --> D3[Repo: grid-kotlin-sdk]
    
    E --> E1[Package: grid]
    E --> E2[PyPI disabled]
    E --> E3[No repo yet]
    
    A --> F[Environment Variables]
    F --> F1[GRID_CLIENT_ID]
    F --> F2[GRID_CLIENT_SECRET]
    F --> F3[GRID_WEBHOOK_PUBKEY]
    
    A --> G[Webhook Configuration]
    G --> G1[Webhook Unwrapping]
    G --> G2[Type Discriminator: type]
    G --> G3[Test Endpoint moved to sandbox]
    
    A --> H[OpenAPI Transformations]
    H --> H1[Remove discriminators from base schemas]
    H --> H2[Remove empty base $refs]
    H --> H3[Fix allOf type conflicts]
Loading

Last reviewed commit: 6cb6a95

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.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

sandbox:
methods:
send_funds: post /sandbox/send
send_test_webhook: post /webhooks/test
Copy link
Contributor

Choose a reason for hiding this comment

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

verify that generated SDK docs properly reflect this endpoint move from webhooks.send_test() to sandbox.send_test_webhook() to avoid breaking existing client code

Prompt To Fix With AI
This is a comment left during a code review.
Path: .stainless/stainless.yml
Line: 232:232

Comment:
verify that generated SDK docs properly reflect this endpoint move from `webhooks.send_test()` to `sandbox.send_test_webhook()` to avoid breaking existing client code

How can I resolve this? If you propose a fix, please make it concise.

@pengying pengying force-pushed the 02-12-feat_adding_webhook_config branch from 15b6eed to d3349f8 Compare February 13, 2026 00:41
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.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +410 to +419
- command: remove
reason: >-
Remove inline destinationType enums from transaction and quote
destination allOf variants to avoid conflicting types with their
base schemas which define destinationType via shared $ref enums
args:
unionPath: AllErrors
enumProperty: code
# ── customerType: IndividualCustomerFields / BusinessCustomerFields ──
target:
- "$.components.schemas.AccountTransactionDestination.allOf[0]"
- "$.components.schemas.UmaAddressTransactionDestination.allOf[0]"
keys: [ "$ref" ]
Copy link
Contributor

Choose a reason for hiding this comment

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

Check that this transformation correctly removes the base schema reference. Removing $ref from allOf[0] is different from the pattern used in other transformations (which remove discriminator properties). Verify the generated SDK handles this correctly.

Prompt To Fix With AI
This is a comment left during a code review.
Path: .stainless/stainless.yml
Line: 410:419

Comment:
Check that this transformation correctly removes the base schema reference. Removing `$ref` from `allOf[0]` is different from the pattern used in other transformations (which remove discriminator properties). Verify the generated SDK handles this correctly.

How can I resolve this? If you propose a fix, please make it concise.

@pengying pengying force-pushed the 02-12-feat_adding_webhook_config branch from d3349f8 to 62e3952 Compare February 19, 2026 00:18
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.

1 file reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +283 to +291
read_env: GRID_CLIENT_ID
password:
type: string
nullable: false
auth:
security_scheme: BasicAuth
role: password
description: API token authentication using format `<api token id>:<api client secret>`
read_env: GRID_PASSWORD
read_env: GRID_CLIENT_SECRET
Copy link
Contributor

Choose a reason for hiding this comment

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

Environment variable names changed from GRID_USERNAME/GRID_PASSWORD to GRID_CLIENT_ID/GRID_CLIENT_SECRET. Check that these are updated in all deployment environments (production, staging, CI/CD pipelines) before merging to prevent authentication failures.

Prompt To Fix With AI
This is a comment left during a code review.
Path: .stainless/stainless.yml
Line: 283-291

Comment:
Environment variable names changed from `GRID_USERNAME`/`GRID_PASSWORD` to `GRID_CLIENT_ID`/`GRID_CLIENT_SECRET`. Check that these are updated in all deployment environments (production, staging, CI/CD pipelines) before merging to prevent authentication failures.

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +44 to +49
python:
edition: python.2025-11-20
package_name: grid
production_repo: null
publish:
maven: false
pypi: false
Copy link
Contributor

Choose a reason for hiding this comment

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

Python SDK has production_repo: null and pypi: false. When ready to publish, ensure the production repo is created and PyPI publishing is enabled with proper authentication configured.

Prompt To Fix With AI
This is a comment left during a code review.
Path: .stainless/stainless.yml
Line: 44-49

Comment:
Python SDK has `production_repo: null` and `pypi: false`. When ready to publish, ensure the production repo is created and PyPI publishing is enabled with proper authentication configured.

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines 214 to +218
methods:
send_test: post /webhooks/test
unwrap:
type: webhook_unwrap
discriminator: type

Copy link
Contributor

Choose a reason for hiding this comment

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

added webhook unwrapping functionality with type discriminator, allowing SDKs to parse webhook payloads into strongly-typed objects based on the type field

Prompt To Fix With AI
This is a comment left during a code review.
Path: .stainless/stainless.yml
Line: 214-218

Comment:
added webhook unwrapping functionality with type discriminator, allowing SDKs to parse webhook payloads into strongly-typed objects based on the `type` field

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Contributor Author

pengying commented Feb 19, 2026

Merge activity

  • Feb 19, 2:28 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Feb 19, 2:28 AM UTC: @pengying merged this pull request with Graphite.

@pengying pengying merged commit e8dea1c into main Feb 19, 2026
7 checks passed
@pengying pengying deleted the 02-12-feat_adding_webhook_config branch February 19, 2026 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments