canopycms-cdk 0.0.61 → 0.0.62
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/constructs/cms-service.d.ts +14 -1
- package/dist/constructs/cms-service.d.ts.map +1 -1
- package/dist/constructs/cms-service.js +130 -21
- package/dist/constructs/cms-service.js.map +1 -1
- package/lambda/asset-transform/dist/handler.js +34 -6
- package/lambda/asset-transform/dist/node_modules/.package-lock.json +33 -6
- package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/LICENSE +21 -0
- package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/README.md +1 -0
- package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/dist/emnapi.cjs.js +1398 -0
- package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/dist/emnapi.cjs.min.d.ts +671 -0
- package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/dist/emnapi.cjs.min.js +1 -0
- package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/dist/emnapi.d.mts +671 -0
- package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/dist/emnapi.d.ts +673 -0
- package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/dist/emnapi.esm-bundler.js +1457 -0
- package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/dist/emnapi.iife.d.ts +426 -0
- package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/dist/emnapi.iife.js +1528 -0
- package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/dist/emnapi.js +1529 -0
- package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/dist/emnapi.min.d.mts +671 -0
- package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/dist/emnapi.min.js +1 -0
- package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/dist/emnapi.min.mjs +1 -0
- package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/dist/emnapi.mjs +1367 -0
- package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/index.js +5 -0
- package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/package.json +48 -0
- package/lambda/asset-transform/dist/node_modules/@img/sharp-wasm32/LICENSE +191 -0
- package/lambda/asset-transform/dist/node_modules/@img/sharp-wasm32/README.md +50 -0
- package/lambda/asset-transform/dist/node_modules/@img/sharp-wasm32/index.cjs +1 -0
- package/lambda/asset-transform/dist/node_modules/@img/sharp-wasm32/lib/sharp-wasm32-0.35.3.node.js +1 -0
- package/lambda/asset-transform/dist/node_modules/@img/sharp-wasm32/lib/sharp-wasm32-0.35.3.node.wasm +0 -0
- package/lambda/asset-transform/dist/node_modules/@img/sharp-wasm32/package.json +37 -0
- package/lambda/asset-transform/dist/node_modules/@img/sharp-wasm32/versions.json +21 -0
- package/lambda/asset-transform/dist/node_modules/tslib/CopyrightNotice.txt +15 -0
- package/lambda/asset-transform/dist/node_modules/tslib/LICENSE.txt +12 -0
- package/lambda/asset-transform/dist/node_modules/tslib/README.md +164 -0
- package/lambda/asset-transform/dist/node_modules/tslib/SECURITY.md +41 -0
- package/lambda/asset-transform/dist/node_modules/tslib/modules/index.d.ts +38 -0
- package/lambda/asset-transform/dist/node_modules/tslib/modules/index.js +70 -0
- package/lambda/asset-transform/dist/node_modules/tslib/modules/package.json +3 -0
- package/lambda/asset-transform/dist/node_modules/tslib/package.json +47 -0
- package/lambda/asset-transform/dist/node_modules/tslib/tslib.d.ts +460 -0
- package/lambda/asset-transform/dist/node_modules/tslib/tslib.es6.html +1 -0
- package/lambda/asset-transform/dist/node_modules/tslib/tslib.es6.js +402 -0
- package/lambda/asset-transform/dist/node_modules/tslib/tslib.es6.mjs +401 -0
- package/lambda/asset-transform/dist/node_modules/tslib/tslib.html +1 -0
- package/lambda/asset-transform/dist/node_modules/tslib/tslib.js +484 -0
- package/package.json +5 -5
- package/worker/dist/index.js +526 -459
package/worker/dist/index.js
CHANGED
|
@@ -814,10 +814,10 @@ var require_src2 = __commonJS({
|
|
|
814
814
|
var fs_1 = __require("fs");
|
|
815
815
|
var debug_1 = __importDefault2(require_src());
|
|
816
816
|
var log7 = debug_1.default("@kwsites/file-exists");
|
|
817
|
-
function check(
|
|
818
|
-
log7(`checking %s`,
|
|
817
|
+
function check(path15, isFile, isDirectory) {
|
|
818
|
+
log7(`checking %s`, path15);
|
|
819
819
|
try {
|
|
820
|
-
const stat = fs_1.statSync(
|
|
820
|
+
const stat = fs_1.statSync(path15);
|
|
821
821
|
if (stat.isFile() && isFile) {
|
|
822
822
|
log7(`[OK] path represents a file`);
|
|
823
823
|
return true;
|
|
@@ -837,8 +837,8 @@ var require_src2 = __commonJS({
|
|
|
837
837
|
throw e5;
|
|
838
838
|
}
|
|
839
839
|
}
|
|
840
|
-
function exists2(
|
|
841
|
-
return check(
|
|
840
|
+
function exists2(path15, type = exports.READABLE) {
|
|
841
|
+
return check(path15, (type & exports.FILE) > 0, (type & exports.FOLDER) > 0);
|
|
842
842
|
}
|
|
843
843
|
exports.exists = exists2;
|
|
844
844
|
exports.FILE = 1;
|
|
@@ -927,54 +927,54 @@ var require_polyfills = __commonJS({
|
|
|
927
927
|
}
|
|
928
928
|
var chdir;
|
|
929
929
|
module.exports = patch;
|
|
930
|
-
function patch(
|
|
930
|
+
function patch(fs10) {
|
|
931
931
|
if (constants2.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
932
|
-
patchLchmod(
|
|
933
|
-
}
|
|
934
|
-
if (!
|
|
935
|
-
patchLutimes(
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
if (
|
|
956
|
-
|
|
932
|
+
patchLchmod(fs10);
|
|
933
|
+
}
|
|
934
|
+
if (!fs10.lutimes) {
|
|
935
|
+
patchLutimes(fs10);
|
|
936
|
+
}
|
|
937
|
+
fs10.chown = chownFix(fs10.chown);
|
|
938
|
+
fs10.fchown = chownFix(fs10.fchown);
|
|
939
|
+
fs10.lchown = chownFix(fs10.lchown);
|
|
940
|
+
fs10.chmod = chmodFix(fs10.chmod);
|
|
941
|
+
fs10.fchmod = chmodFix(fs10.fchmod);
|
|
942
|
+
fs10.lchmod = chmodFix(fs10.lchmod);
|
|
943
|
+
fs10.chownSync = chownFixSync(fs10.chownSync);
|
|
944
|
+
fs10.fchownSync = chownFixSync(fs10.fchownSync);
|
|
945
|
+
fs10.lchownSync = chownFixSync(fs10.lchownSync);
|
|
946
|
+
fs10.chmodSync = chmodFixSync(fs10.chmodSync);
|
|
947
|
+
fs10.fchmodSync = chmodFixSync(fs10.fchmodSync);
|
|
948
|
+
fs10.lchmodSync = chmodFixSync(fs10.lchmodSync);
|
|
949
|
+
fs10.stat = statFix(fs10.stat);
|
|
950
|
+
fs10.fstat = statFix(fs10.fstat);
|
|
951
|
+
fs10.lstat = statFix(fs10.lstat);
|
|
952
|
+
fs10.statSync = statFixSync(fs10.statSync);
|
|
953
|
+
fs10.fstatSync = statFixSync(fs10.fstatSync);
|
|
954
|
+
fs10.lstatSync = statFixSync(fs10.lstatSync);
|
|
955
|
+
if (fs10.chmod && !fs10.lchmod) {
|
|
956
|
+
fs10.lchmod = function(path15, mode, cb) {
|
|
957
957
|
if (cb) process.nextTick(cb);
|
|
958
958
|
};
|
|
959
|
-
|
|
959
|
+
fs10.lchmodSync = function() {
|
|
960
960
|
};
|
|
961
961
|
}
|
|
962
|
-
if (
|
|
963
|
-
|
|
962
|
+
if (fs10.chown && !fs10.lchown) {
|
|
963
|
+
fs10.lchown = function(path15, uid, gid, cb) {
|
|
964
964
|
if (cb) process.nextTick(cb);
|
|
965
965
|
};
|
|
966
|
-
|
|
966
|
+
fs10.lchownSync = function() {
|
|
967
967
|
};
|
|
968
968
|
}
|
|
969
969
|
if (platform === "win32") {
|
|
970
|
-
|
|
970
|
+
fs10.rename = typeof fs10.rename !== "function" ? fs10.rename : (function(fs$rename) {
|
|
971
971
|
function rename(from, to, cb) {
|
|
972
972
|
var start = Date.now();
|
|
973
973
|
var backoff = 0;
|
|
974
974
|
fs$rename(from, to, function CB(er) {
|
|
975
975
|
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
|
976
976
|
setTimeout(function() {
|
|
977
|
-
|
|
977
|
+
fs10.stat(to, function(stater, st) {
|
|
978
978
|
if (stater && stater.code === "ENOENT")
|
|
979
979
|
fs$rename(from, to, CB);
|
|
980
980
|
else
|
|
@@ -990,9 +990,9 @@ var require_polyfills = __commonJS({
|
|
|
990
990
|
}
|
|
991
991
|
if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
|
|
992
992
|
return rename;
|
|
993
|
-
})(
|
|
993
|
+
})(fs10.rename);
|
|
994
994
|
}
|
|
995
|
-
|
|
995
|
+
fs10.read = typeof fs10.read !== "function" ? fs10.read : (function(fs$read) {
|
|
996
996
|
function read(fd, buffer, offset, length, position, callback_) {
|
|
997
997
|
var callback;
|
|
998
998
|
if (callback_ && typeof callback_ === "function") {
|
|
@@ -1000,22 +1000,22 @@ var require_polyfills = __commonJS({
|
|
|
1000
1000
|
callback = function(er, _3, __) {
|
|
1001
1001
|
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
|
1002
1002
|
eagCounter++;
|
|
1003
|
-
return fs$read.call(
|
|
1003
|
+
return fs$read.call(fs10, fd, buffer, offset, length, position, callback);
|
|
1004
1004
|
}
|
|
1005
1005
|
callback_.apply(this, arguments);
|
|
1006
1006
|
};
|
|
1007
1007
|
}
|
|
1008
|
-
return fs$read.call(
|
|
1008
|
+
return fs$read.call(fs10, fd, buffer, offset, length, position, callback);
|
|
1009
1009
|
}
|
|
1010
1010
|
if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
|
|
1011
1011
|
return read;
|
|
1012
|
-
})(
|
|
1013
|
-
|
|
1012
|
+
})(fs10.read);
|
|
1013
|
+
fs10.readSync = typeof fs10.readSync !== "function" ? fs10.readSync : /* @__PURE__ */ (function(fs$readSync) {
|
|
1014
1014
|
return function(fd, buffer, offset, length, position) {
|
|
1015
1015
|
var eagCounter = 0;
|
|
1016
1016
|
while (true) {
|
|
1017
1017
|
try {
|
|
1018
|
-
return fs$readSync.call(
|
|
1018
|
+
return fs$readSync.call(fs10, fd, buffer, offset, length, position);
|
|
1019
1019
|
} catch (er) {
|
|
1020
1020
|
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
1021
1021
|
eagCounter++;
|
|
@@ -1025,11 +1025,11 @@ var require_polyfills = __commonJS({
|
|
|
1025
1025
|
}
|
|
1026
1026
|
}
|
|
1027
1027
|
};
|
|
1028
|
-
})(
|
|
1029
|
-
function patchLchmod(
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1028
|
+
})(fs10.readSync);
|
|
1029
|
+
function patchLchmod(fs11) {
|
|
1030
|
+
fs11.lchmod = function(path15, mode, callback) {
|
|
1031
|
+
fs11.open(
|
|
1032
|
+
path15,
|
|
1033
1033
|
constants2.O_WRONLY | constants2.O_SYMLINK,
|
|
1034
1034
|
mode,
|
|
1035
1035
|
function(err, fd) {
|
|
@@ -1037,80 +1037,80 @@ var require_polyfills = __commonJS({
|
|
|
1037
1037
|
if (callback) callback(err);
|
|
1038
1038
|
return;
|
|
1039
1039
|
}
|
|
1040
|
-
|
|
1041
|
-
|
|
1040
|
+
fs11.fchmod(fd, mode, function(err2) {
|
|
1041
|
+
fs11.close(fd, function(err22) {
|
|
1042
1042
|
if (callback) callback(err2 || err22);
|
|
1043
1043
|
});
|
|
1044
1044
|
});
|
|
1045
1045
|
}
|
|
1046
1046
|
);
|
|
1047
1047
|
};
|
|
1048
|
-
|
|
1049
|
-
var fd =
|
|
1048
|
+
fs11.lchmodSync = function(path15, mode) {
|
|
1049
|
+
var fd = fs11.openSync(path15, constants2.O_WRONLY | constants2.O_SYMLINK, mode);
|
|
1050
1050
|
var threw = true;
|
|
1051
1051
|
var ret;
|
|
1052
1052
|
try {
|
|
1053
|
-
ret =
|
|
1053
|
+
ret = fs11.fchmodSync(fd, mode);
|
|
1054
1054
|
threw = false;
|
|
1055
1055
|
} finally {
|
|
1056
1056
|
if (threw) {
|
|
1057
1057
|
try {
|
|
1058
|
-
|
|
1058
|
+
fs11.closeSync(fd);
|
|
1059
1059
|
} catch (er) {
|
|
1060
1060
|
}
|
|
1061
1061
|
} else {
|
|
1062
|
-
|
|
1062
|
+
fs11.closeSync(fd);
|
|
1063
1063
|
}
|
|
1064
1064
|
}
|
|
1065
1065
|
return ret;
|
|
1066
1066
|
};
|
|
1067
1067
|
}
|
|
1068
|
-
function patchLutimes(
|
|
1069
|
-
if (constants2.hasOwnProperty("O_SYMLINK") &&
|
|
1070
|
-
|
|
1071
|
-
|
|
1068
|
+
function patchLutimes(fs11) {
|
|
1069
|
+
if (constants2.hasOwnProperty("O_SYMLINK") && fs11.futimes) {
|
|
1070
|
+
fs11.lutimes = function(path15, at, mt, cb) {
|
|
1071
|
+
fs11.open(path15, constants2.O_SYMLINK, function(er, fd) {
|
|
1072
1072
|
if (er) {
|
|
1073
1073
|
if (cb) cb(er);
|
|
1074
1074
|
return;
|
|
1075
1075
|
}
|
|
1076
|
-
|
|
1077
|
-
|
|
1076
|
+
fs11.futimes(fd, at, mt, function(er2) {
|
|
1077
|
+
fs11.close(fd, function(er22) {
|
|
1078
1078
|
if (cb) cb(er2 || er22);
|
|
1079
1079
|
});
|
|
1080
1080
|
});
|
|
1081
1081
|
});
|
|
1082
1082
|
};
|
|
1083
|
-
|
|
1084
|
-
var fd =
|
|
1083
|
+
fs11.lutimesSync = function(path15, at, mt) {
|
|
1084
|
+
var fd = fs11.openSync(path15, constants2.O_SYMLINK);
|
|
1085
1085
|
var ret;
|
|
1086
1086
|
var threw = true;
|
|
1087
1087
|
try {
|
|
1088
|
-
ret =
|
|
1088
|
+
ret = fs11.futimesSync(fd, at, mt);
|
|
1089
1089
|
threw = false;
|
|
1090
1090
|
} finally {
|
|
1091
1091
|
if (threw) {
|
|
1092
1092
|
try {
|
|
1093
|
-
|
|
1093
|
+
fs11.closeSync(fd);
|
|
1094
1094
|
} catch (er) {
|
|
1095
1095
|
}
|
|
1096
1096
|
} else {
|
|
1097
|
-
|
|
1097
|
+
fs11.closeSync(fd);
|
|
1098
1098
|
}
|
|
1099
1099
|
}
|
|
1100
1100
|
return ret;
|
|
1101
1101
|
};
|
|
1102
|
-
} else if (
|
|
1103
|
-
|
|
1102
|
+
} else if (fs11.futimes) {
|
|
1103
|
+
fs11.lutimes = function(_a3, _b, _c5, cb) {
|
|
1104
1104
|
if (cb) process.nextTick(cb);
|
|
1105
1105
|
};
|
|
1106
|
-
|
|
1106
|
+
fs11.lutimesSync = function() {
|
|
1107
1107
|
};
|
|
1108
1108
|
}
|
|
1109
1109
|
}
|
|
1110
1110
|
function chmodFix(orig) {
|
|
1111
1111
|
if (!orig) return orig;
|
|
1112
1112
|
return function(target, mode, cb) {
|
|
1113
|
-
return orig.call(
|
|
1113
|
+
return orig.call(fs10, target, mode, function(er) {
|
|
1114
1114
|
if (chownErOk(er)) er = null;
|
|
1115
1115
|
if (cb) cb.apply(this, arguments);
|
|
1116
1116
|
});
|
|
@@ -1120,7 +1120,7 @@ var require_polyfills = __commonJS({
|
|
|
1120
1120
|
if (!orig) return orig;
|
|
1121
1121
|
return function(target, mode) {
|
|
1122
1122
|
try {
|
|
1123
|
-
return orig.call(
|
|
1123
|
+
return orig.call(fs10, target, mode);
|
|
1124
1124
|
} catch (er) {
|
|
1125
1125
|
if (!chownErOk(er)) throw er;
|
|
1126
1126
|
}
|
|
@@ -1129,7 +1129,7 @@ var require_polyfills = __commonJS({
|
|
|
1129
1129
|
function chownFix(orig) {
|
|
1130
1130
|
if (!orig) return orig;
|
|
1131
1131
|
return function(target, uid, gid, cb) {
|
|
1132
|
-
return orig.call(
|
|
1132
|
+
return orig.call(fs10, target, uid, gid, function(er) {
|
|
1133
1133
|
if (chownErOk(er)) er = null;
|
|
1134
1134
|
if (cb) cb.apply(this, arguments);
|
|
1135
1135
|
});
|
|
@@ -1139,7 +1139,7 @@ var require_polyfills = __commonJS({
|
|
|
1139
1139
|
if (!orig) return orig;
|
|
1140
1140
|
return function(target, uid, gid) {
|
|
1141
1141
|
try {
|
|
1142
|
-
return orig.call(
|
|
1142
|
+
return orig.call(fs10, target, uid, gid);
|
|
1143
1143
|
} catch (er) {
|
|
1144
1144
|
if (!chownErOk(er)) throw er;
|
|
1145
1145
|
}
|
|
@@ -1159,13 +1159,13 @@ var require_polyfills = __commonJS({
|
|
|
1159
1159
|
}
|
|
1160
1160
|
if (cb) cb.apply(this, arguments);
|
|
1161
1161
|
}
|
|
1162
|
-
return options ? orig.call(
|
|
1162
|
+
return options ? orig.call(fs10, target, options, callback) : orig.call(fs10, target, callback);
|
|
1163
1163
|
};
|
|
1164
1164
|
}
|
|
1165
1165
|
function statFixSync(orig) {
|
|
1166
1166
|
if (!orig) return orig;
|
|
1167
1167
|
return function(target, options) {
|
|
1168
|
-
var stats = options ? orig.call(
|
|
1168
|
+
var stats = options ? orig.call(fs10, target, options) : orig.call(fs10, target);
|
|
1169
1169
|
if (stats) {
|
|
1170
1170
|
if (stats.uid < 0) stats.uid += 4294967296;
|
|
1171
1171
|
if (stats.gid < 0) stats.gid += 4294967296;
|
|
@@ -1194,16 +1194,16 @@ var require_legacy_streams = __commonJS({
|
|
|
1194
1194
|
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports, module) {
|
|
1195
1195
|
var Stream = __require("stream").Stream;
|
|
1196
1196
|
module.exports = legacy;
|
|
1197
|
-
function legacy(
|
|
1197
|
+
function legacy(fs10) {
|
|
1198
1198
|
return {
|
|
1199
1199
|
ReadStream,
|
|
1200
1200
|
WriteStream
|
|
1201
1201
|
};
|
|
1202
|
-
function ReadStream(
|
|
1203
|
-
if (!(this instanceof ReadStream)) return new ReadStream(
|
|
1202
|
+
function ReadStream(path15, options) {
|
|
1203
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path15, options);
|
|
1204
1204
|
Stream.call(this);
|
|
1205
1205
|
var self2 = this;
|
|
1206
|
-
this.path =
|
|
1206
|
+
this.path = path15;
|
|
1207
1207
|
this.fd = null;
|
|
1208
1208
|
this.readable = true;
|
|
1209
1209
|
this.paused = false;
|
|
@@ -1237,7 +1237,7 @@ var require_legacy_streams = __commonJS({
|
|
|
1237
1237
|
});
|
|
1238
1238
|
return;
|
|
1239
1239
|
}
|
|
1240
|
-
|
|
1240
|
+
fs10.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
1241
1241
|
if (err) {
|
|
1242
1242
|
self2.emit("error", err);
|
|
1243
1243
|
self2.readable = false;
|
|
@@ -1248,10 +1248,10 @@ var require_legacy_streams = __commonJS({
|
|
|
1248
1248
|
self2._read();
|
|
1249
1249
|
});
|
|
1250
1250
|
}
|
|
1251
|
-
function WriteStream(
|
|
1252
|
-
if (!(this instanceof WriteStream)) return new WriteStream(
|
|
1251
|
+
function WriteStream(path15, options) {
|
|
1252
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path15, options);
|
|
1253
1253
|
Stream.call(this);
|
|
1254
|
-
this.path =
|
|
1254
|
+
this.path = path15;
|
|
1255
1255
|
this.fd = null;
|
|
1256
1256
|
this.writable = true;
|
|
1257
1257
|
this.flags = "w";
|
|
@@ -1276,7 +1276,7 @@ var require_legacy_streams = __commonJS({
|
|
|
1276
1276
|
this.busy = false;
|
|
1277
1277
|
this._queue = [];
|
|
1278
1278
|
if (this.fd === null) {
|
|
1279
|
-
this._open =
|
|
1279
|
+
this._open = fs10.open;
|
|
1280
1280
|
this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
|
|
1281
1281
|
this.flush();
|
|
1282
1282
|
}
|
|
@@ -1311,7 +1311,7 @@ var require_clone = __commonJS({
|
|
|
1311
1311
|
// ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js
|
|
1312
1312
|
var require_graceful_fs = __commonJS({
|
|
1313
1313
|
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports, module) {
|
|
1314
|
-
var
|
|
1314
|
+
var fs10 = __require("fs");
|
|
1315
1315
|
var polyfills = require_polyfills();
|
|
1316
1316
|
var legacy = require_legacy_streams();
|
|
1317
1317
|
var clone = require_clone();
|
|
@@ -1343,12 +1343,12 @@ var require_graceful_fs = __commonJS({
|
|
|
1343
1343
|
m5 = "GFS4: " + m5.split(/\n/).join("\nGFS4: ");
|
|
1344
1344
|
console.error(m5);
|
|
1345
1345
|
};
|
|
1346
|
-
if (!
|
|
1346
|
+
if (!fs10[gracefulQueue]) {
|
|
1347
1347
|
queue = global[gracefulQueue] || [];
|
|
1348
|
-
publishQueue(
|
|
1349
|
-
|
|
1348
|
+
publishQueue(fs10, queue);
|
|
1349
|
+
fs10.close = (function(fs$close) {
|
|
1350
1350
|
function close(fd, cb) {
|
|
1351
|
-
return fs$close.call(
|
|
1351
|
+
return fs$close.call(fs10, fd, function(err) {
|
|
1352
1352
|
if (!err) {
|
|
1353
1353
|
resetQueue();
|
|
1354
1354
|
}
|
|
@@ -1360,48 +1360,48 @@ var require_graceful_fs = __commonJS({
|
|
|
1360
1360
|
value: fs$close
|
|
1361
1361
|
});
|
|
1362
1362
|
return close;
|
|
1363
|
-
})(
|
|
1364
|
-
|
|
1363
|
+
})(fs10.close);
|
|
1364
|
+
fs10.closeSync = (function(fs$closeSync) {
|
|
1365
1365
|
function closeSync(fd) {
|
|
1366
|
-
fs$closeSync.apply(
|
|
1366
|
+
fs$closeSync.apply(fs10, arguments);
|
|
1367
1367
|
resetQueue();
|
|
1368
1368
|
}
|
|
1369
1369
|
Object.defineProperty(closeSync, previousSymbol, {
|
|
1370
1370
|
value: fs$closeSync
|
|
1371
1371
|
});
|
|
1372
1372
|
return closeSync;
|
|
1373
|
-
})(
|
|
1373
|
+
})(fs10.closeSync);
|
|
1374
1374
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
1375
1375
|
process.on("exit", function() {
|
|
1376
|
-
debug2(
|
|
1377
|
-
__require("assert").equal(
|
|
1376
|
+
debug2(fs10[gracefulQueue]);
|
|
1377
|
+
__require("assert").equal(fs10[gracefulQueue].length, 0);
|
|
1378
1378
|
});
|
|
1379
1379
|
}
|
|
1380
1380
|
}
|
|
1381
1381
|
var queue;
|
|
1382
1382
|
if (!global[gracefulQueue]) {
|
|
1383
|
-
publishQueue(global,
|
|
1384
|
-
}
|
|
1385
|
-
module.exports = patch(clone(
|
|
1386
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !
|
|
1387
|
-
module.exports = patch(
|
|
1388
|
-
|
|
1389
|
-
}
|
|
1390
|
-
function patch(
|
|
1391
|
-
polyfills(
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
var fs$readFile =
|
|
1396
|
-
|
|
1397
|
-
function readFile(
|
|
1383
|
+
publishQueue(global, fs10[gracefulQueue]);
|
|
1384
|
+
}
|
|
1385
|
+
module.exports = patch(clone(fs10));
|
|
1386
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs10.__patched) {
|
|
1387
|
+
module.exports = patch(fs10);
|
|
1388
|
+
fs10.__patched = true;
|
|
1389
|
+
}
|
|
1390
|
+
function patch(fs11) {
|
|
1391
|
+
polyfills(fs11);
|
|
1392
|
+
fs11.gracefulify = patch;
|
|
1393
|
+
fs11.createReadStream = createReadStream;
|
|
1394
|
+
fs11.createWriteStream = createWriteStream;
|
|
1395
|
+
var fs$readFile = fs11.readFile;
|
|
1396
|
+
fs11.readFile = readFile;
|
|
1397
|
+
function readFile(path15, options, cb) {
|
|
1398
1398
|
if (typeof options === "function")
|
|
1399
1399
|
cb = options, options = null;
|
|
1400
|
-
return go$readFile(
|
|
1401
|
-
function go$readFile(
|
|
1402
|
-
return fs$readFile(
|
|
1400
|
+
return go$readFile(path15, options, cb);
|
|
1401
|
+
function go$readFile(path16, options2, cb2, startTime) {
|
|
1402
|
+
return fs$readFile(path16, options2, function(err) {
|
|
1403
1403
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
1404
|
-
enqueue([go$readFile, [
|
|
1404
|
+
enqueue([go$readFile, [path16, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
1405
1405
|
else {
|
|
1406
1406
|
if (typeof cb2 === "function")
|
|
1407
1407
|
cb2.apply(this, arguments);
|
|
@@ -1409,16 +1409,16 @@ var require_graceful_fs = __commonJS({
|
|
|
1409
1409
|
});
|
|
1410
1410
|
}
|
|
1411
1411
|
}
|
|
1412
|
-
var fs$writeFile =
|
|
1413
|
-
|
|
1414
|
-
function writeFile(
|
|
1412
|
+
var fs$writeFile = fs11.writeFile;
|
|
1413
|
+
fs11.writeFile = writeFile;
|
|
1414
|
+
function writeFile(path15, data2, options, cb) {
|
|
1415
1415
|
if (typeof options === "function")
|
|
1416
1416
|
cb = options, options = null;
|
|
1417
|
-
return go$writeFile(
|
|
1418
|
-
function go$writeFile(
|
|
1419
|
-
return fs$writeFile(
|
|
1417
|
+
return go$writeFile(path15, data2, options, cb);
|
|
1418
|
+
function go$writeFile(path16, data3, options2, cb2, startTime) {
|
|
1419
|
+
return fs$writeFile(path16, data3, options2, function(err) {
|
|
1420
1420
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
1421
|
-
enqueue([go$writeFile, [
|
|
1421
|
+
enqueue([go$writeFile, [path16, data3, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
1422
1422
|
else {
|
|
1423
1423
|
if (typeof cb2 === "function")
|
|
1424
1424
|
cb2.apply(this, arguments);
|
|
@@ -1426,17 +1426,17 @@ var require_graceful_fs = __commonJS({
|
|
|
1426
1426
|
});
|
|
1427
1427
|
}
|
|
1428
1428
|
}
|
|
1429
|
-
var fs$appendFile =
|
|
1429
|
+
var fs$appendFile = fs11.appendFile;
|
|
1430
1430
|
if (fs$appendFile)
|
|
1431
|
-
|
|
1432
|
-
function appendFile(
|
|
1431
|
+
fs11.appendFile = appendFile;
|
|
1432
|
+
function appendFile(path15, data2, options, cb) {
|
|
1433
1433
|
if (typeof options === "function")
|
|
1434
1434
|
cb = options, options = null;
|
|
1435
|
-
return go$appendFile(
|
|
1436
|
-
function go$appendFile(
|
|
1437
|
-
return fs$appendFile(
|
|
1435
|
+
return go$appendFile(path15, data2, options, cb);
|
|
1436
|
+
function go$appendFile(path16, data3, options2, cb2, startTime) {
|
|
1437
|
+
return fs$appendFile(path16, data3, options2, function(err) {
|
|
1438
1438
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
1439
|
-
enqueue([go$appendFile, [
|
|
1439
|
+
enqueue([go$appendFile, [path16, data3, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
1440
1440
|
else {
|
|
1441
1441
|
if (typeof cb2 === "function")
|
|
1442
1442
|
cb2.apply(this, arguments);
|
|
@@ -1444,9 +1444,9 @@ var require_graceful_fs = __commonJS({
|
|
|
1444
1444
|
});
|
|
1445
1445
|
}
|
|
1446
1446
|
}
|
|
1447
|
-
var fs$copyFile =
|
|
1447
|
+
var fs$copyFile = fs11.copyFile;
|
|
1448
1448
|
if (fs$copyFile)
|
|
1449
|
-
|
|
1449
|
+
fs11.copyFile = copyFile;
|
|
1450
1450
|
function copyFile(src, dest, flags, cb) {
|
|
1451
1451
|
if (typeof flags === "function") {
|
|
1452
1452
|
cb = flags;
|
|
@@ -1464,34 +1464,34 @@ var require_graceful_fs = __commonJS({
|
|
|
1464
1464
|
});
|
|
1465
1465
|
}
|
|
1466
1466
|
}
|
|
1467
|
-
var fs$readdir =
|
|
1468
|
-
|
|
1467
|
+
var fs$readdir = fs11.readdir;
|
|
1468
|
+
fs11.readdir = readdir;
|
|
1469
1469
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
1470
|
-
function readdir(
|
|
1470
|
+
function readdir(path15, options, cb) {
|
|
1471
1471
|
if (typeof options === "function")
|
|
1472
1472
|
cb = options, options = null;
|
|
1473
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(
|
|
1474
|
-
return fs$readdir(
|
|
1475
|
-
|
|
1473
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path16, options2, cb2, startTime) {
|
|
1474
|
+
return fs$readdir(path16, fs$readdirCallback(
|
|
1475
|
+
path16,
|
|
1476
1476
|
options2,
|
|
1477
1477
|
cb2,
|
|
1478
1478
|
startTime
|
|
1479
1479
|
));
|
|
1480
|
-
} : function go$readdir2(
|
|
1481
|
-
return fs$readdir(
|
|
1482
|
-
|
|
1480
|
+
} : function go$readdir2(path16, options2, cb2, startTime) {
|
|
1481
|
+
return fs$readdir(path16, options2, fs$readdirCallback(
|
|
1482
|
+
path16,
|
|
1483
1483
|
options2,
|
|
1484
1484
|
cb2,
|
|
1485
1485
|
startTime
|
|
1486
1486
|
));
|
|
1487
1487
|
};
|
|
1488
|
-
return go$readdir(
|
|
1489
|
-
function fs$readdirCallback(
|
|
1488
|
+
return go$readdir(path15, options, cb);
|
|
1489
|
+
function fs$readdirCallback(path16, options2, cb2, startTime) {
|
|
1490
1490
|
return function(err, files) {
|
|
1491
1491
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
1492
1492
|
enqueue([
|
|
1493
1493
|
go$readdir,
|
|
1494
|
-
[
|
|
1494
|
+
[path16, options2, cb2],
|
|
1495
1495
|
err,
|
|
1496
1496
|
startTime || Date.now(),
|
|
1497
1497
|
Date.now()
|
|
@@ -1506,21 +1506,21 @@ var require_graceful_fs = __commonJS({
|
|
|
1506
1506
|
}
|
|
1507
1507
|
}
|
|
1508
1508
|
if (process.version.substr(0, 4) === "v0.8") {
|
|
1509
|
-
var legStreams = legacy(
|
|
1509
|
+
var legStreams = legacy(fs11);
|
|
1510
1510
|
ReadStream = legStreams.ReadStream;
|
|
1511
1511
|
WriteStream = legStreams.WriteStream;
|
|
1512
1512
|
}
|
|
1513
|
-
var fs$ReadStream =
|
|
1513
|
+
var fs$ReadStream = fs11.ReadStream;
|
|
1514
1514
|
if (fs$ReadStream) {
|
|
1515
1515
|
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
|
1516
1516
|
ReadStream.prototype.open = ReadStream$open;
|
|
1517
1517
|
}
|
|
1518
|
-
var fs$WriteStream =
|
|
1518
|
+
var fs$WriteStream = fs11.WriteStream;
|
|
1519
1519
|
if (fs$WriteStream) {
|
|
1520
1520
|
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
1521
1521
|
WriteStream.prototype.open = WriteStream$open;
|
|
1522
1522
|
}
|
|
1523
|
-
Object.defineProperty(
|
|
1523
|
+
Object.defineProperty(fs11, "ReadStream", {
|
|
1524
1524
|
get: function() {
|
|
1525
1525
|
return ReadStream;
|
|
1526
1526
|
},
|
|
@@ -1530,7 +1530,7 @@ var require_graceful_fs = __commonJS({
|
|
|
1530
1530
|
enumerable: true,
|
|
1531
1531
|
configurable: true
|
|
1532
1532
|
});
|
|
1533
|
-
Object.defineProperty(
|
|
1533
|
+
Object.defineProperty(fs11, "WriteStream", {
|
|
1534
1534
|
get: function() {
|
|
1535
1535
|
return WriteStream;
|
|
1536
1536
|
},
|
|
@@ -1541,7 +1541,7 @@ var require_graceful_fs = __commonJS({
|
|
|
1541
1541
|
configurable: true
|
|
1542
1542
|
});
|
|
1543
1543
|
var FileReadStream = ReadStream;
|
|
1544
|
-
Object.defineProperty(
|
|
1544
|
+
Object.defineProperty(fs11, "FileReadStream", {
|
|
1545
1545
|
get: function() {
|
|
1546
1546
|
return FileReadStream;
|
|
1547
1547
|
},
|
|
@@ -1552,7 +1552,7 @@ var require_graceful_fs = __commonJS({
|
|
|
1552
1552
|
configurable: true
|
|
1553
1553
|
});
|
|
1554
1554
|
var FileWriteStream = WriteStream;
|
|
1555
|
-
Object.defineProperty(
|
|
1555
|
+
Object.defineProperty(fs11, "FileWriteStream", {
|
|
1556
1556
|
get: function() {
|
|
1557
1557
|
return FileWriteStream;
|
|
1558
1558
|
},
|
|
@@ -1562,7 +1562,7 @@ var require_graceful_fs = __commonJS({
|
|
|
1562
1562
|
enumerable: true,
|
|
1563
1563
|
configurable: true
|
|
1564
1564
|
});
|
|
1565
|
-
function ReadStream(
|
|
1565
|
+
function ReadStream(path15, options) {
|
|
1566
1566
|
if (this instanceof ReadStream)
|
|
1567
1567
|
return fs$ReadStream.apply(this, arguments), this;
|
|
1568
1568
|
else
|
|
@@ -1582,7 +1582,7 @@ var require_graceful_fs = __commonJS({
|
|
|
1582
1582
|
}
|
|
1583
1583
|
});
|
|
1584
1584
|
}
|
|
1585
|
-
function WriteStream(
|
|
1585
|
+
function WriteStream(path15, options) {
|
|
1586
1586
|
if (this instanceof WriteStream)
|
|
1587
1587
|
return fs$WriteStream.apply(this, arguments), this;
|
|
1588
1588
|
else
|
|
@@ -1600,22 +1600,22 @@ var require_graceful_fs = __commonJS({
|
|
|
1600
1600
|
}
|
|
1601
1601
|
});
|
|
1602
1602
|
}
|
|
1603
|
-
function createReadStream(
|
|
1604
|
-
return new
|
|
1603
|
+
function createReadStream(path15, options) {
|
|
1604
|
+
return new fs11.ReadStream(path15, options);
|
|
1605
1605
|
}
|
|
1606
|
-
function createWriteStream(
|
|
1607
|
-
return new
|
|
1606
|
+
function createWriteStream(path15, options) {
|
|
1607
|
+
return new fs11.WriteStream(path15, options);
|
|
1608
1608
|
}
|
|
1609
|
-
var fs$open =
|
|
1610
|
-
|
|
1611
|
-
function open(
|
|
1609
|
+
var fs$open = fs11.open;
|
|
1610
|
+
fs11.open = open;
|
|
1611
|
+
function open(path15, flags, mode, cb) {
|
|
1612
1612
|
if (typeof mode === "function")
|
|
1613
1613
|
cb = mode, mode = null;
|
|
1614
|
-
return go$open(
|
|
1615
|
-
function go$open(
|
|
1616
|
-
return fs$open(
|
|
1614
|
+
return go$open(path15, flags, mode, cb);
|
|
1615
|
+
function go$open(path16, flags2, mode2, cb2, startTime) {
|
|
1616
|
+
return fs$open(path16, flags2, mode2, function(err, fd) {
|
|
1617
1617
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
1618
|
-
enqueue([go$open, [
|
|
1618
|
+
enqueue([go$open, [path16, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
1619
1619
|
else {
|
|
1620
1620
|
if (typeof cb2 === "function")
|
|
1621
1621
|
cb2.apply(this, arguments);
|
|
@@ -1623,20 +1623,20 @@ var require_graceful_fs = __commonJS({
|
|
|
1623
1623
|
});
|
|
1624
1624
|
}
|
|
1625
1625
|
}
|
|
1626
|
-
return
|
|
1626
|
+
return fs11;
|
|
1627
1627
|
}
|
|
1628
1628
|
function enqueue(elem) {
|
|
1629
1629
|
debug2("ENQUEUE", elem[0].name, elem[1]);
|
|
1630
|
-
|
|
1630
|
+
fs10[gracefulQueue].push(elem);
|
|
1631
1631
|
retry2();
|
|
1632
1632
|
}
|
|
1633
1633
|
var retryTimer;
|
|
1634
1634
|
function resetQueue() {
|
|
1635
1635
|
var now = Date.now();
|
|
1636
|
-
for (var i6 = 0; i6 <
|
|
1637
|
-
if (
|
|
1638
|
-
|
|
1639
|
-
|
|
1636
|
+
for (var i6 = 0; i6 < fs10[gracefulQueue].length; ++i6) {
|
|
1637
|
+
if (fs10[gracefulQueue][i6].length > 2) {
|
|
1638
|
+
fs10[gracefulQueue][i6][3] = now;
|
|
1639
|
+
fs10[gracefulQueue][i6][4] = now;
|
|
1640
1640
|
}
|
|
1641
1641
|
}
|
|
1642
1642
|
retry2();
|
|
@@ -1644,9 +1644,9 @@ var require_graceful_fs = __commonJS({
|
|
|
1644
1644
|
function retry2() {
|
|
1645
1645
|
clearTimeout(retryTimer);
|
|
1646
1646
|
retryTimer = void 0;
|
|
1647
|
-
if (
|
|
1647
|
+
if (fs10[gracefulQueue].length === 0)
|
|
1648
1648
|
return;
|
|
1649
|
-
var elem =
|
|
1649
|
+
var elem = fs10[gracefulQueue].shift();
|
|
1650
1650
|
var fn = elem[0];
|
|
1651
1651
|
var args = elem[1];
|
|
1652
1652
|
var err = elem[2];
|
|
@@ -1668,7 +1668,7 @@ var require_graceful_fs = __commonJS({
|
|
|
1668
1668
|
debug2("RETRY", fn.name, args);
|
|
1669
1669
|
fn.apply(null, args.concat([startTime]));
|
|
1670
1670
|
} else {
|
|
1671
|
-
|
|
1671
|
+
fs10[gracefulQueue].push(elem);
|
|
1672
1672
|
}
|
|
1673
1673
|
}
|
|
1674
1674
|
if (retryTimer === void 0) {
|
|
@@ -2103,10 +2103,10 @@ var require_mtime_precision = __commonJS({
|
|
|
2103
2103
|
"../../node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/lib/mtime-precision.js"(exports, module) {
|
|
2104
2104
|
"use strict";
|
|
2105
2105
|
var cacheSymbol = Symbol();
|
|
2106
|
-
function probe(file,
|
|
2107
|
-
const cachedPrecision =
|
|
2106
|
+
function probe(file, fs10, callback) {
|
|
2107
|
+
const cachedPrecision = fs10[cacheSymbol];
|
|
2108
2108
|
if (cachedPrecision) {
|
|
2109
|
-
return
|
|
2109
|
+
return fs10.stat(file, (err, stat) => {
|
|
2110
2110
|
if (err) {
|
|
2111
2111
|
return callback(err);
|
|
2112
2112
|
}
|
|
@@ -2114,16 +2114,16 @@ var require_mtime_precision = __commonJS({
|
|
|
2114
2114
|
});
|
|
2115
2115
|
}
|
|
2116
2116
|
const mtime = new Date(Math.ceil(Date.now() / 1e3) * 1e3 + 5);
|
|
2117
|
-
|
|
2117
|
+
fs10.utimes(file, mtime, mtime, (err) => {
|
|
2118
2118
|
if (err) {
|
|
2119
2119
|
return callback(err);
|
|
2120
2120
|
}
|
|
2121
|
-
|
|
2121
|
+
fs10.stat(file, (err2, stat) => {
|
|
2122
2122
|
if (err2) {
|
|
2123
2123
|
return callback(err2);
|
|
2124
2124
|
}
|
|
2125
2125
|
const precision = stat.mtime.getTime() % 1e3 === 0 ? "s" : "ms";
|
|
2126
|
-
Object.defineProperty(
|
|
2126
|
+
Object.defineProperty(fs10, cacheSymbol, { value: precision });
|
|
2127
2127
|
callback(null, stat.mtime, precision);
|
|
2128
2128
|
});
|
|
2129
2129
|
});
|
|
@@ -2144,8 +2144,8 @@ var require_mtime_precision = __commonJS({
|
|
|
2144
2144
|
var require_lockfile = __commonJS({
|
|
2145
2145
|
"../../node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/lib/lockfile.js"(exports, module) {
|
|
2146
2146
|
"use strict";
|
|
2147
|
-
var
|
|
2148
|
-
var
|
|
2147
|
+
var path15 = __require("path");
|
|
2148
|
+
var fs10 = require_graceful_fs();
|
|
2149
2149
|
var retry2 = require_retry2();
|
|
2150
2150
|
var onExit = require_signal_exit();
|
|
2151
2151
|
var mtimePrecision = require_mtime_precision();
|
|
@@ -2155,7 +2155,7 @@ var require_lockfile = __commonJS({
|
|
|
2155
2155
|
}
|
|
2156
2156
|
function resolveCanonicalPath(file, options, callback) {
|
|
2157
2157
|
if (!options.realpath) {
|
|
2158
|
-
return callback(null,
|
|
2158
|
+
return callback(null, path15.resolve(file));
|
|
2159
2159
|
}
|
|
2160
2160
|
options.fs.realpath(file, callback);
|
|
2161
2161
|
}
|
|
@@ -2276,7 +2276,7 @@ var require_lockfile = __commonJS({
|
|
|
2276
2276
|
update: null,
|
|
2277
2277
|
realpath: true,
|
|
2278
2278
|
retries: 0,
|
|
2279
|
-
fs:
|
|
2279
|
+
fs: fs10,
|
|
2280
2280
|
onCompromised: (err) => {
|
|
2281
2281
|
throw err;
|
|
2282
2282
|
},
|
|
@@ -2320,7 +2320,7 @@ var require_lockfile = __commonJS({
|
|
|
2320
2320
|
}
|
|
2321
2321
|
function unlock(file, options, callback) {
|
|
2322
2322
|
options = {
|
|
2323
|
-
fs:
|
|
2323
|
+
fs: fs10,
|
|
2324
2324
|
realpath: true,
|
|
2325
2325
|
...options
|
|
2326
2326
|
};
|
|
@@ -2342,7 +2342,7 @@ var require_lockfile = __commonJS({
|
|
|
2342
2342
|
options = {
|
|
2343
2343
|
stale: 1e4,
|
|
2344
2344
|
realpath: true,
|
|
2345
|
-
fs:
|
|
2345
|
+
fs: fs10,
|
|
2346
2346
|
...options
|
|
2347
2347
|
};
|
|
2348
2348
|
options.stale = Math.max(options.stale || 0, 2e3);
|
|
@@ -2381,16 +2381,16 @@ var require_lockfile = __commonJS({
|
|
|
2381
2381
|
var require_adapter = __commonJS({
|
|
2382
2382
|
"../../node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/lib/adapter.js"(exports, module) {
|
|
2383
2383
|
"use strict";
|
|
2384
|
-
var
|
|
2385
|
-
function createSyncFs(
|
|
2384
|
+
var fs10 = require_graceful_fs();
|
|
2385
|
+
function createSyncFs(fs11) {
|
|
2386
2386
|
const methods = ["mkdir", "realpath", "stat", "rmdir", "utimes"];
|
|
2387
|
-
const newFs = { ...
|
|
2387
|
+
const newFs = { ...fs11 };
|
|
2388
2388
|
methods.forEach((method) => {
|
|
2389
2389
|
newFs[method] = (...args) => {
|
|
2390
2390
|
const callback = args.pop();
|
|
2391
2391
|
let ret;
|
|
2392
2392
|
try {
|
|
2393
|
-
ret =
|
|
2393
|
+
ret = fs11[`${method}Sync`](...args);
|
|
2394
2394
|
} catch (err) {
|
|
2395
2395
|
return callback(err);
|
|
2396
2396
|
}
|
|
@@ -2428,7 +2428,7 @@ var require_adapter = __commonJS({
|
|
|
2428
2428
|
}
|
|
2429
2429
|
function toSyncOptions(options) {
|
|
2430
2430
|
options = { ...options };
|
|
2431
|
-
options.fs = createSyncFs(options.fs ||
|
|
2431
|
+
options.fs = createSyncFs(options.fs || fs10);
|
|
2432
2432
|
if (typeof options.retries === "number" && options.retries > 0 || options.retries && typeof options.retries.retries === "number" && options.retries.retries > 0) {
|
|
2433
2433
|
throw Object.assign(new Error("Cannot use retries with the sync api"), { code: "ESYNC" });
|
|
2434
2434
|
}
|
|
@@ -3785,15 +3785,15 @@ var require_dist_node9 = __commonJS({
|
|
|
3785
3785
|
octokit.log.debug("request", options);
|
|
3786
3786
|
const start = Date.now();
|
|
3787
3787
|
const requestOptions = octokit.request.endpoint.parse(options);
|
|
3788
|
-
const
|
|
3788
|
+
const path15 = requestOptions.url.replace(options.baseUrl, "");
|
|
3789
3789
|
return request(options).then((response) => {
|
|
3790
3790
|
octokit.log.info(
|
|
3791
|
-
`${requestOptions.method} ${
|
|
3791
|
+
`${requestOptions.method} ${path15} - ${response.status} in ${Date.now() - start}ms`
|
|
3792
3792
|
);
|
|
3793
3793
|
return response;
|
|
3794
3794
|
}).catch((error2) => {
|
|
3795
3795
|
octokit.log.info(
|
|
3796
|
-
`${requestOptions.method} ${
|
|
3796
|
+
`${requestOptions.method} ${path15} - ${error2.status} in ${Date.now() - start}ms`
|
|
3797
3797
|
);
|
|
3798
3798
|
throw error2;
|
|
3799
3799
|
});
|
|
@@ -7887,7 +7887,7 @@ var require_dist_node13 = __commonJS({
|
|
|
7887
7887
|
];
|
|
7888
7888
|
function routeMatcher(paths) {
|
|
7889
7889
|
const regexes = paths.map(
|
|
7890
|
-
(
|
|
7890
|
+
(path15) => path15.split("/").map((c7) => c7.startsWith("{") ? "(?:.+?)" : c7).join("/")
|
|
7891
7891
|
);
|
|
7892
7892
|
const regex2 = `^(?:${regexes.map((r6) => `(?:${r6})`).join("|")})[^/]*$`;
|
|
7893
7893
|
return new RegExp(regex2, "i");
|
|
@@ -8089,7 +8089,6 @@ var init_types = __esm({
|
|
|
8089
8089
|
"number",
|
|
8090
8090
|
"boolean",
|
|
8091
8091
|
"datetime",
|
|
8092
|
-
"rich-text",
|
|
8093
8092
|
"markdown",
|
|
8094
8093
|
"mdx",
|
|
8095
8094
|
"code"
|
|
@@ -8518,8 +8517,8 @@ var init_parseUtil = __esm({
|
|
|
8518
8517
|
init_errors();
|
|
8519
8518
|
init_en();
|
|
8520
8519
|
makeIssue = (params) => {
|
|
8521
|
-
const { data: data2, path:
|
|
8522
|
-
const fullPath = [...
|
|
8520
|
+
const { data: data2, path: path15, errorMaps, issueData } = params;
|
|
8521
|
+
const fullPath = [...path15, ...issueData.path || []];
|
|
8523
8522
|
const fullIssue = {
|
|
8524
8523
|
...issueData,
|
|
8525
8524
|
path: fullPath
|
|
@@ -8827,11 +8826,11 @@ var init_types2 = __esm({
|
|
|
8827
8826
|
init_parseUtil();
|
|
8828
8827
|
init_util2();
|
|
8829
8828
|
ParseInputLazyPath = class {
|
|
8830
|
-
constructor(parent, value,
|
|
8829
|
+
constructor(parent, value, path15, key) {
|
|
8831
8830
|
this._cachedPath = [];
|
|
8832
8831
|
this.parent = parent;
|
|
8833
8832
|
this.data = value;
|
|
8834
|
-
this._path =
|
|
8833
|
+
this._path = path15;
|
|
8835
8834
|
this._key = key;
|
|
8836
8835
|
}
|
|
8837
8836
|
get path() {
|
|
@@ -12509,8 +12508,8 @@ var init_permissions = __esm({
|
|
|
12509
12508
|
});
|
|
12510
12509
|
|
|
12511
12510
|
// ../canopycms/src/paths/normalize.ts
|
|
12512
|
-
function normalizeFilesystemPath(
|
|
12513
|
-
return
|
|
12511
|
+
function normalizeFilesystemPath(path15) {
|
|
12512
|
+
return path15.split(/[\\/]+/).filter(Boolean).join("/");
|
|
12514
12513
|
}
|
|
12515
12514
|
var init_normalize = __esm({
|
|
12516
12515
|
"../canopycms/src/paths/normalize.ts"() {
|
|
@@ -12536,12 +12535,21 @@ var init_flatten = __esm({
|
|
|
12536
12535
|
}
|
|
12537
12536
|
});
|
|
12538
12537
|
|
|
12538
|
+
// ../canopycms/src/operating-mode/mode-env.ts
|
|
12539
|
+
var init_mode_env = __esm({
|
|
12540
|
+
"../canopycms/src/operating-mode/mode-env.ts"() {
|
|
12541
|
+
"use strict";
|
|
12542
|
+
init_logger();
|
|
12543
|
+
}
|
|
12544
|
+
});
|
|
12545
|
+
|
|
12539
12546
|
// ../canopycms/src/config/validation.ts
|
|
12540
12547
|
var init_validation = __esm({
|
|
12541
12548
|
"../canopycms/src/config/validation.ts"() {
|
|
12542
12549
|
"use strict";
|
|
12543
12550
|
init_config2();
|
|
12544
12551
|
init_flatten();
|
|
12552
|
+
init_mode_env();
|
|
12545
12553
|
}
|
|
12546
12554
|
});
|
|
12547
12555
|
|
|
@@ -12594,6 +12602,7 @@ var init_operating_mode = __esm({
|
|
|
12594
12602
|
init_client_safe_strategy();
|
|
12595
12603
|
init_client_unsafe_strategy();
|
|
12596
12604
|
init_deployment_name();
|
|
12605
|
+
init_mode_env();
|
|
12597
12606
|
}
|
|
12598
12607
|
});
|
|
12599
12608
|
|
|
@@ -13650,9 +13659,9 @@ var init_createPaginator = __esm({
|
|
|
13650
13659
|
command = withCommand(command) ?? command;
|
|
13651
13660
|
return await client.send(command, ...args);
|
|
13652
13661
|
};
|
|
13653
|
-
get = (fromObject,
|
|
13662
|
+
get = (fromObject, path15) => {
|
|
13654
13663
|
let cursor2 = fromObject;
|
|
13655
|
-
const pathComponents =
|
|
13664
|
+
const pathComponents = path15.split(".");
|
|
13656
13665
|
for (const step of pathComponents) {
|
|
13657
13666
|
if (!cursor2 || typeof cursor2 !== "object") {
|
|
13658
13667
|
return void 0;
|
|
@@ -14670,12 +14679,12 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
14670
14679
|
const password = request.password ?? "";
|
|
14671
14680
|
auth = `${username}:${password}`;
|
|
14672
14681
|
}
|
|
14673
|
-
let
|
|
14682
|
+
let path15 = request.path;
|
|
14674
14683
|
if (queryString) {
|
|
14675
|
-
|
|
14684
|
+
path15 += `?${queryString}`;
|
|
14676
14685
|
}
|
|
14677
14686
|
if (request.fragment) {
|
|
14678
|
-
|
|
14687
|
+
path15 += `#${request.fragment}`;
|
|
14679
14688
|
}
|
|
14680
14689
|
let hostname = request.hostname ?? "";
|
|
14681
14690
|
if (hostname[0] === "[" && hostname.endsWith("]")) {
|
|
@@ -14687,7 +14696,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
14687
14696
|
headers: request.headers,
|
|
14688
14697
|
host: hostname,
|
|
14689
14698
|
method: request.method,
|
|
14690
|
-
path:
|
|
14699
|
+
path: path15,
|
|
14691
14700
|
port: request.port,
|
|
14692
14701
|
agent,
|
|
14693
14702
|
auth
|
|
@@ -14970,16 +14979,16 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
14970
14979
|
reject(err);
|
|
14971
14980
|
};
|
|
14972
14981
|
const queryString = querystringBuilder.buildQueryString(query || {});
|
|
14973
|
-
let
|
|
14982
|
+
let path15 = request.path;
|
|
14974
14983
|
if (queryString) {
|
|
14975
|
-
|
|
14984
|
+
path15 += `?${queryString}`;
|
|
14976
14985
|
}
|
|
14977
14986
|
if (request.fragment) {
|
|
14978
|
-
|
|
14987
|
+
path15 += `#${request.fragment}`;
|
|
14979
14988
|
}
|
|
14980
14989
|
const req = session.request({
|
|
14981
14990
|
...request.headers,
|
|
14982
|
-
[http2.constants.HTTP2_HEADER_PATH]:
|
|
14991
|
+
[http2.constants.HTTP2_HEADER_PATH]: path15,
|
|
14983
14992
|
[http2.constants.HTTP2_HEADER_METHOD]: method
|
|
14984
14993
|
});
|
|
14985
14994
|
session.ref();
|
|
@@ -15166,13 +15175,13 @@ var require_dist_cjs14 = __commonJS({
|
|
|
15166
15175
|
const abortError = buildAbortError(abortSignal);
|
|
15167
15176
|
return Promise.reject(abortError);
|
|
15168
15177
|
}
|
|
15169
|
-
let
|
|
15178
|
+
let path15 = request.path;
|
|
15170
15179
|
const queryString = querystringBuilder.buildQueryString(request.query || {});
|
|
15171
15180
|
if (queryString) {
|
|
15172
|
-
|
|
15181
|
+
path15 += `?${queryString}`;
|
|
15173
15182
|
}
|
|
15174
15183
|
if (request.fragment) {
|
|
15175
|
-
|
|
15184
|
+
path15 += `#${request.fragment}`;
|
|
15176
15185
|
}
|
|
15177
15186
|
let auth = "";
|
|
15178
15187
|
if (request.username != null || request.password != null) {
|
|
@@ -15181,7 +15190,7 @@ var require_dist_cjs14 = __commonJS({
|
|
|
15181
15190
|
auth = `${username}:${password}@`;
|
|
15182
15191
|
}
|
|
15183
15192
|
const { port, method } = request;
|
|
15184
|
-
const url = `${request.protocol}//${auth}${request.hostname}${port ? `:${port}` : ""}${
|
|
15193
|
+
const url = `${request.protocol}//${auth}${request.hostname}${port ? `:${port}` : ""}${path15}`;
|
|
15185
15194
|
const body = method === "GET" || method === "HEAD" ? void 0 : request.body;
|
|
15186
15195
|
const requestOptions = {
|
|
15187
15196
|
body,
|
|
@@ -17413,13 +17422,13 @@ function __disposeResources(env) {
|
|
|
17413
17422
|
}
|
|
17414
17423
|
return next();
|
|
17415
17424
|
}
|
|
17416
|
-
function __rewriteRelativeImportExtension(
|
|
17417
|
-
if (typeof
|
|
17418
|
-
return
|
|
17425
|
+
function __rewriteRelativeImportExtension(path15, preserveJsx) {
|
|
17426
|
+
if (typeof path15 === "string" && /^\.\.?\//.test(path15)) {
|
|
17427
|
+
return path15.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m5, tsx, d5, ext, cm) {
|
|
17419
17428
|
return tsx ? preserveJsx ? ".jsx" : ".js" : d5 && (!ext || !cm) ? m5 : d5 + ext + "." + cm.toLowerCase() + "js";
|
|
17420
17429
|
});
|
|
17421
17430
|
}
|
|
17422
|
-
return
|
|
17431
|
+
return path15;
|
|
17423
17432
|
}
|
|
17424
17433
|
var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default;
|
|
17425
17434
|
var init_tslib_es6 = __esm({
|
|
@@ -18317,11 +18326,11 @@ var init_HttpBindingProtocol = __esm({
|
|
|
18317
18326
|
const opTraits = translateTraits(operationSchema.traits);
|
|
18318
18327
|
if (opTraits.http) {
|
|
18319
18328
|
request.method = opTraits.http[0];
|
|
18320
|
-
const [
|
|
18329
|
+
const [path15, search] = opTraits.http[1].split("?");
|
|
18321
18330
|
if (request.path == "/") {
|
|
18322
|
-
request.path =
|
|
18331
|
+
request.path = path15;
|
|
18323
18332
|
} else {
|
|
18324
|
-
request.path +=
|
|
18333
|
+
request.path += path15;
|
|
18325
18334
|
}
|
|
18326
18335
|
const traitSearchParams = new URLSearchParams(search ?? "");
|
|
18327
18336
|
Object.assign(query, Object.fromEntries(traitSearchParams));
|
|
@@ -18724,8 +18733,8 @@ var init_requestBuilder = __esm({
|
|
|
18724
18733
|
return this;
|
|
18725
18734
|
}
|
|
18726
18735
|
p(memberName, labelValueProvider, uriLabel, isGreedyLabel) {
|
|
18727
|
-
this.resolvePathStack.push((
|
|
18728
|
-
this.path = resolvedPath(
|
|
18736
|
+
this.resolvePathStack.push((path15) => {
|
|
18737
|
+
this.path = resolvedPath(path15, this.input, memberName, labelValueProvider, uriLabel, isGreedyLabel);
|
|
18729
18738
|
});
|
|
18730
18739
|
return this;
|
|
18731
18740
|
}
|
|
@@ -19375,18 +19384,18 @@ var require_dist_cjs20 = __commonJS({
|
|
|
19375
19384
|
}
|
|
19376
19385
|
};
|
|
19377
19386
|
var booleanEquals = (value1, value2) => value1 === value2;
|
|
19378
|
-
var getAttrPathList = (
|
|
19379
|
-
const parts =
|
|
19387
|
+
var getAttrPathList = (path15) => {
|
|
19388
|
+
const parts = path15.split(".");
|
|
19380
19389
|
const pathList = [];
|
|
19381
19390
|
for (const part of parts) {
|
|
19382
19391
|
const squareBracketIndex = part.indexOf("[");
|
|
19383
19392
|
if (squareBracketIndex !== -1) {
|
|
19384
19393
|
if (part.indexOf("]") !== part.length - 1) {
|
|
19385
|
-
throw new EndpointError(`Path: '${
|
|
19394
|
+
throw new EndpointError(`Path: '${path15}' does not end with ']'`);
|
|
19386
19395
|
}
|
|
19387
19396
|
const arrayIndex = part.slice(squareBracketIndex + 1, -1);
|
|
19388
19397
|
if (Number.isNaN(parseInt(arrayIndex))) {
|
|
19389
|
-
throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${
|
|
19398
|
+
throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path15}'`);
|
|
19390
19399
|
}
|
|
19391
19400
|
if (squareBracketIndex !== 0) {
|
|
19392
19401
|
pathList.push(part.slice(0, squareBracketIndex));
|
|
@@ -19398,9 +19407,9 @@ var require_dist_cjs20 = __commonJS({
|
|
|
19398
19407
|
}
|
|
19399
19408
|
return pathList;
|
|
19400
19409
|
};
|
|
19401
|
-
var getAttr = (value,
|
|
19410
|
+
var getAttr = (value, path15) => getAttrPathList(path15).reduce((acc, index) => {
|
|
19402
19411
|
if (typeof acc !== "object") {
|
|
19403
|
-
throw new EndpointError(`Index '${index}' in '${
|
|
19412
|
+
throw new EndpointError(`Index '${index}' in '${path15}' not found in '${JSON.stringify(value)}'`);
|
|
19404
19413
|
} else if (Array.isArray(acc)) {
|
|
19405
19414
|
return acc[parseInt(index)];
|
|
19406
19415
|
}
|
|
@@ -19419,8 +19428,8 @@ var require_dist_cjs20 = __commonJS({
|
|
|
19419
19428
|
return value;
|
|
19420
19429
|
}
|
|
19421
19430
|
if (typeof value === "object" && "hostname" in value) {
|
|
19422
|
-
const { hostname: hostname2, port, protocol: protocol2 = "", path:
|
|
19423
|
-
const url = new URL(`${protocol2}//${hostname2}${port ? `:${port}` : ""}${
|
|
19431
|
+
const { hostname: hostname2, port, protocol: protocol2 = "", path: path15 = "", query = {} } = value;
|
|
19432
|
+
const url = new URL(`${protocol2}//${hostname2}${port ? `:${port}` : ""}${path15}`);
|
|
19424
19433
|
url.search = Object.entries(query).map(([k6, v5]) => `${k6}=${v5}`).join("&");
|
|
19425
19434
|
return url;
|
|
19426
19435
|
}
|
|
@@ -20865,10 +20874,10 @@ ${longDate}
|
|
|
20865
20874
|
${credentialScope}
|
|
20866
20875
|
${utilHexEncoding.toHex(hashedRequest)}`;
|
|
20867
20876
|
}
|
|
20868
|
-
getCanonicalPath({ path:
|
|
20877
|
+
getCanonicalPath({ path: path15 }) {
|
|
20869
20878
|
if (this.uriEscapePath) {
|
|
20870
20879
|
const normalizedPathSegments = [];
|
|
20871
|
-
for (const pathSegment of
|
|
20880
|
+
for (const pathSegment of path15.split("/")) {
|
|
20872
20881
|
if (pathSegment?.length === 0)
|
|
20873
20882
|
continue;
|
|
20874
20883
|
if (pathSegment === ".")
|
|
@@ -20879,11 +20888,11 @@ ${utilHexEncoding.toHex(hashedRequest)}`;
|
|
|
20879
20888
|
normalizedPathSegments.push(pathSegment);
|
|
20880
20889
|
}
|
|
20881
20890
|
}
|
|
20882
|
-
const normalizedPath = `${
|
|
20891
|
+
const normalizedPath = `${path15?.startsWith("/") ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && path15?.endsWith("/") ? "/" : ""}`;
|
|
20883
20892
|
const doubleEncoded = utilUriEscape.escapeUri(normalizedPath);
|
|
20884
20893
|
return doubleEncoded.replace(/%2F/g, "/");
|
|
20885
20894
|
}
|
|
20886
|
-
return
|
|
20895
|
+
return path15;
|
|
20887
20896
|
}
|
|
20888
20897
|
validateResolvedCredentials(credentials) {
|
|
20889
20898
|
if (typeof credentials !== "object" || typeof credentials.accessKeyId !== "string" || typeof credentials.secretAccessKey !== "string") {
|
|
@@ -22187,11 +22196,11 @@ var init_SmithyRpcV2CborProtocol = __esm({
|
|
|
22187
22196
|
}
|
|
22188
22197
|
}
|
|
22189
22198
|
const { service, operation: operation2 } = (0, import_util_middleware5.getSmithyContext)(context);
|
|
22190
|
-
const
|
|
22199
|
+
const path15 = `/service/${service}/operation/${operation2}`;
|
|
22191
22200
|
if (request.path.endsWith("/")) {
|
|
22192
|
-
request.path +=
|
|
22201
|
+
request.path += path15.slice(1);
|
|
22193
22202
|
} else {
|
|
22194
|
-
request.path +=
|
|
22203
|
+
request.path += path15;
|
|
22195
22204
|
}
|
|
22196
22205
|
return request;
|
|
22197
22206
|
}
|
|
@@ -27836,14 +27845,14 @@ var require_readFile = __commonJS({
|
|
|
27836
27845
|
var promises_1 = __require("node:fs/promises");
|
|
27837
27846
|
exports.filePromises = {};
|
|
27838
27847
|
exports.fileIntercept = {};
|
|
27839
|
-
var readFile = (
|
|
27840
|
-
if (exports.fileIntercept[
|
|
27841
|
-
return exports.fileIntercept[
|
|
27848
|
+
var readFile = (path15, options) => {
|
|
27849
|
+
if (exports.fileIntercept[path15] !== void 0) {
|
|
27850
|
+
return exports.fileIntercept[path15];
|
|
27842
27851
|
}
|
|
27843
|
-
if (!exports.filePromises[
|
|
27844
|
-
exports.filePromises[
|
|
27852
|
+
if (!exports.filePromises[path15] || options?.ignoreCache) {
|
|
27853
|
+
exports.filePromises[path15] = (0, promises_1.readFile)(path15, "utf8");
|
|
27845
27854
|
}
|
|
27846
|
-
return exports.filePromises[
|
|
27855
|
+
return exports.filePromises[path15];
|
|
27847
27856
|
};
|
|
27848
27857
|
exports.readFile = readFile;
|
|
27849
27858
|
}
|
|
@@ -27856,7 +27865,7 @@ var require_dist_cjs33 = __commonJS({
|
|
|
27856
27865
|
var getHomeDir = require_getHomeDir();
|
|
27857
27866
|
var getSSOTokenFilepath = require_getSSOTokenFilepath();
|
|
27858
27867
|
var getSSOTokenFromFile = require_getSSOTokenFromFile();
|
|
27859
|
-
var
|
|
27868
|
+
var path15 = __require("path");
|
|
27860
27869
|
var types = require_dist_cjs();
|
|
27861
27870
|
var readFile = require_readFile();
|
|
27862
27871
|
var ENV_PROFILE = "AWS_PROFILE";
|
|
@@ -27878,9 +27887,9 @@ var require_dist_cjs33 = __commonJS({
|
|
|
27878
27887
|
...data2.default && { default: data2.default }
|
|
27879
27888
|
});
|
|
27880
27889
|
var ENV_CONFIG_PATH = "AWS_CONFIG_FILE";
|
|
27881
|
-
var getConfigFilepath = () => process.env[ENV_CONFIG_PATH] ||
|
|
27890
|
+
var getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || path15.join(getHomeDir.getHomeDir(), ".aws", "config");
|
|
27882
27891
|
var ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE";
|
|
27883
|
-
var getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] ||
|
|
27892
|
+
var getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || path15.join(getHomeDir.getHomeDir(), ".aws", "credentials");
|
|
27884
27893
|
var prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/;
|
|
27885
27894
|
var profileNameBlockList = ["__proto__", "profile __proto__"];
|
|
27886
27895
|
var parseIni = (iniData) => {
|
|
@@ -27935,11 +27944,11 @@ var require_dist_cjs33 = __commonJS({
|
|
|
27935
27944
|
const relativeHomeDirPrefix = "~/";
|
|
27936
27945
|
let resolvedFilepath = filepath;
|
|
27937
27946
|
if (filepath.startsWith(relativeHomeDirPrefix)) {
|
|
27938
|
-
resolvedFilepath =
|
|
27947
|
+
resolvedFilepath = path15.join(homeDir, filepath.slice(2));
|
|
27939
27948
|
}
|
|
27940
27949
|
let resolvedConfigFilepath = configFilepath;
|
|
27941
27950
|
if (configFilepath.startsWith(relativeHomeDirPrefix)) {
|
|
27942
|
-
resolvedConfigFilepath =
|
|
27951
|
+
resolvedConfigFilepath = path15.join(homeDir, configFilepath.slice(2));
|
|
27943
27952
|
}
|
|
27944
27953
|
const parsedFiles = await Promise.all([
|
|
27945
27954
|
readFile.readFile(resolvedConfigFilepath, {
|
|
@@ -27978,8 +27987,8 @@ var require_dist_cjs33 = __commonJS({
|
|
|
27978
27987
|
getFileRecord() {
|
|
27979
27988
|
return readFile.fileIntercept;
|
|
27980
27989
|
},
|
|
27981
|
-
interceptFile(
|
|
27982
|
-
readFile.fileIntercept[
|
|
27990
|
+
interceptFile(path16, contents) {
|
|
27991
|
+
readFile.fileIntercept[path16] = Promise.resolve(contents);
|
|
27983
27992
|
},
|
|
27984
27993
|
getTokenRecord() {
|
|
27985
27994
|
return getSSOTokenFromFile.tokenIntercept;
|
|
@@ -28304,8 +28313,8 @@ var require_dist_cjs36 = __commonJS({
|
|
|
28304
28313
|
return endpoint.url.href;
|
|
28305
28314
|
}
|
|
28306
28315
|
if ("hostname" in endpoint) {
|
|
28307
|
-
const { protocol, hostname, port, path:
|
|
28308
|
-
return `${protocol}//${hostname}${port ? ":" + port : ""}${
|
|
28316
|
+
const { protocol, hostname, port, path: path15 } = endpoint;
|
|
28317
|
+
return `${protocol}//${hostname}${port ? ":" + port : ""}${path15}`;
|
|
28309
28318
|
}
|
|
28310
28319
|
}
|
|
28311
28320
|
return endpoint;
|
|
@@ -36502,8 +36511,8 @@ var require_dist_cjs53 = __commonJS({
|
|
|
36502
36511
|
});
|
|
36503
36512
|
|
|
36504
36513
|
// ../canopycms/src/worker/cms-worker.ts
|
|
36505
|
-
import
|
|
36506
|
-
import
|
|
36514
|
+
import fs8 from "node:fs/promises";
|
|
36515
|
+
import path12 from "node:path";
|
|
36507
36516
|
|
|
36508
36517
|
// ../../node_modules/.pnpm/simple-git@3.36.0/node_modules/simple-git/dist/esm/index.js
|
|
36509
36518
|
var import_file_exists = __toESM(require_dist(), 1);
|
|
@@ -37094,8 +37103,8 @@ function toLinesWithContent(input = "", trimmed2 = true, separator = "\n") {
|
|
|
37094
37103
|
function forEachLineWithContent(input, callback) {
|
|
37095
37104
|
return toLinesWithContent(input, true).map((line) => callback(line));
|
|
37096
37105
|
}
|
|
37097
|
-
function folderExists(
|
|
37098
|
-
return (0, import_file_exists.exists)(
|
|
37106
|
+
function folderExists(path15) {
|
|
37107
|
+
return (0, import_file_exists.exists)(path15, import_file_exists.FOLDER);
|
|
37099
37108
|
}
|
|
37100
37109
|
function append(target, item) {
|
|
37101
37110
|
if (Array.isArray(target)) {
|
|
@@ -37497,8 +37506,8 @@ function checkIsRepoRootTask() {
|
|
|
37497
37506
|
commands: commands5,
|
|
37498
37507
|
format: "utf-8",
|
|
37499
37508
|
onError,
|
|
37500
|
-
parser(
|
|
37501
|
-
return /^\.(git)?$/.test(
|
|
37509
|
+
parser(path15) {
|
|
37510
|
+
return /^\.(git)?$/.test(path15.trim());
|
|
37502
37511
|
}
|
|
37503
37512
|
};
|
|
37504
37513
|
}
|
|
@@ -37932,11 +37941,11 @@ function parseGrep(grep) {
|
|
|
37932
37941
|
const paths = /* @__PURE__ */ new Set();
|
|
37933
37942
|
const results = {};
|
|
37934
37943
|
forEachLineWithContent(grep, (input) => {
|
|
37935
|
-
const [
|
|
37936
|
-
paths.add(
|
|
37937
|
-
(results[
|
|
37944
|
+
const [path15, line, preview] = input.split(NULL);
|
|
37945
|
+
paths.add(path15);
|
|
37946
|
+
(results[path15] = results[path15] || []).push({
|
|
37938
37947
|
line: asNumber(line),
|
|
37939
|
-
path:
|
|
37948
|
+
path: path15,
|
|
37940
37949
|
preview
|
|
37941
37950
|
});
|
|
37942
37951
|
});
|
|
@@ -38700,14 +38709,14 @@ var init_hash_object = __esm2({
|
|
|
38700
38709
|
init_task();
|
|
38701
38710
|
}
|
|
38702
38711
|
});
|
|
38703
|
-
function parseInit(bare,
|
|
38712
|
+
function parseInit(bare, path15, text) {
|
|
38704
38713
|
const response = String(text).trim();
|
|
38705
38714
|
let result;
|
|
38706
38715
|
if (result = initResponseRegex.exec(response)) {
|
|
38707
|
-
return new InitSummary(bare,
|
|
38716
|
+
return new InitSummary(bare, path15, false, result[1]);
|
|
38708
38717
|
}
|
|
38709
38718
|
if (result = reInitResponseRegex.exec(response)) {
|
|
38710
|
-
return new InitSummary(bare,
|
|
38719
|
+
return new InitSummary(bare, path15, true, result[1]);
|
|
38711
38720
|
}
|
|
38712
38721
|
let gitDir = "";
|
|
38713
38722
|
const tokens = response.split(" ");
|
|
@@ -38718,7 +38727,7 @@ function parseInit(bare, path13, text) {
|
|
|
38718
38727
|
break;
|
|
38719
38728
|
}
|
|
38720
38729
|
}
|
|
38721
|
-
return new InitSummary(bare,
|
|
38730
|
+
return new InitSummary(bare, path15, /^re/i.test(response), gitDir);
|
|
38722
38731
|
}
|
|
38723
38732
|
var InitSummary;
|
|
38724
38733
|
var initResponseRegex;
|
|
@@ -38727,9 +38736,9 @@ var init_InitSummary = __esm2({
|
|
|
38727
38736
|
"src/lib/responses/InitSummary.ts"() {
|
|
38728
38737
|
"use strict";
|
|
38729
38738
|
InitSummary = class {
|
|
38730
|
-
constructor(bare,
|
|
38739
|
+
constructor(bare, path15, existing, gitDir) {
|
|
38731
38740
|
this.bare = bare;
|
|
38732
|
-
this.path =
|
|
38741
|
+
this.path = path15;
|
|
38733
38742
|
this.existing = existing;
|
|
38734
38743
|
this.gitDir = gitDir;
|
|
38735
38744
|
}
|
|
@@ -38741,7 +38750,7 @@ var init_InitSummary = __esm2({
|
|
|
38741
38750
|
function hasBareCommand(command) {
|
|
38742
38751
|
return command.includes(bareCommand);
|
|
38743
38752
|
}
|
|
38744
|
-
function initTask(bare = false,
|
|
38753
|
+
function initTask(bare = false, path15, customArgs) {
|
|
38745
38754
|
const commands5 = ["init", ...customArgs];
|
|
38746
38755
|
if (bare && !hasBareCommand(commands5)) {
|
|
38747
38756
|
commands5.splice(1, 0, bareCommand);
|
|
@@ -38750,7 +38759,7 @@ function initTask(bare = false, path13, customArgs) {
|
|
|
38750
38759
|
commands: commands5,
|
|
38751
38760
|
format: "utf-8",
|
|
38752
38761
|
parser(text) {
|
|
38753
|
-
return parseInit(commands5.includes("--bare"),
|
|
38762
|
+
return parseInit(commands5.includes("--bare"), path15, text);
|
|
38754
38763
|
}
|
|
38755
38764
|
};
|
|
38756
38765
|
}
|
|
@@ -39565,12 +39574,12 @@ var init_FileStatusSummary = __esm2({
|
|
|
39565
39574
|
"use strict";
|
|
39566
39575
|
fromPathRegex = /^(.+)\0(.+)$/;
|
|
39567
39576
|
FileStatusSummary = class {
|
|
39568
|
-
constructor(
|
|
39569
|
-
this.path =
|
|
39577
|
+
constructor(path15, index, working_dir) {
|
|
39578
|
+
this.path = path15;
|
|
39570
39579
|
this.index = index;
|
|
39571
39580
|
this.working_dir = working_dir;
|
|
39572
39581
|
if (index === "R" || working_dir === "R") {
|
|
39573
|
-
const detail = fromPathRegex.exec(
|
|
39582
|
+
const detail = fromPathRegex.exec(path15) || [null, path15, path15];
|
|
39574
39583
|
this.from = detail[2] || "";
|
|
39575
39584
|
this.path = detail[1] || "";
|
|
39576
39585
|
}
|
|
@@ -39601,14 +39610,14 @@ function splitLine(result, lineStr) {
|
|
|
39601
39610
|
default:
|
|
39602
39611
|
return;
|
|
39603
39612
|
}
|
|
39604
|
-
function data2(index, workingDir,
|
|
39613
|
+
function data2(index, workingDir, path15) {
|
|
39605
39614
|
const raw = `${index}${workingDir}`;
|
|
39606
39615
|
const handler = parsers6.get(raw);
|
|
39607
39616
|
if (handler) {
|
|
39608
|
-
handler(result,
|
|
39617
|
+
handler(result, path15);
|
|
39609
39618
|
}
|
|
39610
39619
|
if (raw !== "##" && raw !== "!!") {
|
|
39611
|
-
result.files.push(new FileStatusSummary(
|
|
39620
|
+
result.files.push(new FileStatusSummary(path15, index, workingDir));
|
|
39612
39621
|
}
|
|
39613
39622
|
}
|
|
39614
39623
|
}
|
|
@@ -39959,9 +39968,9 @@ var init_simple_git_api = __esm2({
|
|
|
39959
39968
|
next
|
|
39960
39969
|
);
|
|
39961
39970
|
}
|
|
39962
|
-
hashObject(
|
|
39971
|
+
hashObject(path15, write) {
|
|
39963
39972
|
return this._runTask(
|
|
39964
|
-
hashObjectTask(
|
|
39973
|
+
hashObjectTask(path15, write === true),
|
|
39965
39974
|
trailingFunctionArgument(arguments)
|
|
39966
39975
|
);
|
|
39967
39976
|
}
|
|
@@ -40315,8 +40324,8 @@ var init_branch = __esm2({
|
|
|
40315
40324
|
}
|
|
40316
40325
|
});
|
|
40317
40326
|
function toPath(input) {
|
|
40318
|
-
const
|
|
40319
|
-
return
|
|
40327
|
+
const path15 = input.trim().replace(/^["']|["']$/g, "");
|
|
40328
|
+
return path15 && normalize(path15);
|
|
40320
40329
|
}
|
|
40321
40330
|
var parseCheckIgnore;
|
|
40322
40331
|
var init_CheckIgnore = __esm2({
|
|
@@ -40601,8 +40610,8 @@ __export2(sub_module_exports, {
|
|
|
40601
40610
|
subModuleTask: () => subModuleTask,
|
|
40602
40611
|
updateSubModuleTask: () => updateSubModuleTask
|
|
40603
40612
|
});
|
|
40604
|
-
function addSubModuleTask(repo,
|
|
40605
|
-
return subModuleTask(["add", repo,
|
|
40613
|
+
function addSubModuleTask(repo, path15) {
|
|
40614
|
+
return subModuleTask(["add", repo, path15]);
|
|
40606
40615
|
}
|
|
40607
40616
|
function initSubModuleTask(customArgs) {
|
|
40608
40617
|
return subModuleTask(["init", ...customArgs]);
|
|
@@ -40916,8 +40925,8 @@ var require_git = __commonJS2({
|
|
|
40916
40925
|
}
|
|
40917
40926
|
return this._runTask(straightThroughStringTask2(command, this._trimmed), next);
|
|
40918
40927
|
};
|
|
40919
|
-
Git2.prototype.submoduleAdd = function(repo,
|
|
40920
|
-
return this._runTask(addSubModuleTask2(repo,
|
|
40928
|
+
Git2.prototype.submoduleAdd = function(repo, path15, then) {
|
|
40929
|
+
return this._runTask(addSubModuleTask2(repo, path15), trailingFunctionArgument2(arguments));
|
|
40921
40930
|
};
|
|
40922
40931
|
Git2.prototype.submoduleUpdate = function(args, then) {
|
|
40923
40932
|
return this._runTask(
|
|
@@ -42613,6 +42622,7 @@ var import_short_uuid = __toESM(require_dist3(), 1);
|
|
|
42613
42622
|
var isValidId = isValidContentId;
|
|
42614
42623
|
|
|
42615
42624
|
// ../canopycms/src/content-id-index.ts
|
|
42625
|
+
init_logger();
|
|
42616
42626
|
function extractIdFromFilename(filename) {
|
|
42617
42627
|
if (filename.startsWith(".")) {
|
|
42618
42628
|
return null;
|
|
@@ -42733,6 +42743,16 @@ function isStaleLeaseRejection(message) {
|
|
|
42733
42743
|
|
|
42734
42744
|
// ../canopycms/src/utils/provisioning-lock.ts
|
|
42735
42745
|
var import_proper_lockfile2 = __toESM(require_proper_lockfile(), 1);
|
|
42746
|
+
import fs7 from "node:fs/promises";
|
|
42747
|
+
import path9 from "node:path";
|
|
42748
|
+
async function tryAcquireProvisioningLock(lockTargetDir2, lockName) {
|
|
42749
|
+
await fs7.mkdir(lockTargetDir2, { recursive: true });
|
|
42750
|
+
return import_proper_lockfile2.default.lock(lockTargetDir2, {
|
|
42751
|
+
lockfilePath: path9.join(lockTargetDir2, lockName),
|
|
42752
|
+
retries: 0,
|
|
42753
|
+
stale: 3e4
|
|
42754
|
+
});
|
|
42755
|
+
}
|
|
42736
42756
|
|
|
42737
42757
|
// ../canopycms/src/git-manager.ts
|
|
42738
42758
|
var log4 = createDebugLogger({ prefix: "GitManager" });
|
|
@@ -42759,11 +42779,22 @@ var GITHUB_TRACKING_REF_PREFIX = "refs/remotes/github/";
|
|
|
42759
42779
|
// ../canopycms/src/worker/cms-worker.ts
|
|
42760
42780
|
init_deployment_name();
|
|
42761
42781
|
|
|
42782
|
+
// ../canopycms/src/utils/content-write-lock.ts
|
|
42783
|
+
import path10 from "node:path";
|
|
42784
|
+
var META_DIR2 = ".canopy-meta";
|
|
42785
|
+
var CONTENT_WRITE_LOCK_NAME = "content-write.lock";
|
|
42786
|
+
function lockTargetDir(branchRoot) {
|
|
42787
|
+
return path10.join(path10.resolve(branchRoot), META_DIR2);
|
|
42788
|
+
}
|
|
42789
|
+
function tryAcquireContentWriteLock(branchRoot) {
|
|
42790
|
+
return tryAcquireProvisioningLock(lockTargetDir(branchRoot), CONTENT_WRITE_LOCK_NAME);
|
|
42791
|
+
}
|
|
42792
|
+
|
|
42762
42793
|
// ../canopycms/src/worker/worker-status.ts
|
|
42763
|
-
import
|
|
42794
|
+
import path11 from "node:path";
|
|
42764
42795
|
var WORKER_STATUS_FILE = "worker-status.json";
|
|
42765
42796
|
async function writeWorkerStatus(taskDir, report) {
|
|
42766
|
-
const filePath =
|
|
42797
|
+
const filePath = path11.join(taskDir, WORKER_STATUS_FILE);
|
|
42767
42798
|
const stamped = { ...report, updatedAt: (/* @__PURE__ */ new Date()).toISOString() };
|
|
42768
42799
|
await atomicWriteFile(filePath, JSON.stringify(stamped, null, 2));
|
|
42769
42800
|
}
|
|
@@ -42858,15 +42889,15 @@ var CmsWorker = class {
|
|
|
42858
42889
|
this.releaseLockFn = null;
|
|
42859
42890
|
this.log = cmsTaskQueueLogger;
|
|
42860
42891
|
this.octokit = createCanopyOctokit({ auth: config.githubToken });
|
|
42861
|
-
this.taskDir =
|
|
42862
|
-
this.remoteGitPath =
|
|
42863
|
-
this.contentBranchesPath =
|
|
42892
|
+
this.taskDir = path12.join(config.workspacePath, ".tasks");
|
|
42893
|
+
this.remoteGitPath = path12.join(config.workspacePath, "remote.git");
|
|
42894
|
+
this.contentBranchesPath = path12.join(config.workspacePath, "content-branches");
|
|
42864
42895
|
this.baseBranch = config.baseBranch ?? "main";
|
|
42865
42896
|
this.sanitizedBaseBranch = sanitizeBranchName(this.baseBranch);
|
|
42866
42897
|
this.maxTasksPerCycle = config.maxTasksPerCycle ?? 10;
|
|
42867
42898
|
this.taskTimeoutMs = config.taskTimeoutMs ?? DEFAULT_TASK_TIMEOUT;
|
|
42868
42899
|
this.maxRetries = config.maxRetries ?? DEFAULT_MAX_RETRIES2;
|
|
42869
|
-
this.lockFilePath =
|
|
42900
|
+
this.lockFilePath = path12.join(config.workspacePath, ".tasks", ".worker-lock");
|
|
42870
42901
|
this.lockStaleMs = config.lockStaleMs ?? DEFAULT_LOCK_STALE_MS;
|
|
42871
42902
|
this.contentRoot = config.contentRoot ?? "content";
|
|
42872
42903
|
}
|
|
@@ -43017,7 +43048,7 @@ var CmsWorker = class {
|
|
|
43017
43048
|
* negligible, but a host with a badly wrong clock could misjudge liveness.
|
|
43018
43049
|
*/
|
|
43019
43050
|
async acquireLock() {
|
|
43020
|
-
await
|
|
43051
|
+
await fs8.mkdir(this.taskDir, { recursive: true });
|
|
43021
43052
|
try {
|
|
43022
43053
|
this.releaseLockFn = await import_proper_lockfile3.default.lock(this.taskDir, {
|
|
43023
43054
|
lockfilePath: this.lockFilePath,
|
|
@@ -43111,7 +43142,7 @@ var CmsWorker = class {
|
|
|
43111
43142
|
async ensureRemoteGit() {
|
|
43112
43143
|
let exists2;
|
|
43113
43144
|
try {
|
|
43114
|
-
await
|
|
43145
|
+
await fs8.stat(this.remoteGitPath);
|
|
43115
43146
|
exists2 = true;
|
|
43116
43147
|
} catch {
|
|
43117
43148
|
exists2 = false;
|
|
@@ -43136,7 +43167,7 @@ var CmsWorker = class {
|
|
|
43136
43167
|
workerLogError(
|
|
43137
43168
|
`remote.git base branch verification failed after clone: ${getErrorMessage2(err)}`
|
|
43138
43169
|
);
|
|
43139
|
-
await
|
|
43170
|
+
await fs8.rm(this.remoteGitPath, { recursive: true, force: true });
|
|
43140
43171
|
throw new Error(
|
|
43141
43172
|
`remote.git clone of ${this.config.githubOwner}/${this.config.githubRepo} has no branch '${this.baseBranch}' - the GitHub repository is empty or the base branch does not exist. Push an initial commit to '${this.baseBranch}' and restart the worker (systemd will retry automatically).`
|
|
43142
43173
|
);
|
|
@@ -43352,7 +43383,7 @@ var CmsWorker = class {
|
|
|
43352
43383
|
if (!branch) return;
|
|
43353
43384
|
const branchPath = this.branchWorkspacePath(branch);
|
|
43354
43385
|
try {
|
|
43355
|
-
await
|
|
43386
|
+
await fs8.stat(branchPath);
|
|
43356
43387
|
} catch {
|
|
43357
43388
|
return;
|
|
43358
43389
|
}
|
|
@@ -43396,7 +43427,7 @@ var CmsWorker = class {
|
|
|
43396
43427
|
if (!branch) return;
|
|
43397
43428
|
const branchPath = this.branchWorkspacePath(branch);
|
|
43398
43429
|
try {
|
|
43399
|
-
await
|
|
43430
|
+
await fs8.stat(branchPath);
|
|
43400
43431
|
} catch {
|
|
43401
43432
|
return;
|
|
43402
43433
|
}
|
|
@@ -43432,7 +43463,7 @@ var CmsWorker = class {
|
|
|
43432
43463
|
* is sanitized.
|
|
43433
43464
|
*/
|
|
43434
43465
|
branchWorkspacePath(branchRefName) {
|
|
43435
|
-
return
|
|
43466
|
+
return path12.join(this.contentBranchesPath, sanitizeBranchName(branchRefName));
|
|
43436
43467
|
}
|
|
43437
43468
|
/**
|
|
43438
43469
|
* What `remote.git` currently holds for `branchRef`, or null when this
|
|
@@ -43859,7 +43890,7 @@ var CmsWorker = class {
|
|
|
43859
43890
|
*/
|
|
43860
43891
|
async hasPendingHistoryRewrite(branchName) {
|
|
43861
43892
|
try {
|
|
43862
|
-
const branchPath =
|
|
43893
|
+
const branchPath = path12.join(this.contentBranchesPath, sanitizeBranchName(branchName));
|
|
43863
43894
|
const metaFile = await BranchMetadataFileManager.loadOnly(branchPath);
|
|
43864
43895
|
return typeof metaFile?.branch.historyRewrittenFrom === "string";
|
|
43865
43896
|
} catch {
|
|
@@ -43902,6 +43933,7 @@ var CmsWorker = class {
|
|
|
43902
43933
|
durationMs: Date.now() - cycleStartedAt,
|
|
43903
43934
|
rebased: rebaseSummary.rebased,
|
|
43904
43935
|
skippedDirty: rebaseSummary.skippedDirty,
|
|
43936
|
+
skippedLocked: rebaseSummary.skippedLocked,
|
|
43905
43937
|
failed: rebaseSummary.failed,
|
|
43906
43938
|
tracked: trackedSummary
|
|
43907
43939
|
};
|
|
@@ -43933,7 +43965,7 @@ var CmsWorker = class {
|
|
|
43933
43965
|
async cleanupTrashedBranchDirs() {
|
|
43934
43966
|
let entries;
|
|
43935
43967
|
try {
|
|
43936
|
-
entries = await
|
|
43968
|
+
entries = await fs8.readdir(this.contentBranchesPath);
|
|
43937
43969
|
} catch (err) {
|
|
43938
43970
|
if (isNodeError(err) && err.code === "ENOENT") return 0;
|
|
43939
43971
|
throw err;
|
|
@@ -43954,7 +43986,7 @@ var CmsWorker = class {
|
|
|
43954
43986
|
}
|
|
43955
43987
|
if (now - stampDate.getTime() < TRASH_RETENTION_MS) continue;
|
|
43956
43988
|
try {
|
|
43957
|
-
await
|
|
43989
|
+
await fs8.rm(path12.join(this.contentBranchesPath, name), {
|
|
43958
43990
|
recursive: true,
|
|
43959
43991
|
force: true,
|
|
43960
43992
|
maxRetries: 3,
|
|
@@ -43992,12 +44024,12 @@ var CmsWorker = class {
|
|
|
43992
44024
|
* untouched rather than force-resolved.
|
|
43993
44025
|
*/
|
|
43994
44026
|
async refreshBaseBranchWorkspace() {
|
|
43995
|
-
const basePath32 =
|
|
43996
|
-
const gitDir =
|
|
44027
|
+
const basePath32 = path12.join(this.contentBranchesPath, this.sanitizedBaseBranch);
|
|
44028
|
+
const gitDir = path12.join(basePath32, ".git");
|
|
43997
44029
|
try {
|
|
43998
44030
|
let gitDirStat;
|
|
43999
44031
|
try {
|
|
44000
|
-
gitDirStat = await
|
|
44032
|
+
gitDirStat = await fs8.stat(gitDir);
|
|
44001
44033
|
} catch {
|
|
44002
44034
|
gitDirStat = null;
|
|
44003
44035
|
}
|
|
@@ -44158,24 +44190,39 @@ var CmsWorker = class {
|
|
|
44158
44190
|
workerLogWarn(` Failed to record rebase failure for ${branchDir}: ${getErrorMessage2(err)}`);
|
|
44159
44191
|
}
|
|
44160
44192
|
}
|
|
44193
|
+
/**
|
|
44194
|
+
* Test-only seam: awaited inside `rebaseActiveBranches()`'s conflict round,
|
|
44195
|
+
* after `git rebase` reported conflicted files and BEFORE the
|
|
44196
|
+
* `checkout --theirs` resolution loop overwrites them. No-op in production.
|
|
44197
|
+
*
|
|
44198
|
+
* A test subclass overrides this to land a real `ContentStore` write at
|
|
44199
|
+
* exactly the instant the rebase is mid-flight -- the window the old TOCTOU
|
|
44200
|
+
* comment above the dirty check wrongly called safe -- without any sleeps or
|
|
44201
|
+
* shell rendezvous. See the "Deterministic interleavings" testing pattern in
|
|
44202
|
+
* docs/concurrency.md, and `ContentStore.afterPrePassForTesting()` for the
|
|
44203
|
+
* same idiom on the write side.
|
|
44204
|
+
*/
|
|
44205
|
+
async afterConflictDetectedForTesting() {
|
|
44206
|
+
}
|
|
44161
44207
|
async rebaseActiveBranches() {
|
|
44162
44208
|
const rebased = [];
|
|
44163
44209
|
const skippedDirty = [];
|
|
44210
|
+
const skippedLocked = [];
|
|
44164
44211
|
const failed = [];
|
|
44165
44212
|
let branchDirs;
|
|
44166
44213
|
try {
|
|
44167
|
-
branchDirs = await
|
|
44214
|
+
branchDirs = await fs8.readdir(this.contentBranchesPath);
|
|
44168
44215
|
} catch {
|
|
44169
|
-
return { rebased, skippedDirty, failed };
|
|
44216
|
+
return { rebased, skippedDirty, skippedLocked, failed };
|
|
44170
44217
|
}
|
|
44171
44218
|
for (const branchDir of branchDirs) {
|
|
44172
44219
|
if (branchDir.startsWith(".") || branchDir === "branches.json") {
|
|
44173
44220
|
continue;
|
|
44174
44221
|
}
|
|
44175
|
-
const branchPath =
|
|
44176
|
-
const gitDir =
|
|
44222
|
+
const branchPath = path12.join(this.contentBranchesPath, branchDir);
|
|
44223
|
+
const gitDir = path12.join(branchPath, ".git");
|
|
44177
44224
|
try {
|
|
44178
|
-
const stat = await
|
|
44225
|
+
const stat = await fs8.stat(gitDir);
|
|
44179
44226
|
if (!stat.isDirectory()) {
|
|
44180
44227
|
workerLog(` Skipping ${branchDir}: .git is not a directory`);
|
|
44181
44228
|
continue;
|
|
@@ -44209,148 +44256,168 @@ var CmsWorker = class {
|
|
|
44209
44256
|
config: ["core.editor=true"],
|
|
44210
44257
|
unsafe: { allowUnsafeEditor: true }
|
|
44211
44258
|
});
|
|
44212
|
-
|
|
44213
|
-
|
|
44214
|
-
|
|
44215
|
-
|
|
44216
|
-
|
|
44217
|
-
|
|
44218
|
-
|
|
44219
|
-
|
|
44220
|
-
|
|
44221
|
-
|
|
44222
|
-
branchPath,
|
|
44223
|
-
branchDir,
|
|
44224
|
-
branchRef,
|
|
44225
|
-
headSha: (await branchGit.revparse(["HEAD"])).trim(),
|
|
44226
|
-
marker: metaFile.branch.historyRewrittenFrom
|
|
44227
|
-
});
|
|
44259
|
+
let releaseContentLock;
|
|
44260
|
+
try {
|
|
44261
|
+
releaseContentLock = await tryAcquireContentWriteLock(branchPath);
|
|
44262
|
+
} catch (lockErr) {
|
|
44263
|
+
if (isNodeError(lockErr) && lockErr.code === "ELOCKED") {
|
|
44264
|
+
workerLog(` Skipping ${branchDir}: content write in progress (retrying next cycle)`);
|
|
44265
|
+
skippedLocked.push(branchDir);
|
|
44266
|
+
continue;
|
|
44267
|
+
}
|
|
44268
|
+
throw lockErr;
|
|
44228
44269
|
}
|
|
44229
|
-
|
|
44230
|
-
|
|
44231
|
-
|
|
44232
|
-
|
|
44233
|
-
|
|
44234
|
-
);
|
|
44235
|
-
const meta = getBranchMetadataFileManager(branchPath, this.contentBranchesPath);
|
|
44236
|
-
if (behindCount === 0) {
|
|
44237
|
-
const currentMeta = await BranchMetadataFileManager.loadOnly(branchPath);
|
|
44238
|
-
const conflictStatus = currentMeta?.branch.conflictStatus;
|
|
44239
|
-
const conflictFiles = currentMeta?.branch.conflictFiles;
|
|
44240
|
-
const conflictAlreadyClean = (conflictStatus === void 0 || conflictStatus === "clean") && (conflictFiles === void 0 || conflictFiles.length === 0);
|
|
44241
|
-
const alreadyClean = conflictAlreadyClean && currentMeta?.branch.rebaseFailure === void 0;
|
|
44242
|
-
if (alreadyClean) {
|
|
44270
|
+
try {
|
|
44271
|
+
const dirtyCheck = await branchGit.status();
|
|
44272
|
+
if (dirtyCheck.files.length > 0) {
|
|
44273
|
+
workerLog(` Skipping ${branchDir}: has uncommitted changes`);
|
|
44274
|
+
skippedDirty.push(branchDir);
|
|
44243
44275
|
continue;
|
|
44244
44276
|
}
|
|
44277
|
+
const branchRef = (await branchGit.revparse(["--abbrev-ref", "HEAD"])).trim();
|
|
44278
|
+
const canPublish = branchRef.length > 0 && branchRef !== "HEAD";
|
|
44279
|
+
if (canPublish && metaFile?.branch.historyRewrittenFrom) {
|
|
44280
|
+
await this.reconcilePendingRewrite({
|
|
44281
|
+
branchPath,
|
|
44282
|
+
branchDir,
|
|
44283
|
+
branchRef,
|
|
44284
|
+
headSha: (await branchGit.revparse(["HEAD"])).trim(),
|
|
44285
|
+
marker: metaFile.branch.historyRewrittenFrom
|
|
44286
|
+
});
|
|
44287
|
+
}
|
|
44288
|
+
await branchGit.fetch("origin", this.baseBranch);
|
|
44289
|
+
const fetchedBaseTip = (await branchGit.revparse(["FETCH_HEAD"])).trim();
|
|
44290
|
+
const behindCount = parseInt(
|
|
44291
|
+
(await branchGit.raw(["rev-list", "--count", `HEAD..${fetchedBaseTip}`])).trim(),
|
|
44292
|
+
10
|
|
44293
|
+
);
|
|
44294
|
+
const meta = getBranchMetadataFileManager(branchPath, this.contentBranchesPath);
|
|
44295
|
+
if (behindCount === 0) {
|
|
44296
|
+
const currentMeta = await BranchMetadataFileManager.loadOnly(branchPath);
|
|
44297
|
+
const conflictStatus = currentMeta?.branch.conflictStatus;
|
|
44298
|
+
const conflictFiles = currentMeta?.branch.conflictFiles;
|
|
44299
|
+
const conflictAlreadyClean = (conflictStatus === void 0 || conflictStatus === "clean") && (conflictFiles === void 0 || conflictFiles.length === 0);
|
|
44300
|
+
const alreadyClean = conflictAlreadyClean && currentMeta?.branch.rebaseFailure === void 0;
|
|
44301
|
+
if (alreadyClean) {
|
|
44302
|
+
continue;
|
|
44303
|
+
}
|
|
44304
|
+
await meta.save({
|
|
44305
|
+
branch: {
|
|
44306
|
+
name: branchDir,
|
|
44307
|
+
conflictStatus: "clean",
|
|
44308
|
+
conflictFiles: [],
|
|
44309
|
+
rebaseFailure: void 0
|
|
44310
|
+
}
|
|
44311
|
+
});
|
|
44312
|
+
continue;
|
|
44313
|
+
}
|
|
44314
|
+
workerLog(`Rebasing ${branchDir} (${behindCount} commits behind)...`);
|
|
44315
|
+
const preRebaseHead = (await branchGit.revparse(["HEAD"])).trim();
|
|
44316
|
+
const publishedSha = canPublish ? await this.readPublishedSha(branchRef) : null;
|
|
44317
|
+
const conflictedFiles = [];
|
|
44318
|
+
let nextAction = "start";
|
|
44319
|
+
let completed = false;
|
|
44320
|
+
let failureReason;
|
|
44321
|
+
const MAX_ROUNDS = 50;
|
|
44322
|
+
for (let round = 0; round < MAX_ROUNDS && !completed; round++) {
|
|
44323
|
+
try {
|
|
44324
|
+
if (nextAction === "start") {
|
|
44325
|
+
await branchGit.rebase([fetchedBaseTip]);
|
|
44326
|
+
} else if (nextAction === "continue") {
|
|
44327
|
+
await branchGit.rebase(["--continue"]);
|
|
44328
|
+
} else {
|
|
44329
|
+
await branchGit.rebase(["--skip"]);
|
|
44330
|
+
}
|
|
44331
|
+
completed = true;
|
|
44332
|
+
} catch (rebaseErr) {
|
|
44333
|
+
nextAction = "continue";
|
|
44334
|
+
const st = await branchGit.status();
|
|
44335
|
+
if (st.conflicted.length > 0) {
|
|
44336
|
+
await this.afterConflictDetectedForTesting();
|
|
44337
|
+
for (const file of st.conflicted) {
|
|
44338
|
+
await branchGit.raw(["checkout", "--theirs", file]);
|
|
44339
|
+
await branchGit.add(file);
|
|
44340
|
+
conflictedFiles.push(file);
|
|
44341
|
+
}
|
|
44342
|
+
} else {
|
|
44343
|
+
const msg = rebaseErr instanceof Error ? rebaseErr.message : "";
|
|
44344
|
+
if (msg.toLowerCase().includes("nothing to commit") || msg.toLowerCase().includes("apply --skip")) {
|
|
44345
|
+
nextAction = "skip";
|
|
44346
|
+
} else {
|
|
44347
|
+
workerLogWarn(
|
|
44348
|
+
` Unexpected rebase error in ${branchDir}: ${msg || "Unknown error"}`
|
|
44349
|
+
);
|
|
44350
|
+
failureReason = msg || "Unknown error";
|
|
44351
|
+
await branchGit.rebase(["--abort"]).catch(() => {
|
|
44352
|
+
});
|
|
44353
|
+
break;
|
|
44354
|
+
}
|
|
44355
|
+
}
|
|
44356
|
+
}
|
|
44357
|
+
}
|
|
44358
|
+
if (!completed) {
|
|
44359
|
+
workerLogWarn(
|
|
44360
|
+
failureReason !== void 0 ? ` Rebase of ${branchDir} aborted due to unexpected error: ${failureReason}` : ` Rebase of ${branchDir} did not complete within ${MAX_ROUNDS} rounds, aborting`
|
|
44361
|
+
);
|
|
44362
|
+
await branchGit.rebase(["--abort"]).catch(() => {
|
|
44363
|
+
});
|
|
44364
|
+
const rebaseFailureMessage = failureReason ?? `did not complete within ${MAX_ROUNDS} rounds`;
|
|
44365
|
+
const redactedRebaseFailureMessage = redactCredentials(rebaseFailureMessage);
|
|
44366
|
+
failed.push({
|
|
44367
|
+
branch: branchDir,
|
|
44368
|
+
error: redactedRebaseFailureMessage
|
|
44369
|
+
});
|
|
44370
|
+
await this.recordRebaseFailure(branchPath, branchDir, redactedRebaseFailureMessage);
|
|
44371
|
+
continue;
|
|
44372
|
+
}
|
|
44373
|
+
await invalidateBranchContentCaches(branchPath);
|
|
44374
|
+
const normalizedContentRoot = normalizeFilesystemPath(this.contentRoot);
|
|
44375
|
+
const conflictIds = [...new Set(conflictedFiles)].map((f5) => {
|
|
44376
|
+
const fileId = extractIdFromFilename(path12.basename(f5));
|
|
44377
|
+
if (fileId) return fileId;
|
|
44378
|
+
const parentDir = path12.basename(path12.dirname(f5));
|
|
44379
|
+
const dirId = extractIdFromFilename(parentDir);
|
|
44380
|
+
if (dirId) return dirId;
|
|
44381
|
+
const parentPath = normalizeFilesystemPath(path12.dirname(f5));
|
|
44382
|
+
if (path12.basename(f5) === ".collection.json" && parentPath === normalizedContentRoot) {
|
|
44383
|
+
return ROOT_COLLECTION_ID;
|
|
44384
|
+
}
|
|
44385
|
+
return null;
|
|
44386
|
+
}).filter((id) => id !== null);
|
|
44387
|
+
const conflictIdsDeduped = [...new Set(conflictIds)];
|
|
44388
|
+
const hadConflicts = conflictIdsDeduped.length > 0;
|
|
44389
|
+
workerLog(
|
|
44390
|
+
hadConflicts ? ` Rebased ${branchDir} (kept branch version for ${conflictIdsDeduped.length} conflicting file(s))` : ` Rebased ${branchDir} successfully`
|
|
44391
|
+
);
|
|
44245
44392
|
await meta.save({
|
|
44246
44393
|
branch: {
|
|
44247
44394
|
name: branchDir,
|
|
44248
|
-
conflictStatus: "clean",
|
|
44249
|
-
conflictFiles:
|
|
44395
|
+
conflictStatus: hadConflicts ? "conflicts-detected" : "clean",
|
|
44396
|
+
conflictFiles: conflictIdsDeduped,
|
|
44397
|
+
// PR-W2: the cycle completed successfully -- clear any prior
|
|
44398
|
+
// failure record regardless of conflict outcome.
|
|
44250
44399
|
rebaseFailure: void 0
|
|
44251
44400
|
}
|
|
44252
44401
|
});
|
|
44253
|
-
|
|
44254
|
-
|
|
44255
|
-
|
|
44256
|
-
|
|
44257
|
-
|
|
44258
|
-
|
|
44259
|
-
let nextAction = "start";
|
|
44260
|
-
let completed = false;
|
|
44261
|
-
let failureReason;
|
|
44262
|
-
const MAX_ROUNDS = 50;
|
|
44263
|
-
for (let round = 0; round < MAX_ROUNDS && !completed; round++) {
|
|
44264
|
-
try {
|
|
44265
|
-
if (nextAction === "start") {
|
|
44266
|
-
await branchGit.rebase([fetchedBaseTip]);
|
|
44267
|
-
} else if (nextAction === "continue") {
|
|
44268
|
-
await branchGit.rebase(["--continue"]);
|
|
44269
|
-
} else {
|
|
44270
|
-
await branchGit.rebase(["--skip"]);
|
|
44271
|
-
}
|
|
44272
|
-
completed = true;
|
|
44273
|
-
} catch (rebaseErr) {
|
|
44274
|
-
nextAction = "continue";
|
|
44275
|
-
const st = await branchGit.status();
|
|
44276
|
-
if (st.conflicted.length > 0) {
|
|
44277
|
-
for (const file of st.conflicted) {
|
|
44278
|
-
await branchGit.raw(["checkout", "--theirs", file]);
|
|
44279
|
-
await branchGit.add(file);
|
|
44280
|
-
conflictedFiles.push(file);
|
|
44402
|
+
rebased.push(branchDir);
|
|
44403
|
+
if (publishedSha !== null) {
|
|
44404
|
+
if (publishedSha === preRebaseHead) {
|
|
44405
|
+
await this.markHistoryRewritten(branchPath, branchDir, publishedSha);
|
|
44406
|
+
if (await this.forcePublishToLocalRemote(branchPath, branchRef, publishedSha)) {
|
|
44407
|
+
await this.enqueueGitHubPush(branchRef);
|
|
44281
44408
|
}
|
|
44282
44409
|
} else {
|
|
44283
|
-
const
|
|
44284
|
-
|
|
44285
|
-
|
|
44286
|
-
} else {
|
|
44287
|
-
workerLogWarn(
|
|
44288
|
-
` Unexpected rebase error in ${branchDir}: ${msg || "Unknown error"}`
|
|
44289
|
-
);
|
|
44290
|
-
failureReason = msg || "Unknown error";
|
|
44291
|
-
await branchGit.rebase(["--abort"]).catch(() => {
|
|
44292
|
-
});
|
|
44293
|
-
break;
|
|
44294
|
-
}
|
|
44410
|
+
const divergence = `rebased locally, but remote.git holds ${publishedSha} for ${branchRef}, which this clone never had (a direct push to the branch?). Left untouched -- reconcile it before submitting again.`;
|
|
44411
|
+
workerLogWarn(` ${branchDir}: ${divergence}`);
|
|
44412
|
+
await this.recordRebaseFailure(branchPath, branchDir, divergence);
|
|
44295
44413
|
}
|
|
44296
44414
|
}
|
|
44297
|
-
}
|
|
44298
|
-
|
|
44299
|
-
|
|
44300
|
-
|
|
44301
|
-
|
|
44302
|
-
await branchGit.rebase(["--abort"]).catch(() => {
|
|
44303
|
-
});
|
|
44304
|
-
const rebaseFailureMessage = failureReason ?? `did not complete within ${MAX_ROUNDS} rounds`;
|
|
44305
|
-
const redactedRebaseFailureMessage = redactCredentials(rebaseFailureMessage);
|
|
44306
|
-
failed.push({
|
|
44307
|
-
branch: branchDir,
|
|
44308
|
-
error: redactedRebaseFailureMessage
|
|
44415
|
+
} finally {
|
|
44416
|
+
await releaseContentLock?.().catch((releaseErr) => {
|
|
44417
|
+
workerLogWarn(
|
|
44418
|
+
` Failed to release content-write lock for ${branchDir}: ${getErrorMessage2(releaseErr)}`
|
|
44419
|
+
);
|
|
44309
44420
|
});
|
|
44310
|
-
await this.recordRebaseFailure(branchPath, branchDir, redactedRebaseFailureMessage);
|
|
44311
|
-
continue;
|
|
44312
|
-
}
|
|
44313
|
-
await invalidateBranchContentCaches(branchPath);
|
|
44314
|
-
const normalizedContentRoot = normalizeFilesystemPath(this.contentRoot);
|
|
44315
|
-
const conflictIds = [...new Set(conflictedFiles)].map((f5) => {
|
|
44316
|
-
const fileId = extractIdFromFilename(path10.basename(f5));
|
|
44317
|
-
if (fileId) return fileId;
|
|
44318
|
-
const parentDir = path10.basename(path10.dirname(f5));
|
|
44319
|
-
const dirId = extractIdFromFilename(parentDir);
|
|
44320
|
-
if (dirId) return dirId;
|
|
44321
|
-
const parentPath = normalizeFilesystemPath(path10.dirname(f5));
|
|
44322
|
-
if (path10.basename(f5) === ".collection.json" && parentPath === normalizedContentRoot) {
|
|
44323
|
-
return ROOT_COLLECTION_ID;
|
|
44324
|
-
}
|
|
44325
|
-
return null;
|
|
44326
|
-
}).filter((id) => id !== null);
|
|
44327
|
-
const conflictIdsDeduped = [...new Set(conflictIds)];
|
|
44328
|
-
const hadConflicts = conflictIdsDeduped.length > 0;
|
|
44329
|
-
workerLog(
|
|
44330
|
-
hadConflicts ? ` Rebased ${branchDir} (kept branch version for ${conflictIdsDeduped.length} conflicting file(s))` : ` Rebased ${branchDir} successfully`
|
|
44331
|
-
);
|
|
44332
|
-
await meta.save({
|
|
44333
|
-
branch: {
|
|
44334
|
-
name: branchDir,
|
|
44335
|
-
conflictStatus: hadConflicts ? "conflicts-detected" : "clean",
|
|
44336
|
-
conflictFiles: conflictIdsDeduped,
|
|
44337
|
-
// PR-W2: the cycle completed successfully -- clear any prior
|
|
44338
|
-
// failure record regardless of conflict outcome.
|
|
44339
|
-
rebaseFailure: void 0
|
|
44340
|
-
}
|
|
44341
|
-
});
|
|
44342
|
-
rebased.push(branchDir);
|
|
44343
|
-
if (publishedSha !== null) {
|
|
44344
|
-
if (publishedSha === preRebaseHead) {
|
|
44345
|
-
await this.markHistoryRewritten(branchPath, branchDir, publishedSha);
|
|
44346
|
-
if (await this.forcePublishToLocalRemote(branchPath, branchRef, publishedSha)) {
|
|
44347
|
-
await this.enqueueGitHubPush(branchRef);
|
|
44348
|
-
}
|
|
44349
|
-
} else {
|
|
44350
|
-
const divergence = `rebased locally, but remote.git holds ${publishedSha} for ${branchRef}, which this clone never had (a direct push to the branch?). Left untouched -- reconcile it before submitting again.`;
|
|
44351
|
-
workerLogWarn(` ${branchDir}: ${divergence}`);
|
|
44352
|
-
await this.recordRebaseFailure(branchPath, branchDir, divergence);
|
|
44353
|
-
}
|
|
44354
44421
|
}
|
|
44355
44422
|
} catch (err) {
|
|
44356
44423
|
const message = err instanceof Error ? err.message : "Unknown error";
|
|
@@ -44360,7 +44427,7 @@ var CmsWorker = class {
|
|
|
44360
44427
|
await this.recordRebaseFailure(branchPath, branchDir, redactedMessage);
|
|
44361
44428
|
}
|
|
44362
44429
|
}
|
|
44363
|
-
return { rebased, skippedDirty, failed };
|
|
44430
|
+
return { rebased, skippedDirty, skippedLocked, failed };
|
|
44364
44431
|
}
|
|
44365
44432
|
async refreshAuthCache() {
|
|
44366
44433
|
if (!this.running || !this.config.refreshAuthCache) return;
|
|
@@ -47555,10 +47622,10 @@ var SessionAPI = class extends AbstractAPI {
|
|
|
47555
47622
|
*/
|
|
47556
47623
|
async getToken(sessionId, template, expiresInSeconds) {
|
|
47557
47624
|
this.requireId(sessionId);
|
|
47558
|
-
const
|
|
47625
|
+
const path15 = template ? joinPaths(basePath24, sessionId, "tokens", template) : joinPaths(basePath24, sessionId, "tokens");
|
|
47559
47626
|
const requestOptions = {
|
|
47560
47627
|
method: "POST",
|
|
47561
|
-
path:
|
|
47628
|
+
path: path15
|
|
47562
47629
|
};
|
|
47563
47630
|
if (expiresInSeconds !== void 0) {
|
|
47564
47631
|
requestOptions.bodyParams = { expires_in_seconds: expiresInSeconds };
|
|
@@ -49680,12 +49747,12 @@ function buildRequest(options) {
|
|
|
49680
49747
|
userAgent = USER_AGENT,
|
|
49681
49748
|
skipApiVersionInUrl = false
|
|
49682
49749
|
} = options;
|
|
49683
|
-
const { path:
|
|
49750
|
+
const { path: path15, method, queryParams, headerParams, bodyParams, formData, options: opts } = requestOptions;
|
|
49684
49751
|
const { deepSnakecaseBodyParamKeys = false } = opts || {};
|
|
49685
49752
|
if (requireSecretKey) {
|
|
49686
49753
|
assertValidSecretKey(secretKey);
|
|
49687
49754
|
}
|
|
49688
|
-
const url = skipApiVersionInUrl ? joinPaths(apiUrl,
|
|
49755
|
+
const url = skipApiVersionInUrl ? joinPaths(apiUrl, path15) : joinPaths(apiUrl, apiVersion, path15);
|
|
49689
49756
|
const finalUrl = new URL(url);
|
|
49690
49757
|
if (queryParams) {
|
|
49691
49758
|
const snakecasedQueryParams = snakecase_keys_default({ ...queryParams });
|
|
@@ -51747,38 +51814,38 @@ function createClerkClient(options) {
|
|
|
51747
51814
|
}
|
|
51748
51815
|
|
|
51749
51816
|
// ../canopycms/src/auth/file-based-auth-cache.ts
|
|
51750
|
-
import
|
|
51751
|
-
import
|
|
51817
|
+
import fs9 from "node:fs/promises";
|
|
51818
|
+
import path13 from "node:path";
|
|
51752
51819
|
var log5 = createDebugLogger({ prefix: "FileBasedAuthCache" });
|
|
51753
51820
|
async function writeAuthCacheSnapshot(cachePath, files) {
|
|
51754
|
-
await
|
|
51821
|
+
await fs9.mkdir(cachePath, { recursive: true });
|
|
51755
51822
|
const timestamp2 = Date.now();
|
|
51756
|
-
const snapshotDir =
|
|
51757
|
-
await
|
|
51823
|
+
const snapshotDir = path13.join(cachePath, `snapshot-${timestamp2}`);
|
|
51824
|
+
await fs9.mkdir(snapshotDir, { recursive: true });
|
|
51758
51825
|
for (const [fileName, data2] of Object.entries(files)) {
|
|
51759
|
-
const tmpPath =
|
|
51760
|
-
const finalPath =
|
|
51761
|
-
await
|
|
51762
|
-
await
|
|
51763
|
-
}
|
|
51764
|
-
const currentLink =
|
|
51765
|
-
const tmpLink =
|
|
51766
|
-
await
|
|
51767
|
-
await
|
|
51826
|
+
const tmpPath = path13.join(snapshotDir, `${fileName}.tmp`);
|
|
51827
|
+
const finalPath = path13.join(snapshotDir, fileName);
|
|
51828
|
+
await fs9.writeFile(tmpPath, JSON.stringify(data2, null, 2), "utf-8");
|
|
51829
|
+
await fs9.rename(tmpPath, finalPath);
|
|
51830
|
+
}
|
|
51831
|
+
const currentLink = path13.join(cachePath, "current");
|
|
51832
|
+
const tmpLink = path13.join(cachePath, `current-${timestamp2}`);
|
|
51833
|
+
await fs9.symlink(snapshotDir, tmpLink);
|
|
51834
|
+
await fs9.rename(tmpLink, currentLink);
|
|
51768
51835
|
await cleanupOldSnapshots(cachePath, 2);
|
|
51769
51836
|
return snapshotDir;
|
|
51770
51837
|
}
|
|
51771
51838
|
async function cleanupOldSnapshots(cachePath, keepCount) {
|
|
51772
51839
|
let entries;
|
|
51773
51840
|
try {
|
|
51774
|
-
entries = await
|
|
51841
|
+
entries = await fs9.readdir(cachePath);
|
|
51775
51842
|
} catch {
|
|
51776
51843
|
return;
|
|
51777
51844
|
}
|
|
51778
51845
|
const snapshots = entries.filter((e5) => e5.startsWith("snapshot-")).sort().reverse();
|
|
51779
51846
|
for (const snapshot of snapshots.slice(keepCount)) {
|
|
51780
51847
|
try {
|
|
51781
|
-
await
|
|
51848
|
+
await fs9.rm(path13.join(cachePath, snapshot), {
|
|
51782
51849
|
recursive: true,
|
|
51783
51850
|
force: true
|
|
51784
51851
|
});
|
|
@@ -51872,7 +51939,7 @@ async function refreshClerkCache(options) {
|
|
|
51872
51939
|
}
|
|
51873
51940
|
|
|
51874
51941
|
// worker/index.ts
|
|
51875
|
-
import
|
|
51942
|
+
import path14 from "node:path";
|
|
51876
51943
|
async function getSecret(secretArn, retries = 3) {
|
|
51877
51944
|
const { SecretsManagerClient, GetSecretValueCommand } = await Promise.resolve().then(() => __toESM(require_dist_cjs53(), 1));
|
|
51878
51945
|
const client = new SecretsManagerClient({});
|
|
@@ -51911,7 +51978,7 @@ async function main() {
|
|
|
51911
51978
|
if (!clerkSecretKey && process.env.CLERK_SECRET_KEY_SECRET_ARN) {
|
|
51912
51979
|
clerkSecretKey = await getSecret(process.env.CLERK_SECRET_KEY_SECRET_ARN);
|
|
51913
51980
|
}
|
|
51914
|
-
const cachePath =
|
|
51981
|
+
const cachePath = path14.join(workspacePath, ".cache");
|
|
51915
51982
|
const refreshAuthCache = clerkSecretKey ? async () => {
|
|
51916
51983
|
const result = await refreshClerkCache({
|
|
51917
51984
|
secretKey: clerkSecretKey,
|