Scan your whole stack
Are you using @mgamadeus/ddd-web?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.19.1
@mgamadeus/ddd-web was last scanned on 25 Nov 2026 at version 0.19.1. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.19.1 LATEST | 25 Nov 2026 | No rules fired |
| 0.19.0 | 25 Nov 2026 | No rules fired |
| 0.18.0 | 25 Nov 2026 | No rules fired |
| 0.17.1 | 18 Nov 2026 | Not shown |
| 0.17.0 | 18 Nov 2026 | Not shown |
Findings for v0.19.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.19.1; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
0.x: a minor release may contain breaking changes, a patch never does — see CHANGELOG.md.
@mgamadeus/ddd-web is the frontend counterpart of mgamadeus/ddd,
a PHP framework for domain-driven applications on top of Symfony and Doctrine, distributed via Composer/Packagist.
Every mgamadeus/ddd backend publishes an OpenAPI document per API audience (e.g. admin, partner, public, client) with a
shared set of conventions: entity schemas named after their PHP classes, OData-inspired QueryOptions, translatable
properties, change history, a uniform error format and JWT login with stateless refresh tokens. This package turns
those conventions into frontend code:
x-ddd-* extensions) and generates a
typed RTK Query SDK: endpoints, React hooks, models and cache tagsfilters, orderBy, expand, select, top/skip, fulltext),
matching the backend's validation rulesIt contains no UI components and no domain logic; apps bring their own design system and business screens.
Works with the OpenAPI output of current mgamadeus/ddd backends. The x-ddd-* extensions (contract version 1) are used
when a backend emits them; without them the generator falls back to path and request-body heuristics and prints a
warning.
pnpm add @mgamadeus/ddd-web @reduxjs/toolkit
// openapi-config.ts
import { defineConfig } from '@mgamadeus/ddd-web/codegen';
export default defineConfig({
apis: [{
schemaFile: 'https://api.example.com/api/admin/documentation/openApi', // or a local snapshot file
apiFile: './src/api/baseApi.ts', apiImport: 'baseApi',
outputFile: './src/api/adminApi.ts', exportName: 'adminApi',
hooks: { queries: true, lazyQueries: true, mutations: true },
}],
});
pnpm exec ddd-web-sdk # generate the SDK
pnpm exec ddd-web link-skills # link the agent skills of all DDD packages into .claude/skills
Subpaths: @mgamadeus/ddd-web/codegen, /query, /api, /auth, /contract, /fetch-api-request, /vite
(pages whose global Request is not the Fetch API's, e.g. MooTools or Prototype: dddFetchApiRequestPlugin()) and
/issues, /issues/browser, /issues/node, /issues/wire (client errors, below).
The package is an ES module. A CommonJS script may require() the entries without runtime dependencies — /contract,
/query, /auth, /fetch-api-request, /issues, /issues/browser, /issues/node, /issues/wire — on Node
≥ 20.19 or ≥ 22.12 (Node's require of an ES module; none of them uses top-level await). /api (RTK Query), /vite
and /codegen are import-only.
The default command generates the DDD RTK Query SDK. Install swagger-sdk-generator@^3 and run
pnpm exec ddd-web-sdk --mode future to generate a typed promise client and models. --mode legacy
generates legacy-dialect models, stores, thunks and mocks and needs swagger-sdk-generator@^3.1. Each opt-in mode writes to a separate
generated directory and uses the consumer’s generator installation. See SDK generation modes.
generateLegacySdk({ …, prune: true }) also deletes the files an earlier run wrote and this run no longer plans,
tracked per source and output in .ddd-web-legacy-sdk.json; files it never wrote are never deleted.
With mswHandlers in openapi-config.ts the default mode also writes <stem>Mocks.ts next to each api file: one
MSW handler factory per operation that has a request builder, answering the response model's mock
from your model mocks. Off when absent (the output is unchanged); msw is a dependency of your project, not of DDD Web.
export default defineConfig({
endpoints: { requestBuilders: 'all' },
mswHandlers: { modelMocks: { importPrefix: '@mocks/models/' } }, // → import { getBookMock } from '@mocks/models/App/…/Book.mock'
apis: [/* … */],
});
import { adminApiMocks } from './api/adminApiMocks';
export const handlers = [
adminApiMocks.getApiAdminLibraryBooksByBookId(), // GET */api/admin/library/books/* → getBookGetResponseDtoMock()
adminApiMocks.deleteApiAdminLibraryBooksByBookId({ status: 500, delay: 300 }),
adminApiMocks.getApiAdminLibraryBooksList({ response: (params, defaultMock) => ({ ...defaultMock!, books: { elements: [] } }) }),
];
See SDK generation modes.
Endpoints whose 2xx responses are files (application/octet-stream, application/zip, application/pdf,
application/vnd.* such as Excel, text/csv, image/*, …) are generated with blobResponseHandler and return a
DddFileResponse ({ blob, filename, contentType }); text-only responses get responseHandler: "text".
import { downloadBlob } from '@mgamadeus/ddd-web/api';
const [trigger] = useLazyGetApiAdminLibraryBooksExportQuery();
const { blob, filename } = await trigger({}).unwrap();
downloadBlob(blob, filename ?? 'books.xlsx');
When a spec declares no or the wrong content type (e.g. application/json for an Excel export route), set the handler
in the config; overrides win over detection, the first match wins:
export default defineConfig({
responseHandlers: [{ method: 'GET', path: /\/export$/, handler: 'blob' }], // 'blob' | 'text' | 'json'
apis: [/* … each entry may have its own responseHandlers, checked first */],
});
Operations with a multipart/form-data request body get a multipartFiles argument; with a file the request is sent
as multipart (JSON envelope in the form field body), without one as JSON:
await send({ messageCreateRequestDto: { message: { body: 'see attachment' } }, multipartFiles: { attachmentFiles: [file] } }).unwrap();
For upload progress and cancel, createDddBaseQuery(...) returns a base query with upload() (XMLHttpRequest with the
same Bearer, headers, refresh and retry) to call from a queryFn:
queryFn: ({ file, onProgress }, api, extraOptions) =>
dddBaseQuery.upload({ url: '/api/client/files', files: { files: [file] }, onProgress }, api, extraOptions),
upload() also sends a form you built (formData) or a JSON body with upload progress, and downloads with
responseType: 'blob' and onDownloadProgress.
relogin re-opens a guest, device or impersonation session when there is no refresh token or it was rejected:
createDddBaseQuery({ /* … */ relogin: async ({ reason, baseQuery, api, extraOptions }) => reopenGuestSession(baseQuery, api, extraOptions) });
A request prepared for one account must not leave with another account's token after an account switch (the token is read when the request is sent, after a running refresh, and again for the retry):
createDddBaseQuery({ /* … */ getSessionKey: ({ getState }) => (getState() as RootState).auth.accountId });
query: ({ accountId, draft }) => withDddExpectedSessionKey({ url: '/api/client/drafts', method: 'POST', body: { draft } }, accountId),
A bound request whose session is no longer the current one is not sent: isDddSessionChanged(result.error). Uploads
take expectedSessionKey; extraOptions: { bindToSession: true } binds an endpoint's requests to the session they
start in.
import { mergeDddTagTypes } from '@mgamadeus/ddd-web/api';
tagTypes: mergeDddTagTypes([...adminApiTagTypes], ['Session']), // hand-written endpoints are checked against the generated names
Each mutation invalidates the entity it writes plus the lists of its tag type ({ type, id } + { type, id: 'LIST' }).
The identity comes from x-ddd-entity when present, else from a path parameter naming the entity ({bookId}, also
/books/{bookId}/publish) or from the request DTO's entity property (book.id; a create without id invalidates LIST
only). Only a write without identity invalidates its whole tag type. To change the tags of single endpoints, add a
resolver; returning undefined keeps the default:
import { defineConfig } from '@mgamadeus/ddd-web/codegen';
export default defineConfig({
invalidation: (operation) =>
operation.path.endsWith('/merge') && operation.tag
? [{ type: operation.tag, id: 'LIST' }, operation.tag] // 'Books' = every cached entry of the type
: undefined,
// or `invalidation: broadInvalidation` (also exported from /codegen): the 0.2 behaviour, writes invalidate their whole tag type
apis: [/* … each entry may have its own invalidation, checked first */],
});
@mgamadeus/ddd-web/issues reports the errors of a browser, the app's Node server or a React Native app to the
client-errors endpoint of a mgamadeus/ddd backend (IssuesLogService::logClientIssue, Core 3.10.0 or newer; the
application declares the route, by default POST /api/public/common/issues/report). The core has no DOM, framework
or Node dependency; the platform adapters are separate entries.
// browser, before hydration
import {
createBrowserIssuesReporter,
createBrowserIssuesRouteTracker,
installBrowserIssueCapture,
} from '@mgamadeus/ddd-web/issues/browser';
const issuesReporter = createBrowserIssuesReporter({
app: 'web',
endpoint: 'https://api.example.com/api/public/common/issues/report',
release: () => document.documentElement.dataset.release ?? null,
getAuthorization: () => tokenStorage.read().accessToken,
});
if (issuesReporter) installBrowserIssueCapture(issuesReporter); // uncaught errors, rejections, breadcrumbs, unload flush
const issuesRouteTracker = issuesReporter && createBrowserIssuesRouteTracker(issuesReporter);
// on every route change: the route PATTERN names the issue on the backend
issuesRouteTracker?.trackRoute(pathname, params); // → /books/[bookId]
// Node server (e.g. Next.js instrumentation.ts)
import { createNodeIssuesReporter, createServerRequestErrorHandler } from '@mgamadeus/ddd-web/issues/node';
const serverIssuesReporter = createNodeIssuesReporter({
app: 'web',
apiBaseUrl: process.env.API_INTERNAL_URL, // + the default report path; or `endpoint` = the full URL (wins)
serverToken: process.env.ISSUES_INGEST_SERVER_TOKEN, // the backend files these as WEB_SERVER
});
export const onRequestError = createServerRequestErrorHandler(() => serverIssuesReporter);
Both adapters are generic over the wire types like the core: a wire built from your generated models
(createNodeIssuesReporter({ …, wire: appIssuesWire })) types the event and the body with them; without it the
DDD defaults apply.
React Native and other runtimes use createIssuesReporter from /issues with createFetchIssuesTransport().
Everything is redacted on the device (tokens in paths and queries, e-mails, bearer / JWT tokens, UUIDs, phone numbers),
known noise is dropped, repeats are folded into count, and caps, batching, retry and backoff keep a broken page from
flooding the endpoint. Details: the agent skill, references/consumer.md › Client errors.
Generated clients return what the backend sends, including text and files users, mail, third parties or a model wrote.
Treat it as foreign: never pass it to dangerouslySetInnerHTML, eval, new Function or an iframe with
allow-same-origin; open foreign files through their download URLs (the backend serves them with
UntrustedContentResponseDto: attachment, nosniff, CSP: sandbox). The backend rule and its helpers: skill
ddd-untrusted-input-specialist of mgamadeus/ddd.
link-skills)The package ships the agent skill ddd-web-specialist (consumer guide + maintaining guide). ddd-web link-skills
links it — and the skills of every other DDD package installed through npm or Composer — into the repository's
.claude/skills:
ddd-web link-skills [--check] [--dry-run] [--quiet] [--root <dir>]
{ "scripts": { "postinstall": "ddd-web link-skills" } }
Programmatic: runSkillLinks({ cwd, root, check, dryRun, quiet, logger }) from /codegen returns a report with
exitCode, skills, lines and problems; linkSkills() (one result per skill) stays for existing callers.
ddd-link-skills and ddd-web link-skills)DDD packages ship agent skills at <package>/.claude/skills/<name>/SKILL.md. ddd-link-skills (Composer package
mgamadeus/ddd) and ddd-web link-skills (npm package @mgamadeus/ddd-web) generate and maintain the links to them.
Both behave identically, print the same lines and read and write the same manifest, so a Composer hook and an npm
postinstall never fight; either one alone links everything.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.