Releases: commercetools/commerce-integration-layer-extensions
Release list
@commercetools/cli-topic-integration-layer@0.10.0
Minor Changes
-
0bf5032: Allow extensions to
importthe Nodehttp/httpsmodules. They resolve to a gated shim (request/getover the same allowlist-gatedfetch), never Node's real modules — so a plain-httpsSDK now builds, validates, and runs, with no raw socket and the same per-Project allowlist/SSRF guarantees asfetch.build.tsleaveshttp/https/node:http/node:httpsexternal instead of failing the bundle with "Could not resolve";staticAnalysis.tsallows those four ids while still rejecting every other Node built-in; and the localserve/loadBundlepath resolves them to the shim so local dev matches the deployed sandbox. Anhttp/httpsAgentis accepted but inert (pooling/TLS options ignored, one-time warning).
@commercetools/cli-topic-integration-layer@0.9.0
Minor Changes
-
a465eca: Add
extension invoke-api-extension --deployed: fire the API-Extension callback at the project's DEPLOYED extension (the LIVE code commercetools calls on a write) through the Commerce Integration Layer, instead of running the local bundle in-process. Only the integration layer can sign the connector's/api-extensionscallback (the shared secret is derived from the project's stored client secret and never leaves the server), so--deployedposts the payload to a new IL signing-proxy route and prints the connector's verdict; nothing is persisted to commercetools. It requires acommercetools auth login, uses the deployed code + the project's stored config, and returns the connector's single merged verdict — so it can't be combined with the local-bundle flags (--all,--extensions-dir,--entry,--out,--config,--key). Local (default) invocation is unchanged.Requires the companion Commerce Integration Layer route (
POST /:projectKey/extension/api-extensions/invoke). -
c04939e: Add
extension serve-api-extensionfor local end-to-end debugging of commercetools API Extensions. It serves the bundle'sapiExtensionshandlers over HTTP (in plain Node, so breakpoints work) and dynamically registers a commercetools API Extension pointing at a tunnel you supply with--public-url, so a real cart/order write in the Project calls the code on your machine. Editing the source hot-reloads the handlers and re-registers on a changed trigger.The command is deliberately conservative: before registering it refuses if an existing Extension already triggers on the same resource + action it would register (a collision, which commercetools rejects anyway) — unrelated Extensions are left untouched. It owns everything it creates under the
il-localdev-key prefix and deletes those on exit;--cleanupsweeps leftovers from a crashed run. Point it at a dedicated dev/sandbox Project.Like
serve/build/push, it supports--all: in a monorepo ofextensions/*packages it builds, watches, and serves the one combined bundle a Project deploys (every package'sapiExtensionsconcatenated) and registers the whole set, re-merging on any package's edit. Each API-Extensionkeymust be unique across packages.
@commercetools/cli-topic-integration-layer@0.8.0
Minor Changes
- 9fa0fef:
initnow scaffolds a colocated Vitest test for the starter extension (extensions/hello-world/src/extension.test.ts) that calls the resolver directly against a minimal fake context. The generatedhello-worldpackage gains atestscript (vitest run) plusvitestas a dev dependency, and the root gains apnpm testscript that fans the suites out across every extension (pnpm -r test). The README and CLI docs document the pattern so a copied extension stays testable out of the box.
@commercetools/cli-topic-integration-layer@0.7.0
Minor Changes
- 9f43362: Make
--entryconsistent across--all.build,validate, andpushnow honour--entryin--allmode, applying it as the per-package source segment under each./extensions/*(the default still collapses tosrc/extension.ts, so--entry src/main.tsdiscovers and builds every package from its ownsrc/main.ts).extension servegains the same--entryflag, honoured in both standalone and--allmode.--outwas already the single combined-artifact path under--alland is unchanged. - f87e610: Generalise
extension invoke-api-extensionbeyond cart callbacks:--input(required) supplies a full commercetoolsExtensionInput;--key(repeatable) restricts invocation to named handlers;--all/--extensions-dirinvoke the merged bundle. Addextension create-api-extension-input, which derives supported resource types and enum values from@commercetools/platform-sdkand scaffolds realistic{ action, resource }JSON for local handler testing. - 2bec63f: Load a project
.env(or--env-file <path>) before commands run, soINTEGRATION_LAYER_URLand localEXTENSION_CONFIG_*values work without exporting them in the shell (a variable already set in the environment still wins).extension serveadditionally hot-reloads that file — editing anEXTENSION_CONFIG_*value updatesctx.configfor the next request with no restart — andextension invoke-api-extensionreads the sameEXTENSION_CONFIG_*(env /.env/--env-file) for itsctx.config, with--configoverriding a given key. - c2feacc: Rename
extension invoketoextension invoke-api-extension. The command only ever fired a sample cart callback at a bundle'sapiExtensionshandlers (never the GraphQL half), so the old name didn't say what it invoked. Behaviour and flags are unchanged; update any script or CI step that calledextension invoke.
Patch Changes
- 54eda06: Refresh the
manage_projectbearer automatically instead of failing once it expires. Commands now authenticate like any other topic — aprerunhook fills this copy's security context from~/.commercetools/credentials, and every call goes through aCtpAuthFetchFactoryfetch that injects the token and transparently refreshes/retries it. This removes the bespoke on-disk token reading and fixesGET extension/bundle/meta failed (401): Bearer token is inactive or unknownafter a login goes stale.
@commercetools/cli-topic-integration-layer@0.6.0
Minor Changes
- 49ec8c4:
extension servegates resolverfetchwith the project's HTTP allowlist when logged in and the Commerce Integration Layer is reachable. Without login or when offline, fetch is unrestricted locally (stderr warning).
@commercetools/cli-topic-integration-layer@0.5.1
Patch Changes
- 79173d3:
extension validateandextension pushno longer reject a bundle whose only
contribution is a capability the runtime dispatches directly rather than through the
schema. Such a bundle adds nothing to the SDL, so it was failing the "must export
typeDefsand/orapiExtensions" shape check even though it is complete and
deployable. A bundle that contributes nothing at all is still rejected.