Skip to content

SDK regeneration#239

Merged
fern-support merged 7 commits into
masterfrom
fern-bot/2026-06-12_23-53-29_139
Jun 17, 2026
Merged

SDK regeneration#239
fern-support merged 7 commits into
masterfrom
fern-bot/2026-06-12_23-53-29_139

Conversation

@fern-api

@fern-api fern-api Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Automated SDK generation by Fern

fern-api Bot and others added 7 commits June 12, 2026 23:53
Generated by Fern
CLI Version: unknown
Generators:
  - fernapi/fern-typescript-sdk: 3.43.8
ReportingHelper.loadAndWait wraps reporting.load with an exponential-backoff
retry loop around the "Continue wait" sentinel the async /v1/load endpoint
returns (HTTP 200) while a query is still computing. Exported from the package
root and protected via .fernignore so regeneration won't clobber it.

Tests:
- tests/unit/reporting.test.ts (protected): polling logic, maxAttempts timeout,
  abort, and a real-serializer check that the "Continue wait" body survives
  deserialization as a detectable sentinel. Runnable without a live account.
- tests/integration/reporting.test.ts: live smoke test. Reporting is served only
  from production (connect.squareup.com/reporting; sandbox 404s), so this suite
  targets production by default and needs a production-capable TEST_SQUARE_TOKEN.
  Read-only endpoints (schema discovery + queries).
…257)

Reporting is served only from production and needs a prod, reporting-provisioned
token; CI's token is sandbox-only and 401s against prod, turning the integration
job red. Gate the live suite behind TEST_SQUARE_REPORTING so it skips by default
(CI green) while staying runnable on demand against a real prod account. Default
target stays production. Polling logic remains covered by tests/unit/reporting.test.ts.
…ER-11257)

The customers 'add to group' integration test intermittently exceeds jest's 5s
default under CI load, turning the integration job red. Bump the integration
project's testTimeout to 30s (jest.config.mjs is .fernignore-protected).
…257)

Add a '## Reporting API' section (preserved by the README generator) covering
getMetadata schema discovery, the async 'Continue wait' polling behavior, and
the ReportingHelper.loadAndWait helper, linking to Square's Reporting API docs.
Also add a Table of Contents entry.
@mikekono

Copy link
Copy Markdown
Contributor

🤖 I tested the Reporting API changes against https://connect.squareupstaging.com and pushed a fix commit (819006a0).

What was wrong:

  • LoadResponse was generated as { results: LoadResult[] }, but staging and the public Reporting docs return a top-level row payload: { data: [...] } with sibling fields like annotation, dataSource, lastRefreshTime, query, external, and dbType. The old model made successful /reporting/v1/load calls look like they had no results.
  • TimeDimension.dateRange was generated as an object only, but the API accepts documented string ranges like "last 30 days" and array ranges like ["2026-05-01", "2026-05-31"]. The SDK serializer rejected the string form before sending the request.
  • Reporting filter union branches had optional discriminator fields, so { or: [...] } / { and: [...] } could be serialized through the condition branch and stripped to {}. I made member/operator, or, and and required in their respective variants.
  • Query.responseFormat was exposed by the generated model, but staging rejects responseFormat: "compact" and responseFormat: "columnar" with HTTP 400. I removed it from the request model for now.
  • The live integration test and README were still asserting/logging response.results; they now use response.data.

Validation performed:

  • yarn test:unit --testPathPattern reporting ✅ 7 tests
  • yarn test:wire --testPathPattern reporting ✅ 3 tests
  • yarn build
  • yarn test ✅ 126 suites / 869 tests
  • live staging integration: TEST_SQUARE_BASE_URL=https://connect.squareupstaging.com yarn test:integration --testPathPattern reporting ✅ 3 tests
  • additional staging matrix ✅ 12/12 checks: metadata schema, direct load, loadAndWait, string/array date ranges, tuple ordering, pagination, simple filters, compound or/and filters, segments, and cache mode.

Notes for Fern/API definition follow-up:

  • Please update the source API definition/generator inputs so LoadResponse, TimeDimension.dateRange, Reporting filters, and absence of responseFormat regenerate this shape. These files are generated, so the SDK-side patch is a band-aid unless Fern emits the corrected models.
  • Direct HTTP to staging also rejects object-form order even though docs show it; tuple-array order works. That looks like either docs drift or API-definition drift worth reconciling separately.

@fern-support fern-support merged commit 9e13e63 into master Jun 17, 2026
10 checks passed
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