Files
4953855dda Build: Upgrade @hey-api/openapi-ts to 0.97 (#22735)
* build(deps): updates @hey-api/openapi-ts to latest and regenerates APi types

* build(deps): updates @hey-api/openapi-ts to latest and regenerates APi types (login)

* fix(backoffice): avoid invalid status 0 when synthesizing responses

Default to a 500 fallback status when no upstream Response is provided
to #createResponse, preventing a RangeError from the Response constructor.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* build(deps): updates UmbracoExtension template to @hey-api/openapi-ts 0.97

- Bumps @hey-api/openapi-ts to ^0.97.0 in the extension template.
- Simplifies the generate-openapi.js plugin config: spread @hey-api defaults
  and only override @hey-api/sdk with responseStyle: 'fields' so call sites
  keep the { data, error } destructuring shape. Removes the redundant
  @hey-api/client-fetch redeclaration that triggered duplicate-plugin warnings.
- Drops the hey-api.ts runtime config file in favour of wiring the generated
  client through UMB_AUTH_CONTEXT.configureClient() from the entrypoint, so
  extensions inherit the same auth callback and default response interceptors
  (401 retry, error notifications) as the core backoffice.
- Regenerates the pre-bundled SDK against the template's canonical
  Umbraco.Extension scaffold so it matches what `npm run generate-client`
  produces on first run; default hey-api output is flat function exports.
- Updates dashboard.element.ts call sites to match the new SDK shape and
  renames the user model usage to Iuser to follow the new schema.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(git): marks UmbracoExtension template generated SDK as linguist-generated

So GitHub diffs collapse the regenerated *.gen.ts files in PRs, matching what
we already do for the backoffice client and Login app SDKs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(template): addresses review feedback on PR #22735

- Restores the regenerated SDK's hard-coded baseUrl to https://localhost:44339/
  so the SiteDomain template token in the .template.config still substitutes
  it at scaffold time. The 5443 port leaked in from the local host I used to
  regenerate; that domain is replaced by the user's chosen SiteDomain on
  scaffold.
- Stops marking onInit as `async`. The UmbEntryPointOnInit signature returns
  void; making the hook async is harmless under TS's bivariant void-return
  assignability but is misleading. Kicks the context resolution + client
  configuration off via .then() and logs a warning when UMB_AUTH_CONTEXT is
  not present (instead of silently optional-chaining).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(template): keeps onInit async — the framework awaits it

The previous tweak was based on Copilot's claim that UmbEntryPointOnInit
returns void. The signature does declare void, but the entry-point
initializer in app-entry-point-extension-initializer.ts and
backoffice-entry-point-extension-initializer.ts both `await
moduleInstance.onInit(...)`, so an async onInit is awaited end-to-end.
Reverting to async ensures configureClient runs to completion before any
element in the extension can hit the API client.

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 09:11:59 +00:00

64 lines
1.4 KiB
Plaintext

* text=auto
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
*.jpg binary
*.png binary
*.gif binary
*.cs text=auto diff=csharp
*.vb text=auto
*.c text=auto
*.cpp text=auto
*.cxx text=auto
*.h text=auto
*.hxx text=auto
*.py text=auto
*.rb text=auto
*.java text=auto
*.html text=auto
*.htm text=auto
*.css text=auto
*.scss text=auto
*.sass text=auto
*.less text=auto
*.js text=auto
*.lisp text=auto
*.clj text=auto
*.sql text=auto
*.php text=auto
*.lua text=auto
*.m text=auto
*.asm text=auto
*.erl text=auto
*.fs text=auto
*.fsx text=auto
*.hs text=auto
*.json text=auto
*.xml text=auto
*.resx text=auto
*.yml text eol=lf core.whitespace whitespace=tab-in-indent,trailing-space,tabwidth=2
*.sh eol=lf
*.csproj text=auto merge=union
*.vbproj text=auto merge=union
*.fsproj text=auto merge=union
*.dbproj text=auto merge=union
*.sln text=auto eol=crlf merge=union
*.gitattributes text=auto
# Generated files - hidden by default in GitHub diffs
src/Umbraco.Web.UI.Client/src/packages/core/backend-api/** linguist-generated
src/Umbraco.Web.UI.Login/src/api/** linguist-generated
templates/UmbracoExtension/Client/src/api/** linguist-generated
src/Umbraco.Cms.Api.Management/OpenApi.json linguist-generated