Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
* - all other parameters have no parameter-level dependency and empty
* `dependsOnValueIds` on their entries.
*
* Parity note (#1382 review): `libs/integrations/erli/src/infrastructure/http
* /__tests__/allegro-category-catalog-client.spec.ts` runs this same fixture
* through `AllegroCategoryCatalogClient`'s independently-maintained copy of
* `toNeutralCategoryParameter` with mirrored assertions — a change to this
* mapper's behavior should prompt updating both spec files.
*
* @module libs/integrations/allegro/src/infrastructure/mappers
*/
import { readFileSync } from 'fs';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,38 @@
* confirmed by the #992 spike) drops in via `connection.config.baseUrl` with no
* code change.
*
* `allegroClientId` / `allegroClientSecret` / `allegroEnvironment` (#1382,
* ADR-030) are an optional, separate Allegro app credential pair + environment
* selector — unrelated to Erli's own `apiKey` — that let an Erli connection
* browse Allegro's public category/parameter catalog via
* `grant_type=client_credentials` (see `AllegroCategoryCatalogClient`). The two
* credential fields are "both or neither"; enforced by
* `ErliConnectionCredentialsShapeValidatorAdapter` (#1383), not here.
*
* Lives in `domain/types/` (not infrastructure) so the application-layer
* factory can depend on it without inverting the hexagonal layer direction —
* mirrors the Allegro/PrestaShop connection-type layout.
*
* @module libs/integrations/erli/src/domain/types
*/

/**
* Allegro environment the `AllegroCategoryCatalogClient` resolves its token +
* REST hosts against (#1382, ADR-030). Mirrors `AllegroConnectionConfig
* .environment`'s `as const` + runtime-array convention — kept local rather
* than imported from `@openlinker/integrations-allegro`, since plugin
* packages are architecturally independent (ADR-030).
*/
export const AllegroCatalogEnvironmentValues = ['sandbox', 'production'] as const;
export type AllegroCatalogEnvironment = (typeof AllegroCatalogEnvironmentValues)[number];

/** Encrypted credentials for an Erli connection (resolved via host.credentialsResolver). */
export interface ErliCredentials {
apiKey: string;
/** Allegro app client id (client_credentials grant) — optional, catalog-browsing only (#1382). */
allegroClientId?: string;
/** Allegro app client secret (client_credentials grant) — optional, catalog-browsing only (#1382). */
allegroClientSecret?: string;
}

/**
Expand Down Expand Up @@ -52,6 +74,13 @@ export interface ErliConnectionConfig {
* e.g. `http://host.docker.internal:3000` in dev, the public OL URL in prod.
*/
callbackBaseUrl?: string;
/**
* Allegro environment to resolve the `AllegroCategoryCatalogClient`'s token
* and REST hosts against (#1382, ADR-030) — mirrors `AllegroConnectionConfig
* .environment`'s convention. Defaults to `'production'` when absent. Only
* meaningful when `allegroClientId`/`allegroClientSecret` are configured.
*/
allegroEnvironment?: AllegroCatalogEnvironment;
}

/**
Expand Down
Loading