@fern-api/generator-cli 0.6.3 → 0.6.4
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/cli.js +1695 -1665
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -4867,18 +4867,18 @@ var require_build3 = __commonJS({
|
|
|
4867
4867
|
var require_sync = __commonJS({
|
|
4868
4868
|
"../../node_modules/.pnpm/escalade@3.2.0/node_modules/escalade/sync/index.js"(exports2, module2) {
|
|
4869
4869
|
"use strict";
|
|
4870
|
-
var { dirname:
|
|
4870
|
+
var { dirname: dirname4, resolve: resolve8 } = require("path");
|
|
4871
4871
|
var { readdirSync: readdirSync2, statSync: statSync4 } = require("fs");
|
|
4872
4872
|
module2.exports = function(start, callback) {
|
|
4873
4873
|
let dir = resolve8(".", start);
|
|
4874
4874
|
let tmp3, stats = statSync4(dir);
|
|
4875
4875
|
if (!stats.isDirectory()) {
|
|
4876
|
-
dir =
|
|
4876
|
+
dir = dirname4(dir);
|
|
4877
4877
|
}
|
|
4878
4878
|
while (true) {
|
|
4879
4879
|
tmp3 = callback(dir, readdirSync2(dir));
|
|
4880
4880
|
if (tmp3) return resolve8(dir, tmp3);
|
|
4881
|
-
dir =
|
|
4881
|
+
dir = dirname4(tmp3 = dir);
|
|
4882
4882
|
if (tmp3 === dir) break;
|
|
4883
4883
|
}
|
|
4884
4884
|
};
|
|
@@ -4914,9 +4914,9 @@ var require_require_directory = __commonJS({
|
|
|
4914
4914
|
"../../node_modules/.pnpm/require-directory@2.1.1/node_modules/require-directory/index.js"(exports2, module2) {
|
|
4915
4915
|
"use strict";
|
|
4916
4916
|
var fs3 = require("fs");
|
|
4917
|
-
var
|
|
4917
|
+
var join9 = require("path").join;
|
|
4918
4918
|
var resolve8 = require("path").resolve;
|
|
4919
|
-
var
|
|
4919
|
+
var dirname4 = require("path").dirname;
|
|
4920
4920
|
var defaultOptions2 = {
|
|
4921
4921
|
extensions: ["js", "json", "coffee"],
|
|
4922
4922
|
recurse: true,
|
|
@@ -4949,9 +4949,9 @@ var require_require_directory = __commonJS({
|
|
|
4949
4949
|
options[prop] = defaultOptions2[prop];
|
|
4950
4950
|
}
|
|
4951
4951
|
}
|
|
4952
|
-
path5 = !path5 ?
|
|
4952
|
+
path5 = !path5 ? dirname4(m.filename) : resolve8(dirname4(m.filename), path5);
|
|
4953
4953
|
fs3.readdirSync(path5).forEach(function(filename) {
|
|
4954
|
-
var joined =
|
|
4954
|
+
var joined = join9(path5, filename), files, key, obj;
|
|
4955
4955
|
if (fs3.statSync(joined).isDirectory() && options.recurse) {
|
|
4956
4956
|
files = requireDirectory(m, joined, options);
|
|
4957
4957
|
if (Object.keys(files).length) {
|
|
@@ -6604,7 +6604,7 @@ var require_ms = __commonJS({
|
|
|
6604
6604
|
options = options || {};
|
|
6605
6605
|
var type = typeof val;
|
|
6606
6606
|
if (type === "string" && val.length > 0) {
|
|
6607
|
-
return
|
|
6607
|
+
return parse3(val);
|
|
6608
6608
|
} else if (type === "number" && isFinite(val)) {
|
|
6609
6609
|
return options.long ? fmtLong(val) : fmtShort(val);
|
|
6610
6610
|
}
|
|
@@ -6612,7 +6612,7 @@ var require_ms = __commonJS({
|
|
|
6612
6612
|
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
6613
6613
|
);
|
|
6614
6614
|
};
|
|
6615
|
-
function
|
|
6615
|
+
function parse3(str) {
|
|
6616
6616
|
str = String(str);
|
|
6617
6617
|
if (str.length > 100) {
|
|
6618
6618
|
return;
|
|
@@ -7387,11 +7387,11 @@ var require_src2 = __commonJS({
|
|
|
7387
7387
|
var require_dist = __commonJS({
|
|
7388
7388
|
"../../node_modules/.pnpm/@kwsites+file-exists@1.1.1/node_modules/@kwsites/file-exists/dist/index.js"(exports2) {
|
|
7389
7389
|
"use strict";
|
|
7390
|
-
function
|
|
7390
|
+
function __export4(m) {
|
|
7391
7391
|
for (var p in m) if (!exports2.hasOwnProperty(p)) exports2[p] = m[p];
|
|
7392
7392
|
}
|
|
7393
7393
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7394
|
-
|
|
7394
|
+
__export4(require_src2());
|
|
7395
7395
|
}
|
|
7396
7396
|
});
|
|
7397
7397
|
|
|
@@ -7654,7 +7654,7 @@ function parseStringResponse(result, parsers12, texts, trim = true) {
|
|
|
7654
7654
|
}
|
|
7655
7655
|
return lines[i + offset];
|
|
7656
7656
|
};
|
|
7657
|
-
parsers12.some(({ parse:
|
|
7657
|
+
parsers12.some(({ parse: parse3 }) => parse3(line, result));
|
|
7658
7658
|
}
|
|
7659
7659
|
});
|
|
7660
7660
|
return result;
|
|
@@ -11885,361 +11885,99 @@ var init_esm4 = __esm({
|
|
|
11885
11885
|
}
|
|
11886
11886
|
});
|
|
11887
11887
|
|
|
11888
|
-
// ../../node_modules/.pnpm/
|
|
11889
|
-
var
|
|
11890
|
-
"../../node_modules/.pnpm/
|
|
11888
|
+
// ../../node_modules/.pnpm/fast-content-type-parse@3.0.0/node_modules/fast-content-type-parse/index.js
|
|
11889
|
+
var require_fast_content_type_parse = __commonJS({
|
|
11890
|
+
"../../node_modules/.pnpm/fast-content-type-parse@3.0.0/node_modules/fast-content-type-parse/index.js"(exports2, module2) {
|
|
11891
11891
|
"use strict";
|
|
11892
|
-
|
|
11893
|
-
|
|
11894
|
-
|
|
11895
|
-
|
|
11896
|
-
|
|
11897
|
-
|
|
11898
|
-
|
|
11899
|
-
|
|
11900
|
-
|
|
11901
|
-
|
|
11902
|
-
|
|
11903
|
-
|
|
11904
|
-
}
|
|
11905
|
-
|
|
11906
|
-
|
|
11907
|
-
|
|
11908
|
-
|
|
11909
|
-
|
|
11910
|
-
|
|
11911
|
-
|
|
11912
|
-
|
|
11913
|
-
}
|
|
11914
|
-
}
|
|
11915
|
-
});
|
|
11916
|
-
|
|
11917
|
-
// ../../node_modules/.pnpm/before-after-hook@2.2.3/node_modules/before-after-hook/lib/add.js
|
|
11918
|
-
var require_add = __commonJS({
|
|
11919
|
-
"../../node_modules/.pnpm/before-after-hook@2.2.3/node_modules/before-after-hook/lib/add.js"(exports2, module2) {
|
|
11920
|
-
"use strict";
|
|
11921
|
-
module2.exports = addHook;
|
|
11922
|
-
function addHook(state, kind, name, hook2) {
|
|
11923
|
-
var orig = hook2;
|
|
11924
|
-
if (!state.registry[name]) {
|
|
11925
|
-
state.registry[name] = [];
|
|
11926
|
-
}
|
|
11927
|
-
if (kind === "before") {
|
|
11928
|
-
hook2 = function(method, options) {
|
|
11929
|
-
return Promise.resolve().then(orig.bind(null, options)).then(method.bind(null, options));
|
|
11930
|
-
};
|
|
11931
|
-
}
|
|
11932
|
-
if (kind === "after") {
|
|
11933
|
-
hook2 = function(method, options) {
|
|
11934
|
-
var result;
|
|
11935
|
-
return Promise.resolve().then(method.bind(null, options)).then(function(result_) {
|
|
11936
|
-
result = result_;
|
|
11937
|
-
return orig(result, options);
|
|
11938
|
-
}).then(function() {
|
|
11939
|
-
return result;
|
|
11940
|
-
});
|
|
11941
|
-
};
|
|
11942
|
-
}
|
|
11943
|
-
if (kind === "error") {
|
|
11944
|
-
hook2 = function(method, options) {
|
|
11945
|
-
return Promise.resolve().then(method.bind(null, options)).catch(function(error) {
|
|
11946
|
-
return orig(error, options);
|
|
11947
|
-
});
|
|
11948
|
-
};
|
|
11949
|
-
}
|
|
11950
|
-
state.registry[name].push({
|
|
11951
|
-
hook: hook2,
|
|
11952
|
-
orig
|
|
11953
|
-
});
|
|
11954
|
-
}
|
|
11955
|
-
}
|
|
11956
|
-
});
|
|
11957
|
-
|
|
11958
|
-
// ../../node_modules/.pnpm/before-after-hook@2.2.3/node_modules/before-after-hook/lib/remove.js
|
|
11959
|
-
var require_remove = __commonJS({
|
|
11960
|
-
"../../node_modules/.pnpm/before-after-hook@2.2.3/node_modules/before-after-hook/lib/remove.js"(exports2, module2) {
|
|
11961
|
-
"use strict";
|
|
11962
|
-
module2.exports = removeHook;
|
|
11963
|
-
function removeHook(state, name, method) {
|
|
11964
|
-
if (!state.registry[name]) {
|
|
11965
|
-
return;
|
|
11966
|
-
}
|
|
11967
|
-
var index = state.registry[name].map(function(registered) {
|
|
11968
|
-
return registered.orig;
|
|
11969
|
-
}).indexOf(method);
|
|
11970
|
-
if (index === -1) {
|
|
11971
|
-
return;
|
|
11972
|
-
}
|
|
11973
|
-
state.registry[name].splice(index, 1);
|
|
11974
|
-
}
|
|
11975
|
-
}
|
|
11976
|
-
});
|
|
11977
|
-
|
|
11978
|
-
// ../../node_modules/.pnpm/before-after-hook@2.2.3/node_modules/before-after-hook/index.js
|
|
11979
|
-
var require_before_after_hook = __commonJS({
|
|
11980
|
-
"../../node_modules/.pnpm/before-after-hook@2.2.3/node_modules/before-after-hook/index.js"(exports2, module2) {
|
|
11981
|
-
"use strict";
|
|
11982
|
-
var register = require_register();
|
|
11983
|
-
var addHook = require_add();
|
|
11984
|
-
var removeHook = require_remove();
|
|
11985
|
-
var bind = Function.bind;
|
|
11986
|
-
var bindable = bind.bind(bind);
|
|
11987
|
-
function bindApi(hook2, state, name) {
|
|
11988
|
-
var removeHookRef = bindable(removeHook, null).apply(
|
|
11989
|
-
null,
|
|
11990
|
-
name ? [state, name] : [state]
|
|
11991
|
-
);
|
|
11992
|
-
hook2.api = { remove: removeHookRef };
|
|
11993
|
-
hook2.remove = removeHookRef;
|
|
11994
|
-
["before", "error", "after", "wrap"].forEach(function(kind) {
|
|
11995
|
-
var args = name ? [state, kind, name] : [state, kind];
|
|
11996
|
-
hook2[kind] = hook2.api[kind] = bindable(addHook, null).apply(null, args);
|
|
11997
|
-
});
|
|
11998
|
-
}
|
|
11999
|
-
function HookSingular() {
|
|
12000
|
-
var singularHookName = "h";
|
|
12001
|
-
var singularHookState = {
|
|
12002
|
-
registry: {}
|
|
12003
|
-
};
|
|
12004
|
-
var singularHook = register.bind(null, singularHookState, singularHookName);
|
|
12005
|
-
bindApi(singularHook, singularHookState, singularHookName);
|
|
12006
|
-
return singularHook;
|
|
12007
|
-
}
|
|
12008
|
-
function HookCollection() {
|
|
12009
|
-
var state = {
|
|
12010
|
-
registry: {}
|
|
11892
|
+
var NullObject = function NullObject2() {
|
|
11893
|
+
};
|
|
11894
|
+
NullObject.prototype = /* @__PURE__ */ Object.create(null);
|
|
11895
|
+
var paramRE = /; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu;
|
|
11896
|
+
var quotedPairRE = /\\([\v\u0020-\u00ff])/gu;
|
|
11897
|
+
var mediaTypeRE = /^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u;
|
|
11898
|
+
var defaultContentType = { type: "", parameters: new NullObject() };
|
|
11899
|
+
Object.freeze(defaultContentType.parameters);
|
|
11900
|
+
Object.freeze(defaultContentType);
|
|
11901
|
+
function parse3(header) {
|
|
11902
|
+
if (typeof header !== "string") {
|
|
11903
|
+
throw new TypeError("argument header is required and must be a string");
|
|
11904
|
+
}
|
|
11905
|
+
let index = header.indexOf(";");
|
|
11906
|
+
const type = index !== -1 ? header.slice(0, index).trim() : header.trim();
|
|
11907
|
+
if (mediaTypeRE.test(type) === false) {
|
|
11908
|
+
throw new TypeError("invalid media type");
|
|
11909
|
+
}
|
|
11910
|
+
const result = {
|
|
11911
|
+
type: type.toLowerCase(),
|
|
11912
|
+
parameters: new NullObject()
|
|
12011
11913
|
};
|
|
12012
|
-
|
|
12013
|
-
|
|
12014
|
-
return hook2;
|
|
12015
|
-
}
|
|
12016
|
-
var collectionHookDeprecationMessageDisplayed = false;
|
|
12017
|
-
function Hook() {
|
|
12018
|
-
if (!collectionHookDeprecationMessageDisplayed) {
|
|
12019
|
-
console.warn(
|
|
12020
|
-
'[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4'
|
|
12021
|
-
);
|
|
12022
|
-
collectionHookDeprecationMessageDisplayed = true;
|
|
11914
|
+
if (index === -1) {
|
|
11915
|
+
return result;
|
|
12023
11916
|
}
|
|
12024
|
-
|
|
12025
|
-
|
|
12026
|
-
|
|
12027
|
-
|
|
12028
|
-
|
|
12029
|
-
|
|
12030
|
-
|
|
12031
|
-
module2.exports.Collection = Hook.Collection;
|
|
12032
|
-
}
|
|
12033
|
-
});
|
|
12034
|
-
|
|
12035
|
-
// ../../node_modules/.pnpm/wrappy@1.0.2/node_modules/wrappy/wrappy.js
|
|
12036
|
-
var require_wrappy = __commonJS({
|
|
12037
|
-
"../../node_modules/.pnpm/wrappy@1.0.2/node_modules/wrappy/wrappy.js"(exports2, module2) {
|
|
12038
|
-
"use strict";
|
|
12039
|
-
module2.exports = wrappy;
|
|
12040
|
-
function wrappy(fn, cb) {
|
|
12041
|
-
if (fn && cb) return wrappy(fn)(cb);
|
|
12042
|
-
if (typeof fn !== "function")
|
|
12043
|
-
throw new TypeError("need wrapper function");
|
|
12044
|
-
Object.keys(fn).forEach(function(k) {
|
|
12045
|
-
wrapper[k] = fn[k];
|
|
12046
|
-
});
|
|
12047
|
-
return wrapper;
|
|
12048
|
-
function wrapper() {
|
|
12049
|
-
var args = new Array(arguments.length);
|
|
12050
|
-
for (var i = 0; i < args.length; i++) {
|
|
12051
|
-
args[i] = arguments[i];
|
|
12052
|
-
}
|
|
12053
|
-
var ret = fn.apply(this, args);
|
|
12054
|
-
var cb2 = args[args.length - 1];
|
|
12055
|
-
if (typeof ret === "function" && ret !== cb2) {
|
|
12056
|
-
Object.keys(cb2).forEach(function(k) {
|
|
12057
|
-
ret[k] = cb2[k];
|
|
12058
|
-
});
|
|
11917
|
+
let key;
|
|
11918
|
+
let match2;
|
|
11919
|
+
let value;
|
|
11920
|
+
paramRE.lastIndex = index;
|
|
11921
|
+
while (match2 = paramRE.exec(header)) {
|
|
11922
|
+
if (match2.index !== index) {
|
|
11923
|
+
throw new TypeError("invalid parameter format");
|
|
12059
11924
|
}
|
|
12060
|
-
|
|
12061
|
-
|
|
12062
|
-
|
|
12063
|
-
|
|
12064
|
-
|
|
12065
|
-
|
|
12066
|
-
// ../../node_modules/.pnpm/once@1.4.0/node_modules/once/once.js
|
|
12067
|
-
var require_once = __commonJS({
|
|
12068
|
-
"../../node_modules/.pnpm/once@1.4.0/node_modules/once/once.js"(exports2, module2) {
|
|
12069
|
-
"use strict";
|
|
12070
|
-
var wrappy = require_wrappy();
|
|
12071
|
-
module2.exports = wrappy(once2);
|
|
12072
|
-
module2.exports.strict = wrappy(onceStrict);
|
|
12073
|
-
once2.proto = once2(function() {
|
|
12074
|
-
Object.defineProperty(Function.prototype, "once", {
|
|
12075
|
-
value: function() {
|
|
12076
|
-
return once2(this);
|
|
12077
|
-
},
|
|
12078
|
-
configurable: true
|
|
12079
|
-
});
|
|
12080
|
-
Object.defineProperty(Function.prototype, "onceStrict", {
|
|
12081
|
-
value: function() {
|
|
12082
|
-
return onceStrict(this);
|
|
12083
|
-
},
|
|
12084
|
-
configurable: true
|
|
12085
|
-
});
|
|
12086
|
-
});
|
|
12087
|
-
function once2(fn) {
|
|
12088
|
-
var f = function() {
|
|
12089
|
-
if (f.called) return f.value;
|
|
12090
|
-
f.called = true;
|
|
12091
|
-
return f.value = fn.apply(this, arguments);
|
|
12092
|
-
};
|
|
12093
|
-
f.called = false;
|
|
12094
|
-
return f;
|
|
12095
|
-
}
|
|
12096
|
-
function onceStrict(fn) {
|
|
12097
|
-
var f = function() {
|
|
12098
|
-
if (f.called)
|
|
12099
|
-
throw new Error(f.onceError);
|
|
12100
|
-
f.called = true;
|
|
12101
|
-
return f.value = fn.apply(this, arguments);
|
|
12102
|
-
};
|
|
12103
|
-
var name = fn.name || "Function wrapped with `once`";
|
|
12104
|
-
f.onceError = name + " shouldn't be called more than once";
|
|
12105
|
-
f.called = false;
|
|
12106
|
-
return f;
|
|
12107
|
-
}
|
|
12108
|
-
}
|
|
12109
|
-
});
|
|
12110
|
-
|
|
12111
|
-
// ../../node_modules/.pnpm/@fern-api+replay@0.6.0/node_modules/@fern-api/replay/dist/git/GitClient.js
|
|
12112
|
-
var GitClient_exports = {};
|
|
12113
|
-
__export(GitClient_exports, {
|
|
12114
|
-
GitClient: () => GitClient
|
|
12115
|
-
});
|
|
12116
|
-
var GitClient;
|
|
12117
|
-
var init_GitClient = __esm({
|
|
12118
|
-
"../../node_modules/.pnpm/@fern-api+replay@0.6.0/node_modules/@fern-api/replay/dist/git/GitClient.js"() {
|
|
12119
|
-
"use strict";
|
|
12120
|
-
init_esm4();
|
|
12121
|
-
GitClient = class {
|
|
12122
|
-
git;
|
|
12123
|
-
repoPath;
|
|
12124
|
-
constructor(repoPath) {
|
|
12125
|
-
this.repoPath = repoPath;
|
|
12126
|
-
this.git = simpleGit(repoPath);
|
|
12127
|
-
}
|
|
12128
|
-
async exec(args) {
|
|
12129
|
-
return this.git.raw(args);
|
|
12130
|
-
}
|
|
12131
|
-
async execWithInput(args, input) {
|
|
12132
|
-
const { spawn: spawn2 } = await import("child_process");
|
|
12133
|
-
return new Promise((resolve8, reject) => {
|
|
12134
|
-
const proc = spawn2("git", args, { cwd: this.repoPath });
|
|
12135
|
-
let stdout = "";
|
|
12136
|
-
let stderr = "";
|
|
12137
|
-
proc.stdout.on("data", (data) => {
|
|
12138
|
-
stdout += data.toString();
|
|
12139
|
-
});
|
|
12140
|
-
proc.stderr.on("data", (data) => {
|
|
12141
|
-
stderr += data.toString();
|
|
12142
|
-
});
|
|
12143
|
-
proc.on("close", (code) => {
|
|
12144
|
-
if (code === 0) {
|
|
12145
|
-
resolve8(stdout);
|
|
12146
|
-
} else {
|
|
12147
|
-
reject(new Error(`git ${args.join(" ")} failed (code ${code}): ${stderr}`));
|
|
12148
|
-
}
|
|
12149
|
-
});
|
|
12150
|
-
proc.stdin.write(input);
|
|
12151
|
-
proc.stdin.end();
|
|
12152
|
-
});
|
|
12153
|
-
}
|
|
12154
|
-
async formatPatch(commitSha) {
|
|
12155
|
-
return this.exec(["format-patch", "-1", commitSha, "--stdout"]);
|
|
12156
|
-
}
|
|
12157
|
-
async applyPatch(patchContent) {
|
|
12158
|
-
await this.execWithInput(["am", "--3way"], patchContent);
|
|
12159
|
-
}
|
|
12160
|
-
async getTreeHash(commitSha) {
|
|
12161
|
-
return (await this.exec(["rev-parse", `${commitSha}^{tree}`])).trim();
|
|
12162
|
-
}
|
|
12163
|
-
async showFile(treeish, filePath) {
|
|
12164
|
-
try {
|
|
12165
|
-
return await this.exec(["show", `${treeish}:${filePath}`]);
|
|
12166
|
-
} catch {
|
|
12167
|
-
return null;
|
|
11925
|
+
index += match2[0].length;
|
|
11926
|
+
key = match2[1].toLowerCase();
|
|
11927
|
+
value = match2[2];
|
|
11928
|
+
if (value[0] === '"') {
|
|
11929
|
+
value = value.slice(1, value.length - 1);
|
|
11930
|
+
quotedPairRE.test(value) && (value = value.replace(quotedPairRE, "$1"));
|
|
12168
11931
|
}
|
|
11932
|
+
result.parameters[key] = value;
|
|
12169
11933
|
}
|
|
12170
|
-
|
|
12171
|
-
|
|
12172
|
-
const output = await this.exec(["log", "-1", `--format=${format3}`, commitSha]);
|
|
12173
|
-
const [sha, authorName, authorEmail, message] = output.trim().split("\0");
|
|
12174
|
-
return { sha, authorName, authorEmail, message };
|
|
11934
|
+
if (index !== header.length) {
|
|
11935
|
+
throw new TypeError("invalid parameter format");
|
|
12175
11936
|
}
|
|
12176
|
-
|
|
12177
|
-
|
|
12178
|
-
|
|
11937
|
+
return result;
|
|
11938
|
+
}
|
|
11939
|
+
function safeParse2(header) {
|
|
11940
|
+
if (typeof header !== "string") {
|
|
11941
|
+
return defaultContentType;
|
|
12179
11942
|
}
|
|
12180
|
-
|
|
12181
|
-
|
|
12182
|
-
|
|
12183
|
-
|
|
12184
|
-
for (const line of output.trim().split("\n")) {
|
|
12185
|
-
if (!line)
|
|
12186
|
-
continue;
|
|
12187
|
-
if (line.startsWith("R")) {
|
|
12188
|
-
const parts = line.split(" ");
|
|
12189
|
-
if (parts.length >= 3) {
|
|
12190
|
-
renames.push({ from: parts[1], to: parts[2] });
|
|
12191
|
-
}
|
|
12192
|
-
}
|
|
12193
|
-
}
|
|
12194
|
-
return renames;
|
|
12195
|
-
} catch {
|
|
12196
|
-
return [];
|
|
12197
|
-
}
|
|
11943
|
+
let index = header.indexOf(";");
|
|
11944
|
+
const type = index !== -1 ? header.slice(0, index).trim() : header.trim();
|
|
11945
|
+
if (mediaTypeRE.test(type) === false) {
|
|
11946
|
+
return defaultContentType;
|
|
12198
11947
|
}
|
|
12199
|
-
|
|
12200
|
-
|
|
12201
|
-
|
|
12202
|
-
|
|
12203
|
-
|
|
12204
|
-
|
|
12205
|
-
}
|
|
11948
|
+
const result = {
|
|
11949
|
+
type: type.toLowerCase(),
|
|
11950
|
+
parameters: new NullObject()
|
|
11951
|
+
};
|
|
11952
|
+
if (index === -1) {
|
|
11953
|
+
return result;
|
|
12206
11954
|
}
|
|
12207
|
-
|
|
12208
|
-
|
|
12209
|
-
|
|
12210
|
-
|
|
12211
|
-
|
|
12212
|
-
|
|
11955
|
+
let key;
|
|
11956
|
+
let match2;
|
|
11957
|
+
let value;
|
|
11958
|
+
paramRE.lastIndex = index;
|
|
11959
|
+
while (match2 = paramRE.exec(header)) {
|
|
11960
|
+
if (match2.index !== index) {
|
|
11961
|
+
return defaultContentType;
|
|
12213
11962
|
}
|
|
11963
|
+
index += match2[0].length;
|
|
11964
|
+
key = match2[1].toLowerCase();
|
|
11965
|
+
value = match2[2];
|
|
11966
|
+
if (value[0] === '"') {
|
|
11967
|
+
value = value.slice(1, value.length - 1);
|
|
11968
|
+
quotedPairRE.test(value) && (value = value.replace(quotedPairRE, "$1"));
|
|
11969
|
+
}
|
|
11970
|
+
result.parameters[key] = value;
|
|
12214
11971
|
}
|
|
12215
|
-
|
|
12216
|
-
return
|
|
11972
|
+
if (index !== header.length) {
|
|
11973
|
+
return defaultContentType;
|
|
12217
11974
|
}
|
|
12218
|
-
|
|
12219
|
-
|
|
12220
|
-
}
|
|
12221
|
-
|
|
12222
|
-
|
|
12223
|
-
|
|
12224
|
-
const isFernSupport = FERN_SUPPORT_NAMES.includes(commit.authorName);
|
|
12225
|
-
const isBotAuthor = !isFernSupport && (commit.authorLogin === FERN_BOT_LOGIN2 || commit.authorEmail === FERN_BOT_EMAIL2 || commit.authorName === FERN_BOT_NAME2);
|
|
12226
|
-
const hasGenerationMarker = commit.message.startsWith("[fern-generated]") || commit.message.startsWith("[fern-replay]") || commit.message.includes("Generated by Fern") || commit.message.includes("\u{1F916} Generated with Fern") || // Squash merge of a Fern-generated PR uses the PR title as commit message.
|
|
12227
|
-
// The default PR title is "SDK Generation" (from GithubStep's commitMessage default).
|
|
12228
|
-
// GitHub appends "(#N)" for the PR number, e.g. "SDK Generation (#70)".
|
|
12229
|
-
commit.message.startsWith("SDK Generation");
|
|
12230
|
-
return isBotAuthor || hasGenerationMarker;
|
|
12231
|
-
}
|
|
12232
|
-
function isReplayCommit(commit) {
|
|
12233
|
-
return commit.message.startsWith("[fern-replay]");
|
|
12234
|
-
}
|
|
12235
|
-
var FERN_BOT_NAME2, FERN_BOT_EMAIL2, FERN_BOT_LOGIN2, FERN_SUPPORT_NAMES;
|
|
12236
|
-
var init_CommitDetection = __esm({
|
|
12237
|
-
"../../node_modules/.pnpm/@fern-api+replay@0.6.0/node_modules/@fern-api/replay/dist/git/CommitDetection.js"() {
|
|
12238
|
-
"use strict";
|
|
12239
|
-
FERN_BOT_NAME2 = "fern-api";
|
|
12240
|
-
FERN_BOT_EMAIL2 = "115122769+fern-api[bot]@users.noreply.github.com";
|
|
12241
|
-
FERN_BOT_LOGIN2 = "fern-api[bot]";
|
|
12242
|
-
FERN_SUPPORT_NAMES = ["fern-support", "Fern Support"];
|
|
11975
|
+
return result;
|
|
11976
|
+
}
|
|
11977
|
+
module2.exports.default = { parse: parse3, safeParse: safeParse2 };
|
|
11978
|
+
module2.exports.parse = parse3;
|
|
11979
|
+
module2.exports.safeParse = safeParse2;
|
|
11980
|
+
module2.exports.defaultContentType = defaultContentType;
|
|
12243
11981
|
}
|
|
12244
11982
|
});
|
|
12245
11983
|
|
|
@@ -16115,10 +15853,10 @@ var require_resolve_block_map = __commonJS({
|
|
|
16115
15853
|
let offset = bm.offset;
|
|
16116
15854
|
let commentEnd = null;
|
|
16117
15855
|
for (const collItem of bm.items) {
|
|
16118
|
-
const { start, key, sep:
|
|
15856
|
+
const { start, key, sep: sep3, value } = collItem;
|
|
16119
15857
|
const keyProps = resolveProps.resolveProps(start, {
|
|
16120
15858
|
indicator: "explicit-key-ind",
|
|
16121
|
-
next: key ??
|
|
15859
|
+
next: key ?? sep3?.[0],
|
|
16122
15860
|
offset,
|
|
16123
15861
|
onError: onError2,
|
|
16124
15862
|
startOnNewline: true
|
|
@@ -16131,7 +15869,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
16131
15869
|
else if ("indent" in key && key.indent !== bm.indent)
|
|
16132
15870
|
onError2(offset, "BAD_INDENT", startColMsg);
|
|
16133
15871
|
}
|
|
16134
|
-
if (!keyProps.anchor && !keyProps.tag && !
|
|
15872
|
+
if (!keyProps.anchor && !keyProps.tag && !sep3) {
|
|
16135
15873
|
commentEnd = keyProps.end;
|
|
16136
15874
|
if (keyProps.comment) {
|
|
16137
15875
|
if (map.comment)
|
|
@@ -16153,7 +15891,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
16153
15891
|
utilFlowIndentCheck.flowIndentCheck(bm.indent, key, onError2);
|
|
16154
15892
|
if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
|
|
16155
15893
|
onError2(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
|
|
16156
|
-
const valueProps = resolveProps.resolveProps(
|
|
15894
|
+
const valueProps = resolveProps.resolveProps(sep3 ?? [], {
|
|
16157
15895
|
indicator: "map-value-ind",
|
|
16158
15896
|
next: value,
|
|
16159
15897
|
offset: keyNode.range[2],
|
|
@@ -16168,7 +15906,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
16168
15906
|
if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024)
|
|
16169
15907
|
onError2(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key");
|
|
16170
15908
|
}
|
|
16171
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError2) : composeEmptyNode(ctx, offset,
|
|
15909
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError2) : composeEmptyNode(ctx, offset, sep3, null, valueProps, onError2);
|
|
16172
15910
|
if (ctx.schema.compat)
|
|
16173
15911
|
utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError2);
|
|
16174
15912
|
offset = valueNode.range[2];
|
|
@@ -16256,7 +15994,7 @@ var require_resolve_end = __commonJS({
|
|
|
16256
15994
|
let comment = "";
|
|
16257
15995
|
if (end) {
|
|
16258
15996
|
let hasSpace = false;
|
|
16259
|
-
let
|
|
15997
|
+
let sep3 = "";
|
|
16260
15998
|
for (const token of end) {
|
|
16261
15999
|
const { source, type } = token;
|
|
16262
16000
|
switch (type) {
|
|
@@ -16270,13 +16008,13 @@ var require_resolve_end = __commonJS({
|
|
|
16270
16008
|
if (!comment)
|
|
16271
16009
|
comment = cb;
|
|
16272
16010
|
else
|
|
16273
|
-
comment +=
|
|
16274
|
-
|
|
16011
|
+
comment += sep3 + cb;
|
|
16012
|
+
sep3 = "";
|
|
16275
16013
|
break;
|
|
16276
16014
|
}
|
|
16277
16015
|
case "newline":
|
|
16278
16016
|
if (comment)
|
|
16279
|
-
|
|
16017
|
+
sep3 += source;
|
|
16280
16018
|
hasSpace = true;
|
|
16281
16019
|
break;
|
|
16282
16020
|
default:
|
|
@@ -16317,17 +16055,17 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
16317
16055
|
let offset = fc.offset + fc.start.source.length;
|
|
16318
16056
|
for (let i = 0; i < fc.items.length; ++i) {
|
|
16319
16057
|
const collItem = fc.items[i];
|
|
16320
|
-
const { start, key, sep:
|
|
16058
|
+
const { start, key, sep: sep3, value } = collItem;
|
|
16321
16059
|
const props = resolveProps.resolveProps(start, {
|
|
16322
16060
|
flow: fcName,
|
|
16323
16061
|
indicator: "explicit-key-ind",
|
|
16324
|
-
next: key ??
|
|
16062
|
+
next: key ?? sep3?.[0],
|
|
16325
16063
|
offset,
|
|
16326
16064
|
onError: onError2,
|
|
16327
16065
|
startOnNewline: false
|
|
16328
16066
|
});
|
|
16329
16067
|
if (!props.found) {
|
|
16330
|
-
if (!props.anchor && !props.tag && !
|
|
16068
|
+
if (!props.anchor && !props.tag && !sep3 && !value) {
|
|
16331
16069
|
if (i === 0 && props.comma)
|
|
16332
16070
|
onError2(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
|
|
16333
16071
|
else if (i < fc.items.length - 1)
|
|
@@ -16381,8 +16119,8 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
16381
16119
|
}
|
|
16382
16120
|
}
|
|
16383
16121
|
}
|
|
16384
|
-
if (!isMap && !
|
|
16385
|
-
const valueNode = value ? composeNode(ctx, value, props, onError2) : composeEmptyNode(ctx, props.end,
|
|
16122
|
+
if (!isMap && !sep3 && !props.found) {
|
|
16123
|
+
const valueNode = value ? composeNode(ctx, value, props, onError2) : composeEmptyNode(ctx, props.end, sep3, null, props, onError2);
|
|
16386
16124
|
coll.items.push(valueNode);
|
|
16387
16125
|
offset = valueNode.range[2];
|
|
16388
16126
|
if (isBlock(value))
|
|
@@ -16392,7 +16130,7 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
16392
16130
|
const keyNode = key ? composeNode(ctx, key, props, onError2) : composeEmptyNode(ctx, keyStart, start, null, props, onError2);
|
|
16393
16131
|
if (isBlock(key))
|
|
16394
16132
|
onError2(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
16395
|
-
const valueProps = resolveProps.resolveProps(
|
|
16133
|
+
const valueProps = resolveProps.resolveProps(sep3 ?? [], {
|
|
16396
16134
|
flow: fcName,
|
|
16397
16135
|
indicator: "map-value-ind",
|
|
16398
16136
|
next: value,
|
|
@@ -16402,8 +16140,8 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
16402
16140
|
});
|
|
16403
16141
|
if (valueProps.found) {
|
|
16404
16142
|
if (!isMap && !props.found && ctx.options.strict) {
|
|
16405
|
-
if (
|
|
16406
|
-
for (const st of
|
|
16143
|
+
if (sep3)
|
|
16144
|
+
for (const st of sep3) {
|
|
16407
16145
|
if (st === valueProps.found)
|
|
16408
16146
|
break;
|
|
16409
16147
|
if (st.type === "newline") {
|
|
@@ -16420,7 +16158,7 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
16420
16158
|
else
|
|
16421
16159
|
onError2(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
|
|
16422
16160
|
}
|
|
16423
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError2) : valueProps.found ? composeEmptyNode(ctx, valueProps.end,
|
|
16161
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError2) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep3, null, valueProps, onError2) : null;
|
|
16424
16162
|
if (valueNode) {
|
|
16425
16163
|
if (isBlock(value))
|
|
16426
16164
|
onError2(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
@@ -16585,7 +16323,7 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
16585
16323
|
chompStart = i + 1;
|
|
16586
16324
|
}
|
|
16587
16325
|
let value = "";
|
|
16588
|
-
let
|
|
16326
|
+
let sep3 = "";
|
|
16589
16327
|
let prevMoreIndented = false;
|
|
16590
16328
|
for (let i = 0; i < contentStart; ++i)
|
|
16591
16329
|
value += lines[i][0].slice(trimIndent) + "\n";
|
|
@@ -16602,24 +16340,24 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
16602
16340
|
indent = "";
|
|
16603
16341
|
}
|
|
16604
16342
|
if (type === Scalar.Scalar.BLOCK_LITERAL) {
|
|
16605
|
-
value +=
|
|
16606
|
-
|
|
16343
|
+
value += sep3 + indent.slice(trimIndent) + content;
|
|
16344
|
+
sep3 = "\n";
|
|
16607
16345
|
} else if (indent.length > trimIndent || content[0] === " ") {
|
|
16608
|
-
if (
|
|
16609
|
-
|
|
16610
|
-
else if (!prevMoreIndented &&
|
|
16611
|
-
|
|
16612
|
-
value +=
|
|
16613
|
-
|
|
16346
|
+
if (sep3 === " ")
|
|
16347
|
+
sep3 = "\n";
|
|
16348
|
+
else if (!prevMoreIndented && sep3 === "\n")
|
|
16349
|
+
sep3 = "\n\n";
|
|
16350
|
+
value += sep3 + indent.slice(trimIndent) + content;
|
|
16351
|
+
sep3 = "\n";
|
|
16614
16352
|
prevMoreIndented = true;
|
|
16615
16353
|
} else if (content === "") {
|
|
16616
|
-
if (
|
|
16354
|
+
if (sep3 === "\n")
|
|
16617
16355
|
value += "\n";
|
|
16618
16356
|
else
|
|
16619
|
-
|
|
16357
|
+
sep3 = "\n";
|
|
16620
16358
|
} else {
|
|
16621
|
-
value +=
|
|
16622
|
-
|
|
16359
|
+
value += sep3 + content;
|
|
16360
|
+
sep3 = " ";
|
|
16623
16361
|
prevMoreIndented = false;
|
|
16624
16362
|
}
|
|
16625
16363
|
}
|
|
@@ -16801,25 +16539,25 @@ var require_resolve_flow_scalar = __commonJS({
|
|
|
16801
16539
|
if (!match2)
|
|
16802
16540
|
return source;
|
|
16803
16541
|
let res = match2[1];
|
|
16804
|
-
let
|
|
16542
|
+
let sep3 = " ";
|
|
16805
16543
|
let pos = first2.lastIndex;
|
|
16806
16544
|
line.lastIndex = pos;
|
|
16807
16545
|
while (match2 = line.exec(source)) {
|
|
16808
16546
|
if (match2[1] === "") {
|
|
16809
|
-
if (
|
|
16810
|
-
res +=
|
|
16547
|
+
if (sep3 === "\n")
|
|
16548
|
+
res += sep3;
|
|
16811
16549
|
else
|
|
16812
|
-
|
|
16550
|
+
sep3 = "\n";
|
|
16813
16551
|
} else {
|
|
16814
|
-
res +=
|
|
16815
|
-
|
|
16552
|
+
res += sep3 + match2[1];
|
|
16553
|
+
sep3 = " ";
|
|
16816
16554
|
}
|
|
16817
16555
|
pos = line.lastIndex;
|
|
16818
16556
|
}
|
|
16819
16557
|
const last2 = /[ \t]*(.*)/sy;
|
|
16820
16558
|
last2.lastIndex = pos;
|
|
16821
16559
|
match2 = last2.exec(source);
|
|
16822
|
-
return res +
|
|
16560
|
+
return res + sep3 + (match2?.[1] ?? "");
|
|
16823
16561
|
}
|
|
16824
16562
|
function doubleQuotedValue(source, onError2) {
|
|
16825
16563
|
let res = "";
|
|
@@ -17592,14 +17330,14 @@ var require_cst_stringify = __commonJS({
|
|
|
17592
17330
|
}
|
|
17593
17331
|
}
|
|
17594
17332
|
}
|
|
17595
|
-
function stringifyItem({ start, key, sep:
|
|
17333
|
+
function stringifyItem({ start, key, sep: sep3, value }) {
|
|
17596
17334
|
let res = "";
|
|
17597
17335
|
for (const st of start)
|
|
17598
17336
|
res += st.source;
|
|
17599
17337
|
if (key)
|
|
17600
17338
|
res += stringifyToken(key);
|
|
17601
|
-
if (
|
|
17602
|
-
for (const st of
|
|
17339
|
+
if (sep3)
|
|
17340
|
+
for (const st of sep3)
|
|
17603
17341
|
res += st.source;
|
|
17604
17342
|
if (value)
|
|
17605
17343
|
res += stringifyToken(value);
|
|
@@ -18736,18 +18474,18 @@ var require_parser = __commonJS({
|
|
|
18736
18474
|
if (this.type === "map-value-ind") {
|
|
18737
18475
|
const prev = getPrevProps(this.peek(2));
|
|
18738
18476
|
const start = getFirstKeyStartProps(prev);
|
|
18739
|
-
let
|
|
18477
|
+
let sep3;
|
|
18740
18478
|
if (scalar.end) {
|
|
18741
|
-
|
|
18742
|
-
|
|
18479
|
+
sep3 = scalar.end;
|
|
18480
|
+
sep3.push(this.sourceToken);
|
|
18743
18481
|
delete scalar.end;
|
|
18744
18482
|
} else
|
|
18745
|
-
|
|
18483
|
+
sep3 = [this.sourceToken];
|
|
18746
18484
|
const map = {
|
|
18747
18485
|
type: "block-map",
|
|
18748
18486
|
offset: scalar.offset,
|
|
18749
18487
|
indent: scalar.indent,
|
|
18750
|
-
items: [{ start, key: scalar, sep:
|
|
18488
|
+
items: [{ start, key: scalar, sep: sep3 }]
|
|
18751
18489
|
};
|
|
18752
18490
|
this.onKeyLine = true;
|
|
18753
18491
|
this.stack[this.stack.length - 1] = map;
|
|
@@ -18898,14 +18636,14 @@ var require_parser = __commonJS({
|
|
|
18898
18636
|
} else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
|
|
18899
18637
|
const start2 = getFirstKeyStartProps(it.start);
|
|
18900
18638
|
const key = it.key;
|
|
18901
|
-
const
|
|
18902
|
-
|
|
18639
|
+
const sep3 = it.sep;
|
|
18640
|
+
sep3.push(this.sourceToken);
|
|
18903
18641
|
delete it.key, delete it.sep;
|
|
18904
18642
|
this.stack.push({
|
|
18905
18643
|
type: "block-map",
|
|
18906
18644
|
offset: this.offset,
|
|
18907
18645
|
indent: this.indent,
|
|
18908
|
-
items: [{ start: start2, key, sep:
|
|
18646
|
+
items: [{ start: start2, key, sep: sep3 }]
|
|
18909
18647
|
});
|
|
18910
18648
|
} else if (start.length > 0) {
|
|
18911
18649
|
it.sep = it.sep.concat(start, this.sourceToken);
|
|
@@ -19089,13 +18827,13 @@ var require_parser = __commonJS({
|
|
|
19089
18827
|
const prev = getPrevProps(parent);
|
|
19090
18828
|
const start = getFirstKeyStartProps(prev);
|
|
19091
18829
|
fixFlowSeqItems(fc);
|
|
19092
|
-
const
|
|
19093
|
-
|
|
18830
|
+
const sep3 = fc.end.splice(1, fc.end.length);
|
|
18831
|
+
sep3.push(this.sourceToken);
|
|
19094
18832
|
const map = {
|
|
19095
18833
|
type: "block-map",
|
|
19096
18834
|
offset: fc.offset,
|
|
19097
18835
|
indent: fc.indent,
|
|
19098
|
-
items: [{ start, key: fc, sep:
|
|
18836
|
+
items: [{ start, key: fc, sep: sep3 }]
|
|
19099
18837
|
};
|
|
19100
18838
|
this.onKeyLine = true;
|
|
19101
18839
|
this.stack[this.stack.length - 1] = map;
|
|
@@ -19272,7 +19010,7 @@ var require_public_api = __commonJS({
|
|
|
19272
19010
|
}
|
|
19273
19011
|
return doc;
|
|
19274
19012
|
}
|
|
19275
|
-
function
|
|
19013
|
+
function parse3(src, reviver, options) {
|
|
19276
19014
|
let _reviver = void 0;
|
|
19277
19015
|
if (typeof reviver === "function") {
|
|
19278
19016
|
_reviver = reviver;
|
|
@@ -19311,7 +19049,7 @@ var require_public_api = __commonJS({
|
|
|
19311
19049
|
}
|
|
19312
19050
|
return new Document.Document(value, _replacer, options).toString(options);
|
|
19313
19051
|
}
|
|
19314
|
-
exports2.parse =
|
|
19052
|
+
exports2.parse = parse3;
|
|
19315
19053
|
exports2.parseAllDocuments = parseAllDocuments;
|
|
19316
19054
|
exports2.parseDocument = parseDocument;
|
|
19317
19055
|
exports2.stringify = stringify3;
|
|
@@ -19370,302 +19108,43 @@ var require_dist3 = __commonJS({
|
|
|
19370
19108
|
}
|
|
19371
19109
|
});
|
|
19372
19110
|
|
|
19373
|
-
// ../../node_modules/.pnpm
|
|
19374
|
-
|
|
19375
|
-
|
|
19376
|
-
|
|
19377
|
-
|
|
19378
|
-
|
|
19379
|
-
|
|
19380
|
-
|
|
19381
|
-
|
|
19382
|
-
|
|
19383
|
-
|
|
19384
|
-
|
|
19385
|
-
|
|
19386
|
-
|
|
19387
|
-
|
|
19388
|
-
|
|
19389
|
-
|
|
19390
|
-
|
|
19391
|
-
|
|
19392
|
-
|
|
19393
|
-
|
|
19394
|
-
|
|
19395
|
-
|
|
19396
|
-
|
|
19397
|
-
read() {
|
|
19398
|
-
if (this.lock) {
|
|
19399
|
-
return this.lock;
|
|
19400
|
-
}
|
|
19401
|
-
if (!this.exists()) {
|
|
19402
|
-
throw new Error(`Lockfile not found: ${this.lockfilePath}`);
|
|
19111
|
+
// ../../node_modules/.pnpm/node-diff3@3.2.0/node_modules/node-diff3/dist/diff3.mjs
|
|
19112
|
+
function LCS(buffer1, buffer2) {
|
|
19113
|
+
let equivalenceClasses = {};
|
|
19114
|
+
for (let j = 0; j < buffer2.length; j++) {
|
|
19115
|
+
const item = buffer2[j];
|
|
19116
|
+
if (equivalenceClasses[item]) {
|
|
19117
|
+
equivalenceClasses[item].push(j);
|
|
19118
|
+
} else {
|
|
19119
|
+
equivalenceClasses[item] = [j];
|
|
19120
|
+
}
|
|
19121
|
+
}
|
|
19122
|
+
const NULLRESULT = { buffer1index: -1, buffer2index: -1, chain: null };
|
|
19123
|
+
let candidates = [NULLRESULT];
|
|
19124
|
+
for (let i = 0; i < buffer1.length; i++) {
|
|
19125
|
+
const item = buffer1[i];
|
|
19126
|
+
const buffer2indices = equivalenceClasses[item] || [];
|
|
19127
|
+
let r = 0;
|
|
19128
|
+
let c = candidates[0];
|
|
19129
|
+
for (let jx = 0; jx < buffer2indices.length; jx++) {
|
|
19130
|
+
const j = buffer2indices[jx];
|
|
19131
|
+
let s;
|
|
19132
|
+
for (s = r; s < candidates.length; s++) {
|
|
19133
|
+
if (candidates[s].buffer2index < j && (s === candidates.length - 1 || candidates[s + 1].buffer2index > j)) {
|
|
19134
|
+
break;
|
|
19403
19135
|
}
|
|
19404
|
-
const content = (0, import_node_fs.readFileSync)(this.lockfilePath, "utf-8");
|
|
19405
|
-
this.lock = (0, import_yaml.parse)(content);
|
|
19406
|
-
return this.lock;
|
|
19407
|
-
}
|
|
19408
|
-
initialize(firstGeneration) {
|
|
19409
|
-
this.initializeInMemory(firstGeneration);
|
|
19410
|
-
this.save();
|
|
19411
|
-
}
|
|
19412
|
-
/**
|
|
19413
|
-
* Set up in-memory lock state without writing to disk.
|
|
19414
|
-
* Useful for bootstrap dry-run where we need state for detection
|
|
19415
|
-
* but don't want to persist anything.
|
|
19416
|
-
*/
|
|
19417
|
-
initializeInMemory(firstGeneration) {
|
|
19418
|
-
this.lock = {
|
|
19419
|
-
version: "1.0",
|
|
19420
|
-
generations: [firstGeneration],
|
|
19421
|
-
current_generation: firstGeneration.commit_sha,
|
|
19422
|
-
patches: []
|
|
19423
|
-
};
|
|
19424
19136
|
}
|
|
19425
|
-
|
|
19426
|
-
|
|
19427
|
-
|
|
19428
|
-
|
|
19429
|
-
|
|
19430
|
-
|
|
19431
|
-
(0, import_node_fs.mkdirSync)(dir, { recursive: true });
|
|
19137
|
+
if (s < candidates.length) {
|
|
19138
|
+
const newCandidate = { buffer1index: i, buffer2index: j, chain: candidates[s] };
|
|
19139
|
+
if (r === candidates.length) {
|
|
19140
|
+
candidates.push(c);
|
|
19141
|
+
} else {
|
|
19142
|
+
candidates[r] = c;
|
|
19432
19143
|
}
|
|
19433
|
-
|
|
19434
|
-
|
|
19435
|
-
|
|
19436
|
-
|
|
19437
|
-
const content = LOCKFILE_HEADER + yaml;
|
|
19438
|
-
const tmpPath = this.lockfilePath + ".tmp";
|
|
19439
|
-
(0, import_node_fs.writeFileSync)(tmpPath, content, "utf-8");
|
|
19440
|
-
(0, import_node_fs.renameSync)(tmpPath, this.lockfilePath);
|
|
19441
|
-
}
|
|
19442
|
-
addGeneration(record2) {
|
|
19443
|
-
this.ensureLoaded();
|
|
19444
|
-
this.lock.generations.push(record2);
|
|
19445
|
-
this.lock.current_generation = record2.commit_sha;
|
|
19446
|
-
}
|
|
19447
|
-
addPatch(patch) {
|
|
19448
|
-
this.ensureLoaded();
|
|
19449
|
-
this.lock.patches.push(patch);
|
|
19450
|
-
}
|
|
19451
|
-
updatePatch(patchId, updates) {
|
|
19452
|
-
this.ensureLoaded();
|
|
19453
|
-
const patch = this.lock.patches.find((p) => p.id === patchId);
|
|
19454
|
-
if (!patch) {
|
|
19455
|
-
throw new Error(`Patch not found: ${patchId}`);
|
|
19456
|
-
}
|
|
19457
|
-
Object.assign(patch, updates);
|
|
19458
|
-
}
|
|
19459
|
-
removePatch(patchId) {
|
|
19460
|
-
this.ensureLoaded();
|
|
19461
|
-
this.lock.patches = this.lock.patches.filter((p) => p.id !== patchId);
|
|
19462
|
-
}
|
|
19463
|
-
clearPatches() {
|
|
19464
|
-
this.ensureLoaded();
|
|
19465
|
-
this.lock.patches = [];
|
|
19466
|
-
}
|
|
19467
|
-
getPatches() {
|
|
19468
|
-
this.ensureLoaded();
|
|
19469
|
-
return this.lock.patches;
|
|
19470
|
-
}
|
|
19471
|
-
setReplaySkippedAt(timestamp) {
|
|
19472
|
-
this.ensureLoaded();
|
|
19473
|
-
this.lock.replay_skipped_at = timestamp;
|
|
19474
|
-
}
|
|
19475
|
-
clearReplaySkippedAt() {
|
|
19476
|
-
this.ensureLoaded();
|
|
19477
|
-
delete this.lock.replay_skipped_at;
|
|
19478
|
-
}
|
|
19479
|
-
isReplaySkipped() {
|
|
19480
|
-
this.ensureLoaded();
|
|
19481
|
-
return this.lock.replay_skipped_at != null;
|
|
19482
|
-
}
|
|
19483
|
-
getGeneration(commitSha) {
|
|
19484
|
-
this.ensureLoaded();
|
|
19485
|
-
return this.lock.generations.find((g) => g.commit_sha === commitSha);
|
|
19486
|
-
}
|
|
19487
|
-
getCustomizationsConfig() {
|
|
19488
|
-
if (!(0, import_node_fs.existsSync)(this.customizationsPath)) {
|
|
19489
|
-
return {};
|
|
19490
|
-
}
|
|
19491
|
-
const content = (0, import_node_fs.readFileSync)(this.customizationsPath, "utf-8");
|
|
19492
|
-
return (0, import_yaml.parse)(content) ?? {};
|
|
19493
|
-
}
|
|
19494
|
-
ensureLoaded() {
|
|
19495
|
-
if (!this.lock) {
|
|
19496
|
-
throw new Error("No lockfile loaded. Call read() or initialize() first.");
|
|
19497
|
-
}
|
|
19498
|
-
}
|
|
19499
|
-
};
|
|
19500
|
-
}
|
|
19501
|
-
});
|
|
19502
|
-
|
|
19503
|
-
// ../../node_modules/.pnpm/@fern-api+replay@0.6.0/node_modules/@fern-api/replay/dist/ReplayDetector.js
|
|
19504
|
-
var import_node_crypto, INFRASTRUCTURE_FILES, ReplayDetector;
|
|
19505
|
-
var init_ReplayDetector = __esm({
|
|
19506
|
-
"../../node_modules/.pnpm/@fern-api+replay@0.6.0/node_modules/@fern-api/replay/dist/ReplayDetector.js"() {
|
|
19507
|
-
"use strict";
|
|
19508
|
-
import_node_crypto = require("crypto");
|
|
19509
|
-
init_CommitDetection();
|
|
19510
|
-
INFRASTRUCTURE_FILES = /* @__PURE__ */ new Set([".fernignore"]);
|
|
19511
|
-
ReplayDetector = class {
|
|
19512
|
-
git;
|
|
19513
|
-
lockManager;
|
|
19514
|
-
sdkOutputDir;
|
|
19515
|
-
warnings = [];
|
|
19516
|
-
constructor(git, lockManager, sdkOutputDir) {
|
|
19517
|
-
this.git = git;
|
|
19518
|
-
this.lockManager = lockManager;
|
|
19519
|
-
this.sdkOutputDir = sdkOutputDir;
|
|
19520
|
-
}
|
|
19521
|
-
async detectNewPatches() {
|
|
19522
|
-
const lock = this.lockManager.read();
|
|
19523
|
-
const lastGen = this.getLastGeneration(lock);
|
|
19524
|
-
if (!lastGen) {
|
|
19525
|
-
return [];
|
|
19526
|
-
}
|
|
19527
|
-
const exists2 = await this.git.commitExists(lastGen.commit_sha);
|
|
19528
|
-
if (!exists2) {
|
|
19529
|
-
this.warnings.push(`Generation commit ${lastGen.commit_sha.slice(0, 7)} not found in git history. Skipping new patch detection. Existing lockfile patches will still be applied.`);
|
|
19530
|
-
return [];
|
|
19531
|
-
}
|
|
19532
|
-
const isAncestor = await this.git.isAncestor(lastGen.commit_sha, "HEAD");
|
|
19533
|
-
if (!isAncestor) {
|
|
19534
|
-
return this.detectPatchesViaTreeDiff(lastGen);
|
|
19535
|
-
}
|
|
19536
|
-
const log = await this.git.exec([
|
|
19537
|
-
"log",
|
|
19538
|
-
"--format=%H%x00%an%x00%ae%x00%s",
|
|
19539
|
-
`${lastGen.commit_sha}..HEAD`,
|
|
19540
|
-
"--",
|
|
19541
|
-
this.sdkOutputDir
|
|
19542
|
-
]);
|
|
19543
|
-
if (!log.trim()) {
|
|
19544
|
-
return [];
|
|
19545
|
-
}
|
|
19546
|
-
const commits = this.parseGitLog(log);
|
|
19547
|
-
const newPatches = [];
|
|
19548
|
-
for (const commit of commits) {
|
|
19549
|
-
if (isGenerationCommit(commit)) {
|
|
19550
|
-
continue;
|
|
19551
|
-
}
|
|
19552
|
-
const parents = await this.git.getCommitParents(commit.sha);
|
|
19553
|
-
if (parents.length > 1) {
|
|
19554
|
-
continue;
|
|
19555
|
-
}
|
|
19556
|
-
if (lock.patches.find((p) => p.original_commit === commit.sha)) {
|
|
19557
|
-
continue;
|
|
19558
|
-
}
|
|
19559
|
-
const patchContent = await this.git.formatPatch(commit.sha);
|
|
19560
|
-
const contentHash = this.computeContentHash(patchContent);
|
|
19561
|
-
if (lock.patches.find((p) => p.content_hash === contentHash)) {
|
|
19562
|
-
continue;
|
|
19563
|
-
}
|
|
19564
|
-
const filesOutput = await this.git.exec(["diff-tree", "--no-commit-id", "--name-only", "-r", commit.sha]);
|
|
19565
|
-
const files = filesOutput.trim().split("\n").filter(Boolean).filter((f) => !INFRASTRUCTURE_FILES.has(f));
|
|
19566
|
-
if (files.length === 0) {
|
|
19567
|
-
continue;
|
|
19568
|
-
}
|
|
19569
|
-
newPatches.push({
|
|
19570
|
-
id: `patch-${commit.sha.slice(0, 8)}`,
|
|
19571
|
-
content_hash: contentHash,
|
|
19572
|
-
original_commit: commit.sha,
|
|
19573
|
-
original_message: commit.message,
|
|
19574
|
-
original_author: `${commit.authorName} <${commit.authorEmail}>`,
|
|
19575
|
-
base_generation: lastGen.commit_sha,
|
|
19576
|
-
files,
|
|
19577
|
-
patch_content: patchContent
|
|
19578
|
-
});
|
|
19579
|
-
}
|
|
19580
|
-
return newPatches.reverse();
|
|
19581
|
-
}
|
|
19582
|
-
/**
|
|
19583
|
-
* Compute content hash for deduplication.
|
|
19584
|
-
* Removes commit SHA line and index lines before hashing,
|
|
19585
|
-
* so rebased commits with same content produce the same hash.
|
|
19586
|
-
*/
|
|
19587
|
-
computeContentHash(patchContent) {
|
|
19588
|
-
const normalized = patchContent.split("\n").filter((line) => !line.startsWith("From ") && !line.startsWith("index ") && !line.startsWith("Date: ")).join("\n");
|
|
19589
|
-
return `sha256:${(0, import_node_crypto.createHash)("sha256").update(normalized).digest("hex")}`;
|
|
19590
|
-
}
|
|
19591
|
-
/** Detect patches via tree diff for non-linear history. Returns a composite patch. */
|
|
19592
|
-
async detectPatchesViaTreeDiff(lastGen) {
|
|
19593
|
-
const filesOutput = await this.git.exec(["diff", "--name-only", lastGen.commit_sha, "HEAD"]);
|
|
19594
|
-
const files = filesOutput.trim().split("\n").filter(Boolean).filter((f) => !INFRASTRUCTURE_FILES.has(f)).filter((f) => !f.startsWith(".fern/"));
|
|
19595
|
-
if (files.length === 0)
|
|
19596
|
-
return [];
|
|
19597
|
-
const diff = await this.git.exec(["diff", lastGen.commit_sha, "HEAD", "--", ...files]);
|
|
19598
|
-
if (!diff.trim())
|
|
19599
|
-
return [];
|
|
19600
|
-
const contentHash = this.computeContentHash(diff);
|
|
19601
|
-
const lock = this.lockManager.read();
|
|
19602
|
-
if (lock.patches.some((p) => p.content_hash === contentHash)) {
|
|
19603
|
-
return [];
|
|
19604
|
-
}
|
|
19605
|
-
const headSha = (await this.git.exec(["rev-parse", "HEAD"])).trim();
|
|
19606
|
-
return [
|
|
19607
|
-
{
|
|
19608
|
-
id: `patch-composite-${headSha.slice(0, 8)}`,
|
|
19609
|
-
content_hash: contentHash,
|
|
19610
|
-
original_commit: headSha,
|
|
19611
|
-
original_message: "Customer customizations (composite)",
|
|
19612
|
-
original_author: "composite",
|
|
19613
|
-
base_generation: lastGen.commit_sha,
|
|
19614
|
-
files,
|
|
19615
|
-
patch_content: diff
|
|
19616
|
-
}
|
|
19617
|
-
];
|
|
19618
|
-
}
|
|
19619
|
-
parseGitLog(log) {
|
|
19620
|
-
return log.trim().split("\n").map((line) => {
|
|
19621
|
-
const [sha, authorName, authorEmail, message] = line.split("\0");
|
|
19622
|
-
return { sha, authorName, authorEmail, message };
|
|
19623
|
-
});
|
|
19624
|
-
}
|
|
19625
|
-
getLastGeneration(lock) {
|
|
19626
|
-
return lock.generations.find((g) => g.commit_sha === lock.current_generation);
|
|
19627
|
-
}
|
|
19628
|
-
};
|
|
19629
|
-
}
|
|
19630
|
-
});
|
|
19631
|
-
|
|
19632
|
-
// ../../node_modules/.pnpm/node-diff3@3.2.0/node_modules/node-diff3/dist/diff3.mjs
|
|
19633
|
-
function LCS(buffer1, buffer2) {
|
|
19634
|
-
let equivalenceClasses = {};
|
|
19635
|
-
for (let j = 0; j < buffer2.length; j++) {
|
|
19636
|
-
const item = buffer2[j];
|
|
19637
|
-
if (equivalenceClasses[item]) {
|
|
19638
|
-
equivalenceClasses[item].push(j);
|
|
19639
|
-
} else {
|
|
19640
|
-
equivalenceClasses[item] = [j];
|
|
19641
|
-
}
|
|
19642
|
-
}
|
|
19643
|
-
const NULLRESULT = { buffer1index: -1, buffer2index: -1, chain: null };
|
|
19644
|
-
let candidates = [NULLRESULT];
|
|
19645
|
-
for (let i = 0; i < buffer1.length; i++) {
|
|
19646
|
-
const item = buffer1[i];
|
|
19647
|
-
const buffer2indices = equivalenceClasses[item] || [];
|
|
19648
|
-
let r = 0;
|
|
19649
|
-
let c = candidates[0];
|
|
19650
|
-
for (let jx = 0; jx < buffer2indices.length; jx++) {
|
|
19651
|
-
const j = buffer2indices[jx];
|
|
19652
|
-
let s;
|
|
19653
|
-
for (s = r; s < candidates.length; s++) {
|
|
19654
|
-
if (candidates[s].buffer2index < j && (s === candidates.length - 1 || candidates[s + 1].buffer2index > j)) {
|
|
19655
|
-
break;
|
|
19656
|
-
}
|
|
19657
|
-
}
|
|
19658
|
-
if (s < candidates.length) {
|
|
19659
|
-
const newCandidate = { buffer1index: i, buffer2index: j, chain: candidates[s] };
|
|
19660
|
-
if (r === candidates.length) {
|
|
19661
|
-
candidates.push(c);
|
|
19662
|
-
} else {
|
|
19663
|
-
candidates[r] = c;
|
|
19664
|
-
}
|
|
19665
|
-
r = s + 1;
|
|
19666
|
-
c = newCandidate;
|
|
19667
|
-
if (r === candidates.length) {
|
|
19668
|
-
break;
|
|
19144
|
+
r = s + 1;
|
|
19145
|
+
c = newCandidate;
|
|
19146
|
+
if (r === candidates.length) {
|
|
19147
|
+
break;
|
|
19669
19148
|
}
|
|
19670
19149
|
}
|
|
19671
19150
|
}
|
|
@@ -19837,78 +19316,759 @@ function diff3Merge(a, o, b, options) {
|
|
|
19837
19316
|
}
|
|
19838
19317
|
});
|
|
19839
19318
|
}
|
|
19840
|
-
}
|
|
19841
|
-
});
|
|
19842
|
-
flushOk();
|
|
19843
|
-
return results;
|
|
19844
|
-
}
|
|
19845
|
-
var init_diff3 = __esm({
|
|
19846
|
-
"../../node_modules/.pnpm/node-diff3@3.2.0/node_modules/node-diff3/dist/diff3.mjs"() {
|
|
19847
|
-
"use strict";
|
|
19848
|
-
}
|
|
19849
|
-
});
|
|
19850
|
-
|
|
19851
|
-
// ../../node_modules/.pnpm/@fern-api+replay@0.6.
|
|
19852
|
-
|
|
19853
|
-
|
|
19854
|
-
|
|
19855
|
-
|
|
19856
|
-
|
|
19857
|
-
|
|
19858
|
-
|
|
19859
|
-
|
|
19860
|
-
|
|
19861
|
-
|
|
19862
|
-
|
|
19863
|
-
|
|
19864
|
-
|
|
19865
|
-
|
|
19866
|
-
|
|
19867
|
-
|
|
19868
|
-
|
|
19869
|
-
|
|
19870
|
-
|
|
19871
|
-
|
|
19872
|
-
|
|
19873
|
-
|
|
19874
|
-
|
|
19875
|
-
|
|
19876
|
-
|
|
19877
|
-
|
|
19878
|
-
|
|
19879
|
-
|
|
19880
|
-
|
|
19881
|
-
|
|
19882
|
-
|
|
19883
|
-
|
|
19884
|
-
|
|
19885
|
-
|
|
19886
|
-
|
|
19887
|
-
|
|
19888
|
-
|
|
19889
|
-
|
|
19890
|
-
|
|
19891
|
-
|
|
19892
|
-
|
|
19893
|
-
|
|
19894
|
-
|
|
19895
|
-
|
|
19896
|
-
|
|
19897
|
-
|
|
19898
|
-
|
|
19899
|
-
|
|
19900
|
-
|
|
19901
|
-
|
|
19902
|
-
|
|
19903
|
-
|
|
19904
|
-
|
|
19905
|
-
|
|
19906
|
-
|
|
19907
|
-
|
|
19908
|
-
|
|
19909
|
-
|
|
19910
|
-
|
|
19911
|
-
|
|
19319
|
+
}
|
|
19320
|
+
});
|
|
19321
|
+
flushOk();
|
|
19322
|
+
return results;
|
|
19323
|
+
}
|
|
19324
|
+
var init_diff3 = __esm({
|
|
19325
|
+
"../../node_modules/.pnpm/node-diff3@3.2.0/node_modules/node-diff3/dist/diff3.mjs"() {
|
|
19326
|
+
"use strict";
|
|
19327
|
+
}
|
|
19328
|
+
});
|
|
19329
|
+
|
|
19330
|
+
// ../../node_modules/.pnpm/@fern-api+replay@0.6.1/node_modules/@fern-api/replay/dist/index.js
|
|
19331
|
+
var dist_exports = {};
|
|
19332
|
+
__export(dist_exports, {
|
|
19333
|
+
FERN_BOT_EMAIL: () => FERN_BOT_EMAIL2,
|
|
19334
|
+
FERN_BOT_LOGIN: () => FERN_BOT_LOGIN2,
|
|
19335
|
+
FERN_BOT_NAME: () => FERN_BOT_NAME2,
|
|
19336
|
+
FernignoreMigrator: () => FernignoreMigrator,
|
|
19337
|
+
GitClient: () => GitClient,
|
|
19338
|
+
LockfileManager: () => LockfileManager,
|
|
19339
|
+
ReplayApplicator: () => ReplayApplicator,
|
|
19340
|
+
ReplayCommitter: () => ReplayCommitter,
|
|
19341
|
+
ReplayDetector: () => ReplayDetector,
|
|
19342
|
+
ReplayService: () => ReplayService,
|
|
19343
|
+
bootstrap: () => bootstrap,
|
|
19344
|
+
forget: () => forget,
|
|
19345
|
+
isGenerationCommit: () => isGenerationCommit,
|
|
19346
|
+
isReplayCommit: () => isReplayCommit,
|
|
19347
|
+
reset: () => reset,
|
|
19348
|
+
resolve: () => resolve7,
|
|
19349
|
+
status: () => status,
|
|
19350
|
+
threeWayMerge: () => threeWayMerge
|
|
19351
|
+
});
|
|
19352
|
+
function isGenerationCommit(commit) {
|
|
19353
|
+
const isFernSupport = FERN_SUPPORT_NAMES.includes(commit.authorName);
|
|
19354
|
+
const isBotAuthor = !isFernSupport && (commit.authorLogin === FERN_BOT_LOGIN2 || commit.authorEmail === FERN_BOT_EMAIL2 || commit.authorName === FERN_BOT_NAME2);
|
|
19355
|
+
const hasGenerationMarker = commit.message.startsWith("[fern-generated]") || commit.message.startsWith("[fern-replay]") || commit.message.includes("Generated by Fern") || commit.message.includes("\u{1F916} Generated with Fern") || // Squash merge of a Fern-generated PR uses the PR title as commit message.
|
|
19356
|
+
// The default PR title is "SDK Generation" (from GithubStep's commitMessage default).
|
|
19357
|
+
// GitHub appends "(#N)" for the PR number, e.g. "SDK Generation (#70)".
|
|
19358
|
+
commit.message.startsWith("SDK Generation");
|
|
19359
|
+
return isBotAuthor || hasGenerationMarker;
|
|
19360
|
+
}
|
|
19361
|
+
function isReplayCommit(commit) {
|
|
19362
|
+
return commit.message.startsWith("[fern-replay]");
|
|
19363
|
+
}
|
|
19364
|
+
function threeWayMerge(base, ours, theirs) {
|
|
19365
|
+
const baseLines = base.split("\n");
|
|
19366
|
+
const oursLines = ours.split("\n");
|
|
19367
|
+
const theirsLines = theirs.split("\n");
|
|
19368
|
+
const regions = diff3Merge(oursLines, baseLines, theirsLines);
|
|
19369
|
+
const outputLines = [];
|
|
19370
|
+
const conflicts2 = [];
|
|
19371
|
+
let currentLine = 1;
|
|
19372
|
+
for (const region of regions) {
|
|
19373
|
+
if (region.ok) {
|
|
19374
|
+
outputLines.push(...region.ok);
|
|
19375
|
+
currentLine += region.ok.length;
|
|
19376
|
+
} else if (region.conflict) {
|
|
19377
|
+
const startLine = currentLine;
|
|
19378
|
+
outputLines.push("<<<<<<< Generated");
|
|
19379
|
+
outputLines.push(...region.conflict.a);
|
|
19380
|
+
outputLines.push("=======");
|
|
19381
|
+
outputLines.push(...region.conflict.b);
|
|
19382
|
+
outputLines.push(">>>>>>> Your customization");
|
|
19383
|
+
const conflictLines = region.conflict.a.length + region.conflict.b.length + 3;
|
|
19384
|
+
conflicts2.push({
|
|
19385
|
+
startLine,
|
|
19386
|
+
endLine: startLine + conflictLines - 1,
|
|
19387
|
+
ours: region.conflict.a,
|
|
19388
|
+
theirs: region.conflict.b
|
|
19389
|
+
});
|
|
19390
|
+
currentLine += conflictLines;
|
|
19391
|
+
}
|
|
19392
|
+
}
|
|
19393
|
+
return {
|
|
19394
|
+
content: outputLines.join("\n"),
|
|
19395
|
+
hasConflicts: conflicts2.length > 0,
|
|
19396
|
+
conflicts: conflicts2
|
|
19397
|
+
};
|
|
19398
|
+
}
|
|
19399
|
+
function isBinaryFile(filePath) {
|
|
19400
|
+
const ext2 = (0, import_path9.extname)(filePath).toLowerCase();
|
|
19401
|
+
return BINARY_EXTENSIONS.has(ext2);
|
|
19402
|
+
}
|
|
19403
|
+
function isDiffLineForFile(diffLine, filePath) {
|
|
19404
|
+
const match2 = diffLine.match(/^diff --git a\/.+ b\/(.+)$/);
|
|
19405
|
+
return match2 !== null && match2[1] === filePath;
|
|
19406
|
+
}
|
|
19407
|
+
async function bootstrap(outputDir, options) {
|
|
19408
|
+
const git = new GitClient(outputDir);
|
|
19409
|
+
const lockManager = new LockfileManager(outputDir);
|
|
19410
|
+
const maxCommits = options?.maxCommitsToScan ?? 500;
|
|
19411
|
+
const warnings = [];
|
|
19412
|
+
if (lockManager.exists() && !options?.force) {
|
|
19413
|
+
return {
|
|
19414
|
+
generationCommit: null,
|
|
19415
|
+
patchesDetected: 0,
|
|
19416
|
+
patchesCreated: 0,
|
|
19417
|
+
patches: [],
|
|
19418
|
+
fernignorePatterns: [],
|
|
19419
|
+
fernignoreUpdated: false,
|
|
19420
|
+
warnings: ["Replay lockfile already exists. Use --force to overwrite."],
|
|
19421
|
+
staleGenerationsSkipped: 0,
|
|
19422
|
+
scannedSinceGeneration: ""
|
|
19423
|
+
};
|
|
19424
|
+
}
|
|
19425
|
+
const genCommits = await findAllGenerationCommits(git, maxCommits);
|
|
19426
|
+
if (genCommits.length === 0) {
|
|
19427
|
+
return {
|
|
19428
|
+
generationCommit: null,
|
|
19429
|
+
patchesDetected: 0,
|
|
19430
|
+
patchesCreated: 0,
|
|
19431
|
+
patches: [],
|
|
19432
|
+
fernignorePatterns: [],
|
|
19433
|
+
fernignoreUpdated: false,
|
|
19434
|
+
warnings: [
|
|
19435
|
+
"No generation commits found in the last " + maxCommits + " commits. Run 'fern generate' first to establish a baseline."
|
|
19436
|
+
],
|
|
19437
|
+
staleGenerationsSkipped: 0,
|
|
19438
|
+
scannedSinceGeneration: ""
|
|
19439
|
+
};
|
|
19440
|
+
}
|
|
19441
|
+
const latestGen = genCommits[0];
|
|
19442
|
+
const anchorSha = options?.importHistory ? latestGen.sha : (await git.exec(["rev-parse", "HEAD"])).trim();
|
|
19443
|
+
const treeHash = await git.getTreeHash(anchorSha);
|
|
19444
|
+
const genRecord = {
|
|
19445
|
+
commit_sha: anchorSha,
|
|
19446
|
+
tree_hash: treeHash,
|
|
19447
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
19448
|
+
cli_version: "unknown",
|
|
19449
|
+
generator_versions: {}
|
|
19450
|
+
};
|
|
19451
|
+
lockManager.initializeInMemory(genRecord);
|
|
19452
|
+
const patches = options?.importHistory ? await findAllUserPatches(git, genCommits) : [];
|
|
19453
|
+
const migrator = new FernignoreMigrator(git, lockManager, outputDir);
|
|
19454
|
+
const fernignorePatterns = migrator.readFernignorePatterns();
|
|
19455
|
+
let fernignoreAnalysis;
|
|
19456
|
+
if (options?.importHistory && migrator.fernignoreExists() && fernignorePatterns.length > 0) {
|
|
19457
|
+
fernignoreAnalysis = await migrator.analyzeMigration();
|
|
19458
|
+
if (fernignoreAnalysis.syntheticPatches.length > 0) {
|
|
19459
|
+
patches.push(...fernignoreAnalysis.syntheticPatches);
|
|
19460
|
+
}
|
|
19461
|
+
if (fernignoreAnalysis.fernignoreOnly.length > 0) {
|
|
19462
|
+
for (const file of fernignoreAnalysis.fernignoreOnly) {
|
|
19463
|
+
warnings.push(
|
|
19464
|
+
`${file}: in .fernignore but no recent commits found since last generation. File may be stale, matches generated output, or does not exist. No customization to track.`
|
|
19465
|
+
);
|
|
19466
|
+
}
|
|
19467
|
+
}
|
|
19468
|
+
}
|
|
19469
|
+
if (options?.dryRun) {
|
|
19470
|
+
return {
|
|
19471
|
+
generationCommit: latestGen,
|
|
19472
|
+
patchesDetected: patches.length,
|
|
19473
|
+
patchesCreated: 0,
|
|
19474
|
+
patches,
|
|
19475
|
+
fernignorePatterns,
|
|
19476
|
+
fernignoreAnalysis,
|
|
19477
|
+
fernignoreUpdated: false,
|
|
19478
|
+
warnings,
|
|
19479
|
+
staleGenerationsSkipped: genCommits.length - 1,
|
|
19480
|
+
scannedSinceGeneration: latestGen.sha
|
|
19481
|
+
};
|
|
19482
|
+
}
|
|
19483
|
+
for (const patch of patches) {
|
|
19484
|
+
lockManager.addPatch(patch);
|
|
19485
|
+
}
|
|
19486
|
+
lockManager.save();
|
|
19487
|
+
const fernignoreUpdated = ensureFernignoreEntries(outputDir);
|
|
19488
|
+
if (migrator.fernignoreExists() && fernignorePatterns.length > 0) {
|
|
19489
|
+
const action = options?.fernignoreAction ?? "skip";
|
|
19490
|
+
if (action === "migrate") {
|
|
19491
|
+
const patternsToExclude = fernignoreAnalysis?.fernignoreOnly ?? [];
|
|
19492
|
+
if (patternsToExclude.length > 0) {
|
|
19493
|
+
migrator.movePatternsToReplayYml(patternsToExclude);
|
|
19494
|
+
}
|
|
19495
|
+
}
|
|
19496
|
+
}
|
|
19497
|
+
return {
|
|
19498
|
+
generationCommit: latestGen,
|
|
19499
|
+
patchesDetected: patches.length,
|
|
19500
|
+
patchesCreated: patches.length,
|
|
19501
|
+
patches,
|
|
19502
|
+
fernignorePatterns,
|
|
19503
|
+
fernignoreAnalysis,
|
|
19504
|
+
fernignoreUpdated,
|
|
19505
|
+
warnings,
|
|
19506
|
+
staleGenerationsSkipped: genCommits.length - 1,
|
|
19507
|
+
scannedSinceGeneration: latestGen.sha
|
|
19508
|
+
};
|
|
19509
|
+
}
|
|
19510
|
+
async function findAllGenerationCommits(git, maxCommits) {
|
|
19511
|
+
const log = await git.exec(["log", "--format=%H%x00%an%x00%ae%x00%s", `-${maxCommits}`]);
|
|
19512
|
+
if (!log.trim()) {
|
|
19513
|
+
return [];
|
|
19514
|
+
}
|
|
19515
|
+
const genCommits = [];
|
|
19516
|
+
for (const line of log.trim().split("\n")) {
|
|
19517
|
+
if (!line) continue;
|
|
19518
|
+
const [sha, authorName, authorEmail, message] = line.split("\0");
|
|
19519
|
+
const commit = { sha, authorName, authorEmail, message };
|
|
19520
|
+
if (isGenerationCommit(commit) && !isReplayCommit(commit)) {
|
|
19521
|
+
genCommits.push(commit);
|
|
19522
|
+
}
|
|
19523
|
+
}
|
|
19524
|
+
return genCommits;
|
|
19525
|
+
}
|
|
19526
|
+
async function findAllUserPatches(git, genCommits) {
|
|
19527
|
+
const patches = [];
|
|
19528
|
+
const seenHashes = /* @__PURE__ */ new Set();
|
|
19529
|
+
const latestGen = genCommits[0];
|
|
19530
|
+
const recentPatches = await extractUserPatches(git, latestGen.sha, "HEAD", latestGen.sha, seenHashes);
|
|
19531
|
+
patches.push(...recentPatches);
|
|
19532
|
+
return patches;
|
|
19533
|
+
}
|
|
19534
|
+
async function extractUserPatches(git, fromSha, toRef, baseGeneration, seenHashes) {
|
|
19535
|
+
const log = await git.exec(["log", "--format=%H%x00%an%x00%ae%x00%s", `${fromSha}..${toRef}`]);
|
|
19536
|
+
if (!log.trim()) {
|
|
19537
|
+
return [];
|
|
19538
|
+
}
|
|
19539
|
+
const commits = parseGitLog(log);
|
|
19540
|
+
const patches = [];
|
|
19541
|
+
for (const commit of commits.reverse()) {
|
|
19542
|
+
if (isGenerationCommit(commit)) continue;
|
|
19543
|
+
const parents = await git.getCommitParents(commit.sha);
|
|
19544
|
+
if (parents.length > 1) continue;
|
|
19545
|
+
const patchContent = await git.formatPatch(commit.sha);
|
|
19546
|
+
const contentHash = computeContentHash(patchContent);
|
|
19547
|
+
if (seenHashes.has(contentHash)) continue;
|
|
19548
|
+
seenHashes.add(contentHash);
|
|
19549
|
+
const filesOutput = await git.exec(["diff-tree", "--no-commit-id", "--name-only", "-r", commit.sha]);
|
|
19550
|
+
patches.push({
|
|
19551
|
+
id: `patch-${commit.sha.slice(0, 8)}`,
|
|
19552
|
+
content_hash: contentHash,
|
|
19553
|
+
original_commit: commit.sha,
|
|
19554
|
+
original_message: commit.message,
|
|
19555
|
+
original_author: `${commit.authorName} <${commit.authorEmail}>`,
|
|
19556
|
+
base_generation: baseGeneration,
|
|
19557
|
+
files: filesOutput.trim().split("\n").filter(Boolean),
|
|
19558
|
+
patch_content: patchContent
|
|
19559
|
+
});
|
|
19560
|
+
}
|
|
19561
|
+
return patches;
|
|
19562
|
+
}
|
|
19563
|
+
function parseGitLog(log) {
|
|
19564
|
+
return log.trim().split("\n").filter(Boolean).map((line) => {
|
|
19565
|
+
const [sha, authorName, authorEmail, message] = line.split("\0");
|
|
19566
|
+
return { sha, authorName, authorEmail, message };
|
|
19567
|
+
});
|
|
19568
|
+
}
|
|
19569
|
+
function ensureFernignoreEntries(outputDir) {
|
|
19570
|
+
const fernignorePath = (0, import_path12.join)(outputDir, ".fernignore");
|
|
19571
|
+
let content = "";
|
|
19572
|
+
if ((0, import_fs9.existsSync)(fernignorePath)) {
|
|
19573
|
+
content = (0, import_fs9.readFileSync)(fernignorePath, "utf-8");
|
|
19574
|
+
}
|
|
19575
|
+
const lines = content.split("\n");
|
|
19576
|
+
const toAdd = [];
|
|
19577
|
+
for (const entry of REPLAY_FERNIGNORE_ENTRIES) {
|
|
19578
|
+
if (!lines.some((line) => line.trim() === entry)) {
|
|
19579
|
+
toAdd.push(entry);
|
|
19580
|
+
}
|
|
19581
|
+
}
|
|
19582
|
+
if (toAdd.length === 0) {
|
|
19583
|
+
return false;
|
|
19584
|
+
}
|
|
19585
|
+
if (content && !content.endsWith("\n")) {
|
|
19586
|
+
content += "\n";
|
|
19587
|
+
}
|
|
19588
|
+
content += toAdd.join("\n") + "\n";
|
|
19589
|
+
(0, import_fs9.writeFileSync)(fernignorePath, content, "utf-8");
|
|
19590
|
+
return true;
|
|
19591
|
+
}
|
|
19592
|
+
function computeContentHash(patchContent) {
|
|
19593
|
+
const normalized = patchContent.split("\n").filter((line) => !line.startsWith("From ") && !line.startsWith("index ") && !line.startsWith("Date: ")).join("\n");
|
|
19594
|
+
return `sha256:${(0, import_crypto3.createHash)("sha256").update(normalized).digest("hex")}`;
|
|
19595
|
+
}
|
|
19596
|
+
function forget(outputDir, filePattern, options) {
|
|
19597
|
+
const lockManager = new LockfileManager(outputDir);
|
|
19598
|
+
if (!lockManager.exists()) {
|
|
19599
|
+
return { removed: [], notFound: true };
|
|
19600
|
+
}
|
|
19601
|
+
const lock = lockManager.read();
|
|
19602
|
+
const matchingPatches = lock.patches.filter(
|
|
19603
|
+
(patch) => patch.files.some((file) => file === filePattern || minimatch(file, filePattern))
|
|
19604
|
+
);
|
|
19605
|
+
if (matchingPatches.length === 0) {
|
|
19606
|
+
return { removed: [], notFound: true };
|
|
19607
|
+
}
|
|
19608
|
+
const removed = matchingPatches.map((p) => ({
|
|
19609
|
+
id: p.id,
|
|
19610
|
+
message: p.original_message,
|
|
19611
|
+
files: p.files
|
|
19612
|
+
}));
|
|
19613
|
+
if (!options?.dryRun) {
|
|
19614
|
+
for (const patch of matchingPatches) {
|
|
19615
|
+
lockManager.removePatch(patch.id);
|
|
19616
|
+
}
|
|
19617
|
+
lockManager.save();
|
|
19618
|
+
}
|
|
19619
|
+
return { removed, notFound: false };
|
|
19620
|
+
}
|
|
19621
|
+
function reset(outputDir, options) {
|
|
19622
|
+
const lockManager = new LockfileManager(outputDir);
|
|
19623
|
+
if (!lockManager.exists()) {
|
|
19624
|
+
return {
|
|
19625
|
+
success: true,
|
|
19626
|
+
patchesRemoved: 0,
|
|
19627
|
+
lockfileDeleted: false,
|
|
19628
|
+
nothingToReset: true
|
|
19629
|
+
};
|
|
19630
|
+
}
|
|
19631
|
+
const lock = lockManager.read();
|
|
19632
|
+
const patchCount = lock.patches.length;
|
|
19633
|
+
if (!options?.dryRun) {
|
|
19634
|
+
(0, import_fs10.unlinkSync)(lockManager.lockfilePath);
|
|
19635
|
+
}
|
|
19636
|
+
return {
|
|
19637
|
+
success: true,
|
|
19638
|
+
patchesRemoved: patchCount,
|
|
19639
|
+
lockfileDeleted: true,
|
|
19640
|
+
nothingToReset: false
|
|
19641
|
+
};
|
|
19642
|
+
}
|
|
19643
|
+
async function resolve7(outputDir, options) {
|
|
19644
|
+
const lockManager = new LockfileManager(outputDir);
|
|
19645
|
+
if (!lockManager.exists()) {
|
|
19646
|
+
return { success: false, reason: "no-lockfile" };
|
|
19647
|
+
}
|
|
19648
|
+
const lock = lockManager.read();
|
|
19649
|
+
if (lock.patches.length === 0) {
|
|
19650
|
+
return { success: false, reason: "no-patches" };
|
|
19651
|
+
}
|
|
19652
|
+
const git = new GitClient(outputDir);
|
|
19653
|
+
if (options?.checkMarkers !== false) {
|
|
19654
|
+
const markerFiles = await git.exec(["grep", "-l", "<<<<<<<", "--", "."]).catch(() => "");
|
|
19655
|
+
if (markerFiles.trim()) {
|
|
19656
|
+
const files = markerFiles.trim().split("\n").filter(Boolean);
|
|
19657
|
+
return { success: false, reason: "unresolved-conflicts", unresolvedFiles: files };
|
|
19658
|
+
}
|
|
19659
|
+
}
|
|
19660
|
+
const committer = new ReplayCommitter(git, outputDir);
|
|
19661
|
+
await committer.stageAll();
|
|
19662
|
+
const commitSha = await committer.commitReplay(lock.patches.length, lock.patches);
|
|
19663
|
+
return { success: true, commitSha };
|
|
19664
|
+
}
|
|
19665
|
+
function status(outputDir) {
|
|
19666
|
+
const lockManager = new LockfileManager(outputDir);
|
|
19667
|
+
if (!lockManager.exists()) {
|
|
19668
|
+
return { initialized: false, patches: [], lastGeneration: void 0 };
|
|
19669
|
+
}
|
|
19670
|
+
const lock = lockManager.read();
|
|
19671
|
+
const patches = lock.patches.map((patch) => ({
|
|
19672
|
+
sha: patch.original_commit.slice(0, 7),
|
|
19673
|
+
author: patch.original_author.split("<")[0]?.trim() ?? "unknown",
|
|
19674
|
+
message: patch.original_message,
|
|
19675
|
+
files: patch.files
|
|
19676
|
+
}));
|
|
19677
|
+
let lastGeneration;
|
|
19678
|
+
const lastGen = lock.generations.find((g) => g.commit_sha === lock.current_generation);
|
|
19679
|
+
if (lastGen) {
|
|
19680
|
+
lastGeneration = {
|
|
19681
|
+
sha: lastGen.commit_sha,
|
|
19682
|
+
timestamp: lastGen.timestamp
|
|
19683
|
+
};
|
|
19684
|
+
}
|
|
19685
|
+
return { initialized: true, patches, lastGeneration };
|
|
19686
|
+
}
|
|
19687
|
+
var import_fs6, import_path8, import_yaml, import_crypto, import_promises4, import_os, import_path9, import_fs7, import_path10, import_crypto2, import_fs8, import_path11, import_yaml2, import_crypto3, import_fs9, import_path12, import_fs10, __defProp3, __getOwnPropNames3, __esm3, __export3, GitClient_exports, GitClient, init_GitClient, FERN_BOT_NAME2, FERN_BOT_EMAIL2, FERN_BOT_LOGIN2, FERN_SUPPORT_NAMES, LOCKFILE_HEADER, LockfileManager, INFRASTRUCTURE_FILES, ReplayDetector, BINARY_EXTENSIONS, ReplayApplicator, ReplayCommitter, ReplayService, FernignoreMigrator, REPLAY_FERNIGNORE_ENTRIES;
|
|
19688
|
+
var init_dist = __esm({
|
|
19689
|
+
"../../node_modules/.pnpm/@fern-api+replay@0.6.1/node_modules/@fern-api/replay/dist/index.js"() {
|
|
19690
|
+
"use strict";
|
|
19691
|
+
init_esm4();
|
|
19692
|
+
import_fs6 = require("fs");
|
|
19693
|
+
import_path8 = require("path");
|
|
19694
|
+
import_yaml = __toESM(require_dist3(), 1);
|
|
19695
|
+
import_crypto = require("crypto");
|
|
19696
|
+
init_diff3();
|
|
19697
|
+
import_promises4 = require("fs/promises");
|
|
19698
|
+
import_os = require("os");
|
|
19699
|
+
import_path9 = require("path");
|
|
19700
|
+
init_esm3();
|
|
19701
|
+
import_fs7 = require("fs");
|
|
19702
|
+
import_path10 = require("path");
|
|
19703
|
+
init_esm3();
|
|
19704
|
+
import_crypto2 = require("crypto");
|
|
19705
|
+
import_fs8 = require("fs");
|
|
19706
|
+
import_path11 = require("path");
|
|
19707
|
+
init_esm3();
|
|
19708
|
+
import_yaml2 = __toESM(require_dist3(), 1);
|
|
19709
|
+
import_crypto3 = require("crypto");
|
|
19710
|
+
import_fs9 = require("fs");
|
|
19711
|
+
import_path12 = require("path");
|
|
19712
|
+
init_esm3();
|
|
19713
|
+
import_fs10 = require("fs");
|
|
19714
|
+
__defProp3 = Object.defineProperty;
|
|
19715
|
+
__getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
19716
|
+
__esm3 = (fn, res) => function __init() {
|
|
19717
|
+
return fn && (res = (0, fn[__getOwnPropNames3(fn)[0]])(fn = 0)), res;
|
|
19718
|
+
};
|
|
19719
|
+
__export3 = (target, all) => {
|
|
19720
|
+
for (var name in all)
|
|
19721
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
19722
|
+
};
|
|
19723
|
+
GitClient_exports = {};
|
|
19724
|
+
__export3(GitClient_exports, {
|
|
19725
|
+
GitClient: () => GitClient
|
|
19726
|
+
});
|
|
19727
|
+
init_GitClient = __esm3({
|
|
19728
|
+
"src/git/GitClient.ts"() {
|
|
19729
|
+
"use strict";
|
|
19730
|
+
GitClient = class {
|
|
19731
|
+
git;
|
|
19732
|
+
repoPath;
|
|
19733
|
+
constructor(repoPath) {
|
|
19734
|
+
this.repoPath = repoPath;
|
|
19735
|
+
this.git = simpleGit(repoPath);
|
|
19736
|
+
}
|
|
19737
|
+
async exec(args) {
|
|
19738
|
+
return this.git.raw(args);
|
|
19739
|
+
}
|
|
19740
|
+
async execWithInput(args, input) {
|
|
19741
|
+
const { spawn: spawn2 } = await import("child_process");
|
|
19742
|
+
return new Promise((resolve22, reject) => {
|
|
19743
|
+
const proc = spawn2("git", args, { cwd: this.repoPath });
|
|
19744
|
+
let stdout = "";
|
|
19745
|
+
let stderr = "";
|
|
19746
|
+
proc.stdout.on("data", (data) => {
|
|
19747
|
+
stdout += data.toString();
|
|
19748
|
+
});
|
|
19749
|
+
proc.stderr.on("data", (data) => {
|
|
19750
|
+
stderr += data.toString();
|
|
19751
|
+
});
|
|
19752
|
+
proc.on("close", (code) => {
|
|
19753
|
+
if (code === 0) {
|
|
19754
|
+
resolve22(stdout);
|
|
19755
|
+
} else {
|
|
19756
|
+
reject(new Error(`git ${args.join(" ")} failed (code ${code}): ${stderr}`));
|
|
19757
|
+
}
|
|
19758
|
+
});
|
|
19759
|
+
proc.stdin.write(input);
|
|
19760
|
+
proc.stdin.end();
|
|
19761
|
+
});
|
|
19762
|
+
}
|
|
19763
|
+
async formatPatch(commitSha) {
|
|
19764
|
+
return this.exec(["format-patch", "-1", commitSha, "--stdout"]);
|
|
19765
|
+
}
|
|
19766
|
+
async applyPatch(patchContent) {
|
|
19767
|
+
await this.execWithInput(["am", "--3way"], patchContent);
|
|
19768
|
+
}
|
|
19769
|
+
async getTreeHash(commitSha) {
|
|
19770
|
+
return (await this.exec(["rev-parse", `${commitSha}^{tree}`])).trim();
|
|
19771
|
+
}
|
|
19772
|
+
async showFile(treeish, filePath) {
|
|
19773
|
+
try {
|
|
19774
|
+
return await this.exec(["show", `${treeish}:${filePath}`]);
|
|
19775
|
+
} catch {
|
|
19776
|
+
return null;
|
|
19777
|
+
}
|
|
19778
|
+
}
|
|
19779
|
+
async getCommitInfo(commitSha) {
|
|
19780
|
+
const format3 = "%H%x00%an%x00%ae%x00%s";
|
|
19781
|
+
const output = await this.exec(["log", "-1", `--format=${format3}`, commitSha]);
|
|
19782
|
+
const [sha, authorName, authorEmail, message] = output.trim().split("\0");
|
|
19783
|
+
return { sha, authorName, authorEmail, message };
|
|
19784
|
+
}
|
|
19785
|
+
async getCommitParents(commitSha) {
|
|
19786
|
+
const output = await this.exec(["rev-parse", `${commitSha}^@`]);
|
|
19787
|
+
return output.trim().split("\n").filter(Boolean);
|
|
19788
|
+
}
|
|
19789
|
+
async detectRenames(fromTree, toTree) {
|
|
19790
|
+
try {
|
|
19791
|
+
const output = await this.exec(["diff", "--find-renames", "--name-status", fromTree, toTree]);
|
|
19792
|
+
const renames = [];
|
|
19793
|
+
for (const line of output.trim().split("\n")) {
|
|
19794
|
+
if (!line) continue;
|
|
19795
|
+
if (line.startsWith("R")) {
|
|
19796
|
+
const parts = line.split(" ");
|
|
19797
|
+
if (parts.length >= 3) {
|
|
19798
|
+
renames.push({ from: parts[1], to: parts[2] });
|
|
19799
|
+
}
|
|
19800
|
+
}
|
|
19801
|
+
}
|
|
19802
|
+
return renames;
|
|
19803
|
+
} catch {
|
|
19804
|
+
return [];
|
|
19805
|
+
}
|
|
19806
|
+
}
|
|
19807
|
+
async isAncestor(commit, descendant) {
|
|
19808
|
+
try {
|
|
19809
|
+
const mergeBase = (await this.exec(["merge-base", commit, descendant])).trim();
|
|
19810
|
+
return mergeBase === commit;
|
|
19811
|
+
} catch {
|
|
19812
|
+
return false;
|
|
19813
|
+
}
|
|
19814
|
+
}
|
|
19815
|
+
async commitExists(sha) {
|
|
19816
|
+
try {
|
|
19817
|
+
const type = await this.exec(["cat-file", "-t", sha]);
|
|
19818
|
+
return type.trim() === "commit";
|
|
19819
|
+
} catch {
|
|
19820
|
+
return false;
|
|
19821
|
+
}
|
|
19822
|
+
}
|
|
19823
|
+
getRepoPath() {
|
|
19824
|
+
return this.repoPath;
|
|
19825
|
+
}
|
|
19826
|
+
};
|
|
19827
|
+
}
|
|
19828
|
+
});
|
|
19829
|
+
init_GitClient();
|
|
19830
|
+
FERN_BOT_NAME2 = "fern-api";
|
|
19831
|
+
FERN_BOT_EMAIL2 = "115122769+fern-api[bot]@users.noreply.github.com";
|
|
19832
|
+
FERN_BOT_LOGIN2 = "fern-api[bot]";
|
|
19833
|
+
FERN_SUPPORT_NAMES = ["fern-support", "Fern Support"];
|
|
19834
|
+
LOCKFILE_HEADER = "# DO NOT EDIT MANUALLY - Managed by Fern Replay\n";
|
|
19835
|
+
LockfileManager = class {
|
|
19836
|
+
outputDir;
|
|
19837
|
+
lock = null;
|
|
19838
|
+
constructor(outputDir) {
|
|
19839
|
+
this.outputDir = outputDir;
|
|
19840
|
+
}
|
|
19841
|
+
get lockfilePath() {
|
|
19842
|
+
return (0, import_path8.join)(this.outputDir, ".fern", "replay.lock");
|
|
19843
|
+
}
|
|
19844
|
+
get customizationsPath() {
|
|
19845
|
+
return (0, import_path8.join)(this.outputDir, ".fern", "replay.yml");
|
|
19846
|
+
}
|
|
19847
|
+
exists() {
|
|
19848
|
+
return (0, import_fs6.existsSync)(this.lockfilePath);
|
|
19849
|
+
}
|
|
19850
|
+
read() {
|
|
19851
|
+
if (this.lock) {
|
|
19852
|
+
return this.lock;
|
|
19853
|
+
}
|
|
19854
|
+
if (!this.exists()) {
|
|
19855
|
+
throw new Error(`Lockfile not found: ${this.lockfilePath}`);
|
|
19856
|
+
}
|
|
19857
|
+
const content = (0, import_fs6.readFileSync)(this.lockfilePath, "utf-8");
|
|
19858
|
+
this.lock = (0, import_yaml.parse)(content);
|
|
19859
|
+
return this.lock;
|
|
19860
|
+
}
|
|
19861
|
+
initialize(firstGeneration) {
|
|
19862
|
+
this.initializeInMemory(firstGeneration);
|
|
19863
|
+
this.save();
|
|
19864
|
+
}
|
|
19865
|
+
/**
|
|
19866
|
+
* Set up in-memory lock state without writing to disk.
|
|
19867
|
+
* Useful for bootstrap dry-run where we need state for detection
|
|
19868
|
+
* but don't want to persist anything.
|
|
19869
|
+
*/
|
|
19870
|
+
initializeInMemory(firstGeneration) {
|
|
19871
|
+
this.lock = {
|
|
19872
|
+
version: "1.0",
|
|
19873
|
+
generations: [firstGeneration],
|
|
19874
|
+
current_generation: firstGeneration.commit_sha,
|
|
19875
|
+
patches: []
|
|
19876
|
+
};
|
|
19877
|
+
}
|
|
19878
|
+
save() {
|
|
19879
|
+
if (!this.lock) {
|
|
19880
|
+
throw new Error("No lockfile data to save. Call read() or initialize() first.");
|
|
19881
|
+
}
|
|
19882
|
+
const dir = (0, import_path8.dirname)(this.lockfilePath);
|
|
19883
|
+
if (!(0, import_fs6.existsSync)(dir)) {
|
|
19884
|
+
(0, import_fs6.mkdirSync)(dir, { recursive: true });
|
|
19885
|
+
}
|
|
19886
|
+
const yaml = (0, import_yaml.stringify)(this.lock, {
|
|
19887
|
+
lineWidth: 0,
|
|
19888
|
+
blockQuote: "literal"
|
|
19889
|
+
});
|
|
19890
|
+
const content = LOCKFILE_HEADER + yaml;
|
|
19891
|
+
const tmpPath = this.lockfilePath + ".tmp";
|
|
19892
|
+
(0, import_fs6.writeFileSync)(tmpPath, content, "utf-8");
|
|
19893
|
+
(0, import_fs6.renameSync)(tmpPath, this.lockfilePath);
|
|
19894
|
+
}
|
|
19895
|
+
addGeneration(record2) {
|
|
19896
|
+
this.ensureLoaded();
|
|
19897
|
+
this.lock.generations.push(record2);
|
|
19898
|
+
this.lock.current_generation = record2.commit_sha;
|
|
19899
|
+
}
|
|
19900
|
+
addPatch(patch) {
|
|
19901
|
+
this.ensureLoaded();
|
|
19902
|
+
this.lock.patches.push(patch);
|
|
19903
|
+
}
|
|
19904
|
+
updatePatch(patchId, updates) {
|
|
19905
|
+
this.ensureLoaded();
|
|
19906
|
+
const patch = this.lock.patches.find((p) => p.id === patchId);
|
|
19907
|
+
if (!patch) {
|
|
19908
|
+
throw new Error(`Patch not found: ${patchId}`);
|
|
19909
|
+
}
|
|
19910
|
+
Object.assign(patch, updates);
|
|
19911
|
+
}
|
|
19912
|
+
removePatch(patchId) {
|
|
19913
|
+
this.ensureLoaded();
|
|
19914
|
+
this.lock.patches = this.lock.patches.filter((p) => p.id !== patchId);
|
|
19915
|
+
}
|
|
19916
|
+
clearPatches() {
|
|
19917
|
+
this.ensureLoaded();
|
|
19918
|
+
this.lock.patches = [];
|
|
19919
|
+
}
|
|
19920
|
+
getPatches() {
|
|
19921
|
+
this.ensureLoaded();
|
|
19922
|
+
return this.lock.patches;
|
|
19923
|
+
}
|
|
19924
|
+
setReplaySkippedAt(timestamp) {
|
|
19925
|
+
this.ensureLoaded();
|
|
19926
|
+
this.lock.replay_skipped_at = timestamp;
|
|
19927
|
+
}
|
|
19928
|
+
clearReplaySkippedAt() {
|
|
19929
|
+
this.ensureLoaded();
|
|
19930
|
+
delete this.lock.replay_skipped_at;
|
|
19931
|
+
}
|
|
19932
|
+
isReplaySkipped() {
|
|
19933
|
+
this.ensureLoaded();
|
|
19934
|
+
return this.lock.replay_skipped_at != null;
|
|
19935
|
+
}
|
|
19936
|
+
getGeneration(commitSha) {
|
|
19937
|
+
this.ensureLoaded();
|
|
19938
|
+
return this.lock.generations.find((g) => g.commit_sha === commitSha);
|
|
19939
|
+
}
|
|
19940
|
+
getCustomizationsConfig() {
|
|
19941
|
+
if (!(0, import_fs6.existsSync)(this.customizationsPath)) {
|
|
19942
|
+
return {};
|
|
19943
|
+
}
|
|
19944
|
+
const content = (0, import_fs6.readFileSync)(this.customizationsPath, "utf-8");
|
|
19945
|
+
return (0, import_yaml.parse)(content) ?? {};
|
|
19946
|
+
}
|
|
19947
|
+
ensureLoaded() {
|
|
19948
|
+
if (!this.lock) {
|
|
19949
|
+
throw new Error("No lockfile loaded. Call read() or initialize() first.");
|
|
19950
|
+
}
|
|
19951
|
+
}
|
|
19952
|
+
};
|
|
19953
|
+
INFRASTRUCTURE_FILES = /* @__PURE__ */ new Set([".fernignore"]);
|
|
19954
|
+
ReplayDetector = class {
|
|
19955
|
+
git;
|
|
19956
|
+
lockManager;
|
|
19957
|
+
sdkOutputDir;
|
|
19958
|
+
warnings = [];
|
|
19959
|
+
constructor(git, lockManager, sdkOutputDir) {
|
|
19960
|
+
this.git = git;
|
|
19961
|
+
this.lockManager = lockManager;
|
|
19962
|
+
this.sdkOutputDir = sdkOutputDir;
|
|
19963
|
+
}
|
|
19964
|
+
async detectNewPatches() {
|
|
19965
|
+
const lock = this.lockManager.read();
|
|
19966
|
+
const lastGen = this.getLastGeneration(lock);
|
|
19967
|
+
if (!lastGen) {
|
|
19968
|
+
return [];
|
|
19969
|
+
}
|
|
19970
|
+
const exists2 = await this.git.commitExists(lastGen.commit_sha);
|
|
19971
|
+
if (!exists2) {
|
|
19972
|
+
this.warnings.push(
|
|
19973
|
+
`Generation commit ${lastGen.commit_sha.slice(0, 7)} not found in git history. Skipping new patch detection. Existing lockfile patches will still be applied.`
|
|
19974
|
+
);
|
|
19975
|
+
return [];
|
|
19976
|
+
}
|
|
19977
|
+
const isAncestor = await this.git.isAncestor(lastGen.commit_sha, "HEAD");
|
|
19978
|
+
if (!isAncestor) {
|
|
19979
|
+
return this.detectPatchesViaTreeDiff(lastGen);
|
|
19980
|
+
}
|
|
19981
|
+
const log = await this.git.exec([
|
|
19982
|
+
"log",
|
|
19983
|
+
"--format=%H%x00%an%x00%ae%x00%s",
|
|
19984
|
+
`${lastGen.commit_sha}..HEAD`,
|
|
19985
|
+
"--",
|
|
19986
|
+
this.sdkOutputDir
|
|
19987
|
+
]);
|
|
19988
|
+
if (!log.trim()) {
|
|
19989
|
+
return [];
|
|
19990
|
+
}
|
|
19991
|
+
const commits = this.parseGitLog(log);
|
|
19992
|
+
const newPatches = [];
|
|
19993
|
+
for (const commit of commits) {
|
|
19994
|
+
if (isGenerationCommit(commit)) {
|
|
19995
|
+
continue;
|
|
19996
|
+
}
|
|
19997
|
+
const parents = await this.git.getCommitParents(commit.sha);
|
|
19998
|
+
if (parents.length > 1) {
|
|
19999
|
+
continue;
|
|
20000
|
+
}
|
|
20001
|
+
if (lock.patches.find((p) => p.original_commit === commit.sha)) {
|
|
20002
|
+
continue;
|
|
20003
|
+
}
|
|
20004
|
+
const patchContent = await this.git.formatPatch(commit.sha);
|
|
20005
|
+
const contentHash = this.computeContentHash(patchContent);
|
|
20006
|
+
if (lock.patches.find((p) => p.content_hash === contentHash)) {
|
|
20007
|
+
continue;
|
|
20008
|
+
}
|
|
20009
|
+
const filesOutput = await this.git.exec(["diff-tree", "--no-commit-id", "--name-only", "-r", commit.sha]);
|
|
20010
|
+
const files = filesOutput.trim().split("\n").filter(Boolean).filter((f) => !INFRASTRUCTURE_FILES.has(f));
|
|
20011
|
+
if (files.length === 0) {
|
|
20012
|
+
continue;
|
|
20013
|
+
}
|
|
20014
|
+
newPatches.push({
|
|
20015
|
+
id: `patch-${commit.sha.slice(0, 8)}`,
|
|
20016
|
+
content_hash: contentHash,
|
|
20017
|
+
original_commit: commit.sha,
|
|
20018
|
+
original_message: commit.message,
|
|
20019
|
+
original_author: `${commit.authorName} <${commit.authorEmail}>`,
|
|
20020
|
+
base_generation: lastGen.commit_sha,
|
|
20021
|
+
files,
|
|
20022
|
+
patch_content: patchContent
|
|
20023
|
+
});
|
|
20024
|
+
}
|
|
20025
|
+
return newPatches.reverse();
|
|
20026
|
+
}
|
|
20027
|
+
/**
|
|
20028
|
+
* Compute content hash for deduplication.
|
|
20029
|
+
* Removes commit SHA line and index lines before hashing,
|
|
20030
|
+
* so rebased commits with same content produce the same hash.
|
|
20031
|
+
*/
|
|
20032
|
+
computeContentHash(patchContent) {
|
|
20033
|
+
const normalized = patchContent.split("\n").filter((line) => !line.startsWith("From ") && !line.startsWith("index ") && !line.startsWith("Date: ")).join("\n");
|
|
20034
|
+
return `sha256:${(0, import_crypto.createHash)("sha256").update(normalized).digest("hex")}`;
|
|
20035
|
+
}
|
|
20036
|
+
/** Detect patches via tree diff for non-linear history. Returns a composite patch. */
|
|
20037
|
+
async detectPatchesViaTreeDiff(lastGen) {
|
|
20038
|
+
const filesOutput = await this.git.exec(["diff", "--name-only", lastGen.commit_sha, "HEAD"]);
|
|
20039
|
+
const files = filesOutput.trim().split("\n").filter(Boolean).filter((f) => !INFRASTRUCTURE_FILES.has(f)).filter((f) => !f.startsWith(".fern/"));
|
|
20040
|
+
if (files.length === 0) return [];
|
|
20041
|
+
const diff = await this.git.exec(["diff", lastGen.commit_sha, "HEAD", "--", ...files]);
|
|
20042
|
+
if (!diff.trim()) return [];
|
|
20043
|
+
const contentHash = this.computeContentHash(diff);
|
|
20044
|
+
const lock = this.lockManager.read();
|
|
20045
|
+
if (lock.patches.some((p) => p.content_hash === contentHash)) {
|
|
20046
|
+
return [];
|
|
20047
|
+
}
|
|
20048
|
+
const headSha = (await this.git.exec(["rev-parse", "HEAD"])).trim();
|
|
20049
|
+
return [
|
|
20050
|
+
{
|
|
20051
|
+
id: `patch-composite-${headSha.slice(0, 8)}`,
|
|
20052
|
+
content_hash: contentHash,
|
|
20053
|
+
original_commit: headSha,
|
|
20054
|
+
original_message: "Customer customizations (composite)",
|
|
20055
|
+
original_author: "composite",
|
|
20056
|
+
base_generation: lastGen.commit_sha,
|
|
20057
|
+
files,
|
|
20058
|
+
patch_content: diff
|
|
20059
|
+
}
|
|
20060
|
+
];
|
|
20061
|
+
}
|
|
20062
|
+
parseGitLog(log) {
|
|
20063
|
+
return log.trim().split("\n").map((line) => {
|
|
20064
|
+
const [sha, authorName, authorEmail, message] = line.split("\0");
|
|
20065
|
+
return { sha, authorName, authorEmail, message };
|
|
20066
|
+
});
|
|
20067
|
+
}
|
|
20068
|
+
getLastGeneration(lock) {
|
|
20069
|
+
return lock.generations.find((g) => g.commit_sha === lock.current_generation);
|
|
20070
|
+
}
|
|
20071
|
+
};
|
|
19912
20072
|
BINARY_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
19913
20073
|
".png",
|
|
19914
20074
|
".jpg",
|
|
@@ -19996,9 +20156,8 @@ var init_ReplayApplicator = __esm({
|
|
|
19996
20156
|
}
|
|
19997
20157
|
/** Populate accumulator after git apply succeeds. */
|
|
19998
20158
|
async populateAccumulatorForPatch(patch, baseGen, currentTreeHash) {
|
|
19999
|
-
if (!baseGen)
|
|
20000
|
-
|
|
20001
|
-
const tempDir = await (0, import_promises4.mkdtemp)((0, import_node_path3.join)((0, import_node_os.tmpdir)(), "replay-acc-"));
|
|
20159
|
+
if (!baseGen) return;
|
|
20160
|
+
const tempDir = await (0, import_promises4.mkdtemp)((0, import_path9.join)((0, import_os.tmpdir)(), "replay-acc-"));
|
|
20002
20161
|
const { GitClient: GitClient2 } = await Promise.resolve().then(() => (init_GitClient(), GitClient_exports));
|
|
20003
20162
|
const tempGit = new GitClient2(tempDir);
|
|
20004
20163
|
await tempGit.exec(["init"]);
|
|
@@ -20006,8 +20165,7 @@ var init_ReplayApplicator = __esm({
|
|
|
20006
20165
|
await tempGit.exec(["config", "user.name", "Fern Replay"]);
|
|
20007
20166
|
try {
|
|
20008
20167
|
for (const filePath of patch.files) {
|
|
20009
|
-
if (isBinaryFile(filePath))
|
|
20010
|
-
continue;
|
|
20168
|
+
if (isBinaryFile(filePath)) continue;
|
|
20011
20169
|
const resolvedPath = await this.resolveFilePath(filePath, baseGen.tree_hash, currentTreeHash);
|
|
20012
20170
|
const base = await this.git.showFile(baseGen.tree_hash, filePath);
|
|
20013
20171
|
const theirs = await this.applyPatchToContent(base, patch.patch_content, filePath, tempGit, tempDir);
|
|
@@ -20028,12 +20186,13 @@ var init_ReplayApplicator = __esm({
|
|
|
20028
20186
|
const lock = this.lockManager.read();
|
|
20029
20187
|
const currentGen = lock.generations.find((g) => g.commit_sha === lock.current_generation);
|
|
20030
20188
|
const currentTreeHash = currentGen?.tree_hash ?? baseGen?.tree_hash ?? "";
|
|
20031
|
-
const needsAccumulation = await Promise.all(
|
|
20032
|
-
|
|
20033
|
-
return false;
|
|
20034
|
-
|
|
20035
|
-
|
|
20036
|
-
|
|
20189
|
+
const needsAccumulation = await Promise.all(
|
|
20190
|
+
patch.files.map(async (f) => {
|
|
20191
|
+
if (!baseGen) return false;
|
|
20192
|
+
const resolved = await this.resolveFilePath(f, baseGen.tree_hash, currentTreeHash);
|
|
20193
|
+
return this.fileTheirsAccumulator.has(resolved);
|
|
20194
|
+
})
|
|
20195
|
+
).then((results) => results.some(Boolean));
|
|
20037
20196
|
if (!needsAccumulation) {
|
|
20038
20197
|
const snapshots = /* @__PURE__ */ new Map();
|
|
20039
20198
|
const resolvedFiles = {};
|
|
@@ -20042,7 +20201,7 @@ var init_ReplayApplicator = __esm({
|
|
|
20042
20201
|
if (resolvedPath !== filePath) {
|
|
20043
20202
|
resolvedFiles[filePath] = resolvedPath;
|
|
20044
20203
|
}
|
|
20045
|
-
const fullPath = (0,
|
|
20204
|
+
const fullPath = (0, import_path9.join)(this.outputDir, resolvedPath);
|
|
20046
20205
|
snapshots.set(resolvedPath, await (0, import_promises4.readFile)(fullPath, "utf-8").catch(() => null));
|
|
20047
20206
|
}
|
|
20048
20207
|
try {
|
|
@@ -20057,7 +20216,7 @@ var init_ReplayApplicator = __esm({
|
|
|
20057
20216
|
} catch {
|
|
20058
20217
|
for (const [resolvedPath, content] of snapshots) {
|
|
20059
20218
|
if (content != null) {
|
|
20060
|
-
await (0, import_promises4.writeFile)((0,
|
|
20219
|
+
await (0, import_promises4.writeFile)((0, import_path9.join)(this.outputDir, resolvedPath), content);
|
|
20061
20220
|
}
|
|
20062
20221
|
}
|
|
20063
20222
|
}
|
|
@@ -20067,7 +20226,7 @@ var init_ReplayApplicator = __esm({
|
|
|
20067
20226
|
async applyWithThreeWayMerge(patch) {
|
|
20068
20227
|
const fileResults = [];
|
|
20069
20228
|
const resolvedFiles = {};
|
|
20070
|
-
const tempDir = await (0, import_promises4.mkdtemp)((0,
|
|
20229
|
+
const tempDir = await (0, import_promises4.mkdtemp)((0, import_path9.join)((0, import_os.tmpdir)(), "replay-"));
|
|
20071
20230
|
const { GitClient: GitClient2 } = await Promise.resolve().then(() => (init_GitClient(), GitClient_exports));
|
|
20072
20231
|
const tempGit = new GitClient2(tempDir);
|
|
20073
20232
|
await tempGit.exec(["init"]);
|
|
@@ -20130,13 +20289,26 @@ var init_ReplayApplicator = __esm({
|
|
|
20130
20289
|
renameSourcePath = renameSource;
|
|
20131
20290
|
}
|
|
20132
20291
|
}
|
|
20133
|
-
const oursPath = (0,
|
|
20292
|
+
const oursPath = (0, import_path9.join)(this.outputDir, resolvedPath);
|
|
20134
20293
|
const ours = await (0, import_promises4.readFile)(oursPath, "utf-8").catch(() => null);
|
|
20135
|
-
let theirs = await this.applyPatchToContent(
|
|
20294
|
+
let theirs = await this.applyPatchToContent(
|
|
20295
|
+
base,
|
|
20296
|
+
patch.patch_content,
|
|
20297
|
+
filePath,
|
|
20298
|
+
tempGit,
|
|
20299
|
+
tempDir,
|
|
20300
|
+
renameSourcePath
|
|
20301
|
+
);
|
|
20136
20302
|
let useAccumulatorAsMergeBase = false;
|
|
20137
20303
|
const accumulatorEntry = this.fileTheirsAccumulator.get(resolvedPath);
|
|
20138
20304
|
if (!theirs && base && accumulatorEntry) {
|
|
20139
|
-
theirs = await this.applyPatchToContent(
|
|
20305
|
+
theirs = await this.applyPatchToContent(
|
|
20306
|
+
accumulatorEntry.content,
|
|
20307
|
+
patch.patch_content,
|
|
20308
|
+
filePath,
|
|
20309
|
+
tempGit,
|
|
20310
|
+
tempDir
|
|
20311
|
+
);
|
|
20140
20312
|
if (theirs) {
|
|
20141
20313
|
useAccumulatorAsMergeBase = true;
|
|
20142
20314
|
}
|
|
@@ -20160,14 +20332,14 @@ var init_ReplayApplicator = __esm({
|
|
|
20160
20332
|
}
|
|
20161
20333
|
}
|
|
20162
20334
|
if (!base && !ours && effective_theirs) {
|
|
20163
|
-
const outDir2 = (0,
|
|
20335
|
+
const outDir2 = (0, import_path9.dirname)(oursPath);
|
|
20164
20336
|
await (0, import_promises4.mkdir)(outDir2, { recursive: true });
|
|
20165
20337
|
await (0, import_promises4.writeFile)(oursPath, effective_theirs);
|
|
20166
20338
|
return { file: resolvedPath, status: "merged", reason: "new-file" };
|
|
20167
20339
|
}
|
|
20168
20340
|
if (!base && ours && effective_theirs) {
|
|
20169
20341
|
const merged2 = threeWayMerge("", ours, effective_theirs);
|
|
20170
|
-
const outDir2 = (0,
|
|
20342
|
+
const outDir2 = (0, import_path9.dirname)(oursPath);
|
|
20171
20343
|
await (0, import_promises4.mkdir)(outDir2, { recursive: true });
|
|
20172
20344
|
await (0, import_promises4.writeFile)(oursPath, merged2.content);
|
|
20173
20345
|
if (merged2.hasConflicts) {
|
|
@@ -20197,7 +20369,7 @@ var init_ReplayApplicator = __esm({
|
|
|
20197
20369
|
}
|
|
20198
20370
|
const mergeBase = useAccumulatorAsMergeBase && accumulatorEntry ? accumulatorEntry.content : base;
|
|
20199
20371
|
const merged = threeWayMerge(mergeBase, ours, effective_theirs);
|
|
20200
|
-
const outDir = (0,
|
|
20372
|
+
const outDir = (0, import_path9.dirname)(oursPath);
|
|
20201
20373
|
await (0, import_promises4.mkdir)(outDir, { recursive: true });
|
|
20202
20374
|
await (0, import_promises4.writeFile)(oursPath, merged.content);
|
|
20203
20375
|
if (effective_theirs && base) {
|
|
@@ -20226,8 +20398,7 @@ var init_ReplayApplicator = __esm({
|
|
|
20226
20398
|
}
|
|
20227
20399
|
isExcluded(patch) {
|
|
20228
20400
|
const config = this.lockManager.getCustomizationsConfig();
|
|
20229
|
-
if (!config.exclude)
|
|
20230
|
-
return false;
|
|
20401
|
+
if (!config.exclude) return false;
|
|
20231
20402
|
return patch.files.some((file) => config.exclude.some((pattern) => minimatch(file, pattern)));
|
|
20232
20403
|
}
|
|
20233
20404
|
async resolveFilePath(filePath, baseTreeHash, currentTreeHash) {
|
|
@@ -20263,12 +20434,11 @@ var init_ReplayApplicator = __esm({
|
|
|
20263
20434
|
return this.extractNewFileFromPatch(patchContent, filePath);
|
|
20264
20435
|
}
|
|
20265
20436
|
const fileDiff = this.extractFileDiff(patchContent, filePath);
|
|
20266
|
-
if (!fileDiff)
|
|
20267
|
-
return null;
|
|
20437
|
+
if (!fileDiff) return null;
|
|
20268
20438
|
try {
|
|
20269
20439
|
if (sourceFilePath) {
|
|
20270
|
-
const tempSourcePath = (0,
|
|
20271
|
-
await (0, import_promises4.mkdir)((0,
|
|
20440
|
+
const tempSourcePath = (0, import_path9.join)(tempDir, sourceFilePath);
|
|
20441
|
+
await (0, import_promises4.mkdir)((0, import_path9.dirname)(tempSourcePath), { recursive: true });
|
|
20272
20442
|
await (0, import_promises4.writeFile)(tempSourcePath, base);
|
|
20273
20443
|
await tempGit.exec(["add", sourceFilePath]);
|
|
20274
20444
|
await tempGit.exec([
|
|
@@ -20278,11 +20448,11 @@ var init_ReplayApplicator = __esm({
|
|
|
20278
20448
|
"--allow-empty"
|
|
20279
20449
|
]);
|
|
20280
20450
|
await tempGit.execWithInput(["apply", "--allow-empty"], fileDiff);
|
|
20281
|
-
const tempTargetPath = (0,
|
|
20451
|
+
const tempTargetPath = (0, import_path9.join)(tempDir, filePath);
|
|
20282
20452
|
return await (0, import_promises4.readFile)(tempTargetPath, "utf-8");
|
|
20283
20453
|
}
|
|
20284
|
-
const tempFilePath = (0,
|
|
20285
|
-
await (0, import_promises4.mkdir)((0,
|
|
20454
|
+
const tempFilePath = (0, import_path9.join)(tempDir, filePath);
|
|
20455
|
+
await (0, import_promises4.mkdir)((0, import_path9.dirname)(tempFilePath), { recursive: true });
|
|
20286
20456
|
await (0, import_promises4.writeFile)(tempFilePath, base);
|
|
20287
20457
|
await tempGit.exec(["add", filePath]);
|
|
20288
20458
|
await tempGit.exec(["commit", "-m", `base for ${filePath}`, "--allow-empty"]);
|
|
@@ -20318,15 +20488,12 @@ var init_ReplayApplicator = __esm({
|
|
|
20318
20488
|
let inTargetFile = false;
|
|
20319
20489
|
for (const line of lines) {
|
|
20320
20490
|
if (line.startsWith("diff --git")) {
|
|
20321
|
-
if (inTargetFile)
|
|
20322
|
-
break;
|
|
20491
|
+
if (inTargetFile) break;
|
|
20323
20492
|
inTargetFile = isDiffLineForFile(line, targetFilePath);
|
|
20324
20493
|
continue;
|
|
20325
20494
|
}
|
|
20326
|
-
if (!inTargetFile)
|
|
20327
|
-
|
|
20328
|
-
if (line.startsWith("@@"))
|
|
20329
|
-
break;
|
|
20495
|
+
if (!inTargetFile) continue;
|
|
20496
|
+
if (line.startsWith("@@")) break;
|
|
20330
20497
|
if (line.startsWith("rename from ")) {
|
|
20331
20498
|
return line.slice("rename from ".length);
|
|
20332
20499
|
}
|
|
@@ -20341,20 +20508,17 @@ var init_ReplayApplicator = __esm({
|
|
|
20341
20508
|
let noTrailingNewline = false;
|
|
20342
20509
|
for (const line of lines) {
|
|
20343
20510
|
if (line.startsWith("diff --git")) {
|
|
20344
|
-
if (inTargetFile)
|
|
20345
|
-
break;
|
|
20511
|
+
if (inTargetFile) break;
|
|
20346
20512
|
inTargetFile = isDiffLineForFile(line, filePath);
|
|
20347
20513
|
inHunk = false;
|
|
20348
20514
|
continue;
|
|
20349
20515
|
}
|
|
20350
|
-
if (!inTargetFile)
|
|
20351
|
-
continue;
|
|
20516
|
+
if (!inTargetFile) continue;
|
|
20352
20517
|
if (line.startsWith("@@")) {
|
|
20353
20518
|
inHunk = true;
|
|
20354
20519
|
continue;
|
|
20355
20520
|
}
|
|
20356
|
-
if (!inHunk)
|
|
20357
|
-
continue;
|
|
20521
|
+
if (!inHunk) continue;
|
|
20358
20522
|
if (line === "\") {
|
|
20359
20523
|
noTrailingNewline = true;
|
|
20360
20524
|
continue;
|
|
@@ -20363,19 +20527,10 @@ var init_ReplayApplicator = __esm({
|
|
|
20363
20527
|
addedLines.push(line.slice(1));
|
|
20364
20528
|
}
|
|
20365
20529
|
}
|
|
20366
|
-
if (addedLines.length === 0)
|
|
20367
|
-
return null;
|
|
20530
|
+
if (addedLines.length === 0) return null;
|
|
20368
20531
|
return addedLines.join("\n") + (noTrailingNewline ? "" : "\n");
|
|
20369
20532
|
}
|
|
20370
20533
|
};
|
|
20371
|
-
}
|
|
20372
|
-
});
|
|
20373
|
-
|
|
20374
|
-
// ../../node_modules/.pnpm/@fern-api+replay@0.6.0/node_modules/@fern-api/replay/dist/ReplayCommitter.js
|
|
20375
|
-
var ReplayCommitter;
|
|
20376
|
-
var init_ReplayCommitter = __esm({
|
|
20377
|
-
"../../node_modules/.pnpm/@fern-api+replay@0.6.0/node_modules/@fern-api/replay/dist/ReplayCommitter.js"() {
|
|
20378
|
-
"use strict";
|
|
20379
20534
|
ReplayCommitter = class {
|
|
20380
20535
|
git;
|
|
20381
20536
|
outputDir;
|
|
@@ -20444,22 +20599,7 @@ CLI Version: ${options.cliVersion}`;
|
|
|
20444
20599
|
return this.git.getTreeHash(commitSha);
|
|
20445
20600
|
}
|
|
20446
20601
|
};
|
|
20447
|
-
}
|
|
20448
|
-
});
|
|
20449
|
-
|
|
20450
|
-
// ../../node_modules/.pnpm/@fern-api+replay@0.6.0/node_modules/@fern-api/replay/dist/ReplayService.js
|
|
20451
|
-
var import_node_fs2, import_node_path4, ReplayService;
|
|
20452
|
-
var init_ReplayService = __esm({
|
|
20453
|
-
"../../node_modules/.pnpm/@fern-api+replay@0.6.0/node_modules/@fern-api/replay/dist/ReplayService.js"() {
|
|
20454
|
-
"use strict";
|
|
20455
|
-
import_node_fs2 = require("fs");
|
|
20456
|
-
import_node_path4 = require("path");
|
|
20457
|
-
init_esm3();
|
|
20458
20602
|
init_GitClient();
|
|
20459
|
-
init_LockfileManager();
|
|
20460
|
-
init_ReplayApplicator();
|
|
20461
|
-
init_ReplayCommitter();
|
|
20462
|
-
init_ReplayDetector();
|
|
20463
20603
|
ReplayService = class {
|
|
20464
20604
|
git;
|
|
20465
20605
|
detector;
|
|
@@ -20705,7 +20845,15 @@ var init_ReplayService = __esm({
|
|
|
20705
20845
|
await this.committer.commitReplay(appliedCount, allPatches);
|
|
20706
20846
|
}
|
|
20707
20847
|
}
|
|
20708
|
-
return this.buildReport(
|
|
20848
|
+
return this.buildReport(
|
|
20849
|
+
"normal-regeneration",
|
|
20850
|
+
allPatches,
|
|
20851
|
+
results,
|
|
20852
|
+
options,
|
|
20853
|
+
warnings,
|
|
20854
|
+
rebaseCounts,
|
|
20855
|
+
preRebaseCounts
|
|
20856
|
+
);
|
|
20709
20857
|
}
|
|
20710
20858
|
/**
|
|
20711
20859
|
* Rebase cleanly applied patches so they are relative to the current generation.
|
|
@@ -20735,23 +20883,23 @@ var init_ReplayService = __esm({
|
|
|
20735
20883
|
await this.trimAbsorbedFiles(result, currentGenSha);
|
|
20736
20884
|
continue;
|
|
20737
20885
|
}
|
|
20738
|
-
if (result.status !== "applied")
|
|
20739
|
-
continue;
|
|
20886
|
+
if (result.status !== "applied") continue;
|
|
20740
20887
|
const patch = result.patch;
|
|
20741
|
-
if (patch.base_generation === currentGenSha)
|
|
20742
|
-
continue;
|
|
20888
|
+
if (patch.base_generation === currentGenSha) continue;
|
|
20743
20889
|
try {
|
|
20744
20890
|
const fernignorePatterns = this.readFernignorePatterns();
|
|
20745
|
-
const isUserOwned = await Promise.all(
|
|
20746
|
-
|
|
20747
|
-
|
|
20748
|
-
|
|
20749
|
-
|
|
20750
|
-
|
|
20751
|
-
|
|
20752
|
-
|
|
20753
|
-
|
|
20754
|
-
|
|
20891
|
+
const isUserOwned = await Promise.all(
|
|
20892
|
+
patch.files.map(async (file) => {
|
|
20893
|
+
if (file === ".fernignore") {
|
|
20894
|
+
return true;
|
|
20895
|
+
}
|
|
20896
|
+
if (fernignorePatterns.some((p) => file === p || minimatch(file, p))) {
|
|
20897
|
+
return true;
|
|
20898
|
+
}
|
|
20899
|
+
const content = await this.git.showFile(currentGenSha, file);
|
|
20900
|
+
return content === null;
|
|
20901
|
+
})
|
|
20902
|
+
);
|
|
20755
20903
|
const hasUserOwnedFiles = isUserOwned.some(Boolean);
|
|
20756
20904
|
if (hasUserOwnedFiles) {
|
|
20757
20905
|
this.lockManager.updatePatch(patch.id, {
|
|
@@ -20797,23 +20945,18 @@ var init_ReplayService = __esm({
|
|
|
20797
20945
|
*/
|
|
20798
20946
|
async trimAbsorbedFiles(result, currentGenSha) {
|
|
20799
20947
|
const cleanFiles = result.fileResults.filter((f) => f.status === "merged").map((f) => f.file);
|
|
20800
|
-
if (cleanFiles.length === 0)
|
|
20801
|
-
return;
|
|
20948
|
+
if (cleanFiles.length === 0) return;
|
|
20802
20949
|
const patch = result.patch;
|
|
20803
20950
|
const fernignorePatterns = this.readFernignorePatterns();
|
|
20804
20951
|
const generatorCleanFiles = [];
|
|
20805
20952
|
for (const file of cleanFiles) {
|
|
20806
|
-
if (file === ".fernignore")
|
|
20807
|
-
|
|
20808
|
-
if (fernignorePatterns.some((p) => file === p || minimatch(file, p)))
|
|
20809
|
-
continue;
|
|
20953
|
+
if (file === ".fernignore") continue;
|
|
20954
|
+
if (fernignorePatterns.some((p) => file === p || minimatch(file, p))) continue;
|
|
20810
20955
|
const content = await this.git.showFile(currentGenSha, file);
|
|
20811
|
-
if (content === null)
|
|
20812
|
-
continue;
|
|
20956
|
+
if (content === null) continue;
|
|
20813
20957
|
generatorCleanFiles.push(file);
|
|
20814
20958
|
}
|
|
20815
|
-
if (generatorCleanFiles.length === 0)
|
|
20816
|
-
return;
|
|
20959
|
+
if (generatorCleanFiles.length === 0) return;
|
|
20817
20960
|
const absorbedFiles = /* @__PURE__ */ new Set();
|
|
20818
20961
|
for (const file of generatorCleanFiles) {
|
|
20819
20962
|
try {
|
|
@@ -20824,11 +20967,9 @@ var init_ReplayService = __esm({
|
|
|
20824
20967
|
} catch {
|
|
20825
20968
|
}
|
|
20826
20969
|
}
|
|
20827
|
-
if (absorbedFiles.size === 0)
|
|
20828
|
-
return;
|
|
20970
|
+
if (absorbedFiles.size === 0) return;
|
|
20829
20971
|
const remainingFiles = patch.files.filter((f) => !absorbedFiles.has(f));
|
|
20830
|
-
if (remainingFiles.length === patch.files.length)
|
|
20831
|
-
return;
|
|
20972
|
+
if (remainingFiles.length === patch.files.length) return;
|
|
20832
20973
|
try {
|
|
20833
20974
|
this.lockManager.updatePatch(patch.id, { files: remainingFiles });
|
|
20834
20975
|
} catch {
|
|
@@ -20853,8 +20994,7 @@ var init_ReplayService = __esm({
|
|
|
20853
20994
|
if (patch.base_generation === currentGen) {
|
|
20854
20995
|
try {
|
|
20855
20996
|
const diff = await this.git.exec(["diff", currentGen, "HEAD", "--", ...patch.files]).catch(() => null);
|
|
20856
|
-
if (diff === null)
|
|
20857
|
-
continue;
|
|
20997
|
+
if (diff === null) continue;
|
|
20858
20998
|
if (!diff.trim()) {
|
|
20859
20999
|
this.lockManager.removePatch(patch.id);
|
|
20860
21000
|
contentRefreshed++;
|
|
@@ -20881,11 +21021,9 @@ var init_ReplayService = __esm({
|
|
|
20881
21021
|
}
|
|
20882
21022
|
try {
|
|
20883
21023
|
const markerFiles = await this.git.exec(["grep", "-l", "<<<<<<<", "HEAD", "--", ...patch.files]).catch(() => "");
|
|
20884
|
-
if (markerFiles.trim())
|
|
20885
|
-
continue;
|
|
21024
|
+
if (markerFiles.trim()) continue;
|
|
20886
21025
|
const diff = await this.git.exec(["diff", currentGen, "HEAD", "--", ...patch.files]).catch(() => null);
|
|
20887
|
-
if (diff === null)
|
|
20888
|
-
continue;
|
|
21026
|
+
if (diff === null) continue;
|
|
20889
21027
|
if (!diff.trim()) {
|
|
20890
21028
|
this.lockManager.removePatch(patch.id);
|
|
20891
21029
|
conflictAbsorbed++;
|
|
@@ -20904,10 +21042,9 @@ var init_ReplayService = __esm({
|
|
|
20904
21042
|
return { conflictResolved, conflictAbsorbed, contentRefreshed };
|
|
20905
21043
|
}
|
|
20906
21044
|
readFernignorePatterns() {
|
|
20907
|
-
const fernignorePath = (0,
|
|
20908
|
-
if (!(0,
|
|
20909
|
-
|
|
20910
|
-
return (0, import_node_fs2.readFileSync)(fernignorePath, "utf-8").split("\n").map((line) => line.trim()).filter((line) => line && !line.startsWith("#"));
|
|
21045
|
+
const fernignorePath = (0, import_path10.join)(this.outputDir, ".fernignore");
|
|
21046
|
+
if (!(0, import_fs7.existsSync)(fernignorePath)) return [];
|
|
21047
|
+
return (0, import_fs7.readFileSync)(fernignorePath, "utf-8").split("\n").map((line) => line.trim()).filter((line) => line && !line.startsWith("#"));
|
|
20911
21048
|
}
|
|
20912
21049
|
buildReport(flow, patches, results, options, warnings, rebaseCounts, preRebaseCounts) {
|
|
20913
21050
|
const conflictResults = results.filter((r) => r.status === "conflict");
|
|
@@ -20943,20 +21080,6 @@ var init_ReplayService = __esm({
|
|
|
20943
21080
|
};
|
|
20944
21081
|
}
|
|
20945
21082
|
};
|
|
20946
|
-
}
|
|
20947
|
-
});
|
|
20948
|
-
|
|
20949
|
-
// ../../node_modules/.pnpm/@fern-api+replay@0.6.0/node_modules/@fern-api/replay/dist/FernignoreMigrator.js
|
|
20950
|
-
var import_node_crypto2, import_node_fs3, import_node_path5, import_yaml2, FernignoreMigrator;
|
|
20951
|
-
var init_FernignoreMigrator = __esm({
|
|
20952
|
-
"../../node_modules/.pnpm/@fern-api+replay@0.6.0/node_modules/@fern-api/replay/dist/FernignoreMigrator.js"() {
|
|
20953
|
-
"use strict";
|
|
20954
|
-
import_node_crypto2 = require("crypto");
|
|
20955
|
-
import_node_fs3 = require("fs");
|
|
20956
|
-
import_node_path5 = require("path");
|
|
20957
|
-
init_esm3();
|
|
20958
|
-
import_yaml2 = __toESM(require_dist3(), 1);
|
|
20959
|
-
init_ReplayDetector();
|
|
20960
21083
|
FernignoreMigrator = class {
|
|
20961
21084
|
git;
|
|
20962
21085
|
lockManager;
|
|
@@ -20967,14 +21090,14 @@ var init_FernignoreMigrator = __esm({
|
|
|
20967
21090
|
this.outputDir = outputDir;
|
|
20968
21091
|
}
|
|
20969
21092
|
fernignoreExists() {
|
|
20970
|
-
return (0,
|
|
21093
|
+
return (0, import_fs8.existsSync)((0, import_path11.join)(this.outputDir, ".fernignore"));
|
|
20971
21094
|
}
|
|
20972
21095
|
readFernignorePatterns() {
|
|
20973
|
-
const fernignorePath = (0,
|
|
20974
|
-
if (!(0,
|
|
21096
|
+
const fernignorePath = (0, import_path11.join)(this.outputDir, ".fernignore");
|
|
21097
|
+
if (!(0, import_fs8.existsSync)(fernignorePath)) {
|
|
20975
21098
|
return [];
|
|
20976
21099
|
}
|
|
20977
|
-
const content = (0,
|
|
21100
|
+
const content = (0, import_fs8.readFileSync)(fernignorePath, "utf-8");
|
|
20978
21101
|
return content.split("\n").map((line) => line.trim()).filter((line) => line && !line.startsWith("#"));
|
|
20979
21102
|
}
|
|
20980
21103
|
/** Analyze .fernignore patterns vs git history. Creates synthetic patches for files differing from pristine generation. */
|
|
@@ -21021,9 +21144,9 @@ var init_FernignoreMigrator = __esm({
|
|
|
21021
21144
|
}
|
|
21022
21145
|
if (patchFiles.length > 0) {
|
|
21023
21146
|
const patchContent = diffParts.join("\n");
|
|
21024
|
-
const contentHash = `sha256:${(0,
|
|
21147
|
+
const contentHash = `sha256:${(0, import_crypto2.createHash)("sha256").update(patchContent).digest("hex")}`;
|
|
21025
21148
|
syntheticPatches.push({
|
|
21026
|
-
id: `patch-fernignore-${(0,
|
|
21149
|
+
id: `patch-fernignore-${(0, import_crypto2.createHash)("sha256").update(pattern).digest("hex").slice(0, 8)}`,
|
|
21027
21150
|
content_hash: contentHash,
|
|
21028
21151
|
original_commit: currentGen.commit_sha,
|
|
21029
21152
|
original_message: `[fernignore-migration] Customizations for ${pattern}`,
|
|
@@ -21055,22 +21178,24 @@ var init_FernignoreMigrator = __esm({
|
|
|
21055
21178
|
const allFiles = (await this.git.exec(["ls-files"])).trim().split("\n").filter(Boolean);
|
|
21056
21179
|
const results = [];
|
|
21057
21180
|
for (const pattern of patterns) {
|
|
21058
|
-
const matching = allFiles.filter(
|
|
21181
|
+
const matching = allFiles.filter(
|
|
21182
|
+
(f) => minimatch(f, pattern) || f === pattern || f.startsWith(pattern + "/")
|
|
21183
|
+
);
|
|
21059
21184
|
results.push({ pattern, files: matching.length > 0 ? matching : [pattern] });
|
|
21060
21185
|
}
|
|
21061
21186
|
return results;
|
|
21062
21187
|
}
|
|
21063
21188
|
readFileContent(filePath) {
|
|
21064
|
-
const fullPath = (0,
|
|
21065
|
-
if (!(0,
|
|
21189
|
+
const fullPath = (0, import_path11.join)(this.outputDir, filePath);
|
|
21190
|
+
if (!(0, import_fs8.existsSync)(fullPath)) {
|
|
21066
21191
|
return null;
|
|
21067
21192
|
}
|
|
21068
21193
|
try {
|
|
21069
|
-
const stat = (0,
|
|
21194
|
+
const stat = (0, import_fs8.statSync)(fullPath);
|
|
21070
21195
|
if (stat.isDirectory()) {
|
|
21071
21196
|
return null;
|
|
21072
21197
|
}
|
|
21073
|
-
return (0,
|
|
21198
|
+
return (0, import_fs8.readFileSync)(fullPath, "utf-8");
|
|
21074
21199
|
} catch {
|
|
21075
21200
|
return null;
|
|
21076
21201
|
}
|
|
@@ -21115,7 +21240,9 @@ var init_FernignoreMigrator = __esm({
|
|
|
21115
21240
|
this.lockManager.save();
|
|
21116
21241
|
}
|
|
21117
21242
|
for (const file of analysis.fernignoreOnly) {
|
|
21118
|
-
warnings.push(
|
|
21243
|
+
warnings.push(
|
|
21244
|
+
`${file}: in .fernignore but no commit history found. Commit this file or keep in .fernignore as fallback.`
|
|
21245
|
+
);
|
|
21119
21246
|
}
|
|
21120
21247
|
return {
|
|
21121
21248
|
patchesCreated,
|
|
@@ -21124,405 +21251,25 @@ var init_FernignoreMigrator = __esm({
|
|
|
21124
21251
|
};
|
|
21125
21252
|
}
|
|
21126
21253
|
movePatternsToReplayYml(patterns) {
|
|
21127
|
-
const replayYmlPath = (0,
|
|
21254
|
+
const replayYmlPath = (0, import_path11.join)(this.outputDir, ".fern", "replay.yml");
|
|
21128
21255
|
let config = {};
|
|
21129
|
-
if ((0,
|
|
21130
|
-
const content = (0,
|
|
21256
|
+
if ((0, import_fs8.existsSync)(replayYmlPath)) {
|
|
21257
|
+
const content = (0, import_fs8.readFileSync)(replayYmlPath, "utf-8");
|
|
21131
21258
|
config = (0, import_yaml2.parse)(content) ?? {};
|
|
21132
21259
|
}
|
|
21133
21260
|
const existing = config.exclude ?? [];
|
|
21134
|
-
const merged = [.../* @__PURE__ */ new Set([...existing, ...patterns])];
|
|
21135
|
-
config.exclude = merged;
|
|
21136
|
-
const dir = (0,
|
|
21137
|
-
if (!(0,
|
|
21138
|
-
(0,
|
|
21139
|
-
}
|
|
21140
|
-
(0,
|
|
21141
|
-
}
|
|
21142
|
-
};
|
|
21143
|
-
}
|
|
21144
|
-
});
|
|
21145
|
-
|
|
21146
|
-
// ../../node_modules/.pnpm/@fern-api+replay@0.6.0/node_modules/@fern-api/replay/dist/commands/bootstrap.js
|
|
21147
|
-
async function bootstrap(outputDir, options) {
|
|
21148
|
-
const git = new GitClient(outputDir);
|
|
21149
|
-
const lockManager = new LockfileManager(outputDir);
|
|
21150
|
-
const maxCommits = options?.maxCommitsToScan ?? 500;
|
|
21151
|
-
const warnings = [];
|
|
21152
|
-
if (lockManager.exists() && !options?.force) {
|
|
21153
|
-
return {
|
|
21154
|
-
generationCommit: null,
|
|
21155
|
-
patchesDetected: 0,
|
|
21156
|
-
patchesCreated: 0,
|
|
21157
|
-
patches: [],
|
|
21158
|
-
fernignorePatterns: [],
|
|
21159
|
-
fernignoreUpdated: false,
|
|
21160
|
-
warnings: ["Replay lockfile already exists. Use --force to overwrite."],
|
|
21161
|
-
staleGenerationsSkipped: 0,
|
|
21162
|
-
scannedSinceGeneration: ""
|
|
21163
|
-
};
|
|
21164
|
-
}
|
|
21165
|
-
const genCommits = await findAllGenerationCommits(git, maxCommits);
|
|
21166
|
-
if (genCommits.length === 0) {
|
|
21167
|
-
return {
|
|
21168
|
-
generationCommit: null,
|
|
21169
|
-
patchesDetected: 0,
|
|
21170
|
-
patchesCreated: 0,
|
|
21171
|
-
patches: [],
|
|
21172
|
-
fernignorePatterns: [],
|
|
21173
|
-
fernignoreUpdated: false,
|
|
21174
|
-
warnings: [
|
|
21175
|
-
"No generation commits found in the last " + maxCommits + " commits. Run 'fern generate' first to establish a baseline."
|
|
21176
|
-
],
|
|
21177
|
-
staleGenerationsSkipped: 0,
|
|
21178
|
-
scannedSinceGeneration: ""
|
|
21179
|
-
};
|
|
21180
|
-
}
|
|
21181
|
-
const latestGen = genCommits[0];
|
|
21182
|
-
const anchorSha = options?.importHistory ? latestGen.sha : (await git.exec(["rev-parse", "HEAD"])).trim();
|
|
21183
|
-
const treeHash = await git.getTreeHash(anchorSha);
|
|
21184
|
-
const genRecord = {
|
|
21185
|
-
commit_sha: anchorSha,
|
|
21186
|
-
tree_hash: treeHash,
|
|
21187
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
21188
|
-
cli_version: "unknown",
|
|
21189
|
-
generator_versions: {}
|
|
21190
|
-
};
|
|
21191
|
-
lockManager.initializeInMemory(genRecord);
|
|
21192
|
-
const patches = options?.importHistory ? await findAllUserPatches(git, genCommits) : [];
|
|
21193
|
-
const migrator = new FernignoreMigrator(git, lockManager, outputDir);
|
|
21194
|
-
const fernignorePatterns = migrator.readFernignorePatterns();
|
|
21195
|
-
let fernignoreAnalysis;
|
|
21196
|
-
if (options?.importHistory && migrator.fernignoreExists() && fernignorePatterns.length > 0) {
|
|
21197
|
-
fernignoreAnalysis = await migrator.analyzeMigration();
|
|
21198
|
-
if (fernignoreAnalysis.syntheticPatches.length > 0) {
|
|
21199
|
-
patches.push(...fernignoreAnalysis.syntheticPatches);
|
|
21200
|
-
}
|
|
21201
|
-
if (fernignoreAnalysis.fernignoreOnly.length > 0) {
|
|
21202
|
-
for (const file of fernignoreAnalysis.fernignoreOnly) {
|
|
21203
|
-
warnings.push(`${file}: in .fernignore but no recent commits found since last generation. File may be stale, matches generated output, or does not exist. No customization to track.`);
|
|
21204
|
-
}
|
|
21205
|
-
}
|
|
21206
|
-
}
|
|
21207
|
-
if (options?.dryRun) {
|
|
21208
|
-
return {
|
|
21209
|
-
generationCommit: latestGen,
|
|
21210
|
-
patchesDetected: patches.length,
|
|
21211
|
-
patchesCreated: 0,
|
|
21212
|
-
patches,
|
|
21213
|
-
fernignorePatterns,
|
|
21214
|
-
fernignoreAnalysis,
|
|
21215
|
-
fernignoreUpdated: false,
|
|
21216
|
-
warnings,
|
|
21217
|
-
staleGenerationsSkipped: genCommits.length - 1,
|
|
21218
|
-
scannedSinceGeneration: latestGen.sha
|
|
21219
|
-
};
|
|
21220
|
-
}
|
|
21221
|
-
for (const patch of patches) {
|
|
21222
|
-
lockManager.addPatch(patch);
|
|
21223
|
-
}
|
|
21224
|
-
lockManager.save();
|
|
21225
|
-
const fernignoreUpdated = ensureFernignoreEntries(outputDir);
|
|
21226
|
-
if (migrator.fernignoreExists() && fernignorePatterns.length > 0) {
|
|
21227
|
-
const action = options?.fernignoreAction ?? "skip";
|
|
21228
|
-
if (action === "migrate") {
|
|
21229
|
-
const patternsToExclude = fernignoreAnalysis?.fernignoreOnly ?? [];
|
|
21230
|
-
if (patternsToExclude.length > 0) {
|
|
21231
|
-
migrator.movePatternsToReplayYml(patternsToExclude);
|
|
21261
|
+
const merged = [.../* @__PURE__ */ new Set([...existing, ...patterns])];
|
|
21262
|
+
config.exclude = merged;
|
|
21263
|
+
const dir = (0, import_path11.dirname)(replayYmlPath);
|
|
21264
|
+
if (!(0, import_fs8.existsSync)(dir)) {
|
|
21265
|
+
(0, import_fs8.mkdirSync)(dir, { recursive: true });
|
|
21266
|
+
}
|
|
21267
|
+
(0, import_fs8.writeFileSync)(replayYmlPath, (0, import_yaml2.stringify)(config, { lineWidth: 0 }), "utf-8");
|
|
21232
21268
|
}
|
|
21233
|
-
}
|
|
21234
|
-
}
|
|
21235
|
-
return {
|
|
21236
|
-
generationCommit: latestGen,
|
|
21237
|
-
patchesDetected: patches.length,
|
|
21238
|
-
patchesCreated: patches.length,
|
|
21239
|
-
patches,
|
|
21240
|
-
fernignorePatterns,
|
|
21241
|
-
fernignoreAnalysis,
|
|
21242
|
-
fernignoreUpdated,
|
|
21243
|
-
warnings,
|
|
21244
|
-
staleGenerationsSkipped: genCommits.length - 1,
|
|
21245
|
-
scannedSinceGeneration: latestGen.sha
|
|
21246
|
-
};
|
|
21247
|
-
}
|
|
21248
|
-
async function findAllGenerationCommits(git, maxCommits) {
|
|
21249
|
-
const log = await git.exec(["log", "--format=%H%x00%an%x00%ae%x00%s", `-${maxCommits}`]);
|
|
21250
|
-
if (!log.trim()) {
|
|
21251
|
-
return [];
|
|
21252
|
-
}
|
|
21253
|
-
const genCommits = [];
|
|
21254
|
-
for (const line of log.trim().split("\n")) {
|
|
21255
|
-
if (!line)
|
|
21256
|
-
continue;
|
|
21257
|
-
const [sha, authorName, authorEmail, message] = line.split("\0");
|
|
21258
|
-
const commit = { sha, authorName, authorEmail, message };
|
|
21259
|
-
if (isGenerationCommit(commit) && !isReplayCommit(commit)) {
|
|
21260
|
-
genCommits.push(commit);
|
|
21261
|
-
}
|
|
21262
|
-
}
|
|
21263
|
-
return genCommits;
|
|
21264
|
-
}
|
|
21265
|
-
async function findAllUserPatches(git, genCommits) {
|
|
21266
|
-
const patches = [];
|
|
21267
|
-
const seenHashes = /* @__PURE__ */ new Set();
|
|
21268
|
-
const latestGen = genCommits[0];
|
|
21269
|
-
const recentPatches = await extractUserPatches(git, latestGen.sha, "HEAD", latestGen.sha, seenHashes);
|
|
21270
|
-
patches.push(...recentPatches);
|
|
21271
|
-
return patches;
|
|
21272
|
-
}
|
|
21273
|
-
async function extractUserPatches(git, fromSha, toRef, baseGeneration, seenHashes) {
|
|
21274
|
-
const log = await git.exec(["log", "--format=%H%x00%an%x00%ae%x00%s", `${fromSha}..${toRef}`]);
|
|
21275
|
-
if (!log.trim()) {
|
|
21276
|
-
return [];
|
|
21277
|
-
}
|
|
21278
|
-
const commits = parseGitLog(log);
|
|
21279
|
-
const patches = [];
|
|
21280
|
-
for (const commit of commits.reverse()) {
|
|
21281
|
-
if (isGenerationCommit(commit))
|
|
21282
|
-
continue;
|
|
21283
|
-
const parents = await git.getCommitParents(commit.sha);
|
|
21284
|
-
if (parents.length > 1)
|
|
21285
|
-
continue;
|
|
21286
|
-
const patchContent = await git.formatPatch(commit.sha);
|
|
21287
|
-
const contentHash = computeContentHash(patchContent);
|
|
21288
|
-
if (seenHashes.has(contentHash))
|
|
21289
|
-
continue;
|
|
21290
|
-
seenHashes.add(contentHash);
|
|
21291
|
-
const filesOutput = await git.exec(["diff-tree", "--no-commit-id", "--name-only", "-r", commit.sha]);
|
|
21292
|
-
patches.push({
|
|
21293
|
-
id: `patch-${commit.sha.slice(0, 8)}`,
|
|
21294
|
-
content_hash: contentHash,
|
|
21295
|
-
original_commit: commit.sha,
|
|
21296
|
-
original_message: commit.message,
|
|
21297
|
-
original_author: `${commit.authorName} <${commit.authorEmail}>`,
|
|
21298
|
-
base_generation: baseGeneration,
|
|
21299
|
-
files: filesOutput.trim().split("\n").filter(Boolean),
|
|
21300
|
-
patch_content: patchContent
|
|
21301
|
-
});
|
|
21302
|
-
}
|
|
21303
|
-
return patches;
|
|
21304
|
-
}
|
|
21305
|
-
function parseGitLog(log) {
|
|
21306
|
-
return log.trim().split("\n").filter(Boolean).map((line) => {
|
|
21307
|
-
const [sha, authorName, authorEmail, message] = line.split("\0");
|
|
21308
|
-
return { sha, authorName, authorEmail, message };
|
|
21309
|
-
});
|
|
21310
|
-
}
|
|
21311
|
-
function ensureFernignoreEntries(outputDir) {
|
|
21312
|
-
const fernignorePath = (0, import_node_path6.join)(outputDir, ".fernignore");
|
|
21313
|
-
let content = "";
|
|
21314
|
-
if ((0, import_node_fs4.existsSync)(fernignorePath)) {
|
|
21315
|
-
content = (0, import_node_fs4.readFileSync)(fernignorePath, "utf-8");
|
|
21316
|
-
}
|
|
21317
|
-
const lines = content.split("\n");
|
|
21318
|
-
const toAdd = [];
|
|
21319
|
-
for (const entry of REPLAY_FERNIGNORE_ENTRIES) {
|
|
21320
|
-
if (!lines.some((line) => line.trim() === entry)) {
|
|
21321
|
-
toAdd.push(entry);
|
|
21322
|
-
}
|
|
21323
|
-
}
|
|
21324
|
-
if (toAdd.length === 0) {
|
|
21325
|
-
return false;
|
|
21326
|
-
}
|
|
21327
|
-
if (content && !content.endsWith("\n")) {
|
|
21328
|
-
content += "\n";
|
|
21329
|
-
}
|
|
21330
|
-
content += toAdd.join("\n") + "\n";
|
|
21331
|
-
(0, import_node_fs4.writeFileSync)(fernignorePath, content, "utf-8");
|
|
21332
|
-
return true;
|
|
21333
|
-
}
|
|
21334
|
-
function computeContentHash(patchContent) {
|
|
21335
|
-
const normalized = patchContent.split("\n").filter((line) => !line.startsWith("From ") && !line.startsWith("index ") && !line.startsWith("Date: ")).join("\n");
|
|
21336
|
-
return `sha256:${(0, import_node_crypto3.createHash)("sha256").update(normalized).digest("hex")}`;
|
|
21337
|
-
}
|
|
21338
|
-
var import_node_crypto3, import_node_fs4, import_node_path6, REPLAY_FERNIGNORE_ENTRIES;
|
|
21339
|
-
var init_bootstrap = __esm({
|
|
21340
|
-
"../../node_modules/.pnpm/@fern-api+replay@0.6.0/node_modules/@fern-api/replay/dist/commands/bootstrap.js"() {
|
|
21341
|
-
"use strict";
|
|
21342
|
-
import_node_crypto3 = require("crypto");
|
|
21343
|
-
import_node_fs4 = require("fs");
|
|
21344
|
-
import_node_path6 = require("path");
|
|
21345
|
-
init_FernignoreMigrator();
|
|
21346
|
-
init_CommitDetection();
|
|
21347
|
-
init_GitClient();
|
|
21348
|
-
init_LockfileManager();
|
|
21349
|
-
REPLAY_FERNIGNORE_ENTRIES = [".fern/replay.lock", ".fern/replay.yml"];
|
|
21350
|
-
}
|
|
21351
|
-
});
|
|
21352
|
-
|
|
21353
|
-
// ../../node_modules/.pnpm/@fern-api+replay@0.6.0/node_modules/@fern-api/replay/dist/commands/forget.js
|
|
21354
|
-
function forget(outputDir, filePattern, options) {
|
|
21355
|
-
const lockManager = new LockfileManager(outputDir);
|
|
21356
|
-
if (!lockManager.exists()) {
|
|
21357
|
-
return { removed: [], notFound: true };
|
|
21358
|
-
}
|
|
21359
|
-
const lock = lockManager.read();
|
|
21360
|
-
const matchingPatches = lock.patches.filter((patch) => patch.files.some((file) => file === filePattern || minimatch(file, filePattern)));
|
|
21361
|
-
if (matchingPatches.length === 0) {
|
|
21362
|
-
return { removed: [], notFound: true };
|
|
21363
|
-
}
|
|
21364
|
-
const removed = matchingPatches.map((p) => ({
|
|
21365
|
-
id: p.id,
|
|
21366
|
-
message: p.original_message,
|
|
21367
|
-
files: p.files
|
|
21368
|
-
}));
|
|
21369
|
-
if (!options?.dryRun) {
|
|
21370
|
-
for (const patch of matchingPatches) {
|
|
21371
|
-
lockManager.removePatch(patch.id);
|
|
21372
|
-
}
|
|
21373
|
-
lockManager.save();
|
|
21374
|
-
}
|
|
21375
|
-
return { removed, notFound: false };
|
|
21376
|
-
}
|
|
21377
|
-
var init_forget = __esm({
|
|
21378
|
-
"../../node_modules/.pnpm/@fern-api+replay@0.6.0/node_modules/@fern-api/replay/dist/commands/forget.js"() {
|
|
21379
|
-
"use strict";
|
|
21380
|
-
init_esm3();
|
|
21381
|
-
init_LockfileManager();
|
|
21382
|
-
}
|
|
21383
|
-
});
|
|
21384
|
-
|
|
21385
|
-
// ../../node_modules/.pnpm/@fern-api+replay@0.6.0/node_modules/@fern-api/replay/dist/commands/reset.js
|
|
21386
|
-
function reset(outputDir, options) {
|
|
21387
|
-
const lockManager = new LockfileManager(outputDir);
|
|
21388
|
-
if (!lockManager.exists()) {
|
|
21389
|
-
return {
|
|
21390
|
-
success: true,
|
|
21391
|
-
patchesRemoved: 0,
|
|
21392
|
-
lockfileDeleted: false,
|
|
21393
|
-
nothingToReset: true
|
|
21394
21269
|
};
|
|
21395
|
-
}
|
|
21396
|
-
const lock = lockManager.read();
|
|
21397
|
-
const patchCount = lock.patches.length;
|
|
21398
|
-
if (!options?.dryRun) {
|
|
21399
|
-
(0, import_node_fs5.unlinkSync)(lockManager.lockfilePath);
|
|
21400
|
-
}
|
|
21401
|
-
return {
|
|
21402
|
-
success: true,
|
|
21403
|
-
patchesRemoved: patchCount,
|
|
21404
|
-
lockfileDeleted: true,
|
|
21405
|
-
nothingToReset: false
|
|
21406
|
-
};
|
|
21407
|
-
}
|
|
21408
|
-
var import_node_fs5;
|
|
21409
|
-
var init_reset2 = __esm({
|
|
21410
|
-
"../../node_modules/.pnpm/@fern-api+replay@0.6.0/node_modules/@fern-api/replay/dist/commands/reset.js"() {
|
|
21411
|
-
"use strict";
|
|
21412
|
-
import_node_fs5 = require("fs");
|
|
21413
|
-
init_LockfileManager();
|
|
21414
|
-
}
|
|
21415
|
-
});
|
|
21416
|
-
|
|
21417
|
-
// ../../node_modules/.pnpm/@fern-api+replay@0.6.0/node_modules/@fern-api/replay/dist/commands/resolve.js
|
|
21418
|
-
async function resolve7(outputDir, options) {
|
|
21419
|
-
const lockManager = new LockfileManager(outputDir);
|
|
21420
|
-
if (!lockManager.exists()) {
|
|
21421
|
-
return { success: false, reason: "no-lockfile" };
|
|
21422
|
-
}
|
|
21423
|
-
const lock = lockManager.read();
|
|
21424
|
-
if (lock.patches.length === 0) {
|
|
21425
|
-
return { success: false, reason: "no-patches" };
|
|
21426
|
-
}
|
|
21427
|
-
const git = new GitClient(outputDir);
|
|
21428
|
-
if (options?.checkMarkers !== false) {
|
|
21429
|
-
const markerFiles = await git.exec(["grep", "-l", "<<<<<<<", "--", "."]).catch(() => "");
|
|
21430
|
-
if (markerFiles.trim()) {
|
|
21431
|
-
const files = markerFiles.trim().split("\n").filter(Boolean);
|
|
21432
|
-
return { success: false, reason: "unresolved-conflicts", unresolvedFiles: files };
|
|
21433
|
-
}
|
|
21434
|
-
}
|
|
21435
|
-
const committer = new ReplayCommitter(git, outputDir);
|
|
21436
|
-
await committer.stageAll();
|
|
21437
|
-
const commitSha = await committer.commitReplay(lock.patches.length, lock.patches);
|
|
21438
|
-
return { success: true, commitSha };
|
|
21439
|
-
}
|
|
21440
|
-
var init_resolve = __esm({
|
|
21441
|
-
"../../node_modules/.pnpm/@fern-api+replay@0.6.0/node_modules/@fern-api/replay/dist/commands/resolve.js"() {
|
|
21442
|
-
"use strict";
|
|
21443
21270
|
init_GitClient();
|
|
21444
|
-
|
|
21445
|
-
init_ReplayCommitter();
|
|
21446
|
-
}
|
|
21447
|
-
});
|
|
21448
|
-
|
|
21449
|
-
// ../../node_modules/.pnpm/@fern-api+replay@0.6.0/node_modules/@fern-api/replay/dist/commands/status.js
|
|
21450
|
-
function status(outputDir) {
|
|
21451
|
-
const lockManager = new LockfileManager(outputDir);
|
|
21452
|
-
if (!lockManager.exists()) {
|
|
21453
|
-
return { initialized: false, patches: [], lastGeneration: void 0 };
|
|
21454
|
-
}
|
|
21455
|
-
const lock = lockManager.read();
|
|
21456
|
-
const patches = lock.patches.map((patch) => ({
|
|
21457
|
-
sha: patch.original_commit.slice(0, 7),
|
|
21458
|
-
author: patch.original_author.split("<")[0]?.trim() ?? "unknown",
|
|
21459
|
-
message: patch.original_message,
|
|
21460
|
-
files: patch.files
|
|
21461
|
-
}));
|
|
21462
|
-
let lastGeneration;
|
|
21463
|
-
const lastGen = lock.generations.find((g) => g.commit_sha === lock.current_generation);
|
|
21464
|
-
if (lastGen) {
|
|
21465
|
-
lastGeneration = {
|
|
21466
|
-
sha: lastGen.commit_sha,
|
|
21467
|
-
timestamp: lastGen.timestamp
|
|
21468
|
-
};
|
|
21469
|
-
}
|
|
21470
|
-
return { initialized: true, patches, lastGeneration };
|
|
21471
|
-
}
|
|
21472
|
-
var init_status2 = __esm({
|
|
21473
|
-
"../../node_modules/.pnpm/@fern-api+replay@0.6.0/node_modules/@fern-api/replay/dist/commands/status.js"() {
|
|
21474
|
-
"use strict";
|
|
21475
|
-
init_LockfileManager();
|
|
21476
|
-
}
|
|
21477
|
-
});
|
|
21478
|
-
|
|
21479
|
-
// ../../node_modules/.pnpm/@fern-api+replay@0.6.0/node_modules/@fern-api/replay/dist/commands/index.js
|
|
21480
|
-
var init_commands = __esm({
|
|
21481
|
-
"../../node_modules/.pnpm/@fern-api+replay@0.6.0/node_modules/@fern-api/replay/dist/commands/index.js"() {
|
|
21482
|
-
"use strict";
|
|
21483
|
-
init_bootstrap();
|
|
21484
|
-
init_forget();
|
|
21485
|
-
init_reset2();
|
|
21486
|
-
init_resolve();
|
|
21487
|
-
init_status2();
|
|
21488
|
-
}
|
|
21489
|
-
});
|
|
21490
|
-
|
|
21491
|
-
// ../../node_modules/.pnpm/@fern-api+replay@0.6.0/node_modules/@fern-api/replay/dist/index.js
|
|
21492
|
-
var dist_exports = {};
|
|
21493
|
-
__export(dist_exports, {
|
|
21494
|
-
FERN_BOT_EMAIL: () => FERN_BOT_EMAIL2,
|
|
21495
|
-
FERN_BOT_LOGIN: () => FERN_BOT_LOGIN2,
|
|
21496
|
-
FERN_BOT_NAME: () => FERN_BOT_NAME2,
|
|
21497
|
-
FernignoreMigrator: () => FernignoreMigrator,
|
|
21498
|
-
GitClient: () => GitClient,
|
|
21499
|
-
LockfileManager: () => LockfileManager,
|
|
21500
|
-
ReplayApplicator: () => ReplayApplicator,
|
|
21501
|
-
ReplayCommitter: () => ReplayCommitter,
|
|
21502
|
-
ReplayDetector: () => ReplayDetector,
|
|
21503
|
-
ReplayService: () => ReplayService,
|
|
21504
|
-
bootstrap: () => bootstrap,
|
|
21505
|
-
forget: () => forget,
|
|
21506
|
-
isGenerationCommit: () => isGenerationCommit,
|
|
21507
|
-
isReplayCommit: () => isReplayCommit,
|
|
21508
|
-
reset: () => reset,
|
|
21509
|
-
resolve: () => resolve7,
|
|
21510
|
-
status: () => status,
|
|
21511
|
-
threeWayMerge: () => threeWayMerge
|
|
21512
|
-
});
|
|
21513
|
-
var init_dist = __esm({
|
|
21514
|
-
"../../node_modules/.pnpm/@fern-api+replay@0.6.0/node_modules/@fern-api/replay/dist/index.js"() {
|
|
21515
|
-
"use strict";
|
|
21271
|
+
REPLAY_FERNIGNORE_ENTRIES = [".fern/replay.lock", ".fern/replay.yml"];
|
|
21516
21272
|
init_GitClient();
|
|
21517
|
-
init_CommitDetection();
|
|
21518
|
-
init_LockfileManager();
|
|
21519
|
-
init_ReplayDetector();
|
|
21520
|
-
init_ThreeWayMerge();
|
|
21521
|
-
init_ReplayApplicator();
|
|
21522
|
-
init_ReplayCommitter();
|
|
21523
|
-
init_ReplayService();
|
|
21524
|
-
init_FernignoreMigrator();
|
|
21525
|
-
init_commands();
|
|
21526
21273
|
}
|
|
21527
21274
|
});
|
|
21528
21275
|
|
|
@@ -21560,9 +21307,9 @@ function resolve(...paths) {
|
|
|
21560
21307
|
}
|
|
21561
21308
|
|
|
21562
21309
|
// src/cli.ts
|
|
21563
|
-
var
|
|
21310
|
+
var import_fs14 = __toESM(require("fs"));
|
|
21564
21311
|
var import_promises9 = require("fs/promises");
|
|
21565
|
-
var
|
|
21312
|
+
var import_path16 = __toESM(require("path"));
|
|
21566
21313
|
|
|
21567
21314
|
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/yerror.js
|
|
21568
21315
|
var YError = class _YError extends Error {
|
|
@@ -23574,7 +23321,7 @@ async function cloneRepository({ githubRepository, installationToken, targetDire
|
|
|
23574
23321
|
});
|
|
23575
23322
|
}
|
|
23576
23323
|
|
|
23577
|
-
// ../../node_modules/.pnpm/universal-user-agent@
|
|
23324
|
+
// ../../node_modules/.pnpm/universal-user-agent@7.0.3/node_modules/universal-user-agent/index.js
|
|
23578
23325
|
function getUserAgent() {
|
|
23579
23326
|
if (typeof navigator === "object" && "userAgent" in navigator) {
|
|
23580
23327
|
return navigator.userAgent;
|
|
@@ -23582,16 +23329,117 @@ function getUserAgent() {
|
|
|
23582
23329
|
if (typeof process === "object" && process.version !== void 0) {
|
|
23583
23330
|
return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;
|
|
23584
23331
|
}
|
|
23585
|
-
return "<environment undetectable>";
|
|
23332
|
+
return "<environment undetectable>";
|
|
23333
|
+
}
|
|
23334
|
+
|
|
23335
|
+
// ../../node_modules/.pnpm/before-after-hook@4.0.0/node_modules/before-after-hook/lib/register.js
|
|
23336
|
+
function register(state, name, method, options) {
|
|
23337
|
+
if (typeof method !== "function") {
|
|
23338
|
+
throw new Error("method for before hook must be a function");
|
|
23339
|
+
}
|
|
23340
|
+
if (!options) {
|
|
23341
|
+
options = {};
|
|
23342
|
+
}
|
|
23343
|
+
if (Array.isArray(name)) {
|
|
23344
|
+
return name.reverse().reduce((callback, name2) => {
|
|
23345
|
+
return register.bind(null, state, name2, callback, options);
|
|
23346
|
+
}, method)();
|
|
23347
|
+
}
|
|
23348
|
+
return Promise.resolve().then(() => {
|
|
23349
|
+
if (!state.registry[name]) {
|
|
23350
|
+
return method(options);
|
|
23351
|
+
}
|
|
23352
|
+
return state.registry[name].reduce((method2, registered) => {
|
|
23353
|
+
return registered.hook.bind(null, method2, options);
|
|
23354
|
+
}, method)();
|
|
23355
|
+
});
|
|
23356
|
+
}
|
|
23357
|
+
|
|
23358
|
+
// ../../node_modules/.pnpm/before-after-hook@4.0.0/node_modules/before-after-hook/lib/add.js
|
|
23359
|
+
function addHook(state, kind, name, hook2) {
|
|
23360
|
+
const orig = hook2;
|
|
23361
|
+
if (!state.registry[name]) {
|
|
23362
|
+
state.registry[name] = [];
|
|
23363
|
+
}
|
|
23364
|
+
if (kind === "before") {
|
|
23365
|
+
hook2 = (method, options) => {
|
|
23366
|
+
return Promise.resolve().then(orig.bind(null, options)).then(method.bind(null, options));
|
|
23367
|
+
};
|
|
23368
|
+
}
|
|
23369
|
+
if (kind === "after") {
|
|
23370
|
+
hook2 = (method, options) => {
|
|
23371
|
+
let result;
|
|
23372
|
+
return Promise.resolve().then(method.bind(null, options)).then((result_) => {
|
|
23373
|
+
result = result_;
|
|
23374
|
+
return orig(result, options);
|
|
23375
|
+
}).then(() => {
|
|
23376
|
+
return result;
|
|
23377
|
+
});
|
|
23378
|
+
};
|
|
23379
|
+
}
|
|
23380
|
+
if (kind === "error") {
|
|
23381
|
+
hook2 = (method, options) => {
|
|
23382
|
+
return Promise.resolve().then(method.bind(null, options)).catch((error) => {
|
|
23383
|
+
return orig(error, options);
|
|
23384
|
+
});
|
|
23385
|
+
};
|
|
23386
|
+
}
|
|
23387
|
+
state.registry[name].push({
|
|
23388
|
+
hook: hook2,
|
|
23389
|
+
orig
|
|
23390
|
+
});
|
|
23586
23391
|
}
|
|
23587
23392
|
|
|
23588
|
-
// ../../node_modules/.pnpm
|
|
23589
|
-
|
|
23393
|
+
// ../../node_modules/.pnpm/before-after-hook@4.0.0/node_modules/before-after-hook/lib/remove.js
|
|
23394
|
+
function removeHook(state, name, method) {
|
|
23395
|
+
if (!state.registry[name]) {
|
|
23396
|
+
return;
|
|
23397
|
+
}
|
|
23398
|
+
const index = state.registry[name].map((registered) => {
|
|
23399
|
+
return registered.orig;
|
|
23400
|
+
}).indexOf(method);
|
|
23401
|
+
if (index === -1) {
|
|
23402
|
+
return;
|
|
23403
|
+
}
|
|
23404
|
+
state.registry[name].splice(index, 1);
|
|
23405
|
+
}
|
|
23590
23406
|
|
|
23591
|
-
// ../../node_modules/.pnpm
|
|
23592
|
-
var
|
|
23407
|
+
// ../../node_modules/.pnpm/before-after-hook@4.0.0/node_modules/before-after-hook/index.js
|
|
23408
|
+
var bind = Function.bind;
|
|
23409
|
+
var bindable = bind.bind(bind);
|
|
23410
|
+
function bindApi(hook2, state, name) {
|
|
23411
|
+
const removeHookRef = bindable(removeHook, null).apply(
|
|
23412
|
+
null,
|
|
23413
|
+
name ? [state, name] : [state]
|
|
23414
|
+
);
|
|
23415
|
+
hook2.api = { remove: removeHookRef };
|
|
23416
|
+
hook2.remove = removeHookRef;
|
|
23417
|
+
["before", "error", "after", "wrap"].forEach((kind) => {
|
|
23418
|
+
const args = name ? [state, kind, name] : [state, kind];
|
|
23419
|
+
hook2[kind] = hook2.api[kind] = bindable(addHook, null).apply(null, args);
|
|
23420
|
+
});
|
|
23421
|
+
}
|
|
23422
|
+
function Singular() {
|
|
23423
|
+
const singularHookName = /* @__PURE__ */ Symbol("Singular");
|
|
23424
|
+
const singularHookState = {
|
|
23425
|
+
registry: {}
|
|
23426
|
+
};
|
|
23427
|
+
const singularHook = register.bind(null, singularHookState, singularHookName);
|
|
23428
|
+
bindApi(singularHook, singularHookState, singularHookName);
|
|
23429
|
+
return singularHook;
|
|
23430
|
+
}
|
|
23431
|
+
function Collection() {
|
|
23432
|
+
const state = {
|
|
23433
|
+
registry: {}
|
|
23434
|
+
};
|
|
23435
|
+
const hook2 = register.bind(null, state);
|
|
23436
|
+
bindApi(hook2, state);
|
|
23437
|
+
return hook2;
|
|
23438
|
+
}
|
|
23439
|
+
var before_after_hook_default = { Singular, Collection };
|
|
23593
23440
|
|
|
23594
|
-
// ../../node_modules/.pnpm/@octokit+endpoint@
|
|
23441
|
+
// ../../node_modules/.pnpm/@octokit+endpoint@11.0.2/node_modules/@octokit/endpoint/dist-bundle/index.js
|
|
23442
|
+
var VERSION = "0.0.0-development";
|
|
23595
23443
|
var userAgent = `octokit-endpoint.js/${VERSION} ${getUserAgent()}`;
|
|
23596
23444
|
var DEFAULTS = {
|
|
23597
23445
|
method: "GET",
|
|
@@ -23604,8 +23452,6 @@ var DEFAULTS = {
|
|
|
23604
23452
|
format: ""
|
|
23605
23453
|
}
|
|
23606
23454
|
};
|
|
23607
|
-
|
|
23608
|
-
// ../../node_modules/.pnpm/@octokit+endpoint@9.0.6/node_modules/@octokit/endpoint/dist-src/util/lowercase-keys.js
|
|
23609
23455
|
function lowercaseKeys(object2) {
|
|
23610
23456
|
if (!object2) {
|
|
23611
23457
|
return {};
|
|
@@ -23615,37 +23461,26 @@ function lowercaseKeys(object2) {
|
|
|
23615
23461
|
return newObj;
|
|
23616
23462
|
}, {});
|
|
23617
23463
|
}
|
|
23618
|
-
|
|
23619
|
-
// ../../node_modules/.pnpm/@octokit+endpoint@9.0.6/node_modules/@octokit/endpoint/dist-src/util/is-plain-object.js
|
|
23620
23464
|
function isPlainObject(value) {
|
|
23621
|
-
if (typeof value !== "object" || value === null)
|
|
23622
|
-
|
|
23623
|
-
if (Object.prototype.toString.call(value) !== "[object Object]")
|
|
23624
|
-
return false;
|
|
23465
|
+
if (typeof value !== "object" || value === null) return false;
|
|
23466
|
+
if (Object.prototype.toString.call(value) !== "[object Object]") return false;
|
|
23625
23467
|
const proto = Object.getPrototypeOf(value);
|
|
23626
|
-
if (proto === null)
|
|
23627
|
-
return true;
|
|
23468
|
+
if (proto === null) return true;
|
|
23628
23469
|
const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
|
23629
23470
|
return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
|
|
23630
23471
|
}
|
|
23631
|
-
|
|
23632
|
-
// ../../node_modules/.pnpm/@octokit+endpoint@9.0.6/node_modules/@octokit/endpoint/dist-src/util/merge-deep.js
|
|
23633
23472
|
function mergeDeep(defaults3, options) {
|
|
23634
23473
|
const result = Object.assign({}, defaults3);
|
|
23635
23474
|
Object.keys(options).forEach((key) => {
|
|
23636
23475
|
if (isPlainObject(options[key])) {
|
|
23637
|
-
if (!(key in defaults3))
|
|
23638
|
-
|
|
23639
|
-
else
|
|
23640
|
-
result[key] = mergeDeep(defaults3[key], options[key]);
|
|
23476
|
+
if (!(key in defaults3)) Object.assign(result, { [key]: options[key] });
|
|
23477
|
+
else result[key] = mergeDeep(defaults3[key], options[key]);
|
|
23641
23478
|
} else {
|
|
23642
23479
|
Object.assign(result, { [key]: options[key] });
|
|
23643
23480
|
}
|
|
23644
23481
|
});
|
|
23645
23482
|
return result;
|
|
23646
23483
|
}
|
|
23647
|
-
|
|
23648
|
-
// ../../node_modules/.pnpm/@octokit+endpoint@9.0.6/node_modules/@octokit/endpoint/dist-src/util/remove-undefined-properties.js
|
|
23649
23484
|
function removeUndefinedProperties(obj) {
|
|
23650
23485
|
for (const key in obj) {
|
|
23651
23486
|
if (obj[key] === void 0) {
|
|
@@ -23654,8 +23489,6 @@ function removeUndefinedProperties(obj) {
|
|
|
23654
23489
|
}
|
|
23655
23490
|
return obj;
|
|
23656
23491
|
}
|
|
23657
|
-
|
|
23658
|
-
// ../../node_modules/.pnpm/@octokit+endpoint@9.0.6/node_modules/@octokit/endpoint/dist-src/merge.js
|
|
23659
23492
|
function merge(defaults3, route, options) {
|
|
23660
23493
|
if (typeof route === "string") {
|
|
23661
23494
|
let [method, url] = route.split(" ");
|
|
@@ -23677,8 +23510,6 @@ function merge(defaults3, route, options) {
|
|
|
23677
23510
|
}
|
|
23678
23511
|
return mergedOptions;
|
|
23679
23512
|
}
|
|
23680
|
-
|
|
23681
|
-
// ../../node_modules/.pnpm/@octokit+endpoint@9.0.6/node_modules/@octokit/endpoint/dist-src/util/add-query-parameters.js
|
|
23682
23513
|
function addQueryParameters(url, parameters) {
|
|
23683
23514
|
const separator = /\?/.test(url) ? "&" : "?";
|
|
23684
23515
|
const names = Object.keys(parameters);
|
|
@@ -23692,8 +23523,6 @@ function addQueryParameters(url, parameters) {
|
|
|
23692
23523
|
return `${name}=${encodeURIComponent(parameters[name])}`;
|
|
23693
23524
|
}).join("&");
|
|
23694
23525
|
}
|
|
23695
|
-
|
|
23696
|
-
// ../../node_modules/.pnpm/@octokit+endpoint@9.0.6/node_modules/@octokit/endpoint/dist-src/util/extract-url-variable-names.js
|
|
23697
23526
|
var urlVariableRegex = /\{[^{}}]+\}/g;
|
|
23698
23527
|
function removeNonChars(variableName) {
|
|
23699
23528
|
return variableName.replace(/(?:^\W+)|(?:(?<!\W)\W+$)/g, "").split(/,/);
|
|
@@ -23705,8 +23534,6 @@ function extractUrlVariableNames(url) {
|
|
|
23705
23534
|
}
|
|
23706
23535
|
return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
|
|
23707
23536
|
}
|
|
23708
|
-
|
|
23709
|
-
// ../../node_modules/.pnpm/@octokit+endpoint@9.0.6/node_modules/@octokit/endpoint/dist-src/util/omit.js
|
|
23710
23537
|
function omit(object2, keysToOmit) {
|
|
23711
23538
|
const result = { __proto__: null };
|
|
23712
23539
|
for (const key of Object.keys(object2)) {
|
|
@@ -23716,8 +23543,6 @@ function omit(object2, keysToOmit) {
|
|
|
23716
23543
|
}
|
|
23717
23544
|
return result;
|
|
23718
23545
|
}
|
|
23719
|
-
|
|
23720
|
-
// ../../node_modules/.pnpm/@octokit+endpoint@9.0.6/node_modules/@octokit/endpoint/dist-src/util/url-template.js
|
|
23721
23546
|
function encodeReserved(str) {
|
|
23722
23547
|
return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) {
|
|
23723
23548
|
if (!/%[0-9A-Fa-f]/.test(part)) {
|
|
@@ -23848,8 +23673,6 @@ function expand2(template2, context) {
|
|
|
23848
23673
|
return template2.replace(/\/$/, "");
|
|
23849
23674
|
}
|
|
23850
23675
|
}
|
|
23851
|
-
|
|
23852
|
-
// ../../node_modules/.pnpm/@octokit+endpoint@9.0.6/node_modules/@octokit/endpoint/dist-src/parse.js
|
|
23853
23676
|
function parse(options) {
|
|
23854
23677
|
let method = options.method.toUpperCase();
|
|
23855
23678
|
let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
|
|
@@ -23913,13 +23736,9 @@ function parse(options) {
|
|
|
23913
23736
|
options.request ? { request: options.request } : null
|
|
23914
23737
|
);
|
|
23915
23738
|
}
|
|
23916
|
-
|
|
23917
|
-
// ../../node_modules/.pnpm/@octokit+endpoint@9.0.6/node_modules/@octokit/endpoint/dist-src/endpoint-with-defaults.js
|
|
23918
23739
|
function endpointWithDefaults(defaults3, route, options) {
|
|
23919
23740
|
return parse(merge(defaults3, route, options));
|
|
23920
23741
|
}
|
|
23921
|
-
|
|
23922
|
-
// ../../node_modules/.pnpm/@octokit+endpoint@9.0.6/node_modules/@octokit/endpoint/dist-src/with-defaults.js
|
|
23923
23742
|
function withDefaults(oldDefaults, newDefaults) {
|
|
23924
23743
|
const DEFAULTS2 = merge(oldDefaults, newDefaults);
|
|
23925
23744
|
const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2);
|
|
@@ -23930,56 +23749,35 @@ function withDefaults(oldDefaults, newDefaults) {
|
|
|
23930
23749
|
parse
|
|
23931
23750
|
});
|
|
23932
23751
|
}
|
|
23933
|
-
|
|
23934
|
-
// ../../node_modules/.pnpm/@octokit+endpoint@9.0.6/node_modules/@octokit/endpoint/dist-src/index.js
|
|
23935
23752
|
var endpoint = withDefaults(null, DEFAULTS);
|
|
23936
23753
|
|
|
23937
|
-
// ../../node_modules/.pnpm/@octokit+request@
|
|
23938
|
-
var
|
|
23939
|
-
|
|
23940
|
-
// ../../node_modules/.pnpm/@octokit+request@8.4.1/node_modules/@octokit/request/dist-src/is-plain-object.js
|
|
23941
|
-
function isPlainObject2(value) {
|
|
23942
|
-
if (typeof value !== "object" || value === null)
|
|
23943
|
-
return false;
|
|
23944
|
-
if (Object.prototype.toString.call(value) !== "[object Object]")
|
|
23945
|
-
return false;
|
|
23946
|
-
const proto = Object.getPrototypeOf(value);
|
|
23947
|
-
if (proto === null)
|
|
23948
|
-
return true;
|
|
23949
|
-
const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
|
23950
|
-
return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
|
|
23951
|
-
}
|
|
23754
|
+
// ../../node_modules/.pnpm/@octokit+request@10.0.7/node_modules/@octokit/request/dist-bundle/index.js
|
|
23755
|
+
var import_fast_content_type_parse = __toESM(require_fast_content_type_parse(), 1);
|
|
23952
23756
|
|
|
23953
|
-
// ../../node_modules/.pnpm
|
|
23954
|
-
var Deprecation = class extends Error {
|
|
23955
|
-
constructor(message) {
|
|
23956
|
-
super(message);
|
|
23957
|
-
if (Error.captureStackTrace) {
|
|
23958
|
-
Error.captureStackTrace(this, this.constructor);
|
|
23959
|
-
}
|
|
23960
|
-
this.name = "Deprecation";
|
|
23961
|
-
}
|
|
23962
|
-
};
|
|
23963
|
-
|
|
23964
|
-
// ../../node_modules/.pnpm/@octokit+request-error@5.1.1/node_modules/@octokit/request-error/dist-src/index.js
|
|
23965
|
-
var import_once = __toESM(require_once());
|
|
23966
|
-
var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation));
|
|
23967
|
-
var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation));
|
|
23757
|
+
// ../../node_modules/.pnpm/@octokit+request-error@7.1.0/node_modules/@octokit/request-error/dist-src/index.js
|
|
23968
23758
|
var RequestError = class extends Error {
|
|
23759
|
+
name;
|
|
23760
|
+
/**
|
|
23761
|
+
* http status code
|
|
23762
|
+
*/
|
|
23763
|
+
status;
|
|
23764
|
+
/**
|
|
23765
|
+
* Request options that lead to the error.
|
|
23766
|
+
*/
|
|
23767
|
+
request;
|
|
23768
|
+
/**
|
|
23769
|
+
* Response object if a response was received
|
|
23770
|
+
*/
|
|
23771
|
+
response;
|
|
23969
23772
|
constructor(message, statusCode, options) {
|
|
23970
|
-
super(message);
|
|
23971
|
-
if (Error.captureStackTrace) {
|
|
23972
|
-
Error.captureStackTrace(this, this.constructor);
|
|
23973
|
-
}
|
|
23773
|
+
super(message, { cause: options.cause });
|
|
23974
23774
|
this.name = "HttpError";
|
|
23975
|
-
this.status = statusCode;
|
|
23976
|
-
|
|
23977
|
-
|
|
23978
|
-
headers = options.headers;
|
|
23775
|
+
this.status = Number.parseInt(statusCode);
|
|
23776
|
+
if (Number.isNaN(this.status)) {
|
|
23777
|
+
this.status = 0;
|
|
23979
23778
|
}
|
|
23980
23779
|
if ("response" in options) {
|
|
23981
23780
|
this.response = options.response;
|
|
23982
|
-
headers = options.response.headers;
|
|
23983
23781
|
}
|
|
23984
23782
|
const requestCopy = Object.assign({}, options.request);
|
|
23985
23783
|
if (options.request.headers.authorization) {
|
|
@@ -23992,171 +23790,162 @@ var RequestError = class extends Error {
|
|
|
23992
23790
|
}
|
|
23993
23791
|
requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
|
|
23994
23792
|
this.request = requestCopy;
|
|
23995
|
-
Object.defineProperty(this, "code", {
|
|
23996
|
-
get() {
|
|
23997
|
-
logOnceCode(
|
|
23998
|
-
new Deprecation(
|
|
23999
|
-
"[@octokit/request-error] `error.code` is deprecated, use `error.status`."
|
|
24000
|
-
)
|
|
24001
|
-
);
|
|
24002
|
-
return statusCode;
|
|
24003
|
-
}
|
|
24004
|
-
});
|
|
24005
|
-
Object.defineProperty(this, "headers", {
|
|
24006
|
-
get() {
|
|
24007
|
-
logOnceHeaders(
|
|
24008
|
-
new Deprecation(
|
|
24009
|
-
"[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."
|
|
24010
|
-
)
|
|
24011
|
-
);
|
|
24012
|
-
return headers || {};
|
|
24013
|
-
}
|
|
24014
|
-
});
|
|
24015
23793
|
}
|
|
24016
23794
|
};
|
|
24017
23795
|
|
|
24018
|
-
// ../../node_modules/.pnpm/@octokit+request@
|
|
24019
|
-
|
|
24020
|
-
|
|
24021
|
-
|
|
24022
|
-
|
|
24023
|
-
// ../../node_modules/.pnpm/@octokit+request@8.4.1/node_modules/@octokit/request/dist-src/fetch-wrapper.js
|
|
24024
|
-
function fetchWrapper(requestOptions) {
|
|
24025
|
-
const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;
|
|
24026
|
-
const parseSuccessResponseBody = requestOptions.request?.parseSuccessResponseBody !== false;
|
|
24027
|
-
if (isPlainObject2(requestOptions.body) || Array.isArray(requestOptions.body)) {
|
|
24028
|
-
requestOptions.body = JSON.stringify(requestOptions.body);
|
|
24029
|
-
}
|
|
24030
|
-
let headers = {};
|
|
24031
|
-
let status2;
|
|
24032
|
-
let url;
|
|
24033
|
-
let { fetch: fetch2 } = globalThis;
|
|
24034
|
-
if (requestOptions.request?.fetch) {
|
|
24035
|
-
fetch2 = requestOptions.request.fetch;
|
|
23796
|
+
// ../../node_modules/.pnpm/@octokit+request@10.0.7/node_modules/@octokit/request/dist-bundle/index.js
|
|
23797
|
+
var VERSION2 = "10.0.7";
|
|
23798
|
+
var defaults_default = {
|
|
23799
|
+
headers: {
|
|
23800
|
+
"user-agent": `octokit-request.js/${VERSION2} ${getUserAgent()}`
|
|
24036
23801
|
}
|
|
23802
|
+
};
|
|
23803
|
+
function isPlainObject2(value) {
|
|
23804
|
+
if (typeof value !== "object" || value === null) return false;
|
|
23805
|
+
if (Object.prototype.toString.call(value) !== "[object Object]") return false;
|
|
23806
|
+
const proto = Object.getPrototypeOf(value);
|
|
23807
|
+
if (proto === null) return true;
|
|
23808
|
+
const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
|
23809
|
+
return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
|
|
23810
|
+
}
|
|
23811
|
+
var noop = () => "";
|
|
23812
|
+
async function fetchWrapper(requestOptions) {
|
|
23813
|
+
const fetch2 = requestOptions.request?.fetch || globalThis.fetch;
|
|
24037
23814
|
if (!fetch2) {
|
|
24038
23815
|
throw new Error(
|
|
24039
23816
|
"fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing"
|
|
24040
23817
|
);
|
|
24041
23818
|
}
|
|
24042
|
-
|
|
24043
|
-
|
|
24044
|
-
|
|
24045
|
-
|
|
24046
|
-
|
|
24047
|
-
|
|
24048
|
-
|
|
24049
|
-
|
|
24050
|
-
|
|
24051
|
-
|
|
24052
|
-
|
|
24053
|
-
|
|
24054
|
-
|
|
24055
|
-
|
|
24056
|
-
|
|
24057
|
-
|
|
24058
|
-
|
|
24059
|
-
|
|
24060
|
-
|
|
24061
|
-
|
|
24062
|
-
|
|
24063
|
-
|
|
24064
|
-
|
|
24065
|
-
|
|
24066
|
-
|
|
24067
|
-
|
|
24068
|
-
|
|
24069
|
-
return;
|
|
23819
|
+
const log = requestOptions.request?.log || console;
|
|
23820
|
+
const parseSuccessResponseBody = requestOptions.request?.parseSuccessResponseBody !== false;
|
|
23821
|
+
const body = isPlainObject2(requestOptions.body) || Array.isArray(requestOptions.body) ? JSON.stringify(requestOptions.body) : requestOptions.body;
|
|
23822
|
+
const requestHeaders = Object.fromEntries(
|
|
23823
|
+
Object.entries(requestOptions.headers).map(([name, value]) => [
|
|
23824
|
+
name,
|
|
23825
|
+
String(value)
|
|
23826
|
+
])
|
|
23827
|
+
);
|
|
23828
|
+
let fetchResponse;
|
|
23829
|
+
try {
|
|
23830
|
+
fetchResponse = await fetch2(requestOptions.url, {
|
|
23831
|
+
method: requestOptions.method,
|
|
23832
|
+
body,
|
|
23833
|
+
redirect: requestOptions.request?.redirect,
|
|
23834
|
+
headers: requestHeaders,
|
|
23835
|
+
signal: requestOptions.request?.signal,
|
|
23836
|
+
// duplex must be set if request.body is ReadableStream or Async Iterables.
|
|
23837
|
+
// See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.
|
|
23838
|
+
...requestOptions.body && { duplex: "half" }
|
|
23839
|
+
});
|
|
23840
|
+
} catch (error) {
|
|
23841
|
+
let message = "Unknown Error";
|
|
23842
|
+
if (error instanceof Error) {
|
|
23843
|
+
if (error.name === "AbortError") {
|
|
23844
|
+
error.status = 500;
|
|
23845
|
+
throw error;
|
|
24070
23846
|
}
|
|
24071
|
-
|
|
24072
|
-
|
|
24073
|
-
|
|
24074
|
-
|
|
24075
|
-
|
|
24076
|
-
|
|
24077
|
-
}
|
|
24078
|
-
request: requestOptions
|
|
24079
|
-
});
|
|
24080
|
-
}
|
|
24081
|
-
if (status2 === 304) {
|
|
24082
|
-
throw new RequestError("Not modified", status2, {
|
|
24083
|
-
response: {
|
|
24084
|
-
url,
|
|
24085
|
-
status: status2,
|
|
24086
|
-
headers,
|
|
24087
|
-
data: await getResponseData(response)
|
|
24088
|
-
},
|
|
24089
|
-
request: requestOptions
|
|
24090
|
-
});
|
|
24091
|
-
}
|
|
24092
|
-
if (status2 >= 400) {
|
|
24093
|
-
const data = await getResponseData(response);
|
|
24094
|
-
const error = new RequestError(toErrorMessage(data), status2, {
|
|
24095
|
-
response: {
|
|
24096
|
-
url,
|
|
24097
|
-
status: status2,
|
|
24098
|
-
headers,
|
|
24099
|
-
data
|
|
24100
|
-
},
|
|
24101
|
-
request: requestOptions
|
|
24102
|
-
});
|
|
24103
|
-
throw error;
|
|
24104
|
-
}
|
|
24105
|
-
return parseSuccessResponseBody ? await getResponseData(response) : response.body;
|
|
24106
|
-
}).then((data) => {
|
|
24107
|
-
return {
|
|
24108
|
-
status: status2,
|
|
24109
|
-
url,
|
|
24110
|
-
headers,
|
|
24111
|
-
data
|
|
24112
|
-
};
|
|
24113
|
-
}).catch((error) => {
|
|
24114
|
-
if (error instanceof RequestError)
|
|
24115
|
-
throw error;
|
|
24116
|
-
else if (error.name === "AbortError")
|
|
24117
|
-
throw error;
|
|
24118
|
-
let message = error.message;
|
|
24119
|
-
if (error.name === "TypeError" && "cause" in error) {
|
|
24120
|
-
if (error.cause instanceof Error) {
|
|
24121
|
-
message = error.cause.message;
|
|
24122
|
-
} else if (typeof error.cause === "string") {
|
|
24123
|
-
message = error.cause;
|
|
23847
|
+
message = error.message;
|
|
23848
|
+
if (error.name === "TypeError" && "cause" in error) {
|
|
23849
|
+
if (error.cause instanceof Error) {
|
|
23850
|
+
message = error.cause.message;
|
|
23851
|
+
} else if (typeof error.cause === "string") {
|
|
23852
|
+
message = error.cause;
|
|
23853
|
+
}
|
|
24124
23854
|
}
|
|
24125
23855
|
}
|
|
24126
|
-
|
|
23856
|
+
const requestError = new RequestError(message, 500, {
|
|
24127
23857
|
request: requestOptions
|
|
24128
23858
|
});
|
|
24129
|
-
|
|
23859
|
+
requestError.cause = error;
|
|
23860
|
+
throw requestError;
|
|
23861
|
+
}
|
|
23862
|
+
const status2 = fetchResponse.status;
|
|
23863
|
+
const url = fetchResponse.url;
|
|
23864
|
+
const responseHeaders = {};
|
|
23865
|
+
for (const [key, value] of fetchResponse.headers) {
|
|
23866
|
+
responseHeaders[key] = value;
|
|
23867
|
+
}
|
|
23868
|
+
const octokitResponse = {
|
|
23869
|
+
url,
|
|
23870
|
+
status: status2,
|
|
23871
|
+
headers: responseHeaders,
|
|
23872
|
+
data: ""
|
|
23873
|
+
};
|
|
23874
|
+
if ("deprecation" in responseHeaders) {
|
|
23875
|
+
const matches = responseHeaders.link && responseHeaders.link.match(/<([^<>]+)>; rel="deprecation"/);
|
|
23876
|
+
const deprecationLink = matches && matches.pop();
|
|
23877
|
+
log.warn(
|
|
23878
|
+
`[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${responseHeaders.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
|
|
23879
|
+
);
|
|
23880
|
+
}
|
|
23881
|
+
if (status2 === 204 || status2 === 205) {
|
|
23882
|
+
return octokitResponse;
|
|
23883
|
+
}
|
|
23884
|
+
if (requestOptions.method === "HEAD") {
|
|
23885
|
+
if (status2 < 400) {
|
|
23886
|
+
return octokitResponse;
|
|
23887
|
+
}
|
|
23888
|
+
throw new RequestError(fetchResponse.statusText, status2, {
|
|
23889
|
+
response: octokitResponse,
|
|
23890
|
+
request: requestOptions
|
|
23891
|
+
});
|
|
23892
|
+
}
|
|
23893
|
+
if (status2 === 304) {
|
|
23894
|
+
octokitResponse.data = await getResponseData(fetchResponse);
|
|
23895
|
+
throw new RequestError("Not modified", status2, {
|
|
23896
|
+
response: octokitResponse,
|
|
23897
|
+
request: requestOptions
|
|
23898
|
+
});
|
|
23899
|
+
}
|
|
23900
|
+
if (status2 >= 400) {
|
|
23901
|
+
octokitResponse.data = await getResponseData(fetchResponse);
|
|
23902
|
+
throw new RequestError(toErrorMessage(octokitResponse.data), status2, {
|
|
23903
|
+
response: octokitResponse,
|
|
23904
|
+
request: requestOptions
|
|
23905
|
+
});
|
|
23906
|
+
}
|
|
23907
|
+
octokitResponse.data = parseSuccessResponseBody ? await getResponseData(fetchResponse) : fetchResponse.body;
|
|
23908
|
+
return octokitResponse;
|
|
24130
23909
|
}
|
|
24131
23910
|
async function getResponseData(response) {
|
|
24132
23911
|
const contentType = response.headers.get("content-type");
|
|
24133
|
-
if (
|
|
24134
|
-
return response.
|
|
23912
|
+
if (!contentType) {
|
|
23913
|
+
return response.text().catch(noop);
|
|
24135
23914
|
}
|
|
24136
|
-
|
|
24137
|
-
|
|
23915
|
+
const mimetype = (0, import_fast_content_type_parse.safeParse)(contentType);
|
|
23916
|
+
if (isJSONResponse(mimetype)) {
|
|
23917
|
+
let text = "";
|
|
23918
|
+
try {
|
|
23919
|
+
text = await response.text();
|
|
23920
|
+
return JSON.parse(text);
|
|
23921
|
+
} catch (err) {
|
|
23922
|
+
return text;
|
|
23923
|
+
}
|
|
23924
|
+
} else if (mimetype.type.startsWith("text/") || mimetype.parameters.charset?.toLowerCase() === "utf-8") {
|
|
23925
|
+
return response.text().catch(noop);
|
|
23926
|
+
} else {
|
|
23927
|
+
return response.arrayBuffer().catch(
|
|
23928
|
+
/* v8 ignore next -- @preserve */
|
|
23929
|
+
() => new ArrayBuffer(0)
|
|
23930
|
+
);
|
|
24138
23931
|
}
|
|
24139
|
-
|
|
23932
|
+
}
|
|
23933
|
+
function isJSONResponse(mimetype) {
|
|
23934
|
+
return mimetype.type === "application/json" || mimetype.type === "application/scim+json";
|
|
24140
23935
|
}
|
|
24141
23936
|
function toErrorMessage(data) {
|
|
24142
|
-
if (typeof data === "string")
|
|
23937
|
+
if (typeof data === "string") {
|
|
24143
23938
|
return data;
|
|
24144
|
-
|
|
24145
|
-
if (
|
|
24146
|
-
|
|
24147
|
-
} else {
|
|
24148
|
-
suffix = "";
|
|
23939
|
+
}
|
|
23940
|
+
if (data instanceof ArrayBuffer) {
|
|
23941
|
+
return "Unknown error";
|
|
24149
23942
|
}
|
|
24150
23943
|
if ("message" in data) {
|
|
24151
|
-
|
|
24152
|
-
|
|
24153
|
-
}
|
|
24154
|
-
return `${data.message}${suffix}`;
|
|
23944
|
+
const suffix = "documentation_url" in data ? ` - ${data.documentation_url}` : "";
|
|
23945
|
+
return Array.isArray(data.errors) ? `${data.message}: ${data.errors.map((v) => JSON.stringify(v)).join(", ")}${suffix}` : `${data.message}${suffix}`;
|
|
24155
23946
|
}
|
|
24156
23947
|
return `Unknown error: ${JSON.stringify(data)}`;
|
|
24157
23948
|
}
|
|
24158
|
-
|
|
24159
|
-
// ../../node_modules/.pnpm/@octokit+request@8.4.1/node_modules/@octokit/request/dist-src/with-defaults.js
|
|
24160
23949
|
function withDefaults2(oldEndpoint, newDefaults) {
|
|
24161
23950
|
const endpoint2 = oldEndpoint.defaults(newDefaults);
|
|
24162
23951
|
const newApi = function(route, parameters) {
|
|
@@ -24180,16 +23969,10 @@ function withDefaults2(oldEndpoint, newDefaults) {
|
|
|
24180
23969
|
defaults: withDefaults2.bind(null, endpoint2)
|
|
24181
23970
|
});
|
|
24182
23971
|
}
|
|
23972
|
+
var request = withDefaults2(endpoint, defaults_default);
|
|
24183
23973
|
|
|
24184
|
-
// ../../node_modules/.pnpm/@octokit+
|
|
24185
|
-
var
|
|
24186
|
-
headers: {
|
|
24187
|
-
"user-agent": `octokit-request.js/${VERSION2} ${getUserAgent()}`
|
|
24188
|
-
}
|
|
24189
|
-
});
|
|
24190
|
-
|
|
24191
|
-
// ../../node_modules/.pnpm/@octokit+graphql@7.1.1/node_modules/@octokit/graphql/dist-web/index.js
|
|
24192
|
-
var VERSION3 = "7.1.1";
|
|
23974
|
+
// ../../node_modules/.pnpm/@octokit+graphql@9.0.3/node_modules/@octokit/graphql/dist-bundle/index.js
|
|
23975
|
+
var VERSION3 = "0.0.0-development";
|
|
24193
23976
|
function _buildMessageForResponseErrors(data) {
|
|
24194
23977
|
return `Request failed due to following response errors:
|
|
24195
23978
|
` + data.errors.map((e) => ` - ${e.message}`).join("\n");
|
|
@@ -24200,13 +23983,15 @@ var GraphqlResponseError = class extends Error {
|
|
|
24200
23983
|
this.request = request2;
|
|
24201
23984
|
this.headers = headers;
|
|
24202
23985
|
this.response = response;
|
|
24203
|
-
this.name = "GraphqlResponseError";
|
|
24204
23986
|
this.errors = response.errors;
|
|
24205
23987
|
this.data = response.data;
|
|
24206
23988
|
if (Error.captureStackTrace) {
|
|
24207
23989
|
Error.captureStackTrace(this, this.constructor);
|
|
24208
23990
|
}
|
|
24209
23991
|
}
|
|
23992
|
+
name = "GraphqlResponseError";
|
|
23993
|
+
errors;
|
|
23994
|
+
data;
|
|
24210
23995
|
};
|
|
24211
23996
|
var NON_VARIABLE_OPTIONS = [
|
|
24212
23997
|
"method",
|
|
@@ -24215,7 +24000,8 @@ var NON_VARIABLE_OPTIONS = [
|
|
|
24215
24000
|
"headers",
|
|
24216
24001
|
"request",
|
|
24217
24002
|
"query",
|
|
24218
|
-
"mediaType"
|
|
24003
|
+
"mediaType",
|
|
24004
|
+
"operationName"
|
|
24219
24005
|
];
|
|
24220
24006
|
var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"];
|
|
24221
24007
|
var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
|
|
@@ -24292,14 +24078,15 @@ function withCustomRequest(customRequest) {
|
|
|
24292
24078
|
});
|
|
24293
24079
|
}
|
|
24294
24080
|
|
|
24295
|
-
// ../../node_modules/.pnpm/@octokit+auth-token@
|
|
24296
|
-
var
|
|
24297
|
-
var
|
|
24298
|
-
var
|
|
24081
|
+
// ../../node_modules/.pnpm/@octokit+auth-token@6.0.0/node_modules/@octokit/auth-token/dist-bundle/index.js
|
|
24082
|
+
var b64url = "(?:[a-zA-Z0-9_-]+)";
|
|
24083
|
+
var sep2 = "\\.";
|
|
24084
|
+
var jwtRE = new RegExp(`^${b64url}${sep2}${b64url}${sep2}${b64url}$`);
|
|
24085
|
+
var isJWT = jwtRE.test.bind(jwtRE);
|
|
24299
24086
|
async function auth(token) {
|
|
24300
|
-
const isApp = token
|
|
24301
|
-
const isInstallation =
|
|
24302
|
-
const isUserToServer =
|
|
24087
|
+
const isApp = isJWT(token);
|
|
24088
|
+
const isInstallation = token.startsWith("v1.") || token.startsWith("ghs_");
|
|
24089
|
+
const isUserToServer = token.startsWith("ghu_");
|
|
24303
24090
|
const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
|
|
24304
24091
|
return {
|
|
24305
24092
|
type: "token",
|
|
@@ -24307,16 +24094,12 @@ async function auth(token) {
|
|
|
24307
24094
|
tokenType
|
|
24308
24095
|
};
|
|
24309
24096
|
}
|
|
24310
|
-
|
|
24311
|
-
// ../../node_modules/.pnpm/@octokit+auth-token@4.0.0/node_modules/@octokit/auth-token/dist-src/with-authorization-prefix.js
|
|
24312
24097
|
function withAuthorizationPrefix(token) {
|
|
24313
24098
|
if (token.split(/\./).length === 3) {
|
|
24314
24099
|
return `bearer ${token}`;
|
|
24315
24100
|
}
|
|
24316
24101
|
return `token ${token}`;
|
|
24317
24102
|
}
|
|
24318
|
-
|
|
24319
|
-
// ../../node_modules/.pnpm/@octokit+auth-token@4.0.0/node_modules/@octokit/auth-token/dist-src/hook.js
|
|
24320
24103
|
async function hook(token, request2, route, parameters) {
|
|
24321
24104
|
const endpoint2 = request2.endpoint.merge(
|
|
24322
24105
|
route,
|
|
@@ -24325,8 +24108,6 @@ async function hook(token, request2, route, parameters) {
|
|
|
24325
24108
|
endpoint2.headers.authorization = withAuthorizationPrefix(token);
|
|
24326
24109
|
return request2(endpoint2);
|
|
24327
24110
|
}
|
|
24328
|
-
|
|
24329
|
-
// ../../node_modules/.pnpm/@octokit+auth-token@4.0.0/node_modules/@octokit/auth-token/dist-src/index.js
|
|
24330
24111
|
var createTokenAuth = function createTokenAuth2(token) {
|
|
24331
24112
|
if (!token) {
|
|
24332
24113
|
throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
|
|
@@ -24342,18 +24123,20 @@ var createTokenAuth = function createTokenAuth2(token) {
|
|
|
24342
24123
|
});
|
|
24343
24124
|
};
|
|
24344
24125
|
|
|
24345
|
-
// ../../node_modules/.pnpm/@octokit+core@
|
|
24346
|
-
var VERSION4 = "
|
|
24347
|
-
|
|
24126
|
+
// ../../node_modules/.pnpm/@octokit+core@7.0.6/node_modules/@octokit/core/dist-src/version.js
|
|
24127
|
+
var VERSION4 = "7.0.6";
|
|
24128
|
+
|
|
24129
|
+
// ../../node_modules/.pnpm/@octokit+core@7.0.6/node_modules/@octokit/core/dist-src/index.js
|
|
24130
|
+
var noop2 = () => {
|
|
24348
24131
|
};
|
|
24349
24132
|
var consoleWarn = console.warn.bind(console);
|
|
24350
24133
|
var consoleError = console.error.bind(console);
|
|
24351
24134
|
function createLogger2(logger = {}) {
|
|
24352
24135
|
if (typeof logger.debug !== "function") {
|
|
24353
|
-
logger.debug =
|
|
24136
|
+
logger.debug = noop2;
|
|
24354
24137
|
}
|
|
24355
24138
|
if (typeof logger.info !== "function") {
|
|
24356
|
-
logger.info =
|
|
24139
|
+
logger.info = noop2;
|
|
24357
24140
|
}
|
|
24358
24141
|
if (typeof logger.warn !== "function") {
|
|
24359
24142
|
logger.warn = consoleWarn;
|
|
@@ -24365,9 +24148,7 @@ function createLogger2(logger = {}) {
|
|
|
24365
24148
|
}
|
|
24366
24149
|
var userAgentTrail = `octokit-core.js/${VERSION4} ${getUserAgent()}`;
|
|
24367
24150
|
var Octokit = class {
|
|
24368
|
-
static
|
|
24369
|
-
this.VERSION = VERSION4;
|
|
24370
|
-
}
|
|
24151
|
+
static VERSION = VERSION4;
|
|
24371
24152
|
static defaults(defaults3) {
|
|
24372
24153
|
const OctokitWithDefaults = class extends this {
|
|
24373
24154
|
constructor(...args) {
|
|
@@ -24390,9 +24171,7 @@ var Octokit = class {
|
|
|
24390
24171
|
};
|
|
24391
24172
|
return OctokitWithDefaults;
|
|
24392
24173
|
}
|
|
24393
|
-
static
|
|
24394
|
-
this.plugins = [];
|
|
24395
|
-
}
|
|
24174
|
+
static plugins = [];
|
|
24396
24175
|
/**
|
|
24397
24176
|
* Attach a plugin (or many) to your Octokit instance.
|
|
24398
24177
|
*
|
|
@@ -24402,16 +24181,14 @@ var Octokit = class {
|
|
|
24402
24181
|
static plugin(...newPlugins) {
|
|
24403
24182
|
const currentPlugins = this.plugins;
|
|
24404
24183
|
const NewOctokit = class extends this {
|
|
24405
|
-
static
|
|
24406
|
-
|
|
24407
|
-
|
|
24408
|
-
);
|
|
24409
|
-
}
|
|
24184
|
+
static plugins = currentPlugins.concat(
|
|
24185
|
+
newPlugins.filter((plugin) => !currentPlugins.includes(plugin))
|
|
24186
|
+
);
|
|
24410
24187
|
};
|
|
24411
24188
|
return NewOctokit;
|
|
24412
24189
|
}
|
|
24413
24190
|
constructor(options = {}) {
|
|
24414
|
-
const hook2 = new
|
|
24191
|
+
const hook2 = new before_after_hook_default.Collection();
|
|
24415
24192
|
const requestDefaults = {
|
|
24416
24193
|
baseUrl: request.endpoint.DEFAULTS.baseUrl,
|
|
24417
24194
|
headers: {},
|
|
@@ -24474,12 +24251,19 @@ var Octokit = class {
|
|
|
24474
24251
|
Object.assign(this, classConstructor.plugins[i](this, options));
|
|
24475
24252
|
}
|
|
24476
24253
|
}
|
|
24254
|
+
// assigned during constructor
|
|
24255
|
+
request;
|
|
24256
|
+
graphql;
|
|
24257
|
+
log;
|
|
24258
|
+
hook;
|
|
24259
|
+
// TODO: type `octokit.auth` based on passed options.authStrategy
|
|
24260
|
+
auth;
|
|
24477
24261
|
};
|
|
24478
24262
|
|
|
24479
|
-
// ../../node_modules/.pnpm/@octokit+plugin-request-log@
|
|
24480
|
-
var VERSION5 = "
|
|
24263
|
+
// ../../node_modules/.pnpm/@octokit+plugin-request-log@6.0.0_@octokit+core@7.0.6/node_modules/@octokit/plugin-request-log/dist-src/version.js
|
|
24264
|
+
var VERSION5 = "6.0.0";
|
|
24481
24265
|
|
|
24482
|
-
// ../../node_modules/.pnpm/@octokit+plugin-request-log@
|
|
24266
|
+
// ../../node_modules/.pnpm/@octokit+plugin-request-log@6.0.0_@octokit+core@7.0.6/node_modules/@octokit/plugin-request-log/dist-src/index.js
|
|
24483
24267
|
function requestLog(octokit) {
|
|
24484
24268
|
octokit.hook.wrap("request", (request2, options) => {
|
|
24485
24269
|
octokit.log.debug("request", options);
|
|
@@ -24487,13 +24271,15 @@ function requestLog(octokit) {
|
|
|
24487
24271
|
const requestOptions = octokit.request.endpoint.parse(options);
|
|
24488
24272
|
const path5 = requestOptions.url.replace(options.baseUrl, "");
|
|
24489
24273
|
return request2(options).then((response) => {
|
|
24274
|
+
const requestId = response.headers["x-github-request-id"];
|
|
24490
24275
|
octokit.log.info(
|
|
24491
|
-
`${requestOptions.method} ${path5} - ${response.status} in ${Date.now() - start}ms`
|
|
24276
|
+
`${requestOptions.method} ${path5} - ${response.status} with id ${requestId} in ${Date.now() - start}ms`
|
|
24492
24277
|
);
|
|
24493
24278
|
return response;
|
|
24494
24279
|
}).catch((error) => {
|
|
24495
|
-
|
|
24496
|
-
|
|
24280
|
+
const requestId = error.response?.headers["x-github-request-id"] || "UNKNOWN";
|
|
24281
|
+
octokit.log.error(
|
|
24282
|
+
`${requestOptions.method} ${path5} - ${error.status} with id ${requestId} in ${Date.now() - start}ms`
|
|
24497
24283
|
);
|
|
24498
24284
|
throw error;
|
|
24499
24285
|
});
|
|
@@ -24501,8 +24287,8 @@ function requestLog(octokit) {
|
|
|
24501
24287
|
}
|
|
24502
24288
|
requestLog.VERSION = VERSION5;
|
|
24503
24289
|
|
|
24504
|
-
// ../../node_modules/.pnpm/@octokit+plugin-paginate-rest@
|
|
24505
|
-
var VERSION6 = "
|
|
24290
|
+
// ../../node_modules/.pnpm/@octokit+plugin-paginate-rest@14.0.0_@octokit+core@7.0.6/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js
|
|
24291
|
+
var VERSION6 = "0.0.0-development";
|
|
24506
24292
|
function normalizePaginatedListResponse(response) {
|
|
24507
24293
|
if (!response.data) {
|
|
24508
24294
|
return {
|
|
@@ -24510,14 +24296,16 @@ function normalizePaginatedListResponse(response) {
|
|
|
24510
24296
|
data: []
|
|
24511
24297
|
};
|
|
24512
24298
|
}
|
|
24513
|
-
const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data);
|
|
24299
|
+
const responseNeedsNormalization = ("total_count" in response.data || "total_commits" in response.data) && !("url" in response.data);
|
|
24514
24300
|
if (!responseNeedsNormalization) return response;
|
|
24515
24301
|
const incompleteResults = response.data.incomplete_results;
|
|
24516
24302
|
const repositorySelection = response.data.repository_selection;
|
|
24517
24303
|
const totalCount = response.data.total_count;
|
|
24304
|
+
const totalCommits = response.data.total_commits;
|
|
24518
24305
|
delete response.data.incomplete_results;
|
|
24519
24306
|
delete response.data.repository_selection;
|
|
24520
24307
|
delete response.data.total_count;
|
|
24308
|
+
delete response.data.total_commits;
|
|
24521
24309
|
const namespaceKey = Object.keys(response.data)[0];
|
|
24522
24310
|
const data = response.data[namespaceKey];
|
|
24523
24311
|
response.data = data;
|
|
@@ -24528,6 +24316,7 @@ function normalizePaginatedListResponse(response) {
|
|
|
24528
24316
|
response.data.repository_selection = repositorySelection;
|
|
24529
24317
|
}
|
|
24530
24318
|
response.data.total_count = totalCount;
|
|
24319
|
+
response.data.total_commits = totalCommits;
|
|
24531
24320
|
return response;
|
|
24532
24321
|
}
|
|
24533
24322
|
function iterator(octokit, route, parameters) {
|
|
@@ -24546,6 +24335,16 @@ function iterator(octokit, route, parameters) {
|
|
|
24546
24335
|
url = ((normalizedResponse.headers.link || "").match(
|
|
24547
24336
|
/<([^<>]+)>;\s*rel="next"/
|
|
24548
24337
|
) || [])[1];
|
|
24338
|
+
if (!url && "total_commits" in normalizedResponse.data) {
|
|
24339
|
+
const parsedUrl = new URL(normalizedResponse.url);
|
|
24340
|
+
const params = parsedUrl.searchParams;
|
|
24341
|
+
const page = parseInt(params.get("page") || "1", 10);
|
|
24342
|
+
const per_page = parseInt(params.get("per_page") || "250", 10);
|
|
24343
|
+
if (page * per_page < normalizedResponse.data.total_commits) {
|
|
24344
|
+
params.set("page", String(page + 1));
|
|
24345
|
+
url = parsedUrl.toString();
|
|
24346
|
+
}
|
|
24347
|
+
}
|
|
24549
24348
|
return { value: normalizedResponse };
|
|
24550
24349
|
} catch (error) {
|
|
24551
24350
|
if (error.status !== 409) throw error;
|
|
@@ -24604,10 +24403,10 @@ function paginateRest(octokit) {
|
|
|
24604
24403
|
}
|
|
24605
24404
|
paginateRest.VERSION = VERSION6;
|
|
24606
24405
|
|
|
24607
|
-
// ../../node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@
|
|
24608
|
-
var VERSION7 = "
|
|
24406
|
+
// ../../node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@17.0.0_@octokit+core@7.0.6/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js
|
|
24407
|
+
var VERSION7 = "17.0.0";
|
|
24609
24408
|
|
|
24610
|
-
// ../../node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@
|
|
24409
|
+
// ../../node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@17.0.0_@octokit+core@7.0.6/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js
|
|
24611
24410
|
var Endpoints = {
|
|
24612
24411
|
actions: {
|
|
24613
24412
|
addCustomLabelsToSelfHostedRunnerForOrg: [
|
|
@@ -24634,6 +24433,7 @@ var Endpoints = {
|
|
|
24634
24433
|
createEnvironmentVariable: [
|
|
24635
24434
|
"POST /repos/{owner}/{repo}/environments/{environment_name}/variables"
|
|
24636
24435
|
],
|
|
24436
|
+
createHostedRunnerForOrg: ["POST /orgs/{org}/actions/hosted-runners"],
|
|
24637
24437
|
createOrUpdateEnvironmentSecret: [
|
|
24638
24438
|
"PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"
|
|
24639
24439
|
],
|
|
@@ -24665,12 +24465,21 @@ var Endpoints = {
|
|
|
24665
24465
|
deleteArtifact: [
|
|
24666
24466
|
"DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"
|
|
24667
24467
|
],
|
|
24468
|
+
deleteCustomImageFromOrg: [
|
|
24469
|
+
"DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"
|
|
24470
|
+
],
|
|
24471
|
+
deleteCustomImageVersionFromOrg: [
|
|
24472
|
+
"DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"
|
|
24473
|
+
],
|
|
24668
24474
|
deleteEnvironmentSecret: [
|
|
24669
24475
|
"DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"
|
|
24670
24476
|
],
|
|
24671
24477
|
deleteEnvironmentVariable: [
|
|
24672
24478
|
"DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"
|
|
24673
24479
|
],
|
|
24480
|
+
deleteHostedRunnerForOrg: [
|
|
24481
|
+
"DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"
|
|
24482
|
+
],
|
|
24674
24483
|
deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"],
|
|
24675
24484
|
deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"],
|
|
24676
24485
|
deleteRepoSecret: [
|
|
@@ -24735,6 +24544,12 @@ var Endpoints = {
|
|
|
24735
24544
|
"GET /repos/{owner}/{repo}/actions/permissions/selected-actions"
|
|
24736
24545
|
],
|
|
24737
24546
|
getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],
|
|
24547
|
+
getCustomImageForOrg: [
|
|
24548
|
+
"GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"
|
|
24549
|
+
],
|
|
24550
|
+
getCustomImageVersionForOrg: [
|
|
24551
|
+
"GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"
|
|
24552
|
+
],
|
|
24738
24553
|
getCustomOidcSubClaimForRepo: [
|
|
24739
24554
|
"GET /repos/{owner}/{repo}/actions/oidc/customization/sub"
|
|
24740
24555
|
],
|
|
@@ -24759,6 +24574,24 @@ var Endpoints = {
|
|
|
24759
24574
|
getGithubActionsPermissionsRepository: [
|
|
24760
24575
|
"GET /repos/{owner}/{repo}/actions/permissions"
|
|
24761
24576
|
],
|
|
24577
|
+
getHostedRunnerForOrg: [
|
|
24578
|
+
"GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"
|
|
24579
|
+
],
|
|
24580
|
+
getHostedRunnersGithubOwnedImagesForOrg: [
|
|
24581
|
+
"GET /orgs/{org}/actions/hosted-runners/images/github-owned"
|
|
24582
|
+
],
|
|
24583
|
+
getHostedRunnersLimitsForOrg: [
|
|
24584
|
+
"GET /orgs/{org}/actions/hosted-runners/limits"
|
|
24585
|
+
],
|
|
24586
|
+
getHostedRunnersMachineSpecsForOrg: [
|
|
24587
|
+
"GET /orgs/{org}/actions/hosted-runners/machine-sizes"
|
|
24588
|
+
],
|
|
24589
|
+
getHostedRunnersPartnerImagesForOrg: [
|
|
24590
|
+
"GET /orgs/{org}/actions/hosted-runners/images/partner"
|
|
24591
|
+
],
|
|
24592
|
+
getHostedRunnersPlatformsForOrg: [
|
|
24593
|
+
"GET /orgs/{org}/actions/hosted-runners/platforms"
|
|
24594
|
+
],
|
|
24762
24595
|
getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],
|
|
24763
24596
|
getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"],
|
|
24764
24597
|
getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"],
|
|
@@ -24796,12 +24629,22 @@ var Endpoints = {
|
|
|
24796
24629
|
"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"
|
|
24797
24630
|
],
|
|
24798
24631
|
listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"],
|
|
24632
|
+
listCustomImageVersionsForOrg: [
|
|
24633
|
+
"GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions"
|
|
24634
|
+
],
|
|
24635
|
+
listCustomImagesForOrg: [
|
|
24636
|
+
"GET /orgs/{org}/actions/hosted-runners/images/custom"
|
|
24637
|
+
],
|
|
24799
24638
|
listEnvironmentSecrets: [
|
|
24800
24639
|
"GET /repos/{owner}/{repo}/environments/{environment_name}/secrets"
|
|
24801
24640
|
],
|
|
24802
24641
|
listEnvironmentVariables: [
|
|
24803
24642
|
"GET /repos/{owner}/{repo}/environments/{environment_name}/variables"
|
|
24804
24643
|
],
|
|
24644
|
+
listGithubHostedRunnersInGroupForOrg: [
|
|
24645
|
+
"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners"
|
|
24646
|
+
],
|
|
24647
|
+
listHostedRunnersForOrg: ["GET /orgs/{org}/actions/hosted-runners"],
|
|
24805
24648
|
listJobsForWorkflowRun: [
|
|
24806
24649
|
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"
|
|
24807
24650
|
],
|
|
@@ -24920,6 +24763,9 @@ var Endpoints = {
|
|
|
24920
24763
|
updateEnvironmentVariable: [
|
|
24921
24764
|
"PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"
|
|
24922
24765
|
],
|
|
24766
|
+
updateHostedRunnerForOrg: [
|
|
24767
|
+
"PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"
|
|
24768
|
+
],
|
|
24923
24769
|
updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"],
|
|
24924
24770
|
updateRepoVariable: [
|
|
24925
24771
|
"PATCH /repos/{owner}/{repo}/actions/variables/{name}"
|
|
@@ -25047,9 +24893,18 @@ var Endpoints = {
|
|
|
25047
24893
|
getGithubActionsBillingUser: [
|
|
25048
24894
|
"GET /users/{username}/settings/billing/actions"
|
|
25049
24895
|
],
|
|
24896
|
+
getGithubBillingPremiumRequestUsageReportOrg: [
|
|
24897
|
+
"GET /organizations/{org}/settings/billing/premium_request/usage"
|
|
24898
|
+
],
|
|
24899
|
+
getGithubBillingPremiumRequestUsageReportUser: [
|
|
24900
|
+
"GET /users/{username}/settings/billing/premium_request/usage"
|
|
24901
|
+
],
|
|
25050
24902
|
getGithubBillingUsageReportOrg: [
|
|
25051
24903
|
"GET /organizations/{org}/settings/billing/usage"
|
|
25052
24904
|
],
|
|
24905
|
+
getGithubBillingUsageReportUser: [
|
|
24906
|
+
"GET /users/{username}/settings/billing/usage"
|
|
24907
|
+
],
|
|
25053
24908
|
getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"],
|
|
25054
24909
|
getGithubPackagesBillingUser: [
|
|
25055
24910
|
"GET /users/{username}/settings/billing/packages"
|
|
@@ -25061,6 +24916,13 @@ var Endpoints = {
|
|
|
25061
24916
|
"GET /users/{username}/settings/billing/shared-storage"
|
|
25062
24917
|
]
|
|
25063
24918
|
},
|
|
24919
|
+
campaigns: {
|
|
24920
|
+
createCampaign: ["POST /orgs/{org}/campaigns"],
|
|
24921
|
+
deleteCampaign: ["DELETE /orgs/{org}/campaigns/{campaign_number}"],
|
|
24922
|
+
getCampaignSummary: ["GET /orgs/{org}/campaigns/{campaign_number}"],
|
|
24923
|
+
listOrgCampaigns: ["GET /orgs/{org}/campaigns"],
|
|
24924
|
+
updateCampaign: ["PATCH /orgs/{org}/campaigns/{campaign_number}"]
|
|
24925
|
+
},
|
|
25064
24926
|
checks: {
|
|
25065
24927
|
create: ["POST /repos/{owner}/{repo}/check-runs"],
|
|
25066
24928
|
createSuite: ["POST /repos/{owner}/{repo}/check-suites"],
|
|
@@ -25339,10 +25201,9 @@ var Endpoints = {
|
|
|
25339
25201
|
getCopilotSeatDetailsForUser: [
|
|
25340
25202
|
"GET /orgs/{org}/members/{username}/copilot"
|
|
25341
25203
|
],
|
|
25342
|
-
listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"]
|
|
25343
|
-
usageMetricsForOrg: ["GET /orgs/{org}/copilot/usage"],
|
|
25344
|
-
usageMetricsForTeam: ["GET /orgs/{org}/team/{team_slug}/copilot/usage"]
|
|
25204
|
+
listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"]
|
|
25345
25205
|
},
|
|
25206
|
+
credentials: { revoke: ["POST /credentials/revoke"] },
|
|
25346
25207
|
dependabot: {
|
|
25347
25208
|
addSelectedRepoToOrgSecret: [
|
|
25348
25209
|
"PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
|
|
@@ -25379,11 +25240,20 @@ var Endpoints = {
|
|
|
25379
25240
|
removeSelectedRepoFromOrgSecret: [
|
|
25380
25241
|
"DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
|
|
25381
25242
|
],
|
|
25243
|
+
repositoryAccessForOrg: [
|
|
25244
|
+
"GET /organizations/{org}/dependabot/repository-access"
|
|
25245
|
+
],
|
|
25246
|
+
setRepositoryAccessDefaultLevel: [
|
|
25247
|
+
"PUT /organizations/{org}/dependabot/repository-access/default-level"
|
|
25248
|
+
],
|
|
25382
25249
|
setSelectedReposForOrgSecret: [
|
|
25383
25250
|
"PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
|
|
25384
25251
|
],
|
|
25385
25252
|
updateAlert: [
|
|
25386
25253
|
"PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"
|
|
25254
|
+
],
|
|
25255
|
+
updateRepositoryAccessForOrg: [
|
|
25256
|
+
"PATCH /organizations/{org}/dependabot/repository-access"
|
|
25387
25257
|
]
|
|
25388
25258
|
},
|
|
25389
25259
|
dependencyGraph: {
|
|
@@ -25396,6 +25266,51 @@ var Endpoints = {
|
|
|
25396
25266
|
exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"]
|
|
25397
25267
|
},
|
|
25398
25268
|
emojis: { get: ["GET /emojis"] },
|
|
25269
|
+
enterpriseTeamMemberships: {
|
|
25270
|
+
add: [
|
|
25271
|
+
"PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"
|
|
25272
|
+
],
|
|
25273
|
+
bulkAdd: [
|
|
25274
|
+
"POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add"
|
|
25275
|
+
],
|
|
25276
|
+
bulkRemove: [
|
|
25277
|
+
"POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove"
|
|
25278
|
+
],
|
|
25279
|
+
get: [
|
|
25280
|
+
"GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"
|
|
25281
|
+
],
|
|
25282
|
+
list: ["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships"],
|
|
25283
|
+
remove: [
|
|
25284
|
+
"DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"
|
|
25285
|
+
]
|
|
25286
|
+
},
|
|
25287
|
+
enterpriseTeamOrganizations: {
|
|
25288
|
+
add: [
|
|
25289
|
+
"PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"
|
|
25290
|
+
],
|
|
25291
|
+
bulkAdd: [
|
|
25292
|
+
"POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add"
|
|
25293
|
+
],
|
|
25294
|
+
bulkRemove: [
|
|
25295
|
+
"POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove"
|
|
25296
|
+
],
|
|
25297
|
+
delete: [
|
|
25298
|
+
"DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"
|
|
25299
|
+
],
|
|
25300
|
+
getAssignment: [
|
|
25301
|
+
"GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"
|
|
25302
|
+
],
|
|
25303
|
+
getAssignments: [
|
|
25304
|
+
"GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations"
|
|
25305
|
+
]
|
|
25306
|
+
},
|
|
25307
|
+
enterpriseTeams: {
|
|
25308
|
+
create: ["POST /enterprises/{enterprise}/teams"],
|
|
25309
|
+
delete: ["DELETE /enterprises/{enterprise}/teams/{team_slug}"],
|
|
25310
|
+
get: ["GET /enterprises/{enterprise}/teams/{team_slug}"],
|
|
25311
|
+
list: ["GET /enterprises/{enterprise}/teams"],
|
|
25312
|
+
update: ["PATCH /enterprises/{enterprise}/teams/{team_slug}"]
|
|
25313
|
+
},
|
|
25399
25314
|
gists: {
|
|
25400
25315
|
checkIsStarred: ["GET /gists/{gist_id}/star"],
|
|
25401
25316
|
create: ["POST /gists"],
|
|
@@ -25437,6 +25352,26 @@ var Endpoints = {
|
|
|
25437
25352
|
getAllTemplates: ["GET /gitignore/templates"],
|
|
25438
25353
|
getTemplate: ["GET /gitignore/templates/{name}"]
|
|
25439
25354
|
},
|
|
25355
|
+
hostedCompute: {
|
|
25356
|
+
createNetworkConfigurationForOrg: [
|
|
25357
|
+
"POST /orgs/{org}/settings/network-configurations"
|
|
25358
|
+
],
|
|
25359
|
+
deleteNetworkConfigurationFromOrg: [
|
|
25360
|
+
"DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id}"
|
|
25361
|
+
],
|
|
25362
|
+
getNetworkConfigurationForOrg: [
|
|
25363
|
+
"GET /orgs/{org}/settings/network-configurations/{network_configuration_id}"
|
|
25364
|
+
],
|
|
25365
|
+
getNetworkSettingsForOrg: [
|
|
25366
|
+
"GET /orgs/{org}/settings/network-settings/{network_settings_id}"
|
|
25367
|
+
],
|
|
25368
|
+
listNetworkConfigurationsForOrg: [
|
|
25369
|
+
"GET /orgs/{org}/settings/network-configurations"
|
|
25370
|
+
],
|
|
25371
|
+
updateNetworkConfigurationForOrg: [
|
|
25372
|
+
"PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id}"
|
|
25373
|
+
]
|
|
25374
|
+
},
|
|
25440
25375
|
interactions: {
|
|
25441
25376
|
getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"],
|
|
25442
25377
|
getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"],
|
|
@@ -25469,6 +25404,9 @@ var Endpoints = {
|
|
|
25469
25404
|
addAssignees: [
|
|
25470
25405
|
"POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"
|
|
25471
25406
|
],
|
|
25407
|
+
addBlockedByDependency: [
|
|
25408
|
+
"POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"
|
|
25409
|
+
],
|
|
25472
25410
|
addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],
|
|
25473
25411
|
addSubIssue: [
|
|
25474
25412
|
"POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"
|
|
@@ -25495,10 +25433,17 @@ var Endpoints = {
|
|
|
25495
25433
|
getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"],
|
|
25496
25434
|
getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"],
|
|
25497
25435
|
getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],
|
|
25436
|
+
getParent: ["GET /repos/{owner}/{repo}/issues/{issue_number}/parent"],
|
|
25498
25437
|
list: ["GET /issues"],
|
|
25499
25438
|
listAssignees: ["GET /repos/{owner}/{repo}/assignees"],
|
|
25500
25439
|
listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],
|
|
25501
25440
|
listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"],
|
|
25441
|
+
listDependenciesBlockedBy: [
|
|
25442
|
+
"GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"
|
|
25443
|
+
],
|
|
25444
|
+
listDependenciesBlocking: [
|
|
25445
|
+
"GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking"
|
|
25446
|
+
],
|
|
25502
25447
|
listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],
|
|
25503
25448
|
listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"],
|
|
25504
25449
|
listEventsForTimeline: [
|
|
@@ -25525,6 +25470,9 @@ var Endpoints = {
|
|
|
25525
25470
|
removeAssignees: [
|
|
25526
25471
|
"DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"
|
|
25527
25472
|
],
|
|
25473
|
+
removeDependencyBlockedBy: [
|
|
25474
|
+
"DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}"
|
|
25475
|
+
],
|
|
25528
25476
|
removeLabel: [
|
|
25529
25477
|
"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"
|
|
25530
25478
|
],
|
|
@@ -25627,32 +25575,69 @@ var Endpoints = {
|
|
|
25627
25575
|
convertMemberToOutsideCollaborator: [
|
|
25628
25576
|
"PUT /orgs/{org}/outside_collaborators/{username}"
|
|
25629
25577
|
],
|
|
25578
|
+
createArtifactStorageRecord: [
|
|
25579
|
+
"POST /orgs/{org}/artifacts/metadata/storage-record"
|
|
25580
|
+
],
|
|
25630
25581
|
createInvitation: ["POST /orgs/{org}/invitations"],
|
|
25631
|
-
|
|
25632
|
-
|
|
25633
|
-
|
|
25582
|
+
createIssueType: ["POST /orgs/{org}/issue-types"],
|
|
25583
|
+
createWebhook: ["POST /orgs/{org}/hooks"],
|
|
25584
|
+
customPropertiesForOrgsCreateOrUpdateOrganizationValues: [
|
|
25585
|
+
"PATCH /organizations/{org}/org-properties/values"
|
|
25586
|
+
],
|
|
25587
|
+
customPropertiesForOrgsGetOrganizationValues: [
|
|
25588
|
+
"GET /organizations/{org}/org-properties/values"
|
|
25634
25589
|
],
|
|
25635
|
-
|
|
25590
|
+
customPropertiesForReposCreateOrUpdateOrganizationDefinition: [
|
|
25636
25591
|
"PUT /orgs/{org}/properties/schema/{custom_property_name}"
|
|
25637
25592
|
],
|
|
25638
|
-
|
|
25593
|
+
customPropertiesForReposCreateOrUpdateOrganizationDefinitions: [
|
|
25594
|
+
"PATCH /orgs/{org}/properties/schema"
|
|
25595
|
+
],
|
|
25596
|
+
customPropertiesForReposCreateOrUpdateOrganizationValues: [
|
|
25597
|
+
"PATCH /orgs/{org}/properties/values"
|
|
25598
|
+
],
|
|
25599
|
+
customPropertiesForReposDeleteOrganizationDefinition: [
|
|
25600
|
+
"DELETE /orgs/{org}/properties/schema/{custom_property_name}"
|
|
25601
|
+
],
|
|
25602
|
+
customPropertiesForReposGetOrganizationDefinition: [
|
|
25603
|
+
"GET /orgs/{org}/properties/schema/{custom_property_name}"
|
|
25604
|
+
],
|
|
25605
|
+
customPropertiesForReposGetOrganizationDefinitions: [
|
|
25606
|
+
"GET /orgs/{org}/properties/schema"
|
|
25607
|
+
],
|
|
25608
|
+
customPropertiesForReposGetOrganizationValues: [
|
|
25609
|
+
"GET /orgs/{org}/properties/values"
|
|
25610
|
+
],
|
|
25639
25611
|
delete: ["DELETE /orgs/{org}"],
|
|
25612
|
+
deleteAttestationsBulk: ["POST /orgs/{org}/attestations/delete-request"],
|
|
25613
|
+
deleteAttestationsById: [
|
|
25614
|
+
"DELETE /orgs/{org}/attestations/{attestation_id}"
|
|
25615
|
+
],
|
|
25616
|
+
deleteAttestationsBySubjectDigest: [
|
|
25617
|
+
"DELETE /orgs/{org}/attestations/digest/{subject_digest}"
|
|
25618
|
+
],
|
|
25619
|
+
deleteIssueType: ["DELETE /orgs/{org}/issue-types/{issue_type_id}"],
|
|
25640
25620
|
deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"],
|
|
25641
|
-
|
|
25642
|
-
"
|
|
25643
|
-
|
|
25644
|
-
|
|
25645
|
-
|
|
25646
|
-
}
|
|
25621
|
+
disableSelectedRepositoryImmutableReleasesOrganization: [
|
|
25622
|
+
"DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"
|
|
25623
|
+
],
|
|
25624
|
+
enableSelectedRepositoryImmutableReleasesOrganization: [
|
|
25625
|
+
"PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"
|
|
25647
25626
|
],
|
|
25648
25627
|
get: ["GET /orgs/{org}"],
|
|
25649
|
-
|
|
25650
|
-
|
|
25651
|
-
|
|
25628
|
+
getImmutableReleasesSettings: [
|
|
25629
|
+
"GET /orgs/{org}/settings/immutable-releases"
|
|
25630
|
+
],
|
|
25631
|
+
getImmutableReleasesSettingsRepositories: [
|
|
25632
|
+
"GET /orgs/{org}/settings/immutable-releases/repositories"
|
|
25652
25633
|
],
|
|
25653
25634
|
getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"],
|
|
25654
25635
|
getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"],
|
|
25655
25636
|
getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"],
|
|
25637
|
+
getOrgRulesetHistory: ["GET /orgs/{org}/rulesets/{ruleset_id}/history"],
|
|
25638
|
+
getOrgRulesetVersion: [
|
|
25639
|
+
"GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}"
|
|
25640
|
+
],
|
|
25656
25641
|
getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"],
|
|
25657
25642
|
getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"],
|
|
25658
25643
|
getWebhookDelivery: [
|
|
@@ -25660,13 +25645,20 @@ var Endpoints = {
|
|
|
25660
25645
|
],
|
|
25661
25646
|
list: ["GET /organizations"],
|
|
25662
25647
|
listAppInstallations: ["GET /orgs/{org}/installations"],
|
|
25648
|
+
listArtifactStorageRecords: [
|
|
25649
|
+
"GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records"
|
|
25650
|
+
],
|
|
25651
|
+
listAttestationRepositories: ["GET /orgs/{org}/attestations/repositories"],
|
|
25663
25652
|
listAttestations: ["GET /orgs/{org}/attestations/{subject_digest}"],
|
|
25653
|
+
listAttestationsBulk: [
|
|
25654
|
+
"POST /orgs/{org}/attestations/bulk-list{?per_page,before,after}"
|
|
25655
|
+
],
|
|
25664
25656
|
listBlockedUsers: ["GET /orgs/{org}/blocks"],
|
|
25665
|
-
listCustomPropertiesValuesForRepos: ["GET /orgs/{org}/properties/values"],
|
|
25666
25657
|
listFailedInvitations: ["GET /orgs/{org}/failed_invitations"],
|
|
25667
25658
|
listForAuthenticatedUser: ["GET /user/orgs"],
|
|
25668
25659
|
listForUser: ["GET /users/{username}/orgs"],
|
|
25669
25660
|
listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"],
|
|
25661
|
+
listIssueTypes: ["GET /orgs/{org}/issue-types"],
|
|
25670
25662
|
listMembers: ["GET /orgs/{org}/members"],
|
|
25671
25663
|
listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"],
|
|
25672
25664
|
listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"],
|
|
@@ -25699,9 +25691,6 @@ var Endpoints = {
|
|
|
25699
25691
|
redeliverWebhookDelivery: [
|
|
25700
25692
|
"POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
|
|
25701
25693
|
],
|
|
25702
|
-
removeCustomProperty: [
|
|
25703
|
-
"DELETE /orgs/{org}/properties/schema/{custom_property_name}"
|
|
25704
|
-
],
|
|
25705
25694
|
removeMember: ["DELETE /orgs/{org}/members/{username}"],
|
|
25706
25695
|
removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"],
|
|
25707
25696
|
removeOutsideCollaborator: [
|
|
@@ -25735,12 +25724,19 @@ var Endpoints = {
|
|
|
25735
25724
|
revokeOrgRoleUser: [
|
|
25736
25725
|
"DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"
|
|
25737
25726
|
],
|
|
25727
|
+
setImmutableReleasesSettings: [
|
|
25728
|
+
"PUT /orgs/{org}/settings/immutable-releases"
|
|
25729
|
+
],
|
|
25730
|
+
setImmutableReleasesSettingsRepositories: [
|
|
25731
|
+
"PUT /orgs/{org}/settings/immutable-releases/repositories"
|
|
25732
|
+
],
|
|
25738
25733
|
setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"],
|
|
25739
25734
|
setPublicMembershipForAuthenticatedUser: [
|
|
25740
25735
|
"PUT /orgs/{org}/public_members/{username}"
|
|
25741
25736
|
],
|
|
25742
25737
|
unblockUser: ["DELETE /orgs/{org}/blocks/{username}"],
|
|
25743
25738
|
update: ["PATCH /orgs/{org}"],
|
|
25739
|
+
updateIssueType: ["PUT /orgs/{org}/issue-types/{issue_type_id}"],
|
|
25744
25740
|
updateMembershipForAuthenticatedUser: [
|
|
25745
25741
|
"PATCH /user/memberships/orgs/{org}"
|
|
25746
25742
|
],
|
|
@@ -25854,35 +25850,44 @@ var Endpoints = {
|
|
|
25854
25850
|
]
|
|
25855
25851
|
},
|
|
25856
25852
|
projects: {
|
|
25857
|
-
|
|
25858
|
-
|
|
25859
|
-
|
|
25860
|
-
|
|
25861
|
-
|
|
25862
|
-
|
|
25863
|
-
|
|
25864
|
-
|
|
25865
|
-
|
|
25866
|
-
get: ["GET /projects/{project_id}"],
|
|
25867
|
-
getCard: ["GET /projects/columns/cards/{card_id}"],
|
|
25868
|
-
getColumn: ["GET /projects/columns/{column_id}"],
|
|
25869
|
-
getPermissionForUser: [
|
|
25870
|
-
"GET /projects/{project_id}/collaborators/{username}/permission"
|
|
25871
|
-
],
|
|
25872
|
-
listCards: ["GET /projects/columns/{column_id}/cards"],
|
|
25873
|
-
listCollaborators: ["GET /projects/{project_id}/collaborators"],
|
|
25874
|
-
listColumns: ["GET /projects/{project_id}/columns"],
|
|
25875
|
-
listForOrg: ["GET /orgs/{org}/projects"],
|
|
25876
|
-
listForRepo: ["GET /repos/{owner}/{repo}/projects"],
|
|
25877
|
-
listForUser: ["GET /users/{username}/projects"],
|
|
25878
|
-
moveCard: ["POST /projects/columns/cards/{card_id}/moves"],
|
|
25879
|
-
moveColumn: ["POST /projects/columns/{column_id}/moves"],
|
|
25880
|
-
removeCollaborator: [
|
|
25881
|
-
"DELETE /projects/{project_id}/collaborators/{username}"
|
|
25853
|
+
addItemForOrg: ["POST /orgs/{org}/projectsV2/{project_number}/items"],
|
|
25854
|
+
addItemForUser: [
|
|
25855
|
+
"POST /users/{username}/projectsV2/{project_number}/items"
|
|
25856
|
+
],
|
|
25857
|
+
deleteItemForOrg: [
|
|
25858
|
+
"DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}"
|
|
25859
|
+
],
|
|
25860
|
+
deleteItemForUser: [
|
|
25861
|
+
"DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}"
|
|
25882
25862
|
],
|
|
25883
|
-
|
|
25884
|
-
|
|
25885
|
-
|
|
25863
|
+
getFieldForOrg: [
|
|
25864
|
+
"GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}"
|
|
25865
|
+
],
|
|
25866
|
+
getFieldForUser: [
|
|
25867
|
+
"GET /users/{username}/projectsV2/{project_number}/fields/{field_id}"
|
|
25868
|
+
],
|
|
25869
|
+
getForOrg: ["GET /orgs/{org}/projectsV2/{project_number}"],
|
|
25870
|
+
getForUser: ["GET /users/{username}/projectsV2/{project_number}"],
|
|
25871
|
+
getOrgItem: ["GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],
|
|
25872
|
+
getUserItem: [
|
|
25873
|
+
"GET /users/{username}/projectsV2/{project_number}/items/{item_id}"
|
|
25874
|
+
],
|
|
25875
|
+
listFieldsForOrg: ["GET /orgs/{org}/projectsV2/{project_number}/fields"],
|
|
25876
|
+
listFieldsForUser: [
|
|
25877
|
+
"GET /users/{username}/projectsV2/{project_number}/fields"
|
|
25878
|
+
],
|
|
25879
|
+
listForOrg: ["GET /orgs/{org}/projectsV2"],
|
|
25880
|
+
listForUser: ["GET /users/{username}/projectsV2"],
|
|
25881
|
+
listItemsForOrg: ["GET /orgs/{org}/projectsV2/{project_number}/items"],
|
|
25882
|
+
listItemsForUser: [
|
|
25883
|
+
"GET /users/{username}/projectsV2/{project_number}/items"
|
|
25884
|
+
],
|
|
25885
|
+
updateItemForOrg: [
|
|
25886
|
+
"PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}"
|
|
25887
|
+
],
|
|
25888
|
+
updateItemForUser: [
|
|
25889
|
+
"PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}"
|
|
25890
|
+
]
|
|
25886
25891
|
},
|
|
25887
25892
|
pulls: {
|
|
25888
25893
|
checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
|
|
@@ -26044,6 +26049,7 @@ var Endpoints = {
|
|
|
26044
26049
|
"GET /repos/{owner}/{repo}/automated-security-fixes"
|
|
26045
26050
|
],
|
|
26046
26051
|
checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"],
|
|
26052
|
+
checkImmutableReleases: ["GET /repos/{owner}/{repo}/immutable-releases"],
|
|
26047
26053
|
checkPrivateVulnerabilityReporting: [
|
|
26048
26054
|
"GET /repos/{owner}/{repo}/private-vulnerability-reporting"
|
|
26049
26055
|
],
|
|
@@ -26079,9 +26085,6 @@ var Endpoints = {
|
|
|
26079
26085
|
createForAuthenticatedUser: ["POST /user/repos"],
|
|
26080
26086
|
createFork: ["POST /repos/{owner}/{repo}/forks"],
|
|
26081
26087
|
createInOrg: ["POST /orgs/{org}/repos"],
|
|
26082
|
-
createOrUpdateCustomPropertiesValues: [
|
|
26083
|
-
"PATCH /repos/{owner}/{repo}/properties/values"
|
|
26084
|
-
],
|
|
26085
26088
|
createOrUpdateEnvironment: [
|
|
26086
26089
|
"PUT /repos/{owner}/{repo}/environments/{environment_name}"
|
|
26087
26090
|
],
|
|
@@ -26095,6 +26098,12 @@ var Endpoints = {
|
|
|
26095
26098
|
"POST /repos/{template_owner}/{template_repo}/generate"
|
|
26096
26099
|
],
|
|
26097
26100
|
createWebhook: ["POST /repos/{owner}/{repo}/hooks"],
|
|
26101
|
+
customPropertiesForReposCreateOrUpdateRepositoryValues: [
|
|
26102
|
+
"PATCH /repos/{owner}/{repo}/properties/values"
|
|
26103
|
+
],
|
|
26104
|
+
customPropertiesForReposGetRepositoryValues: [
|
|
26105
|
+
"GET /repos/{owner}/{repo}/properties/values"
|
|
26106
|
+
],
|
|
26098
26107
|
declineInvitation: [
|
|
26099
26108
|
"DELETE /user/repository_invitations/{invitation_id}",
|
|
26100
26109
|
{},
|
|
@@ -26149,6 +26158,9 @@ var Endpoints = {
|
|
|
26149
26158
|
disableDeploymentProtectionRule: [
|
|
26150
26159
|
"DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
|
|
26151
26160
|
],
|
|
26161
|
+
disableImmutableReleases: [
|
|
26162
|
+
"DELETE /repos/{owner}/{repo}/immutable-releases"
|
|
26163
|
+
],
|
|
26152
26164
|
disablePrivateVulnerabilityReporting: [
|
|
26153
26165
|
"DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"
|
|
26154
26166
|
],
|
|
@@ -26165,6 +26177,7 @@ var Endpoints = {
|
|
|
26165
26177
|
enableAutomatedSecurityFixes: [
|
|
26166
26178
|
"PUT /repos/{owner}/{repo}/automated-security-fixes"
|
|
26167
26179
|
],
|
|
26180
|
+
enableImmutableReleases: ["PUT /repos/{owner}/{repo}/immutable-releases"],
|
|
26168
26181
|
enablePrivateVulnerabilityReporting: [
|
|
26169
26182
|
"PUT /repos/{owner}/{repo}/private-vulnerability-reporting"
|
|
26170
26183
|
],
|
|
@@ -26216,7 +26229,6 @@ var Endpoints = {
|
|
|
26216
26229
|
getCustomDeploymentProtectionRule: [
|
|
26217
26230
|
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
|
|
26218
26231
|
],
|
|
26219
|
-
getCustomPropertiesValues: ["GET /repos/{owner}/{repo}/properties/values"],
|
|
26220
26232
|
getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"],
|
|
26221
26233
|
getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],
|
|
26222
26234
|
getDeploymentBranchPolicy: [
|
|
@@ -26255,6 +26267,12 @@ var Endpoints = {
|
|
|
26255
26267
|
],
|
|
26256
26268
|
getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"],
|
|
26257
26269
|
getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
|
|
26270
|
+
getRepoRulesetHistory: [
|
|
26271
|
+
"GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history"
|
|
26272
|
+
],
|
|
26273
|
+
getRepoRulesetVersion: [
|
|
26274
|
+
"GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}"
|
|
26275
|
+
],
|
|
26258
26276
|
getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"],
|
|
26259
26277
|
getStatusChecksProtection: [
|
|
26260
26278
|
"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
|
|
@@ -26442,16 +26460,19 @@ var Endpoints = {
|
|
|
26442
26460
|
"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
|
|
26443
26461
|
],
|
|
26444
26462
|
getScanHistory: ["GET /repos/{owner}/{repo}/secret-scanning/scan-history"],
|
|
26445
|
-
listAlertsForEnterprise: [
|
|
26446
|
-
"GET /enterprises/{enterprise}/secret-scanning/alerts"
|
|
26447
|
-
],
|
|
26448
26463
|
listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"],
|
|
26449
26464
|
listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"],
|
|
26450
26465
|
listLocationsForAlert: [
|
|
26451
26466
|
"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"
|
|
26452
26467
|
],
|
|
26468
|
+
listOrgPatternConfigs: [
|
|
26469
|
+
"GET /orgs/{org}/secret-scanning/pattern-configurations"
|
|
26470
|
+
],
|
|
26453
26471
|
updateAlert: [
|
|
26454
26472
|
"PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
|
|
26473
|
+
],
|
|
26474
|
+
updateOrgPatternConfigs: [
|
|
26475
|
+
"PATCH /orgs/{org}/secret-scanning/pattern-configurations"
|
|
26455
26476
|
]
|
|
26456
26477
|
},
|
|
26457
26478
|
securityAdvisories: {
|
|
@@ -26482,15 +26503,9 @@ var Endpoints = {
|
|
|
26482
26503
|
addOrUpdateMembershipForUserInOrg: [
|
|
26483
26504
|
"PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"
|
|
26484
26505
|
],
|
|
26485
|
-
addOrUpdateProjectPermissionsInOrg: [
|
|
26486
|
-
"PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"
|
|
26487
|
-
],
|
|
26488
26506
|
addOrUpdateRepoPermissionsInOrg: [
|
|
26489
26507
|
"PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
|
|
26490
26508
|
],
|
|
26491
|
-
checkPermissionsForProjectInOrg: [
|
|
26492
|
-
"GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"
|
|
26493
|
-
],
|
|
26494
26509
|
checkPermissionsForRepoInOrg: [
|
|
26495
26510
|
"GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
|
|
26496
26511
|
],
|
|
@@ -26527,14 +26542,10 @@ var Endpoints = {
|
|
|
26527
26542
|
listPendingInvitationsInOrg: [
|
|
26528
26543
|
"GET /orgs/{org}/teams/{team_slug}/invitations"
|
|
26529
26544
|
],
|
|
26530
|
-
listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"],
|
|
26531
26545
|
listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"],
|
|
26532
26546
|
removeMembershipForUserInOrg: [
|
|
26533
26547
|
"DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"
|
|
26534
26548
|
],
|
|
26535
|
-
removeProjectInOrg: [
|
|
26536
|
-
"DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"
|
|
26537
|
-
],
|
|
26538
26549
|
removeRepoInOrg: [
|
|
26539
26550
|
"DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
|
|
26540
26551
|
],
|
|
@@ -26571,6 +26582,15 @@ var Endpoints = {
|
|
|
26571
26582
|
],
|
|
26572
26583
|
createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"],
|
|
26573
26584
|
createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"],
|
|
26585
|
+
deleteAttestationsBulk: [
|
|
26586
|
+
"POST /users/{username}/attestations/delete-request"
|
|
26587
|
+
],
|
|
26588
|
+
deleteAttestationsById: [
|
|
26589
|
+
"DELETE /users/{username}/attestations/{attestation_id}"
|
|
26590
|
+
],
|
|
26591
|
+
deleteAttestationsBySubjectDigest: [
|
|
26592
|
+
"DELETE /users/{username}/attestations/digest/{subject_digest}"
|
|
26593
|
+
],
|
|
26574
26594
|
deleteEmailForAuthenticated: [
|
|
26575
26595
|
"DELETE /user/emails",
|
|
26576
26596
|
{},
|
|
@@ -26615,6 +26635,9 @@ var Endpoints = {
|
|
|
26615
26635
|
],
|
|
26616
26636
|
list: ["GET /users"],
|
|
26617
26637
|
listAttestations: ["GET /users/{username}/attestations/{subject_digest}"],
|
|
26638
|
+
listAttestationsBulk: [
|
|
26639
|
+
"POST /users/{username}/attestations/bulk-list{?per_page,before,after}"
|
|
26640
|
+
],
|
|
26618
26641
|
listBlockedByAuthenticated: [
|
|
26619
26642
|
"GET /user/blocks",
|
|
26620
26643
|
{},
|
|
@@ -26675,7 +26698,7 @@ var Endpoints = {
|
|
|
26675
26698
|
};
|
|
26676
26699
|
var endpoints_default = Endpoints;
|
|
26677
26700
|
|
|
26678
|
-
// ../../node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@
|
|
26701
|
+
// ../../node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@17.0.0_@octokit+core@7.0.6/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js
|
|
26679
26702
|
var endpointMethodsMap = /* @__PURE__ */ new Map();
|
|
26680
26703
|
for (const [scope, endpoints] of Object.entries(endpoints_default)) {
|
|
26681
26704
|
for (const [methodName, endpoint2] of Object.entries(endpoints)) {
|
|
@@ -26798,7 +26821,7 @@ function decorate(octokit, scope, methodName, defaults3, decorations) {
|
|
|
26798
26821
|
return Object.assign(withDecorations, requestWithDefaults);
|
|
26799
26822
|
}
|
|
26800
26823
|
|
|
26801
|
-
// ../../node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@
|
|
26824
|
+
// ../../node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@17.0.0_@octokit+core@7.0.6/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js
|
|
26802
26825
|
function restEndpointMethods(octokit) {
|
|
26803
26826
|
const api = endpointsToMethods(octokit);
|
|
26804
26827
|
return {
|
|
@@ -26815,15 +26838,15 @@ function legacyRestEndpointMethods(octokit) {
|
|
|
26815
26838
|
}
|
|
26816
26839
|
legacyRestEndpointMethods.VERSION = VERSION7;
|
|
26817
26840
|
|
|
26818
|
-
// ../../node_modules/.pnpm/@octokit+rest@
|
|
26819
|
-
var VERSION8 = "
|
|
26820
|
-
|
|
26821
|
-
|
|
26822
|
-
|
|
26823
|
-
|
|
26824
|
-
|
|
26825
|
-
|
|
26826
|
-
|
|
26841
|
+
// ../../node_modules/.pnpm/@octokit+rest@22.0.1/node_modules/@octokit/rest/dist-src/version.js
|
|
26842
|
+
var VERSION8 = "22.0.1";
|
|
26843
|
+
|
|
26844
|
+
// ../../node_modules/.pnpm/@octokit+rest@22.0.1/node_modules/@octokit/rest/dist-src/index.js
|
|
26845
|
+
var Octokit2 = Octokit.plugin(requestLog, legacyRestEndpointMethods, paginateRest).defaults(
|
|
26846
|
+
{
|
|
26847
|
+
userAgent: `octokit-rest.js/${VERSION8}`
|
|
26848
|
+
}
|
|
26849
|
+
);
|
|
26827
26850
|
|
|
26828
26851
|
// src/github/GitHub.ts
|
|
26829
26852
|
var GitHub = class {
|
|
@@ -31556,16 +31579,16 @@ function sleep(ms) {
|
|
|
31556
31579
|
// src/replay/replay-run.ts
|
|
31557
31580
|
init_dist();
|
|
31558
31581
|
var import_child_process3 = require("child_process");
|
|
31559
|
-
var
|
|
31560
|
-
var
|
|
31582
|
+
var import_fs12 = require("fs");
|
|
31583
|
+
var import_path14 = require("path");
|
|
31561
31584
|
|
|
31562
31585
|
// src/replay/fernignore.ts
|
|
31563
|
-
var
|
|
31586
|
+
var import_fs11 = require("fs");
|
|
31564
31587
|
var import_promises5 = require("fs/promises");
|
|
31565
|
-
var
|
|
31588
|
+
var import_path13 = require("path");
|
|
31566
31589
|
var REPLAY_FERNIGNORE_ENTRIES2 = [".fern/replay.lock", ".fern/replay.yml"];
|
|
31567
31590
|
async function ensureReplayFernignoreEntries(outputDir) {
|
|
31568
|
-
const fernignorePath = (0,
|
|
31591
|
+
const fernignorePath = (0, import_path13.join)(outputDir, ".fernignore");
|
|
31569
31592
|
let content = "";
|
|
31570
31593
|
try {
|
|
31571
31594
|
content = await (0, import_promises5.readFile)(fernignorePath, "utf-8");
|
|
@@ -31581,16 +31604,16 @@ async function ensureReplayFernignoreEntries(outputDir) {
|
|
|
31581
31604
|
return false;
|
|
31582
31605
|
}
|
|
31583
31606
|
function ensureReplayFernignoreEntriesSync(outputDir) {
|
|
31584
|
-
const fernignorePath = (0,
|
|
31607
|
+
const fernignorePath = (0, import_path13.join)(outputDir, ".fernignore");
|
|
31585
31608
|
let content = "";
|
|
31586
|
-
if ((0,
|
|
31587
|
-
content = (0,
|
|
31609
|
+
if ((0, import_fs11.existsSync)(fernignorePath)) {
|
|
31610
|
+
content = (0, import_fs11.readFileSync)(fernignorePath, "utf-8");
|
|
31588
31611
|
}
|
|
31589
31612
|
const lines = content.split("\n");
|
|
31590
31613
|
const toAdd = REPLAY_FERNIGNORE_ENTRIES2.filter((entry) => !lines.some((line) => line.trim() === entry));
|
|
31591
31614
|
if (toAdd.length > 0) {
|
|
31592
31615
|
const suffix = content.length > 0 && !content.endsWith("\n") ? "\n" : "";
|
|
31593
|
-
(0,
|
|
31616
|
+
(0, import_fs11.writeFileSync)(fernignorePath, content + suffix + toAdd.join("\n") + "\n", "utf-8");
|
|
31594
31617
|
}
|
|
31595
31618
|
}
|
|
31596
31619
|
|
|
@@ -31605,8 +31628,8 @@ async function replayRun(params) {
|
|
|
31605
31628
|
skipApplication,
|
|
31606
31629
|
logger
|
|
31607
31630
|
} = params;
|
|
31608
|
-
const lockfilePath = (0,
|
|
31609
|
-
if (!(0,
|
|
31631
|
+
const lockfilePath = (0, import_path14.join)(outputDir, ".fern", "replay.lock");
|
|
31632
|
+
if (!(0, import_fs12.existsSync)(lockfilePath)) {
|
|
31610
31633
|
return {
|
|
31611
31634
|
report: null,
|
|
31612
31635
|
fernignoreUpdated: false,
|
|
@@ -31868,8 +31891,8 @@ var PostGenerationPipeline = class {
|
|
|
31868
31891
|
|
|
31869
31892
|
// src/replay/replay-init.ts
|
|
31870
31893
|
init_dist();
|
|
31871
|
-
var
|
|
31872
|
-
var
|
|
31894
|
+
var import_fs13 = require("fs");
|
|
31895
|
+
var import_path15 = require("path");
|
|
31873
31896
|
var import_tmp_promise2 = __toESM(require_tmp_promise());
|
|
31874
31897
|
async function replayInit(params) {
|
|
31875
31898
|
const { githubRepo, token, dryRun } = params;
|
|
@@ -31900,7 +31923,7 @@ async function replayInit(params) {
|
|
|
31900
31923
|
Tracked ${bootstrapResult.patchesCreated} customization patch(es).
|
|
31901
31924
|
Base generation: ${bootstrapResult.generationCommit.sha.slice(0, 7)}`;
|
|
31902
31925
|
const filesToAdd = [".fern/replay.lock", ".fern/replay.yml", ".fernignore"].filter(
|
|
31903
|
-
(f) => (0,
|
|
31926
|
+
(f) => (0, import_fs13.existsSync)((0, import_path15.join)(repoPath, f))
|
|
31904
31927
|
);
|
|
31905
31928
|
const branchName = `fern-replay/init-${Date.now()}`;
|
|
31906
31929
|
await repository.checkoutOrCreateLocal(branchName);
|
|
@@ -32236,8 +32259,8 @@ void yargs_default(hideBin(process.argv)).scriptName(process.env.CLI_NAME ?? "ge
|
|
|
32236
32259
|
const result = await pipeline.run();
|
|
32237
32260
|
if (argv["result-file"] != null) {
|
|
32238
32261
|
const resultPath = resolve(wd, argv["result-file"]);
|
|
32239
|
-
await (0, import_promises9.mkdir)(
|
|
32240
|
-
await
|
|
32262
|
+
await (0, import_promises9.mkdir)(import_path16.default.dirname(resultPath), { recursive: true });
|
|
32263
|
+
await import_fs14.default.promises.writeFile(resultPath, JSON.stringify(result, null, 2));
|
|
32241
32264
|
}
|
|
32242
32265
|
process.stderr.write(`Pipeline ${result.success ? "succeeded" : "failed"}
|
|
32243
32266
|
`);
|
|
@@ -32443,9 +32466,9 @@ async function createWriteStream(outputPath) {
|
|
|
32443
32466
|
}
|
|
32444
32467
|
async function createWriteStreamFromFile(filepath) {
|
|
32445
32468
|
if (!await doesPathExist(filepath)) {
|
|
32446
|
-
await (0, import_promises9.mkdir)(
|
|
32469
|
+
await (0, import_promises9.mkdir)(import_path16.default.dirname(filepath), { recursive: true });
|
|
32447
32470
|
}
|
|
32448
|
-
return
|
|
32471
|
+
return import_fs14.default.createWriteStream(filepath);
|
|
32449
32472
|
}
|
|
32450
32473
|
/*! Bundled license information:
|
|
32451
32474
|
|
|
@@ -32477,4 +32500,11 @@ yargs-parser/build/lib/index.js:
|
|
|
32477
32500
|
* Copyright (c) 2016, Contributors
|
|
32478
32501
|
* SPDX-License-Identifier: ISC
|
|
32479
32502
|
*)
|
|
32503
|
+
|
|
32504
|
+
@octokit/request-error/dist-src/index.js:
|
|
32505
|
+
(* v8 ignore else -- @preserve -- Bug with vitest coverage where it sees an else branch that doesn't exist *)
|
|
32506
|
+
|
|
32507
|
+
@octokit/request/dist-bundle/index.js:
|
|
32508
|
+
(* v8 ignore next -- @preserve *)
|
|
32509
|
+
(* v8 ignore else -- @preserve *)
|
|
32480
32510
|
*/
|