refactor(contracts): 폐기 별칭 import를 새 이름으로 옮기고 lint로 막는다 (07-01)

문제
MappingResult라는 이름이 두 모양을 가리킨다. external-contract-runtime.ts의
MappingResult({ ok:false, error:{ kind, code } })는 주석이 "정본"이라고
부르지만 테스트 말고 쓰는 곳이 없다. boundary-mapper.ts는
{ ok:false, code } 모양을 BoundaryMappingResult로 이름 붙이고 같은 이름
MappingResult를 @deprecated 별칭으로 남겼는데, 실행 경로가 그 별칭을
요구한다(feature-http-binding mapSuccess, client.ts, resource-mapper,
참조 mapper, boundary-mapper 자신의 helper 반환 타입). 그래서 별칭의 제거
조건("이 파일에서 MappingResult를 import하는 모듈이 없을 때")이 충족될 수
없다. ApiFailure 별칭도 포트 2개와 참조 기능을 포함해 7개 파일이 쓴다.
eslint 설정에 폐기 검사가 없다.

고른 방법 (리뷰 최소 개선 (1)·(4)와 lint, 공개 이름은 그대로)
- boundary-mapper의 BoundaryMapper.map, mapWithBoundaryRegistry,
  mappingSuccess, mappingFailure와 바인딩 mapSuccess가
  BoundaryMappingResult를 반환한다. 참조 mapper·client·resource-mapper도
  옮겼다. ApiFailure를 쓰던 파일은 AppFailure를 쓴다. 타입이 같아서
  런타임과 공개 시그니처는 바뀌지 않는다.
- D-15 주석을 실제와 맞췄다. 기능 mapper와 HTTP 바인딩은
  BoundaryMappingResult(닫힌 실패 코드)를 반환하고, 계약 패키지 쪽 결과가
  필요하면 toContractMappingResult로 바꾼다. 참조 기능 README의 "ApiFailure는
  같은 type의 alias" 문장도 고쳤다.
- 폐기 검사: 이 repo의 ESLint는 babel 파서라 타입 정보가 없어
  @typescript-eslint/no-deprecated를 쓸 수 없다. 대신 core
  no-restricted-imports의 patterns.importNames로 boundary-mapper의
  MappingResult와 errors의 ApiFailure import를 src·tests 전체에서 막는다.
  층별 no-restricted-imports 설정이 같은 규칙을 덮어쓰므로
  restrictedImports()가 별칭 패턴을 항상 덧붙이고, 층 규칙이 없는 파일은
  그 앞에 둔 공통 블록이 받는다.

버린 대안
- 별칭 export 삭제와 정본 이름을 ContractMappingResult로 바꾸기(리뷰 (2)
  후반·(3)): 다운스트림 import를 깨는 공개 이름 변경이다. 이번 묶음 규칙상
  공개 시그니처를 깨는 변경은 하지 않는다. 별칭 주석에 "repo 안 사용 0,
  lint로 강제, 제거는 minor 릴리스 + CHANGELOG [계약] 행"을 적었다.
- typescript-eslint 도입 후 no-deprecated: 새 의존성과 type-aware lint
  설정(속도·설정 범위)이 필요하다.
- 바인딩이 정본 모양을 받게 바꾸기(리뷰 C): 실패 코드가 닫힌 3종에서 자유
  문자열로 넓어져 계약이 약해진다.

위험·한계
- 이름 MappingResult는 여전히 두 파일에서 export된다(한쪽은 폐기 별칭).
  리뷰 완료 기준("MappingResult export 하나, grep 0건")은 별칭을 지워야
  충족된다. 제거 시점은 릴리스 결정으로 남긴다.
- 다운스트림이 eslint.config.ts를 동기화하면 그쪽의 별칭 import가 lint
  오류가 된다. 이름만 바꾸면 된다(tech-log는 mappingSuccess를 쓰는데,
  반환 타입은 같은 모양이라 영향 없음).
- adapters/http의 client.ts·feature-http-binding.ts는 타입 이름만 바꿨다.
  같은 파일을 고치는 다른 수정과 합칠 때 줄 단위 충돌이 날 수 있다.

검증
- RED: 규칙만 먼저 넣고 eslint src tests -> 9개 파일 11 errors
  ("'MappingResult' import from '../../contracts/boundary-mapper.ts' is
  restricted ... deprecated alias: import BoundaryMappingResult", ApiFailure
  같은 꼴).
