@ue-shed/map-history 0.1.0
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/LICENSE +21 -0
- package/README.md +47 -0
- package/dist/baseline-materialization.d.ts +17 -0
- package/dist/baseline-materialization.d.ts.map +1 -0
- package/dist/baseline-materialization.js +86 -0
- package/dist/baseline-materialization.js.map +1 -0
- package/dist/diff.d.ts +7 -0
- package/dist/diff.d.ts.map +1 -0
- package/dist/diff.js +159 -0
- package/dist/diff.js.map +1 -0
- package/dist/errors.d.ts +14 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +27 -0
- package/dist/errors.js.map +1 -0
- package/dist/fast-history-target.d.ts +61 -0
- package/dist/fast-history-target.d.ts.map +1 -0
- package/dist/fast-history-target.js +248 -0
- package/dist/fast-history-target.js.map +1 -0
- package/dist/historical-project-tree.d.ts +18 -0
- package/dist/historical-project-tree.d.ts.map +1 -0
- package/dist/historical-project-tree.js +123 -0
- package/dist/historical-project-tree.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/map-history.d.ts +24 -0
- package/dist/map-history.d.ts.map +1 -0
- package/dist/map-history.js +365 -0
- package/dist/map-history.js.map +1 -0
- package/dist/package-correlation.d.ts +16 -0
- package/dist/package-correlation.d.ts.map +1 -0
- package/dist/package-correlation.js +76 -0
- package/dist/package-correlation.js.map +1 -0
- package/dist/perforce-map-scope.d.ts +56 -0
- package/dist/perforce-map-scope.d.ts.map +1 -0
- package/dist/perforce-map-scope.js +284 -0
- package/dist/perforce-map-scope.js.map +1 -0
- package/dist/perforce.d.ts +105 -0
- package/dist/perforce.d.ts.map +1 -0
- package/dist/perforce.js +441 -0
- package/dist/perforce.js.map +1 -0
- package/dist/playback.d.ts +60 -0
- package/dist/playback.d.ts.map +1 -0
- package/dist/playback.js +168 -0
- package/dist/playback.js.map +1 -0
- package/dist/revision-materialization.d.ts +14 -0
- package/dist/revision-materialization.d.ts.map +1 -0
- package/dist/revision-materialization.js +68 -0
- package/dist/revision-materialization.js.map +1 -0
- package/dist/revision-plan.d.ts +44 -0
- package/dist/revision-plan.d.ts.map +1 -0
- package/dist/revision-plan.js +84 -0
- package/dist/revision-plan.js.map +1 -0
- package/dist/schema.d.ts +7964 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +292 -0
- package/dist/schema.js.map +1 -0
- package/dist/submitted-change-selection.d.ts +22 -0
- package/dist/submitted-change-selection.d.ts.map +1 -0
- package/dist/submitted-change-selection.js +101 -0
- package/dist/submitted-change-selection.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { isAbsolute, relative, resolve } from "node:path";
|
|
2
|
+
import { AssetReader } from "@ue-shed/unreal-assets";
|
|
3
|
+
import { Effect } from "effect";
|
|
4
|
+
import { MapHistoryError } from "./errors.js";
|
|
5
|
+
import { PerforceHistorySource } from "./perforce.js";
|
|
6
|
+
export const MAX_DIRECT_MAP_MOVES = 16;
|
|
7
|
+
function savedWorldError(error) {
|
|
8
|
+
return new MapHistoryError({
|
|
9
|
+
kind: error.kind === "resource_limit" ? "resource_limit" : "saved_world_decode",
|
|
10
|
+
message: `Could not resolve the saved map scope: ${error.message}`,
|
|
11
|
+
recovery: error.kind === "resource_limit"
|
|
12
|
+
? "Narrow the map scope or raise maxPackages explicitly."
|
|
13
|
+
: "Confirm that the selected map can be read from the project and retry.",
|
|
14
|
+
retrySafe: error.retrySafe
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function invalidScope(message) {
|
|
18
|
+
return new MapHistoryError({
|
|
19
|
+
kind: "invalid_target",
|
|
20
|
+
message,
|
|
21
|
+
recovery: "Select a map and external-actor root contained by the project root.",
|
|
22
|
+
retrySafe: false
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function depotSubtree(root) {
|
|
26
|
+
return `${root.replace(/\/+$/, "")}/...`;
|
|
27
|
+
}
|
|
28
|
+
function depotPackageFileSpec(depotPath) {
|
|
29
|
+
const extensionIndex = depotPath.lastIndexOf(".");
|
|
30
|
+
const separatorIndex = depotPath.lastIndexOf("/");
|
|
31
|
+
return extensionIndex > separatorIndex ? `${depotPath.slice(0, extensionIndex)}.*` : depotPath;
|
|
32
|
+
}
|
|
33
|
+
function normalizeDepotRoot(path) {
|
|
34
|
+
return path.replace(/\/+$/, "");
|
|
35
|
+
}
|
|
36
|
+
function normalizeLocalPath(path) {
|
|
37
|
+
return process.platform === "win32" && path.startsWith("\\\\?\\") ? path.slice(4) : path;
|
|
38
|
+
}
|
|
39
|
+
function projectRelativePath(projectRoot, localPath) {
|
|
40
|
+
const resolvedProjectRoot = resolve(normalizeLocalPath(projectRoot));
|
|
41
|
+
const resolvedPath = resolve(normalizeLocalPath(localPath));
|
|
42
|
+
const path = relative(resolvedProjectRoot, resolvedPath);
|
|
43
|
+
if (path.length === 0 ||
|
|
44
|
+
isAbsolute(path) ||
|
|
45
|
+
path === ".." ||
|
|
46
|
+
path.startsWith("..\\") ||
|
|
47
|
+
path.startsWith("../")) {
|
|
48
|
+
throw invalidScope(`${localPath} is not a file or directory inside ${projectRoot}.`);
|
|
49
|
+
}
|
|
50
|
+
return path.replaceAll("\\", "/");
|
|
51
|
+
}
|
|
52
|
+
function packageNameForProjectPath(projectRelativePath) {
|
|
53
|
+
const normalized = projectRelativePath.replaceAll("\\", "/");
|
|
54
|
+
if (!normalized.startsWith("Content/"))
|
|
55
|
+
return undefined;
|
|
56
|
+
const sourcePath = normalized.slice("Content/".length);
|
|
57
|
+
const extension = /(?:\.(?:uasset|umap|uexp|uptnl)|(?:\.m)?\.ubulk)$/i;
|
|
58
|
+
if (!extension.test(sourcePath))
|
|
59
|
+
return undefined;
|
|
60
|
+
return `/Game/${sourcePath.replace(extension, "")}`;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Converts a `/Game/...` package name to the project-relative saved package path for a primary
|
|
64
|
+
* `.uasset` or `.umap` file. Companion sidecar extensions are derived later from depot listings.
|
|
65
|
+
*/
|
|
66
|
+
export function projectRelativePathForPackageName(packageName, extension) {
|
|
67
|
+
if (!packageName.startsWith("/Game/"))
|
|
68
|
+
return undefined;
|
|
69
|
+
const rest = packageName.slice("/Game/".length);
|
|
70
|
+
if (rest.length === 0 ||
|
|
71
|
+
rest.includes("\\") ||
|
|
72
|
+
rest.split("/").some((part) => part.length === 0 || part === "." || part === "..")) {
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
return `Content/${rest}${extension}`;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Converts a depot path to one exact, supported saved-package file in the selected map scope.
|
|
79
|
+
* Paths outside the map or current external-actor subtree, including unrelated depot metadata,
|
|
80
|
+
* deliberately return `undefined` rather than becoming historical project files.
|
|
81
|
+
*/
|
|
82
|
+
export function scopedPerforceFile(scope, depotPath) {
|
|
83
|
+
const mapExtensionIndex = scope.mapDepotPath.lastIndexOf(".");
|
|
84
|
+
const mapDepotStem = mapExtensionIndex > scope.mapDepotPath.lastIndexOf("/")
|
|
85
|
+
? scope.mapDepotPath.slice(0, mapExtensionIndex)
|
|
86
|
+
: scope.mapDepotPath;
|
|
87
|
+
const mapRelativeExtensionIndex = scope.mapProjectRelativePath.lastIndexOf(".");
|
|
88
|
+
const mapProjectRelativeStem = mapRelativeExtensionIndex > scope.mapProjectRelativePath.lastIndexOf("/")
|
|
89
|
+
? scope.mapProjectRelativePath.slice(0, mapRelativeExtensionIndex)
|
|
90
|
+
: scope.mapProjectRelativePath;
|
|
91
|
+
const mapSuffix = depotPath.startsWith(`${mapDepotStem}.`)
|
|
92
|
+
? depotPath.slice(mapDepotStem.length)
|
|
93
|
+
: undefined;
|
|
94
|
+
if (depotPath === scope.mapDepotPath ||
|
|
95
|
+
(mapSuffix !== undefined && /(?:\.(?:umap|uexp|uptnl)|(?:\.m)?\.ubulk)$/i.test(mapSuffix))) {
|
|
96
|
+
return {
|
|
97
|
+
depotPath,
|
|
98
|
+
packageName: scope.mapPackageName,
|
|
99
|
+
projectRelativePath: depotPath === scope.mapDepotPath
|
|
100
|
+
? scope.mapProjectRelativePath
|
|
101
|
+
: `${mapProjectRelativeStem}${mapSuffix}`
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
if (scope.externalActorDepotRoot === undefined ||
|
|
105
|
+
scope.externalActorProjectRoot === undefined) {
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
const externalRoot = normalizeDepotRoot(scope.externalActorDepotRoot);
|
|
109
|
+
if (!depotPath.startsWith(`${externalRoot}/`))
|
|
110
|
+
return undefined;
|
|
111
|
+
const suffix = depotPath.slice(externalRoot.length + 1);
|
|
112
|
+
if (suffix.length === 0 ||
|
|
113
|
+
suffix.includes("\\") ||
|
|
114
|
+
suffix.split("/").some((part) => part === "." || part === "..")) {
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
const projectRelativePath = `${scope.externalActorProjectRoot}/${suffix}`;
|
|
118
|
+
const packageName = packageNameForProjectPath(projectRelativePath);
|
|
119
|
+
if (packageName === undefined)
|
|
120
|
+
return undefined;
|
|
121
|
+
if (scope.allowedPackageNames !== undefined && !scope.allowedPackageNames.has(packageName)) {
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
return { depotPath, packageName, projectRelativePath };
|
|
125
|
+
}
|
|
126
|
+
/** Resolves the selected saved map and its present-day World Partition actor subtree to P4 scopes. */
|
|
127
|
+
export function resolvePerforceMapScope(query) {
|
|
128
|
+
return Effect.fn("MapHistory.resolvePerforceMapScope")(function* () {
|
|
129
|
+
const { scope } = yield* resolvePresentDayMapScope(query);
|
|
130
|
+
return scope;
|
|
131
|
+
})();
|
|
132
|
+
}
|
|
133
|
+
/** Resolves only direct map moves and keeps every resulting location inside the selected project. */
|
|
134
|
+
export function resolvePerforceMapLineage(options) {
|
|
135
|
+
return Effect.fn("MapHistory.resolvePerforceMapLineage")(function* () {
|
|
136
|
+
const source = yield* PerforceHistorySource;
|
|
137
|
+
if (source.resolveMapLineage === undefined) {
|
|
138
|
+
return { locations: [options.scope], moves: [] };
|
|
139
|
+
}
|
|
140
|
+
const lineage = yield* source.resolveMapLineage({
|
|
141
|
+
depotPath: options.scope.mapDepotPath,
|
|
142
|
+
maxMoves: MAX_DIRECT_MAP_MOVES,
|
|
143
|
+
maxRevisionRecords: options.limits.maxChangelists + MAX_DIRECT_MAP_MOVES + 2
|
|
144
|
+
});
|
|
145
|
+
if (lineage.locations.length === 0) {
|
|
146
|
+
return yield* Effect.fail(new MapHistoryError({
|
|
147
|
+
kind: "ambiguous_map_lineage",
|
|
148
|
+
message: `Perforce returned no direct lineage location for ${options.scope.mapDepotPath}.`,
|
|
149
|
+
recovery: "Inspect the selected map's Perforce filelog and retry.",
|
|
150
|
+
retrySafe: false
|
|
151
|
+
}));
|
|
152
|
+
}
|
|
153
|
+
if (lineage.moves.length === 0) {
|
|
154
|
+
if (lineage.locations.length !== 1 ||
|
|
155
|
+
lineage.locations[0]?.depotPath !== options.scope.mapDepotPath) {
|
|
156
|
+
return yield* Effect.fail(new MapHistoryError({
|
|
157
|
+
kind: "ambiguous_map_lineage",
|
|
158
|
+
message: `Perforce returned an inconsistent direct lineage for ${options.scope.mapDepotPath}.`,
|
|
159
|
+
recovery: "Inspect the selected map's Perforce filelog and retry.",
|
|
160
|
+
retrySafe: false
|
|
161
|
+
}));
|
|
162
|
+
}
|
|
163
|
+
return { locations: [options.scope], moves: [] };
|
|
164
|
+
}
|
|
165
|
+
if (lineage.moves.length > 0 && options.scope.sourceKind === "world_partition") {
|
|
166
|
+
return yield* Effect.fail(new MapHistoryError({
|
|
167
|
+
kind: "unsupported_history_layout",
|
|
168
|
+
message: "Direct map relocation currently cannot prove the matching historical World Partition external-actor roots.",
|
|
169
|
+
recovery: "Choose a range after the World Partition map move, or use a conventional saved map.",
|
|
170
|
+
retrySafe: false
|
|
171
|
+
}));
|
|
172
|
+
}
|
|
173
|
+
const locations = [];
|
|
174
|
+
for (const location of lineage.locations) {
|
|
175
|
+
const mapProjectRelativePath = yield* Effect.try({
|
|
176
|
+
try: () => projectRelativePath(options.projectRoot, location.localPath),
|
|
177
|
+
catch: (cause) => cause instanceof MapHistoryError
|
|
178
|
+
? cause
|
|
179
|
+
: invalidScope(`Could not resolve historical map location ${location.localPath} beneath the selected project.`)
|
|
180
|
+
});
|
|
181
|
+
const mapPackageName = packageNameForProjectPath(mapProjectRelativePath);
|
|
182
|
+
if (mapPackageName === undefined || !/\.umap$/iu.test(mapProjectRelativePath)) {
|
|
183
|
+
return yield* Effect.fail(new MapHistoryError({
|
|
184
|
+
kind: "ambiguous_map_lineage",
|
|
185
|
+
message: `Direct map move destination ${location.depotPath} is not a supported project .umap path.`,
|
|
186
|
+
recovery: "Inspect the selected map's direct Perforce move records and retry.",
|
|
187
|
+
retrySafe: false
|
|
188
|
+
}));
|
|
189
|
+
}
|
|
190
|
+
locations.push({
|
|
191
|
+
fileSpecs: [depotPackageFileSpec(location.depotPath)],
|
|
192
|
+
mapDepotPath: location.depotPath,
|
|
193
|
+
mapPackageName,
|
|
194
|
+
mapProjectRelativePath,
|
|
195
|
+
sourceKind: options.scope.sourceKind
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
for (const [index, move] of lineage.moves.entries()) {
|
|
199
|
+
const from = locations[index];
|
|
200
|
+
const to = locations[index + 1];
|
|
201
|
+
const previous = lineage.moves[index - 1];
|
|
202
|
+
if (from === undefined ||
|
|
203
|
+
to === undefined ||
|
|
204
|
+
move.fromDepotPath !== from.mapDepotPath ||
|
|
205
|
+
move.toDepotPath !== to.mapDepotPath ||
|
|
206
|
+
(previous !== undefined && previous.change >= move.change)) {
|
|
207
|
+
return yield* Effect.fail(new MapHistoryError({
|
|
208
|
+
kind: "ambiguous_map_lineage",
|
|
209
|
+
message: `Perforce returned an unordered direct move lineage for ${options.scope.mapDepotPath}.`,
|
|
210
|
+
recovery: "Inspect the selected map's direct Perforce move records and retry.",
|
|
211
|
+
retrySafe: false
|
|
212
|
+
}));
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return { locations, moves: lineage.moves };
|
|
216
|
+
})();
|
|
217
|
+
}
|
|
218
|
+
export function resolvePresentDayMapScope(query) {
|
|
219
|
+
return Effect.fn("MapHistory.resolvePresentDayMapScope")(function* () {
|
|
220
|
+
const reader = yield* AssetReader;
|
|
221
|
+
const perforce = yield* PerforceHistorySource;
|
|
222
|
+
const world = yield* reader
|
|
223
|
+
.readSavedWorld({
|
|
224
|
+
concurrency: query.limits.maxConcurrency,
|
|
225
|
+
mapPath: query.mapPath,
|
|
226
|
+
maximumAssets: query.limits.maxPackages,
|
|
227
|
+
projectRoot: query.projectRoot
|
|
228
|
+
})
|
|
229
|
+
.pipe(Effect.mapError(savedWorldError));
|
|
230
|
+
const mapLocalPath = resolve(query.projectRoot, query.mapPath);
|
|
231
|
+
const mapProjectRelativePath = yield* Effect.try({
|
|
232
|
+
try: () => projectRelativePath(query.projectRoot, mapLocalPath),
|
|
233
|
+
catch: (cause) => cause instanceof MapHistoryError
|
|
234
|
+
? cause
|
|
235
|
+
: invalidScope(`Could not resolve ${query.mapPath} beneath the selected project.`)
|
|
236
|
+
});
|
|
237
|
+
const mapMapping = yield* perforce.resolveLocalPath(mapLocalPath);
|
|
238
|
+
if (world.externalActorRoot === undefined) {
|
|
239
|
+
if (world.sourceKind === "world_partition") {
|
|
240
|
+
return yield* Effect.fail(new MapHistoryError({
|
|
241
|
+
kind: "saved_world_decode",
|
|
242
|
+
message: "The World Partition map did not report its external-actor root, so its actor history cannot be scoped safely.",
|
|
243
|
+
recovery: "Confirm the map's saved external-actor layout can be read, then retry.",
|
|
244
|
+
retrySafe: false
|
|
245
|
+
}));
|
|
246
|
+
}
|
|
247
|
+
return {
|
|
248
|
+
scope: {
|
|
249
|
+
fileSpecs: [depotPackageFileSpec(mapMapping.depotPath)],
|
|
250
|
+
mapDepotPath: mapMapping.depotPath,
|
|
251
|
+
mapPackageName: world.authority.mapPackage,
|
|
252
|
+
mapProjectRelativePath,
|
|
253
|
+
sourceKind: world.sourceKind
|
|
254
|
+
},
|
|
255
|
+
world
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
const externalActorRoot = normalizeLocalPath(world.externalActorRoot);
|
|
259
|
+
const externalActorProjectRoot = yield* Effect.try({
|
|
260
|
+
try: () => projectRelativePath(query.projectRoot, externalActorRoot),
|
|
261
|
+
catch: (cause) => cause instanceof MapHistoryError
|
|
262
|
+
? cause
|
|
263
|
+
: invalidScope("Could not resolve the external-actor root beneath the project.")
|
|
264
|
+
});
|
|
265
|
+
const externalActorMapping = yield* perforce.resolveLocalPath(externalActorRoot);
|
|
266
|
+
return {
|
|
267
|
+
scope: {
|
|
268
|
+
externalActorDepotRoot: normalizeDepotRoot(externalActorMapping.depotPath),
|
|
269
|
+
externalActorProjectRoot,
|
|
270
|
+
fileSpecs: [
|
|
271
|
+
depotPackageFileSpec(mapMapping.depotPath),
|
|
272
|
+
depotSubtree(externalActorMapping.depotPath)
|
|
273
|
+
],
|
|
274
|
+
mapDepotPath: mapMapping.depotPath,
|
|
275
|
+
mapPackageName: world.authority.mapPackage,
|
|
276
|
+
mapProjectRelativePath,
|
|
277
|
+
sourceKind: world.sourceKind
|
|
278
|
+
},
|
|
279
|
+
world
|
|
280
|
+
};
|
|
281
|
+
})();
|
|
282
|
+
}
|
|
283
|
+
export { depotPackageFileSpec };
|
|
284
|
+
//# sourceMappingURL=perforce-map-scope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"perforce-map-scope.js","sourceRoot":"","sources":["../src/perforce-map-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAyB,MAAM,wBAAwB,CAAC;AAE5E,OAAO,EAAE,M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AAU,CAAC,SAAS;oBAClC,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC,UAAU;oBAC1C,sBAAsB;oBACtB,UAAU,EAAE,KAAK,CAAC,UAAU;iBAC5B;gBACD,KAAK;aACL,CAAC;QACH,CAAC;QACD,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;QACtE,MAAM,wBAAwB,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;YAClD,GAAG,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,KAAK,CAAC,WAAW,EAAE,iBAAiB,CAAC;YACpE,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAChB,KAAK,YAAY,eAAe;gBAC/B,CAAC,CAAC,KAAK;gBACP,CAAC,CAAC,YAAY,CAAC,gEAAgE,CAAC;SAClF,CAAC,CAAC;QACH,MAAM,oBAAoB,GAAG,KAAK,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;QACjF,OAAO;YACN,KAAK,EAAE;gBACN,sBAAsB,EAAE,kBAAkB,CAAC,oBAAoB,CAAC,SAAS,CAAC;gBAC1E,wBAAwB;gBACxB,SAAS,EAAE;oBACV,oBAAoB,CAAC,UAAU,CAAC,SAAS,CAAC;oBAC1C,YAAY,CAAC,oBAAoB,CAAC,SAAS,CAAC;iBAC5C;gBACD,YAAY,EAAE,UAAU,CAAC,SAAS;gBAClC,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC,UAAU;gBAC1C,sBAAsB;gBACtB,UAAU,EAAE,KAAK,CAAC,UAAU;aAC5B;YACD,KAAK;SACL,CAAC;IACH,CAAC,CAAC,EAAE,CAAC;AACN,CAAC;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Context, Effect, Layer } from "effect";
|
|
2
|
+
import { type ListDepotFilesAtChangeOptions, type ListDepotFilesAtChangeResult, type ListSubmittedChangelistsOptions, type ListSubmittedChangelistsResult, type MaterializeDepotFilesOptions, type P4ChangelistDescription, type P4ClientOptions, type P4MaterializeResult } from "p4client-ts";
|
|
3
|
+
import { MapHistoryError } from "./errors.js";
|
|
4
|
+
export interface PerforceChangedFile {
|
|
5
|
+
readonly action: string;
|
|
6
|
+
readonly depotPath: string;
|
|
7
|
+
readonly revision: number | null;
|
|
8
|
+
readonly type: string | null;
|
|
9
|
+
}
|
|
10
|
+
export interface PerforceSubmittedChange {
|
|
11
|
+
readonly change: number;
|
|
12
|
+
readonly description?: string;
|
|
13
|
+
readonly submittedAt?: string;
|
|
14
|
+
readonly user?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface PerforceChangeDescription extends PerforceSubmittedChange {
|
|
17
|
+
readonly files: readonly PerforceChangedFile[];
|
|
18
|
+
readonly status: "pending" | "submitted";
|
|
19
|
+
}
|
|
20
|
+
export interface PerforceDepotFile {
|
|
21
|
+
readonly action: string;
|
|
22
|
+
readonly changelist: number;
|
|
23
|
+
readonly depotPath: string;
|
|
24
|
+
readonly revision: number;
|
|
25
|
+
readonly type: string;
|
|
26
|
+
}
|
|
27
|
+
export interface PerforceDepotSnapshot {
|
|
28
|
+
readonly files: readonly PerforceDepotFile[];
|
|
29
|
+
readonly hasMore: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface PerforceMaterializedFile {
|
|
32
|
+
readonly file: PerforceDepotFile;
|
|
33
|
+
readonly localPath: string;
|
|
34
|
+
}
|
|
35
|
+
export interface PerforceMaterialization {
|
|
36
|
+
readonly directory: string;
|
|
37
|
+
readonly files: readonly PerforceMaterializedFile[];
|
|
38
|
+
readonly totalCount: number;
|
|
39
|
+
}
|
|
40
|
+
export interface PerforceMaterializationOptions {
|
|
41
|
+
readonly concurrency?: number;
|
|
42
|
+
readonly directory: string;
|
|
43
|
+
readonly files: readonly PerforceDepotFile[];
|
|
44
|
+
readonly maxFiles: number;
|
|
45
|
+
}
|
|
46
|
+
export interface PerforceLocalMapping {
|
|
47
|
+
readonly depotPath: string;
|
|
48
|
+
}
|
|
49
|
+
export interface PerforceMapLocation {
|
|
50
|
+
readonly depotPath: string;
|
|
51
|
+
readonly localPath: string;
|
|
52
|
+
}
|
|
53
|
+
export interface PerforceMapMove {
|
|
54
|
+
readonly change: number;
|
|
55
|
+
readonly fromDepotPath: string;
|
|
56
|
+
readonly toDepotPath: string;
|
|
57
|
+
}
|
|
58
|
+
export interface PerforceMapLineage {
|
|
59
|
+
readonly locations: readonly PerforceMapLocation[];
|
|
60
|
+
readonly moves: readonly PerforceMapMove[];
|
|
61
|
+
}
|
|
62
|
+
export interface PerforceMapLineageOptions {
|
|
63
|
+
readonly depotPath: string;
|
|
64
|
+
readonly maxMoves: number;
|
|
65
|
+
readonly maxRevisionRecords: number;
|
|
66
|
+
}
|
|
67
|
+
export interface PerforceHistorySourceShape {
|
|
68
|
+
readonly describeChangelist: (change: number) => Effect.Effect<PerforceChangeDescription, MapHistoryError>;
|
|
69
|
+
readonly listDepotFilesAtChange: (options: ListDepotFilesAtChangeOptions) => Effect.Effect<PerforceDepotSnapshot, MapHistoryError>;
|
|
70
|
+
readonly listSubmittedChangelists: (options: ListSubmittedChangelistsOptions) => Effect.Effect<{
|
|
71
|
+
readonly hasMore: boolean;
|
|
72
|
+
readonly items: readonly PerforceSubmittedChange[];
|
|
73
|
+
readonly nextBeforeChange: number | null;
|
|
74
|
+
}, MapHistoryError>;
|
|
75
|
+
readonly materializeDepotFiles: (options: PerforceMaterializationOptions) => Effect.Effect<PerforceMaterialization, MapHistoryError>;
|
|
76
|
+
readonly resolveLocalPath: (localPath: string) => Effect.Effect<PerforceLocalMapping, MapHistoryError>;
|
|
77
|
+
/** Optional for narrow test sources; the live adapter always provides this capability. */
|
|
78
|
+
readonly resolveMapLineage?: (options: PerforceMapLineageOptions) => Effect.Effect<PerforceMapLineage, MapHistoryError>;
|
|
79
|
+
}
|
|
80
|
+
declare const PerforceHistorySource_base: Context.ServiceClass<PerforceHistorySource, "@ue-shed/map-history/PerforceHistorySource", PerforceHistorySourceShape>;
|
|
81
|
+
export declare class PerforceHistorySource extends PerforceHistorySource_base {
|
|
82
|
+
}
|
|
83
|
+
/** The selected project root used to resolve local Perforce configuration and workspace context. */
|
|
84
|
+
export declare const PerforceProjectContext: Context.Service<string, string>;
|
|
85
|
+
interface PerforceBackend {
|
|
86
|
+
readonly describeChangelist: (change: number) => Effect.Effect<P4ChangelistDescription, unknown>;
|
|
87
|
+
readonly listDepotFilesAtChange: (options: ListDepotFilesAtChangeOptions) => Effect.Effect<ListDepotFilesAtChangeResult, unknown>;
|
|
88
|
+
readonly listSubmittedChangelists: (options: ListSubmittedChangelistsOptions) => Effect.Effect<ListSubmittedChangelistsResult, unknown>;
|
|
89
|
+
readonly materializeDepotFiles: (options: MaterializeDepotFilesOptions) => Effect.Effect<P4MaterializeResult, unknown>;
|
|
90
|
+
}
|
|
91
|
+
type PerforceBackendResolver = (projectRoot: string | undefined) => PerforceBackend;
|
|
92
|
+
export declare function makePerforceHistorySource(backend: PerforceBackend | PerforceBackendResolver, resolveLocalPath?: PerforceHistorySourceShape["resolveLocalPath"], resolveMapLineage?: NonNullable<PerforceHistorySourceShape["resolveMapLineage"]>): PerforceHistorySourceShape;
|
|
93
|
+
/** Selects the client whose local workspace root is the selected project root. */
|
|
94
|
+
export declare function selectPerforceWorkspace(options: {
|
|
95
|
+
readonly configuredClient: string | null;
|
|
96
|
+
readonly projectRoot: string;
|
|
97
|
+
readonly workspaces: readonly {
|
|
98
|
+
readonly client: string;
|
|
99
|
+
readonly root: string;
|
|
100
|
+
}[];
|
|
101
|
+
}): string | undefined;
|
|
102
|
+
export declare function perforceHistorySourceLayer(options?: P4ClientOptions): Layer.Layer<PerforceHistorySource>;
|
|
103
|
+
export declare function makePerforceHistorySourceTestLayer(source: PerforceHistorySourceShape): Layer.Layer<PerforceHistorySource>;
|
|
104
|
+
export {};
|
|
105
|
+
//# sourceMappingURL=perforce.d.ts.map
|
|
@@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