@abapify/adt-services 0.4.51 → 0.4.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +77 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +259 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +13 -13
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FileLockStore, LockService } from "@abapify/adt-locks";
|
|
2
|
-
import { AdkContext, AdkObject, AdkTransportRequest, ObjectSourceVersionsResult, ReleaseResult, TransportObjectSelector, TransportSourceManifest, buildTransportSourceManifest, listObjectSourceVersions } from "@abapify/adk";
|
|
2
|
+
import { AdkContext, AdkObject, AdkTransportRequest, ObjectSourceVersionsResult, ReleaseResult, TransportObjectInventoryEntry, TransportObjectSelector, TransportSourceManifest, buildTransportSourceManifest, listObjectSourceVersions } from "@abapify/adk";
|
|
3
3
|
import { AdtPlugin, FormatOptionValue } from "@abapify/adt-plugin";
|
|
4
4
|
import { Destination, Destination as Destination$1, LoadedConfig, LoadedConfig as LoadedConfig$1 } from "@abapify/adt-config";
|
|
5
|
-
import { AdtAdapterConfig, AdtClient, Logger } from "@abapify/adt-client";
|
|
5
|
+
import { AdtAdapterConfig, AdtClient, Logger, Transport } from "@abapify/adt-client";
|
|
6
6
|
import { AuthConfig, AuthManager, AuthMethod, AuthPlugin, AuthPluginOptions, AuthPluginResult, AuthSession, BasicCredentials, CookieCredentials, Credentials } from "@abapify/adt-auth";
|
|
7
7
|
import { BasicObjectPropertiesResponse } from "@abapify/adt-contracts";
|
|
8
8
|
import { Logger as Logger$1 } from "@abapify/logger";
|
|
@@ -434,6 +434,80 @@ declare class CtsTransportMetadataService {
|
|
|
434
434
|
constructor(client: AdtClient);
|
|
435
435
|
get(transport: string): Promise<CtsTransportMetadataResult>;
|
|
436
436
|
}
|
|
437
|
+
/** A raw CTS field the projection does not map, kept with its provenance. */
|
|
438
|
+
interface UnsupportedCtsField {
|
|
439
|
+
field: string;
|
|
440
|
+
value: unknown;
|
|
441
|
+
}
|
|
442
|
+
interface NormalizedCtsUnit {
|
|
443
|
+
kind: 'request' | 'task';
|
|
444
|
+
number: string;
|
|
445
|
+
parent?: string;
|
|
446
|
+
description?: string;
|
|
447
|
+
owner?: string;
|
|
448
|
+
status?: string;
|
|
449
|
+
type?: string;
|
|
450
|
+
target?: string;
|
|
451
|
+
lastChangedTimestamp?: string;
|
|
452
|
+
unsupportedFields: UnsupportedCtsField[];
|
|
453
|
+
}
|
|
454
|
+
interface NormalizedCtsInventory {
|
|
455
|
+
requestedTransport: string;
|
|
456
|
+
/** The first normalized unit: a request, or the requested task itself. */
|
|
457
|
+
request?: NormalizedCtsUnit;
|
|
458
|
+
tasks: NormalizedCtsUnit[];
|
|
459
|
+
units: NormalizedCtsUnit[];
|
|
460
|
+
}
|
|
461
|
+
interface PlannedCtsScopeRoot {
|
|
462
|
+
transport: string;
|
|
463
|
+
system?: string;
|
|
464
|
+
tasks: string[];
|
|
465
|
+
/** Every original request spelling that resolved to this root. */
|
|
466
|
+
requestedBy: string[];
|
|
467
|
+
}
|
|
468
|
+
interface PlannedCtsScope {
|
|
469
|
+
roots: PlannedCtsScopeRoot[];
|
|
470
|
+
systems: string[];
|
|
471
|
+
requestedCount: number;
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* Generic request/task normalization over the raw CTS transport payload.
|
|
475
|
+
* Pure: unknown fields are retained as unsupported provenance, missing
|
|
476
|
+
* metadata stays missing, and parent identities are canonicalized
|
|
477
|
+
* case-insensitively. The caller's input object is never mutated.
|
|
478
|
+
*/
|
|
479
|
+
declare function normalizeCtsTransport(raw: Transport): NormalizedCtsInventory;
|
|
480
|
+
interface PlannedCtsScopeRequest {
|
|
481
|
+
transport: string;
|
|
482
|
+
system?: string;
|
|
483
|
+
normalized: NormalizedCtsInventory;
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* Ordered multi-root scope planning over requested transports. Pure and
|
|
487
|
+
* deterministic: requested order wins, identities are scoped per system,
|
|
488
|
+
* case-insensitive duplicates deduplicate with provenance, a requested task
|
|
489
|
+
* whose parent is also requested folds into that parent root, root task
|
|
490
|
+
* lists are sorted by transport number, and systems stay separated. The
|
|
491
|
+
* caller's inputs are never mutated.
|
|
492
|
+
*/
|
|
493
|
+
declare function planCtsScope(requests: ReadonlyArray<PlannedCtsScopeRequest>): PlannedCtsScope;
|
|
494
|
+
interface CtsInventoryOwnerGroup {
|
|
495
|
+
/** The representative owner entry, with its original spelling preserved. */
|
|
496
|
+
owner: TransportObjectInventoryEntry;
|
|
497
|
+
/** Every entry folding into this owner, in input order (provenance). */
|
|
498
|
+
leaves: TransportObjectInventoryEntry[];
|
|
499
|
+
/** True when no R3TR owner exists for this group in the given inventory. */
|
|
500
|
+
unresolved: boolean;
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Deduplicate raw CTS inventory entries to their repository owners.
|
|
504
|
+
* Pure: padded or case-different spellings of the same object merge into one
|
|
505
|
+
* group, LIMU component leaves fold into the R3TR owner resolved through the
|
|
506
|
+
* shared ADK owner rule, namespaced names stay distinct identities, and
|
|
507
|
+
* ownerless entries are retained as unresolved groups with provenance. The
|
|
508
|
+
* caller's input is never mutated.
|
|
509
|
+
*/
|
|
510
|
+
declare function dedupeCtsInventoryToOwners(entries: ReadonlyArray<TransportObjectInventoryEntry>): CtsInventoryOwnerGroup[];
|
|
437
511
|
/**
|
|
438
512
|
* Options for importing a single object by name (search-based)
|
|
439
513
|
*/
|
|
@@ -1217,5 +1291,5 @@ declare function AdtLink(ref?: AdtObjectRef): Component;
|
|
|
1217
1291
|
* Package Link Component - convenience for package links
|
|
1218
1292
|
*/
|
|
1219
1293
|
declare function PackageLink(packageName: string): Component;
|
|
1220
|
-
export { type AddEntryArgs, AdtAuthError, AdtClientV2Options, AdtLink, AdtObjectRef, type ApplyOptions, type ApplyResult, type ApplyTierResult, type AuthConfig, type AuthMethod, type AuthPlugin, type AuthPluginOptions, type AuthPluginResult, type AuthSession, BadiImplementation, BadiInfo, BadiKind, BadiMetadata, BadiReadResult, BadiService, BasicAuthVerificationError, type BasicCredentials, type BuildTransportManifestInput, type BuildTransportManifestResult, CapturedResponse, type ChangeAction, type ChangePlan, type ChangePlanEntry, type Changeset, type ChangesetEntry, ChangesetService, type ChangesetStatus, CheckMessage, CheckReport, CheckResult, CheckService, CheckServiceInput, CheckSourceVersion, type CheckinOptions, type CheckinResult, CheckinService, ClassicBadiMetadata, ClassicBadiService, CliContext, type CommitResult, Component, type ConnectionResolveArgs, type CookieCredentials, type CreateTaskInput, type CreateTaskResult, type Credentials, type CtsTransportLifecycleOperations, CtsTransportLifecycleService, type CtsTransportMetadataResult, CtsTransportMetadataService, type CtsTransportMetadataUnit, type CtsTransportSummary, DEFAULT_CHECK_SOURCE_VERSION, type DependencyTier, type Destination, type ExactSourceHistoryOperations, ExactSourceHistoryService, ExactSourceHistoryServiceError, type ExactSourceHistoryServiceErrorCode, type GetSourceDefaultResult, type GetSourceGrepResult, type GetSourceMethodListResult, type GetSourceMethodResult, type GetSourceOptions, type GetSourceResult, type GetSourceStructuredResult, GetSourceTooLargeError, type GetVersionSourceInput, type GrepMatch, ImportAcquisitionDiagnostics, ImportResult, ImportService, Link, type ListObjectVersionsInput, type ListObjectVersionsResult, type LoadedConfig, MenuItem, ObjectImportOptions, PackageImportOptions, PackageLink, Page, ProgressOptions, ProgressReporter, type ReassignTransportInput, type ReassignTransportResult, type ReleaseTransportInput, type ReleaseTransportResult, type ResolveConnectionClientHooks, type ResolvedConnectionClient, type RollbackResult, SearchObject, type SourceInclude, type SourceMethod, TransportImportOptions, VerifyBasicAuthInput, __getTestAdtClient, __setTestAdtClient, adtLink, applyPlan, buildPlan, classifyTier, clearConfigCache, consoleLogger, createChangeset, createProgressReporter, diffObject, flattenPlanObjects, getAdtClientV2, getAdtClientV2Safe, getAdtSystem, getAuthManager, getBadiInfo, getCaptured, getCliContext, getConfig, getDefaultSid, getDestination, getLockService, getSource, hasDestination, hyperlink, isExpired, link, listAvailableSids, listDestinations, loadAuthSession, loadFormatPlugin, lockStore, normalizeClassicBadiMetadata, normalizeSearchResults, packageLink, parseEnhancementImplementation, parseFormatSpec, parseTransportNumbers, refreshCredentials, resetCaptured, resetCliContext, resolveAdtHeadersTimeoutMs, resolveConnectionClient, resolveObjectUri, resolvePackageForFormatId, saveAuthSession, setAdtSystem, setCaptured, setCliContext, setDefaultSid, silentLogger, toMetadataOnlySourceVersionListing, toMetadataOnlyTransportSourceManifest, verifyBasicAuth };
|
|
1294
|
+
export { type AddEntryArgs, AdtAuthError, AdtClientV2Options, AdtLink, AdtObjectRef, type ApplyOptions, type ApplyResult, type ApplyTierResult, type AuthConfig, type AuthMethod, type AuthPlugin, type AuthPluginOptions, type AuthPluginResult, type AuthSession, BadiImplementation, BadiInfo, BadiKind, BadiMetadata, BadiReadResult, BadiService, BasicAuthVerificationError, type BasicCredentials, type BuildTransportManifestInput, type BuildTransportManifestResult, CapturedResponse, type ChangeAction, type ChangePlan, type ChangePlanEntry, type Changeset, type ChangesetEntry, ChangesetService, type ChangesetStatus, CheckMessage, CheckReport, CheckResult, CheckService, CheckServiceInput, CheckSourceVersion, type CheckinOptions, type CheckinResult, CheckinService, ClassicBadiMetadata, ClassicBadiService, CliContext, type CommitResult, Component, type ConnectionResolveArgs, type CookieCredentials, type CreateTaskInput, type CreateTaskResult, type Credentials, type CtsInventoryOwnerGroup, type CtsTransportLifecycleOperations, CtsTransportLifecycleService, type CtsTransportMetadataResult, CtsTransportMetadataService, type CtsTransportMetadataUnit, type CtsTransportSummary, DEFAULT_CHECK_SOURCE_VERSION, type DependencyTier, type Destination, type ExactSourceHistoryOperations, ExactSourceHistoryService, ExactSourceHistoryServiceError, type ExactSourceHistoryServiceErrorCode, type GetSourceDefaultResult, type GetSourceGrepResult, type GetSourceMethodListResult, type GetSourceMethodResult, type GetSourceOptions, type GetSourceResult, type GetSourceStructuredResult, GetSourceTooLargeError, type GetVersionSourceInput, type GrepMatch, ImportAcquisitionDiagnostics, ImportResult, ImportService, Link, type ListObjectVersionsInput, type ListObjectVersionsResult, type LoadedConfig, MenuItem, type NormalizedCtsInventory, type NormalizedCtsUnit, ObjectImportOptions, PackageImportOptions, PackageLink, Page, type PlannedCtsScope, type PlannedCtsScopeRequest, type PlannedCtsScopeRoot, ProgressOptions, ProgressReporter, type ReassignTransportInput, type ReassignTransportResult, type ReleaseTransportInput, type ReleaseTransportResult, type ResolveConnectionClientHooks, type ResolvedConnectionClient, type RollbackResult, SearchObject, type SourceInclude, type SourceMethod, TransportImportOptions, type UnsupportedCtsField, VerifyBasicAuthInput, __getTestAdtClient, __setTestAdtClient, adtLink, applyPlan, buildPlan, classifyTier, clearConfigCache, consoleLogger, createChangeset, createProgressReporter, dedupeCtsInventoryToOwners, diffObject, flattenPlanObjects, getAdtClientV2, getAdtClientV2Safe, getAdtSystem, getAuthManager, getBadiInfo, getCaptured, getCliContext, getConfig, getDefaultSid, getDestination, getLockService, getSource, hasDestination, hyperlink, isExpired, link, listAvailableSids, listDestinations, loadAuthSession, loadFormatPlugin, lockStore, normalizeClassicBadiMetadata, normalizeCtsTransport, normalizeSearchResults, packageLink, parseEnhancementImplementation, parseFormatSpec, parseTransportNumbers, planCtsScope, refreshCredentials, resetCaptured, resetCliContext, resolveAdtHeadersTimeoutMs, resolveConnectionClient, resolveObjectUri, resolvePackageForFormatId, saveAuthSession, setAdtSystem, setCaptured, setCliContext, setDefaultSid, silentLogger, toMetadataOnlySourceVersionListing, toMetadataOnlyTransportSourceManifest, verifyBasicAuth };
|
|
1221
1295
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":["LoadedConfig","Destination","Logger"],"sources":["../src/services/badi/index.ts","../src/services/changeset/service.ts","../src/services/checkin/diff.ts","../src/services/checkin/plan.ts","../src/services/checkin/apply.ts","../src/services/checkin/service.ts","../src/services/connection/service.ts","../src/services/cts/transport-lifecycle.ts","../src/services/cts/transport-metadata.ts","../src/services/import/service.ts","../src/services/source/service.ts","../src/services/source-history/service.ts","../src/services/check/service.ts","../src/shared/adt-client.ts","../src/utils/adt-client-v2.ts","../src/utils/adt-http-options.ts","../src/utils/auth.ts","../src/utils/destinations.ts","../src/utils/format-loader.ts","../src/utils/lock-helpers.ts","../src/utils/progress-reporter.ts","../src/utils/transport-numbers.ts","../src/utils/verify-basic-auth.ts","../src/ui/types.ts","../src/ui/components/link.ts"],"mappings":";;;;;;;;UAiBiB;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,qBAAqB;;;;;iBA8EP,+BAA+B,cAAc;;;;;iBAmBvC,cACpB,QACA;EAEA,QAAQ;EACR;IACE,QAAQ;KAeA;KAEA;EACV;EACA;EACA,MAAM;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;IAAiB;IAAe;;;KAGtB,iBAAiB;;EAE3B,cAAc;EACd;;EAEA,kBAAkB;;;KAIR,sBAAsB,KAAK;iBA6CvB,+BACd,UACA;EAEA,UAAU;EACV;IACE;cAySS;mBACkB;EAAA,YAAA,QAAQ;UAE7B;UAIA;EAOF,cAAc;IAAU;MAAiB,QAAQ;EAIjD,MACJ,MACA;IAEA;IACA;MAAY;MAAyB;;MACnC,QAAQ;EAIN,gBAAgB;IAAU;MAAiB,QAAQ;EAInD,oBAAoB;IAAU;MAAiB,QAAQ;;;;;;EASvD,sBACJ;IAEA;MACE,QAAQ;;;cAMD,2BAAkB;KClhBnB;UAGK;EACf;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA,QAAQ;EACR,SAAS;EACT;;UAGe;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;IAAU;IAAa;;;UAGR;EACf;EACA;IAAU;IAAa;;;;iBAST,gBAAgB,uBA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BAAiB,qBAAqB;EACtC,wBAAwB,qBAAqB,QAAQ;;;;;;;;UAStC,yBAAyB;EACxC,QAAQ;EACR;EACA;;iBAGoB,wBAAwB,SAC5C,MAAM,uBACN,OAAO,6BAA6B,WACnC,QAAQ,yBAAyB;UCtCnB;EACf,aACE,mBACA,QAAQ,YACP,QAAQ;;UAQI;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA,QAAQ;;UAGO;EACf;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA;;cAGW;mBAEQ;mBACA;EADA,YAAA,QAAQ,WACR,aAAY;EAGzB,aAAa,oBAAoB,QAAQ;EAmBzC,QAAQ,OAAO,wBAAwB,QAAQ;EA8B/C,WAAW,OAAO,kBAAkB,QAAQ;EA6B5C,SACJ,OAAO,yBACN,QAAQ;;UChKI;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA,OAAO;;;;;;cAOI;mBACkB;EAAA,YAAA,QAAQ;EAE/B,IAAI,oBAAoB,QAAQ
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":["LoadedConfig","Destination","Logger"],"sources":["../src/services/badi/index.ts","../src/services/changeset/service.ts","../src/services/checkin/diff.ts","../src/services/checkin/plan.ts","../src/services/checkin/apply.ts","../src/services/checkin/service.ts","../src/services/connection/service.ts","../src/services/cts/transport-lifecycle.ts","../src/services/cts/transport-metadata.ts","../src/services/cts/cts-normalization.ts","../src/services/cts/cts-inventory-owners.ts","../src/services/import/service.ts","../src/services/source/service.ts","../src/services/source-history/service.ts","../src/services/check/service.ts","../src/shared/adt-client.ts","../src/utils/adt-client-v2.ts","../src/utils/adt-http-options.ts","../src/utils/auth.ts","../src/utils/destinations.ts","../src/utils/format-loader.ts","../src/utils/lock-helpers.ts","../src/utils/progress-reporter.ts","../src/utils/transport-numbers.ts","../src/utils/ver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kBAAkB,kBAClC,oBACA,qBACA,mBACA,uBACC;EAAU;EAAa;;;;;;;iBAqDV,eACd,QAAQ,QAAQ,kBAAkB,mBACjC;UC1Hc;;EAEf,KAAK;;EAEL,QAAQ;;EAER,KAAK;;EAEL;;UAGe;;EAEf;;EAEA,SAASC;;EAET;;iBAOc,uBACd,UAAS,kBACR;;;;;;;;;;;;;;;iBCxBa,sBAAsB;;;;;;;;;;;;UCArB;;EAEf;;EAEA;EACA;EACA;;EAEA;;;;;EAKA;;;;;;;;cASW,mCAAmC;WACrC;EAEG,YAAA,iBAAiB;IAAY;IAAiB;;;;;;;;;;;iBA8GtC,gBACpB,OAAO,uBACN;;;;;;;;;UC9Ic;EACf;;;;;UAMe,aAAa;EAC5B;;EAEA;EACA;EACA,OAAO;EACP;;EAEA;;;;;UAMe;EACf;EACA;EACA;EACA;EACA;;;;;;;;;iBCVc,UAAU,cAAc;;;;iBAgBxB,aAAa;;;;iBAOb;;;;;UA4FC;;EAEf;;EAEA;;EAEA;;;;;iBAUc,KAAK,cAAc;;;;;;;;iBAWnB,QAAQ,MAAM;;;;iBAiCd,YAAY;;;;iBAWJ,KAAK,cAAc,cAAc;;;;;iBAUzC,QAAQ,MAAM,eAAe;;;;iBAY7B,YAAY,sBAAsB"}
|
package/dist/index.mjs
CHANGED
|
@@ -1137,6 +1137,264 @@ var CtsTransportMetadataService = class {
|
|
|
1137
1137
|
}
|
|
1138
1138
|
};
|
|
1139
1139
|
|
|
1140
|
+
// src/services/cts/cts-normalization.ts
|
|
1141
|
+
const KNOWN_UNIT_FIELDS = /* @__PURE__ */ new Set([
|
|
1142
|
+
"number",
|
|
1143
|
+
"desc",
|
|
1144
|
+
"owner",
|
|
1145
|
+
"status",
|
|
1146
|
+
"type",
|
|
1147
|
+
"target",
|
|
1148
|
+
"parent",
|
|
1149
|
+
"lastChangedTimestamp",
|
|
1150
|
+
"tasks"
|
|
1151
|
+
]);
|
|
1152
|
+
function canonicalTransport(value) {
|
|
1153
|
+
return value.trim().toUpperCase();
|
|
1154
|
+
}
|
|
1155
|
+
function unsupportedFieldsOf(raw) {
|
|
1156
|
+
return Object.entries(raw).filter(([field]) => !KNOWN_UNIT_FIELDS.has(field)).map(([field, value]) => ({
|
|
1157
|
+
field,
|
|
1158
|
+
value
|
|
1159
|
+
}));
|
|
1160
|
+
}
|
|
1161
|
+
function normalizedParent(raw, fallbackParent) {
|
|
1162
|
+
const parentRaw = raw.parent;
|
|
1163
|
+
if (typeof parentRaw === "string" && parentRaw.trim() !== "") return canonicalTransport(parentRaw);
|
|
1164
|
+
return fallbackParent;
|
|
1165
|
+
}
|
|
1166
|
+
function optionalUnitFields(raw) {
|
|
1167
|
+
return {
|
|
1168
|
+
...typeof raw.desc === "string" ? { description: raw.desc } : {},
|
|
1169
|
+
...typeof raw.owner === "string" ? { owner: raw.owner } : {},
|
|
1170
|
+
...typeof raw.status === "string" ? { status: raw.status } : {},
|
|
1171
|
+
...typeof raw.type === "string" ? { type: raw.type } : {},
|
|
1172
|
+
...typeof raw.target === "string" ? { target: raw.target } : {},
|
|
1173
|
+
...typeof raw.lastChangedTimestamp === "string" ? { lastChangedTimestamp: raw.lastChangedTimestamp } : {}
|
|
1174
|
+
};
|
|
1175
|
+
}
|
|
1176
|
+
function normalizeUnit(raw, fallbackParent) {
|
|
1177
|
+
const parent = normalizedParent(raw, fallbackParent);
|
|
1178
|
+
return {
|
|
1179
|
+
kind: parent === void 0 ? "request" : "task",
|
|
1180
|
+
number: canonicalTransport(String(raw.number)),
|
|
1181
|
+
...parent === void 0 ? {} : { parent },
|
|
1182
|
+
...optionalUnitFields(raw),
|
|
1183
|
+
unsupportedFields: unsupportedFieldsOf(raw)
|
|
1184
|
+
};
|
|
1185
|
+
}
|
|
1186
|
+
/**
|
|
1187
|
+
* Generic request/task normalization over the raw CTS transport payload.
|
|
1188
|
+
* Pure: unknown fields are retained as unsupported provenance, missing
|
|
1189
|
+
* metadata stays missing, and parent identities are canonicalized
|
|
1190
|
+
* case-insensitively. The caller's input object is never mutated.
|
|
1191
|
+
*/
|
|
1192
|
+
function normalizeCtsTransport(raw) {
|
|
1193
|
+
const rawRecord = raw;
|
|
1194
|
+
if (typeof rawRecord.number !== "string" || rawRecord.number.trim() === "") throw new Error("Transport number is required");
|
|
1195
|
+
const requestedTransport = canonicalTransport(rawRecord.number);
|
|
1196
|
+
const rawTasks = Array.isArray(rawRecord.tasks) ? rawRecord.tasks : [];
|
|
1197
|
+
const request = normalizeUnit(rawRecord);
|
|
1198
|
+
if (rawTasks.length === 0) return {
|
|
1199
|
+
requestedTransport,
|
|
1200
|
+
request,
|
|
1201
|
+
tasks: [],
|
|
1202
|
+
units: [request]
|
|
1203
|
+
};
|
|
1204
|
+
const tasks = rawTasks.map((task) => normalizeUnit(task, request.number));
|
|
1205
|
+
return {
|
|
1206
|
+
requestedTransport,
|
|
1207
|
+
request,
|
|
1208
|
+
tasks,
|
|
1209
|
+
units: [request, ...tasks]
|
|
1210
|
+
};
|
|
1211
|
+
}
|
|
1212
|
+
function rootKey(key) {
|
|
1213
|
+
return JSON.stringify([key.system ?? null, key.transport]);
|
|
1214
|
+
}
|
|
1215
|
+
function collectRoots(requests) {
|
|
1216
|
+
const roots = /* @__PURE__ */ new Map();
|
|
1217
|
+
requests.forEach((request, index) => {
|
|
1218
|
+
const identity = canonicalTransport(request.transport);
|
|
1219
|
+
const key = rootKey({
|
|
1220
|
+
system: request.system,
|
|
1221
|
+
transport: identity
|
|
1222
|
+
});
|
|
1223
|
+
let builder = roots.get(key);
|
|
1224
|
+
if (!builder) {
|
|
1225
|
+
if (canonicalTransport(request.normalized.requestedTransport) !== identity) throw new Error(`Normalized payload for transport ${identity} does not match request.`);
|
|
1226
|
+
builder = {
|
|
1227
|
+
root: {
|
|
1228
|
+
transport: identity,
|
|
1229
|
+
...request.system === void 0 ? {} : { system: request.system },
|
|
1230
|
+
tasks: [],
|
|
1231
|
+
requestedBy: []
|
|
1232
|
+
},
|
|
1233
|
+
payload: request.normalized,
|
|
1234
|
+
order: index,
|
|
1235
|
+
origins: []
|
|
1236
|
+
};
|
|
1237
|
+
roots.set(key, builder);
|
|
1238
|
+
} else if (JSON.stringify(request.normalized.units) !== JSON.stringify(builder.payload.units)) throw new Error(`Conflicting normalized payloads for transport ${identity}.`);
|
|
1239
|
+
builder.origins.push({
|
|
1240
|
+
spelling: request.transport,
|
|
1241
|
+
index
|
|
1242
|
+
});
|
|
1243
|
+
});
|
|
1244
|
+
return { roots };
|
|
1245
|
+
}
|
|
1246
|
+
function appendTask(tasks, taskNumber, root) {
|
|
1247
|
+
if (taskNumber !== root.transport && !tasks.includes(taskNumber)) tasks.push(taskNumber);
|
|
1248
|
+
}
|
|
1249
|
+
function foldTargetOf(key, payloads) {
|
|
1250
|
+
const unit = payloads.roots.get(key)?.payload.request;
|
|
1251
|
+
if (unit?.kind !== "task") return;
|
|
1252
|
+
const parent = unit.parent;
|
|
1253
|
+
if (parent === void 0) return;
|
|
1254
|
+
const system = payloads.roots.get(key)?.root.system;
|
|
1255
|
+
return payloads.roots.get(rootKey({
|
|
1256
|
+
system,
|
|
1257
|
+
transport: parent
|
|
1258
|
+
}));
|
|
1259
|
+
}
|
|
1260
|
+
function foldIntoParent(key, folded, parent, payloads) {
|
|
1261
|
+
parent.origins.push(...folded.origins);
|
|
1262
|
+
parent.order = Math.min(parent.order, folded.order);
|
|
1263
|
+
appendTask(parent.root.tasks, folded.root.transport, parent.root);
|
|
1264
|
+
for (const task of folded.payload.tasks) appendTask(parent.root.tasks, task.number, parent.root);
|
|
1265
|
+
payloads.roots.delete(key);
|
|
1266
|
+
}
|
|
1267
|
+
/**
|
|
1268
|
+
* A requested task whose parent is also requested in the same system folds
|
|
1269
|
+
* into the parent root and takes its request provenance with it.
|
|
1270
|
+
*/
|
|
1271
|
+
function foldTaskRootsIntoParents(payloads) {
|
|
1272
|
+
for (const [key, folded] of payloads.roots) {
|
|
1273
|
+
const parent = foldTargetOf(key, payloads);
|
|
1274
|
+
if (parent) foldIntoParent(key, folded, parent, payloads);
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
function expandRootTasks(payloads) {
|
|
1278
|
+
for (const builder of payloads.roots.values()) for (const task of builder.payload.tasks) appendTask(builder.root.tasks, task.number, builder.root);
|
|
1279
|
+
}
|
|
1280
|
+
/**
|
|
1281
|
+
* Ordered multi-root scope planning over requested transports. Pure and
|
|
1282
|
+
* deterministic: requested order wins, identities are scoped per system,
|
|
1283
|
+
* case-insensitive duplicates deduplicate with provenance, a requested task
|
|
1284
|
+
* whose parent is also requested folds into that parent root, root task
|
|
1285
|
+
* lists are sorted by transport number, and systems stay separated. The
|
|
1286
|
+
* caller's inputs are never mutated.
|
|
1287
|
+
*/
|
|
1288
|
+
function planCtsScope(requests) {
|
|
1289
|
+
const payloads = collectRoots(requests);
|
|
1290
|
+
foldTaskRootsIntoParents(payloads);
|
|
1291
|
+
expandRootTasks(payloads);
|
|
1292
|
+
const ordered = Array.from(payloads.roots.values());
|
|
1293
|
+
ordered.sort((a, b) => a.order - b.order);
|
|
1294
|
+
for (const builder of ordered) {
|
|
1295
|
+
builder.root.tasks.sort((a, b) => a.localeCompare(b));
|
|
1296
|
+
const origins = Array.from(builder.origins);
|
|
1297
|
+
origins.sort((a, b) => a.index - b.index);
|
|
1298
|
+
builder.root.requestedBy = origins.map(({ spelling }) => spelling);
|
|
1299
|
+
}
|
|
1300
|
+
const systems = [...new Set(ordered.map((builder) => builder.root.system).filter((system) => system !== void 0))];
|
|
1301
|
+
systems.sort((a, b) => a.localeCompare(b));
|
|
1302
|
+
return {
|
|
1303
|
+
roots: ordered.map((builder) => builder.root),
|
|
1304
|
+
systems,
|
|
1305
|
+
requestedCount: requests.length
|
|
1306
|
+
};
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
// src/services/cts/cts-inventory-owners.ts
|
|
1310
|
+
function canonicalKey(entry) {
|
|
1311
|
+
return [
|
|
1312
|
+
entry.pgmid.trim().toUpperCase(),
|
|
1313
|
+
entry.type.trim().toUpperCase(),
|
|
1314
|
+
entry.name.trim().toUpperCase()
|
|
1315
|
+
].join("/");
|
|
1316
|
+
}
|
|
1317
|
+
function isR3tr(entry) {
|
|
1318
|
+
return entry.pgmid.trim().toUpperCase() === "R3TR";
|
|
1319
|
+
}
|
|
1320
|
+
/** The first R3TR entry in a group becomes its repository owner. */
|
|
1321
|
+
function promoteOwner(group, entry) {
|
|
1322
|
+
if (!isR3tr(entry)) return;
|
|
1323
|
+
if (group.owner !== void 0 && isR3tr(group.owner)) return;
|
|
1324
|
+
group.owner = entry;
|
|
1325
|
+
}
|
|
1326
|
+
/**
|
|
1327
|
+
* Derive the repository owner key for a component leaf. Class components
|
|
1328
|
+
* resolve through the shared ADK owner rule (the WB type describes the
|
|
1329
|
+
* component subtype; the owner name comes from the ADT URI or the padded
|
|
1330
|
+
* transport name). A FUNC leaf folds into the FUGR owner named by its WB
|
|
1331
|
+
* type.
|
|
1332
|
+
*/
|
|
1333
|
+
function componentOwnerKey(entry) {
|
|
1334
|
+
const classOwner = resolveClassComponentOwnerName({
|
|
1335
|
+
pgmid: entry.pgmid,
|
|
1336
|
+
type: entry.type,
|
|
1337
|
+
name: entry.name,
|
|
1338
|
+
wbtype: entry.wbtype,
|
|
1339
|
+
uri: entry.uri
|
|
1340
|
+
});
|
|
1341
|
+
if (classOwner) return `R3TR/CLAS/${classOwner}`;
|
|
1342
|
+
const wbtype = entry.wbtype?.trim().toUpperCase();
|
|
1343
|
+
if (wbtype?.startsWith("FUGR/") && wbtype.length > 5) return `R3TR/${wbtype}`;
|
|
1344
|
+
}
|
|
1345
|
+
function collectGroups(entries) {
|
|
1346
|
+
const groups = /* @__PURE__ */ new Map();
|
|
1347
|
+
entries.forEach((entry, index) => {
|
|
1348
|
+
const key = canonicalKey(entry);
|
|
1349
|
+
let group = groups.get(key);
|
|
1350
|
+
if (!group) {
|
|
1351
|
+
group = {
|
|
1352
|
+
owner: void 0,
|
|
1353
|
+
leaves: []
|
|
1354
|
+
};
|
|
1355
|
+
groups.set(key, group);
|
|
1356
|
+
}
|
|
1357
|
+
group.leaves.push({
|
|
1358
|
+
entry,
|
|
1359
|
+
index
|
|
1360
|
+
});
|
|
1361
|
+
promoteOwner(group, entry);
|
|
1362
|
+
});
|
|
1363
|
+
return groups;
|
|
1364
|
+
}
|
|
1365
|
+
/**
|
|
1366
|
+
* Fold component groups into the owner group referenced by any of their
|
|
1367
|
+
* leaves. Ownerless groups keep their identity.
|
|
1368
|
+
*/
|
|
1369
|
+
function foldComponentGroups(groups) {
|
|
1370
|
+
for (const [key, group] of groups) {
|
|
1371
|
+
if (group.owner !== void 0) continue;
|
|
1372
|
+
const target = [...group.leaves].sort((a, b) => a.index - b.index).map(({ entry }) => componentOwnerKey(entry)).find((candidate) => candidate !== void 0 && candidate !== key);
|
|
1373
|
+
if (!target || !groups.has(target)) continue;
|
|
1374
|
+
const ownerGroup = groups.get(target);
|
|
1375
|
+
if (!ownerGroup) continue;
|
|
1376
|
+
ownerGroup.leaves.push(...group.leaves);
|
|
1377
|
+
groups.delete(key);
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
/**
|
|
1381
|
+
* Deduplicate raw CTS inventory entries to their repository owners.
|
|
1382
|
+
* Pure: padded or case-different spellings of the same object merge into one
|
|
1383
|
+
* group, LIMU component leaves fold into the R3TR owner resolved through the
|
|
1384
|
+
* shared ADK owner rule, namespaced names stay distinct identities, and
|
|
1385
|
+
* ownerless entries are retained as unresolved groups with provenance. The
|
|
1386
|
+
* caller's input is never mutated.
|
|
1387
|
+
*/
|
|
1388
|
+
function dedupeCtsInventoryToOwners(entries) {
|
|
1389
|
+
const groups = collectGroups(entries);
|
|
1390
|
+
foldComponentGroups(groups);
|
|
1391
|
+
return [...groups.values()].map((group) => ({
|
|
1392
|
+
owner: group.owner ?? [...group.leaves].sort((a, b) => a.index - b.index)[0].entry,
|
|
1393
|
+
leaves: [...group.leaves].sort((a, b) => a.index - b.index).map(({ entry }) => entry),
|
|
1394
|
+
unresolved: group.owner === void 0
|
|
1395
|
+
}));
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1140
1398
|
// src/shared/adt-client.ts
|
|
1141
1399
|
let globalCliContext = {};
|
|
1142
1400
|
/**
|
|
@@ -3447,5 +3705,5 @@ async function verifyBasicAuth(input) {
|
|
|
3447
3705
|
}
|
|
3448
3706
|
}
|
|
3449
3707
|
|
|
3450
|
-
export { AdtAuthError, AdtLink, BadiService, BasicAuthVerificationError, ChangesetService, CheckService, CheckinService, ClassicBadiService, CtsTransportLifecycleService, CtsTransportMetadataService, DEFAULT_CHECK_SOURCE_VERSION, ExactSourceHistoryService, ExactSourceHistoryServiceError, GetSourceTooLargeError, ImportService, Link, PackageLink, __getTestAdtClient, __setTestAdtClient, adtLink, applyPlan, buildPlan, classifyTier, clearConfigCache, consoleLogger, createChangeset, createProgressReporter, diffObject, flattenPlanObjects, getAdtClientV2, getAdtClientV2Safe, getAdtSystem, getAuthManager, getBadiInfo, getCaptured, getCliContext, getConfig, getDefaultSid, getDestination, getLockService, getSource, hasDestination, hyperlink, isExpired, link, listAvailableSids, listDestinations, loadAuthSession, loadFormatPlugin, lockStore, normalizeClassicBadiMetadata, normalizeSearchResults, packageLink, parseEnhancementImplementation, parseFormatSpec, parseTransportNumbers, refreshCredentials, resetCaptured, resetCliContext, resolveAdtHeadersTimeoutMs, resolveConnectionClient, resolveObjectUri, resolvePackageForFormatId, saveAuthSession, setAdtSystem, setCaptured, setCliContext, setDefaultSid, silentLogger, toMetadataOnlySourceVersionListing, toMetadataOnlyTransportSourceManifest, verifyBasicAuth };
|
|
3708
|
+
export { AdtAuthError, AdtLink, BadiService, BasicAuthVerificationError, ChangesetService, CheckService, CheckinService, ClassicBadiService, CtsTransportLifecycleService, CtsTransportMetadataService, DEFAULT_CHECK_SOURCE_VERSION, ExactSourceHistoryService, ExactSourceHistoryServiceError, GetSourceTooLargeError, ImportService, Link, PackageLink, __getTestAdtClient, __setTestAdtClient, adtLink, applyPlan, buildPlan, classifyTier, clearConfigCache, consoleLogger, createChangeset, createProgressReporter, dedupeCtsInventoryToOwners, diffObject, flattenPlanObjects, getAdtClientV2, getAdtClientV2Safe, getAdtSystem, getAuthManager, getBadiInfo, getCaptured, getCliContext, getConfig, getDefaultSid, getDestination, getLockService, getSource, hasDestination, hyperlink, isExpired, link, listAvailableSids, listDestinations, loadAuthSession, loadFormatPlugin, lockStore, normalizeClassicBadiMetadata, normalizeCtsTransport, normalizeSearchResults, packageLink, parseEnhancementImplementation, parseFormatSpec, parseTransportNumbers, planCtsScope, refreshCredentials, resetCaptured, resetCliContext, resolveAdtHeadersTimeoutMs, resolveConnectionClient, resolveObjectUri, resolvePackageForFormatId, saveAuthSession, setAdtSystem, setCaptured, setCliContext, setDefaultSid, silentLogger, toMetadataOnlySourceVersionListing, toMetadataOnlyTransportSourceManifest, verifyBasicAuth };
|
|
3451
3709
|
//# sourceMappingURL=index.mjs.map
|