- GREEN: lint 전체 범위(src scripts tests recipes .storybook 설정 파일)
  --max-warnings=0 rc=0. src에서 별칭을 쓰는 곳은 정의 줄뿐(git grep).
- 회귀: tsc app/test/node rc=0. run-vitest tests/architecture tests/unit
  tests/features tests/platform tests/component tests/contract
  tests/runtime-schema tests/integration(pnpm·corepack을 띄우는 4파일 제외)
  273 files / 3136 tests 중 3135 통과. 실패 1건은
  provider-guardian-transaction(guardian exit=126, 단독 실행도 같음, 이
  변경과 무관한 scripts/lib 프로세스 테스트).
  check-registries PASS, verify-documentation-readiness PASS_SCOPED,
  check-adapter-inventory PASS.
- 미실행: check:architecture(pnpm 필요). depcruise 직접 실행은 0 modules로
  사실상 미검증.

Refs: docs/reviews/2026-11-01-maturity-review/07-contracts.md
This commit is contained in:
DongHyeonka
2026-11-01 22:35:54 +09:00
parent 32da8a40e9
commit fc303d89bc
14 changed files with 96 additions and 58 deletions
+29 -1
View File
@@ -50,8 +50,28 @@ const layerMessages = {
"an adapter implements an application port and never imports UI or bootstrap (adapters-do-not-know-presentation). Pass what it needs through the port.",
} as const;
// 07-01. Deprecated aliases stay exported for downstream projects until they
// are removed, but nothing in this repository imports them. The ESLint parser
// here has no type information, so this stands in for a no-deprecated rule.
const deprecatedAliasImports = [
{
group: ["**/contracts/boundary-mapper.ts", "**/contracts/boundary-mapper"],
importNames: ["MappingResult"],
message:
"deprecated alias: import BoundaryMappingResult. The contract-side MappingResult lives in external-contract-runtime.ts.",
},
{
group: ["**/contracts/errors.ts", "**/contracts/errors"],
importNames: ["ApiFailure"],
message: "deprecated alias: import AppFailure.",
},
];
function restrictedImports(patterns: readonly string[], message: string) {
return ["error", { patterns: [{ group: [...patterns], message }] }];
return [
"error",
{ patterns: [{ group: [...patterns], message }, ...deprecatedAliasImports] },
];
}
const restrictedBrowserDataProperties = [
@@ -553,6 +573,14 @@ export default [
"browser-data-boundary/no-capability-alias": "error",
},
},
{
// 07-01. Every file outside a layer rule; the layer rules below replace
// this entry and carry the same aliases through restrictedImports.
files: [`src/**/*.${sourceExtensions}`, `tests/**/*.${sourceExtensions}`],
rules: {
"no-restricted-imports": ["error", { patterns: deprecatedAliasImports }],
},
},
{
files: [`src/domain/**/*.${sourceExtensions}`],
rules: {
+5 -5
View File
@@ -41,11 +41,11 @@ import type { ClockPort } from "../../application/ports/clock-port.ts";
import type { DiagnosticsPort } from "../../application/ports/diagnostics-port.ts";
import type { TelemetryPort } from "../../application/ports/telemetry-port.ts";
import type { ApiOperation } from "../../contracts/api-operations.ts";
import type { ApiFailure, FailureKind } from "../../contracts/errors.ts";
import type { AppFailure, FailureKind } from "../../contracts/errors.ts";
import type { OperationRequestInput } from "./request-builder.ts";
import { readBoundedJson } from "./bounded-json.ts";
import { admitCredentialHeaders } from "./http-contract-bridge.ts";
import type { MappingResult } from "../../contracts/boundary-mapper.ts";
import type { BoundaryMappingResult } from "../../contracts/boundary-mapper.ts";
import {
createRestProviderProfile,
resolveRestSecurityProfiles,
@@ -70,7 +70,7 @@ const noAuthSession: HttpAuthSession = Object.freeze({
onUnauthenticated: () => {},
} satisfies HttpAuthSession);
export type HttpFailure = ApiFailure;
export type HttpFailure = AppFailure;
export type Scheduler = Readonly<{
setTimeout(callback: () => void, milliseconds: number): unknown;
@@ -104,7 +104,7 @@ export type HttpClientDependencies = Readonly<{
mapPayload?: (
operationId: string,
payload: unknown,
) => MappingResult<unknown>;
) => BoundaryMappingResult<unknown>;
idempotencyKeyFactory?: () => string;
/**
* Default total deadline for an operation without its own `timeoutMs`. Not a
@@ -866,7 +866,7 @@ async function parseResponse(
mapPayload: (
operationId: string,
payload: unknown,
) => MappingResult<unknown>,
) => BoundaryMappingResult<unknown>,
now: number,
): Promise<HttpResult> {
// R3-1. Retry-After is read only where the retry policy honors it; 502/504
+13 -13
View File
@@ -2,11 +2,11 @@ import type {
InstalledHttpContract,
} from "../../contracts/external-contract-runtime.ts";
import type { Result } from "../../contracts/result.ts";
import type { MappingResult } from "../../contracts/boundary-mapper.ts";
import type { BoundaryMappingResult } from "../../contracts/boundary-mapper.ts";
import {
createFailure,
kindForStatus,
type ApiFailure,
type AppFailure,
type FailureEffectCertainty,
type FailureKind,
type ValidationIssue,
@@ -90,7 +90,7 @@ type FeatureHttpOperationSpec<
routeId: RouteId;
mapSuccess(
value: HttpContractWireOutput<Contract>,
): MappingResult<Value>;
): BoundaryMappingResult<Value>;
mapProblem?(
problem: HttpContractProblem<Contract>,
metadata: SafeResponseMetadata,
@@ -221,7 +221,7 @@ export type FeatureHttpBinding<
intent?: MutationIntent;
execution?: ExecutionContext;
}>,
): Promise<Result<OperationValue<Operations[OperationId]>, ApiFailure>>;
): Promise<Result<OperationValue<Operations[OperationId]>, AppFailure>>;
}>;
/**
@@ -254,7 +254,7 @@ export function createFeatureHttpBinding<
intent?: MutationIntent;
execution?: ExecutionContext;
}> = {},
): Promise<Result<OperationValue<Operations[OperationId]>, ApiFailure>> {
): Promise<Result<OperationValue<Operations[OperationId]>, AppFailure>> {
const operation = operations[operationId];
type SelectedOperation = Operations[OperationId];
type Input = OperationInput<SelectedOperation>;
@@ -277,7 +277,7 @@ export function createFeatureHttpBinding<
});
return projectExecutionOutcome(
operation.operationId,
operation.mapSuccess as (value: WireOutput) => MappingResult<Value>,
operation.mapSuccess as (value: WireOutput) => BoundaryMappingResult<Value>,
operation.mapProblem as
| ((
problem: Problem,
@@ -296,7 +296,7 @@ export function createFeatureHttpBinding<
*/
function projectExecutionOutcome<WireOutput, Problem, Value>(
operationId: string,
mapSuccess: (value: WireOutput) => MappingResult<Value>,
mapSuccess: (value: WireOutput) => BoundaryMappingResult<Value>,
mapProblem:
| ((
problem: Problem,
@@ -304,7 +304,7 @@ function projectExecutionOutcome<WireOutput, Problem, Value>(
) => FeatureHttpProblemMapping | undefined)
| undefined,
outcome: HttpExecutionOutcome<WireOutput, Problem>,
): Result<Value, ApiFailure> {
): Result<Value, AppFailure> {
const projected = projectOutcome(operationId, mapSuccess, mapProblem, outcome);
const requestId =
"metadata" in outcome
@@ -320,7 +320,7 @@ function projectExecutionOutcome<WireOutput, Problem, Value>(
function projectOutcome<WireOutput, Problem, Value>(
operationId: string,
mapSuccess: (value: WireOutput) => MappingResult<Value>,
mapSuccess: (value: WireOutput) => BoundaryMappingResult<Value>,
mapProblem:
| ((
problem: Problem,
@@ -328,13 +328,13 @@ function projectOutcome<WireOutput, Problem, Value>(
) => FeatureHttpProblemMapping | undefined)
| undefined,
outcome: HttpExecutionOutcome<WireOutput, Problem>,
): Result<Value, ApiFailure> {
): Result<Value, AppFailure> {
// A throwing feature mapper is a mapping defect, not a transport failure: it
// must not reject and lose the effect the server already confirmed.
const mapperThrew = (
effect: FailureEffectCertainty,
httpStatus: number,
): Result<Value, ApiFailure> =>
): Result<Value, AppFailure> =>
failure(
"MAPPING_CONTRACT_VIOLATION",
operationId,
@@ -343,7 +343,7 @@ function projectOutcome<WireOutput, Problem, Value>(
);
switch (outcome.kind) {
case "SUCCESS": {
let mapped: MappingResult<Value>;
let mapped: BoundaryMappingResult<Value>;
try {
mapped = mapSuccess(outcome.value);
} catch {
@@ -484,7 +484,7 @@ function failure(
effect?: FailureEffectCertainty;
validationIssues?: readonly ValidationIssue[];
}> = {},
): Result<never, ApiFailure> {
): Result<never, AppFailure> {
return Object.freeze({
ok: false as const,
error: createFailure(kind, operationId, 0, { code, ...details }),
+2 -2
View File
@@ -1,11 +1,11 @@
import {
mappingFailure,
type MappingResult,
type BoundaryMappingResult,
} from "../../contracts/boundary-mapper.ts";
export function mapOperationPayload(
_operationId: string,
_payload: unknown,
): MappingResult<never> {
): BoundaryMappingResult<never> {
return mappingFailure("MAPPING_INVARIANT_REJECTED");
}
+3 -3
View File
@@ -1,12 +1,12 @@
import type { ApiFailure } from "../../contracts/errors.ts";
import type { AppFailure } from "../../contracts/errors.ts";
export type QueryCacheReadResult =
| Readonly<{ ok: true; value: unknown }>
| Readonly<{ ok: false; error: ApiFailure }>;
| Readonly<{ ok: false; error: AppFailure }>;
export type QueryCacheWriteResult =
| Readonly<{ ok: true }>
| Readonly<{ ok: false; error: ApiFailure }>;
| Readonly<{ ok: false; error: AppFailure }>;
export type QueryCachePort = Readonly<{
read(key: readonly unknown[]): QueryCacheReadResult;
+3 -3
View File
@@ -1,12 +1,12 @@
import type { ApiFailure } from "../../contracts/errors.ts";
import type { AppFailure } from "../../contracts/errors.ts";
export type StorageReadResult =
| Readonly<{ ok: true; value: unknown }>
| Readonly<{ ok: false; error: ApiFailure }>;
| Readonly<{ ok: false; error: AppFailure }>;
export type StorageMutationResult =
| Readonly<{ ok: true }>
| Readonly<{ ok: false; error: ApiFailure; fallback?: string }>;
| Readonly<{ ok: false; error: AppFailure; fallback?: string }>;
export type StoragePort = Readonly<{
read(logicalName: string): StorageReadResult;
+15 -11
View File
@@ -6,20 +6,24 @@ export type MappingFailureCode =
| "OUTPUT_LIMIT_EXCEEDED";
/**
* D-15. The boundary mapper's own result: a flat failure `code`. The canonical
* mapping result is `MappingResult` in `external-contract-runtime.ts`
* (`error: { kind, code }`); convert with `toContractMappingResult`.
* D-15, 07-01. What a feature mapper returns: a flat failure `code` from the
* closed `MappingFailureCode` set. The HTTP binding (`mapSuccess`) and every
* helper below use this shape. The contract-package side has its own result,
* `MappingResult` in `external-contract-runtime.ts` (`error: { kind, code }`,
* free code); convert to it with `toContractMappingResult`.
*/
export type BoundaryMappingResult<Value> =
| Readonly<{ ok: true; value: Value }>
| Readonly<{ ok: false; code: MappingFailureCode }>;
/**
* Compatible alias kept for existing importers.
* Compatible alias kept for downstream importers. It shares its name with the
* contract-side `MappingResult` but not its shape.
*
* @deprecated Use `BoundaryMappingResult`. Remove in the next minor release
* once no module imports `MappingResult` from this file (owner:
* frontend-platform).
* @deprecated Use `BoundaryMappingResult`. Nothing in this repository imports
* it (07-01, enforced by `no-restricted-imports` in eslint.config.ts).
* Removing it breaks downstream importers; do it in a minor release with a
* CHANGELOG [계약] entry (owner: frontend-platform).
*/
export type MappingResult<Value> = BoundaryMappingResult<Value>;
@@ -44,7 +48,7 @@ export type BoundaryMapper<Input, Output> = Readonly<{
outputContractId: string;
owner: string;
maxOutputItems: number;
map(input: Input): MappingResult<Output>;
map(input: Input): BoundaryMappingResult<Output>;
}>;
export type InstalledBoundaryMapper = BoundaryMapper<unknown, unknown>;
@@ -80,7 +84,7 @@ export function mapWithBoundaryRegistry(
mapperId: string,
input: unknown,
registry: Readonly<Record<string, InstalledBoundaryMapper>>,
): MappingResult<unknown> {
): BoundaryMappingResult<unknown> {
const mapper = Object.hasOwn(registry, mapperId)
? registry[mapperId]
: undefined;
@@ -92,10 +96,10 @@ export function mapWithBoundaryRegistry(
}
}
export function mappingSuccess<Value>(value: Value): MappingResult<Value> {
export function mappingSuccess<Value>(value: Value): BoundaryMappingResult<Value> {
return Object.freeze({ ok: true, value });
}
export function mappingFailure(code: MappingFailureCode): MappingResult<never> {
export function mappingFailure(code: MappingFailureCode): BoundaryMappingResult<never> {
return Object.freeze({ ok: false, code });
}
+4 -2
View File
@@ -137,8 +137,10 @@ export type AppFailure = Readonly<{
/**
* Backward-compatible transport-facing name.
*
* @deprecated Use `AppFailure`. Remove in the next minor release once
* `grep -rw ApiFailure src` finds only this line (owner: frontend-platform).
* @deprecated Use `AppFailure`. Nothing in this repository imports it (07-01,
* enforced by `no-restricted-imports` in eslint.config.ts). Removing it breaks
* downstream importers; do it in a minor release with a CHANGELOG [계약]
* entry (owner: frontend-platform).
*/
export type ApiFailure = AppFailure;
+6 -3
View File
@@ -40,9 +40,12 @@ export const HTTP_EXECUTION_CEILINGS = Object.freeze({
});
/*
* D-15. The validator protocol and `MappingResult` below are the canonical
* shapes. `RuntimeSchemaCodec` (`schema-registry.ts`) and the boundary
* mapper's result (`boundary-mapper.ts`) are adapters over them.
* D-15. The validator protocol below is the canonical shape;
* `RuntimeSchemaCodec` (`schema-registry.ts`) adapts over it. `MappingResult`
* below is the contract-package side of a mapping result. Feature mappers and
* the HTTP binding return `BoundaryMappingResult` (`boundary-mapper.ts`)
* instead, whose failure code is a closed set; `toContractMappingResult`
* converts one into this shape (07-01).
*/
export type RuntimeValidationIssue = Readonly<{
path: readonly (string | number)[];
+3 -2
View File
@@ -24,8 +24,9 @@ augmentation으로 `"reference-feature": ReferenceFeatureInput`을 기여하므
`src/contracts/result.ts`의 `Result<Value, Failure = AppFailure>`로 반환한다.
`src/application/result.ts`는 기존 호출자를 위한 deprecated migration shim일
뿐 새 코드의 import 경로가 아니다. `AppFailure.kind`는
`ERROR_REGISTRY` key에서 파생된 닫힌 vocabulary이며, transport 호환 이름인
`ApiFailure`는 같은 type의 alias다.
`ERROR_REGISTRY` key에서 파생된 닫힌 vocabulary다. 폐기된 별칭 `ApiFailure`
대신 `AppFailure`를 import한다(lint가 막는다). mapper는 `boundary-mapper.ts`의
`BoundaryMappingResult`를 반환한다.
HTTP adapter는 `src/adapters/http/feature-http-binding.ts`의 capability-specific
typed binding을 사용한다. feature는 operation ID, route ID, request type, 성공
@@ -2,7 +2,7 @@ import {
defineAppError,
type AppError,
} from "../../../platform/errors/app-error.ts";
import type { ApiFailure } from "../../../contracts/errors.ts";
import type { AppFailure } from "../../../contracts/errors.ts";
/**
* Spec §17–§19. The reference feature's own domain errors.
@@ -57,7 +57,7 @@ export const REFERENCE_ERRORS = Object.freeze({
* Anything that is not a reference domain outcome stays `null`: the platform
* error mapping, not this feature, owns transport/contract failures.
*/
export function toReferenceError(failure: ApiFailure): ReferenceError | null {
export function toReferenceError(failure: AppFailure): ReferenceError | null {
switch (failure.kind) {
case "NOT_FOUND":
return REFERENCE_ERRORS.NOT_FOUND;
@@ -8,7 +8,7 @@ import type { ReferenceResource } from "../domain/reference-resource.ts";
import type { MutationIntent } from "../../../contracts/mutation-intent.ts";
import type { ExecutionContext } from "../../../platform/execution/execution-context.ts";
import type { TelemetryPort } from "../../../platform/telemetry/telemetry-port.ts";
import type { ApiFailure } from "../../../contracts/errors.ts";
import type { AppFailure } from "../../../contracts/errors.ts";
import { REFERENCE_FEATURE_ID } from "../contracts/reference-feature-contract.ts";
/**
@@ -75,13 +75,13 @@ export type ReferenceGateway = Readonly<{
*/
export type ReferenceLoadFailedPayload = Readonly<{
operation: "list" | "detail";
reason: ApiFailure["kind"];
reason: AppFailure["kind"];
}>;
function reportLoadFailure(
telemetry: TelemetryPort | undefined,
operation: ReferenceLoadFailedPayload["operation"],
failure: ApiFailure,
failure: AppFailure,
context: ReferenceCallContext | undefined,
): void {
if (!telemetry || failure.kind === "REQUEST_ABORTED") return;
@@ -6,7 +6,7 @@ import {
mappingFailure,
mappingSuccess,
type InstalledBoundaryMapper,
type MappingResult,
type BoundaryMappingResult,
} from "../../../contracts/boundary-mapper.ts";
import type { ReferenceResourceDto } from "./reference-schemas.ts";
@@ -23,7 +23,7 @@ export type ReferenceResourceView = Readonly<{
*/
export function mapReferenceResourcePayload(
dto: ReferenceResourceDto,
): MappingResult<ReferenceResource> {
): BoundaryMappingResult<ReferenceResource> {
try {
return mappingSuccess(
createReferenceResource({
@@ -39,7 +39,7 @@ export function mapReferenceResourcePayload(
export function mapReferenceResourceListPayload(
payload: readonly ReferenceResourceDto[],
): MappingResult<readonly ReferenceResource[]> {
): BoundaryMappingResult<readonly ReferenceResource[]> {
const output: ReferenceResource[] = [];
for (const item of payload) {
const mapped = mapReferenceResourcePayload(item);
@@ -61,7 +61,7 @@ function isReferenceResourceDto(value: unknown): value is ReferenceResourceDto {
function mapUnknownReferenceResourcePayload(
value: unknown,
): MappingResult<ReferenceResource> {
): BoundaryMappingResult<ReferenceResource> {
return isReferenceResourceDto(value)
? mapReferenceResourcePayload(value)
: mappingFailure("MAPPING_INVARIANT_REJECTED");
@@ -69,7 +69,7 @@ function mapUnknownReferenceResourcePayload(
function mapUnknownReferenceResourceListPayload(
value: unknown,
): MappingResult<readonly ReferenceResource[]> {
): BoundaryMappingResult<readonly ReferenceResource[]> {
if (
!Array.isArray(value) ||
value.length > 100 ||
@@ -92,7 +92,7 @@ function mapUnknownReferenceResourceListPayload(
export function mapReferenceOperation(
operationId: string,
payload: unknown,
): MappingResult<ReferenceResource | readonly ReferenceResource[]> {
): BoundaryMappingResult<ReferenceResource | readonly ReferenceResource[]> {
if (operationId === "LIST_REFERENCE_RESOURCES") {
return mapUnknownReferenceResourceListPayload(payload);
}
@@ -1,7 +1,7 @@
import { describe, expect, it } from "vitest";
import type { Result } from "../../../src/contracts/result.ts";
import { createFailure, type ApiFailure } from "../../../src/contracts/errors.ts";
import { createFailure, type AppFailure } from "../../../src/contracts/errors.ts";
import {
createReferenceHttpGateway,
type ReferenceHttpBinding,
@@ -23,7 +23,7 @@ const resources = Object.freeze({
type ScriptedResult = Result<
ReferenceResource | readonly ReferenceResource[],
ApiFailure
AppFailure
>;
function scriptedBinding(results: ScriptedResult[]) {