tnp 21.0.294 → 21.0.296
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/VERIFIED-BUILD-DATA.jsonc +3 -3
- package/browser/fesm2022/tnp-browser.mjs +21 -11
- package/browser/fesm2022/tnp-browser.mjs.map +1 -1
- package/browser/package.json +1 -1
- package/browser/types/tnp-browser.d.ts +3 -2
- package/browser-prod/fesm2022/tnp-browser-prod.mjs +22 -12
- package/browser-prod/fesm2022/tnp-browser-prod.mjs.map +1 -1
- package/browser-prod/package.json +1 -1
- package/browser-prod/types/tnp-browser-prod.d.ts +3 -2
- package/browser-prod.split-namespaces.json +4 -0
- package/cli.js +1557 -644
- package/full-dts/build-info._auto-generated_.d.ts +1 -1
- package/full-dts/project/abstract/artifacts/angular-node-app/artifact-angular-node-app-helpers.d.ts +7 -0
- package/full-dts/project/abstract/cloud-flare-projects/cloud-flare-project.d.ts +1 -1
- package/full-dts/project/abstract/cloud-flare-projects/cloud-flare-projects.utils.d.ts +2 -0
- package/full-dts/project/abstract/sub-project.d.ts +1 -1
- package/full-dts/project/cli/cli-_GLOBAL_.d.ts +2 -0
- package/lib/build-info._auto-generated_.d.ts +1 -1
- package/lib/build-info._auto-generated_.js +1 -1
- package/lib/package.json +1 -1
- package/lib/project/abstract/artifacts/angular-node-app/artifact-angular-node-app-helpers.d.ts +6 -0
- package/lib/project/abstract/artifacts/angular-node-app/artifact-angular-node-app-helpers.js +83 -0
- package/lib/project/abstract/artifacts/angular-node-app/artifact-angular-node-app-helpers.js.map +1 -0
- package/lib/project/abstract/artifacts/angular-node-app/artifact-angular-node-app.js +3 -66
- package/lib/project/abstract/artifacts/angular-node-app/artifact-angular-node-app.js.map +1 -1
- package/lib/project/abstract/artifacts/artifacts-manager.js +18 -8
- package/lib/project/abstract/artifacts/artifacts-manager.js.map +1 -1
- package/lib/project/abstract/cloud-flare-projects/cloud-flare-custom-worker.js +7 -0
- package/lib/project/abstract/cloud-flare-projects/cloud-flare-custom-worker.js.map +1 -1
- package/lib/project/abstract/cloud-flare-projects/cloud-flare-project.d.ts +1 -1
- package/lib/project/abstract/cloud-flare-projects/cloud-flare-project.js +24 -3
- package/lib/project/abstract/cloud-flare-projects/cloud-flare-project.js.map +1 -1
- package/lib/project/abstract/cloud-flare-projects/cloud-flare-projects.utils.d.ts +2 -0
- package/lib/project/abstract/cloud-flare-projects/cloud-flare-projects.utils.js.map +1 -1
- package/lib/project/abstract/project.js +6 -0
- package/lib/project/abstract/project.js.map +1 -1
- package/lib/project/abstract/release-process/release-process.js +1 -0
- package/lib/project/abstract/release-process/release-process.js.map +1 -1
- package/lib/project/abstract/sub-project.d.ts +1 -1
- package/lib/project/abstract/sub-project.js +2 -2
- package/lib/project/abstract/sub-project.js.map +1 -1
- package/lib/project/cli/cli-SUB_PROJECT.js +12 -8
- package/lib/project/cli/cli-SUB_PROJECT.js.map +1 -1
- package/lib/project/cli/cli-_GLOBAL_.d.ts +2 -0
- package/lib/project/cli/cli-_GLOBAL_.js +120 -3
- package/lib/project/cli/cli-_GLOBAL_.js.map +1 -1
- package/lib/vscode-plugin/vscode-menu-items.js +14 -10
- package/lib/vscode-plugin/vscode-menu-items.js.map +1 -1
- package/lib-esm/lib/build-info._auto-generated_.d.ts +1 -1
- package/lib-esm/lib/build-info._auto-generated_.js +1 -1
- package/lib-esm/lib/project/abstract/artifacts/angular-node-app/artifact-angular-node-app-helpers.d.ts +6 -0
- package/lib-esm/lib/project/abstract/artifacts/angular-node-app/artifact-angular-node-app-helpers.js +80 -0
- package/lib-esm/lib/project/abstract/artifacts/angular-node-app/artifact-angular-node-app-helpers.js.map +1 -0
- package/lib-esm/lib/project/abstract/artifacts/angular-node-app/artifact-angular-node-app.js +4 -67
- package/lib-esm/lib/project/abstract/artifacts/angular-node-app/artifact-angular-node-app.js.map +1 -1
- package/lib-esm/lib/project/abstract/artifacts/artifacts-manager.js +18 -8
- package/lib-esm/lib/project/abstract/artifacts/artifacts-manager.js.map +1 -1
- package/lib-esm/lib/project/abstract/cloud-flare-projects/cloud-flare-custom-worker.js +7 -0
- package/lib-esm/lib/project/abstract/cloud-flare-projects/cloud-flare-custom-worker.js.map +1 -1
- package/lib-esm/lib/project/abstract/cloud-flare-projects/cloud-flare-project.d.ts +1 -1
- package/lib-esm/lib/project/abstract/cloud-flare-projects/cloud-flare-project.js +24 -3
- package/lib-esm/lib/project/abstract/cloud-flare-projects/cloud-flare-project.js.map +1 -1
- package/lib-esm/lib/project/abstract/cloud-flare-projects/cloud-flare-projects.utils.d.ts +2 -0
- package/lib-esm/lib/project/abstract/cloud-flare-projects/cloud-flare-projects.utils.js.map +1 -1
- package/lib-esm/lib/project/abstract/project.js +7 -1
- package/lib-esm/lib/project/abstract/project.js.map +1 -1
- package/lib-esm/lib/project/abstract/release-process/release-process.js +1 -0
- package/lib-esm/lib/project/abstract/release-process/release-process.js.map +1 -1
- package/lib-esm/lib/project/abstract/sub-project.d.ts +1 -1
- package/lib-esm/lib/project/abstract/sub-project.js +2 -2
- package/lib-esm/lib/project/abstract/sub-project.js.map +1 -1
- package/lib-esm/lib/project/cli/cli-SUB_PROJECT.js +12 -8
- package/lib-esm/lib/project/cli/cli-SUB_PROJECT.js.map +1 -1
- package/lib-esm/lib/project/cli/cli-_GLOBAL_.d.ts +2 -0
- package/lib-esm/lib/project/cli/cli-_GLOBAL_.js +121 -4
- package/lib-esm/lib/project/cli/cli-_GLOBAL_.js.map +1 -1
- package/lib-esm/lib/vscode-plugin/vscode-menu-items.js +14 -10
- package/lib-esm/lib/vscode-plugin/vscode-menu-items.js.map +1 -1
- package/lib-prod/build-info._auto-generated_.d.ts +1 -1
- package/lib-prod/build-info._auto-generated_.js +1 -1
- package/lib-prod/package.json +1 -1
- package/lib-prod/project/abstract/artifacts/angular-node-app/artifact-angular-node-app-helpers.d.ts +4 -0
- package/lib-prod/project/abstract/artifacts/angular-node-app/artifact-angular-node-app-helpers.js +79 -0
- package/lib-prod/project/abstract/artifacts/angular-node-app/artifact-angular-node-app-helpers.js.map +1 -0
- package/lib-prod/project/abstract/artifacts/angular-node-app/artifact-angular-node-app.js +5 -68
- package/lib-prod/project/abstract/artifacts/angular-node-app/artifact-angular-node-app.js.map +1 -1
- package/lib-prod/project/abstract/artifacts/artifacts-manager.js +18 -8
- package/lib-prod/project/abstract/artifacts/artifacts-manager.js.map +1 -1
- package/lib-prod/project/abstract/cloud-flare-projects/cloud-flare-custom-worker.js +7 -0
- package/lib-prod/project/abstract/cloud-flare-projects/cloud-flare-custom-worker.js.map +1 -1
- package/lib-prod/project/abstract/cloud-flare-projects/cloud-flare-project.d.ts +1 -1
- package/lib-prod/project/abstract/cloud-flare-projects/cloud-flare-project.js +24 -3
- package/lib-prod/project/abstract/cloud-flare-projects/cloud-flare-project.js.map +1 -1
- package/lib-prod/project/abstract/cloud-flare-projects/cloud-flare-projects.utils.d.ts +2 -0
- package/lib-prod/project/abstract/cloud-flare-projects/cloud-flare-projects.utils.js.map +1 -1
- package/lib-prod/project/abstract/project.js +7 -1
- package/lib-prod/project/abstract/project.js.map +1 -1
- package/lib-prod/project/abstract/release-process/release-process.js +1 -0
- package/lib-prod/project/abstract/release-process/release-process.js.map +1 -1
- package/lib-prod/project/abstract/sub-project.d.ts +1 -1
- package/lib-prod/project/abstract/sub-project.js +2 -2
- package/lib-prod/project/abstract/sub-project.js.map +1 -1
- package/lib-prod/project/abstract/taon-worker/deployments/deployments.controller.js.map +1 -1
- package/lib-prod/project/cli/cli-SUB_PROJECT.js +12 -8
- package/lib-prod/project/cli/cli-SUB_PROJECT.js.map +1 -1
- package/lib-prod/project/cli/cli-_GLOBAL_.d.ts +2 -0
- package/lib-prod/project/cli/cli-_GLOBAL_.js +124 -7
- package/lib-prod/project/cli/cli-_GLOBAL_.js.map +1 -1
- package/lib-prod/vscode-plugin/vscode-menu-items.js +14 -10
- package/lib-prod/vscode-plugin/vscode-menu-items.js.map +1 -1
- package/lib-prod.split-namespaces.json +4 -0
- package/package.json +1 -1
- package/ts-source/browser-code/build-info._auto-generated_.ts +1 -1
- package/ts-source/browser-code/project/abstract/artifacts/angular-node-app/artifact-angular-node-app-helpers.ts +22 -0
- package/ts-source/browser-code/project/abstract/artifacts/angular-node-app/artifact-angular-node-app.ts +1 -0
- package/ts-source/browser-code/project/abstract/artifacts/artifacts-manager.ts +6 -3
- package/ts-source/browser-code/project/abstract/cloud-flare-projects/cloud-flare-project.ts +2 -1
- package/ts-source/browser-code/project/abstract/cloud-flare-projects/cloud-flare-projects.utils.ts +2 -0
- package/ts-source/browser-code/project/abstract/project.ts +7 -1
- package/ts-source/browser-code/project/abstract/sub-project.ts +1 -1
- package/ts-source/browser-code/project/cli/cli-_GLOBAL_.ts +9 -2
- package/ts-source/browser-code/vscode-plugin/vscode-menu-items.ts +0 -10
- package/ts-source/browser-code-prod/build-info._auto-generated_.ts +1 -1
- package/ts-source/browser-code-prod/project/abstract/artifacts/angular-node-app/artifact-angular-node-app-helpers.split-namespaces.json +10 -0
- package/ts-source/browser-code-prod/project/abstract/artifacts/angular-node-app/artifact-angular-node-app-helpers.ts +20 -0
- package/ts-source/browser-code-prod/project/abstract/artifacts/angular-node-app/artifact-angular-node-app.ts +1 -0
- package/ts-source/browser-code-prod/project/abstract/artifacts/artifacts-manager.ts +6 -3
- package/ts-source/browser-code-prod/project/abstract/artifacts/npm-lib-and-cli-tool/tools/taon-build-observer.ts +1 -1
- package/ts-source/browser-code-prod/project/abstract/cloud-flare-projects/cloud-flare-project.ts +2 -1
- package/ts-source/browser-code-prod/project/abstract/cloud-flare-projects/cloud-flare-projects.utils.ts +2 -0
- package/ts-source/browser-code-prod/project/abstract/project.ts +7 -1
- package/ts-source/browser-code-prod/project/abstract/sub-project.ts +1 -1
- package/ts-source/browser-code-prod/project/abstract/taon-worker/deployments/deployments.controller.ts +1 -1
- package/ts-source/browser-code-prod/project/cli/cli-_GLOBAL_.ts +9 -2
- package/ts-source/browser-code-prod/vscode-plugin/vscode-menu-items.ts +0 -10
- package/ts-source/websql-code/build-info._auto-generated_.ts +1 -1
- package/ts-source/websql-code/project/abstract/artifacts/angular-node-app/artifact-angular-node-app-helpers.ts +22 -0
- package/ts-source/websql-code/project/abstract/artifacts/angular-node-app/artifact-angular-node-app.ts +1 -0
- package/ts-source/websql-code/project/abstract/artifacts/artifacts-manager.ts +6 -3
- package/ts-source/websql-code/project/abstract/cloud-flare-projects/cloud-flare-project.ts +2 -1
- package/ts-source/websql-code/project/abstract/cloud-flare-projects/cloud-flare-projects.utils.ts +2 -0
- package/ts-source/websql-code/project/abstract/project.ts +7 -1
- package/ts-source/websql-code/project/abstract/sub-project.ts +1 -1
- package/ts-source/websql-code/project/cli/cli-_GLOBAL_.ts +9 -2
- package/ts-source/websql-code/vscode-plugin/vscode-menu-items.ts +0 -10
- package/ts-source/websql-code-prod/build-info._auto-generated_.ts +1 -1
- package/ts-source/websql-code-prod/project/abstract/artifacts/angular-node-app/artifact-angular-node-app-helpers.split-namespaces.json +10 -0
- package/ts-source/websql-code-prod/project/abstract/artifacts/angular-node-app/artifact-angular-node-app-helpers.ts +20 -0
- package/ts-source/websql-code-prod/project/abstract/artifacts/angular-node-app/artifact-angular-node-app.ts +1 -0
- package/ts-source/websql-code-prod/project/abstract/artifacts/artifacts-manager.ts +6 -3
- package/ts-source/websql-code-prod/project/abstract/artifacts/npm-lib-and-cli-tool/tools/taon-build-observer.ts +1 -1
- package/ts-source/websql-code-prod/project/abstract/cloud-flare-projects/cloud-flare-project.ts +2 -1
- package/ts-source/websql-code-prod/project/abstract/cloud-flare-projects/cloud-flare-projects.utils.ts +2 -0
- package/ts-source/websql-code-prod/project/abstract/project.ts +7 -1
- package/ts-source/websql-code-prod/project/abstract/sub-project.ts +1 -1
- package/ts-source/websql-code-prod/project/abstract/taon-worker/deployments/deployments.controller.ts +1 -1
- package/ts-source/websql-code-prod/project/cli/cli-_GLOBAL_.ts +9 -2
- package/ts-source/websql-code-prod/vscode-plugin/vscode-menu-items.ts +0 -10
- package/websql/fesm2022/tnp-websql.mjs +21 -11
- package/websql/fesm2022/tnp-websql.mjs.map +1 -1
- package/websql/package.json +1 -1
- package/websql/types/tnp-websql.d.ts +3 -2
- package/websql-prod/fesm2022/tnp-websql-prod.mjs +22 -12
- package/websql-prod/fesm2022/tnp-websql-prod.mjs.map +1 -1
- package/websql-prod/package.json +1 -1
- package/websql-prod/types/tnp-websql-prod.d.ts +3 -2
- package/websql-prod.split-namespaces.json +4 -0
- package/browser-prod/types/tnp-browser-prod.d.ts.map +0 -1
- package/full-dts/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/code-split-process.enum.d.ts +0 -53
- package/full-dts/project/abstract/taon-worker/secrets-keychain/secrets-keychain.repository copy.d.ts +0 -10
- package/full-dts/project/cli/cli-LANG copy.d.ts +0 -16
- package/full-dts/wrap-env.d.ts +0 -4
- package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/code-split-process.enum.d.ts +0 -52
- package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/code-split-process.enum.js +0 -306
- package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/code-split-process.enum.js.map +0 -1
- package/lib/project/abstract/taon-worker/deployments/deployments-api.service.d.ts +0 -5
- package/lib/project/abstract/taon-worker/dev-build/dev-build-api.service.d.ts +0 -5
- package/lib/project/abstract/taon-worker/dev-mode/dev-mode-api.service.d.ts +0 -4
- package/lib/project/abstract/taon-worker/isomorphic-packages/isomorphic-packages-api.service.d.ts +0 -4
- package/lib/project/abstract/taon-worker/secrets-keychain/secrets-keychain.api.service.d.ts +0 -8
- package/lib/project/abstract/taon-worker/secrets-keychain/secrets-keychain.repository copy.d.ts +0 -9
- package/lib/project/abstract/taon-worker/secrets-keychain/secrets-keychain.repository copy.js +0 -37
- package/lib/project/abstract/taon-worker/secrets-keychain/secrets-keychain.repository copy.js.map +0 -1
- package/lib/project/cli/cli-LANG copy.d.ts +0 -15
- package/lib/project/cli/cli-LANG copy.js +0 -46
- package/lib/project/cli/cli-LANG copy.js.map +0 -1
- package/lib/wrap-env.d.ts +0 -3
- package/lib/wrap-env.js +0 -10
- package/lib/wrap-env.js.map +0 -1
- package/lib-esm/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/code-split-process.enum.d.ts +0 -52
- package/lib-esm/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/code-split-process.enum.js +0 -302
- package/lib-esm/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/code-split-process.enum.js.map +0 -1
- package/lib-esm/lib/project/abstract/taon-worker/secrets-keychain/secrets-keychain.repository copy.d.ts +0 -9
- package/lib-esm/lib/project/abstract/taon-worker/secrets-keychain/secrets-keychain.repository copy.js +0 -28
- package/lib-esm/lib/project/abstract/taon-worker/secrets-keychain/secrets-keychain.repository copy.js.map +0 -1
- package/lib-esm/lib/project/cli/cli-LANG copy.d.ts +0 -15
- package/lib-esm/lib/project/cli/cli-LANG copy.js +0 -42
- package/lib-esm/lib/project/cli/cli-LANG copy.js.map +0 -1
- package/lib-esm/lib/wrap-env.d.ts +0 -3
- package/lib-esm/lib/wrap-env.js +0 -7
- package/lib-esm/lib/wrap-env.js.map +0 -1
- package/lib-prod/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/code-split-process.enum.d.ts +0 -38
- package/lib-prod/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/code-split-process.enum.js +0 -295
- package/lib-prod/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/code-split-process.enum.js.map +0 -1
- package/lib-prod/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/utils-code-cut.test.d.ts +0 -1
- package/lib-prod/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/utils-code-cut.test.js +0 -75
- package/lib-prod/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/utils-code-cut.test.js.map +0 -1
- package/websql-prod/types/tnp-websql-prod.d.ts.map +0 -1
package/cli.js
CHANGED
|
@@ -28832,6 +28832,17 @@ var require_utils = __commonJS({
|
|
|
28832
28832
|
var setMaxIndex = function setMaxIndex2(obj, maxIndex) {
|
|
28833
28833
|
overflowChannel.set(obj, maxIndex);
|
|
28834
28834
|
};
|
|
28835
|
+
var conflictChannel = getSideChannel();
|
|
28836
|
+
var markConflict = function markConflict2(obj, maxIndex) {
|
|
28837
|
+
conflictChannel.set(obj, maxIndex);
|
|
28838
|
+
return obj;
|
|
28839
|
+
};
|
|
28840
|
+
var isConflict = function isConflict2(obj) {
|
|
28841
|
+
return conflictChannel.has(obj);
|
|
28842
|
+
};
|
|
28843
|
+
var getConflictIndex = function getConflictIndex2(obj) {
|
|
28844
|
+
return conflictChannel.get(obj);
|
|
28845
|
+
};
|
|
28835
28846
|
var hexTable = (function() {
|
|
28836
28847
|
var array = [];
|
|
28837
28848
|
for (var i = 0; i < 256; ++i) {
|
|
@@ -28875,6 +28886,27 @@ var require_utils = __commonJS({
|
|
|
28875
28886
|
obj[key] = value;
|
|
28876
28887
|
}
|
|
28877
28888
|
};
|
|
28889
|
+
var maxNumericIndex = function maxNumericIndex2(obj, min2) {
|
|
28890
|
+
var max2 = min2;
|
|
28891
|
+
var keys2 = Object.keys(obj);
|
|
28892
|
+
for (var i = 0; i < keys2.length; ++i) {
|
|
28893
|
+
var num = parseInt(keys2[i], 10);
|
|
28894
|
+
if (String(num) === keys2[i] && num > max2) {
|
|
28895
|
+
max2 = num;
|
|
28896
|
+
}
|
|
28897
|
+
}
|
|
28898
|
+
return max2;
|
|
28899
|
+
};
|
|
28900
|
+
var limitedPair = function limitedPair2(first2, second, options2) {
|
|
28901
|
+
var pair = [first2, second];
|
|
28902
|
+
if (options2 && typeof options2.arrayLimit === "number" && pair.length > options2.arrayLimit) {
|
|
28903
|
+
if (options2.throwOnLimitExceeded) {
|
|
28904
|
+
throw new RangeError("Array limit exceeded. Only " + options2.arrayLimit + " element" + (options2.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
|
|
28905
|
+
}
|
|
28906
|
+
return markOverflow(arrayToObject(pair, options2), 1);
|
|
28907
|
+
}
|
|
28908
|
+
return pair;
|
|
28909
|
+
};
|
|
28878
28910
|
var merge = function merge2(target, source, options2) {
|
|
28879
28911
|
if (!source) {
|
|
28880
28912
|
return target;
|
|
@@ -28894,13 +28926,21 @@ var require_utils = __commonJS({
|
|
|
28894
28926
|
var newIndex = getMaxIndex(target) + 1;
|
|
28895
28927
|
target[newIndex] = source;
|
|
28896
28928
|
setMaxIndex(target, newIndex);
|
|
28929
|
+
} else if (options2 && options2.strictMerge && isConflict(target)) {
|
|
28930
|
+
var nextConflict = getConflictIndex(target) + 1;
|
|
28931
|
+
if (options2.throwOnLimitExceeded && typeof options2.arrayLimit === "number" && nextConflict >= options2.arrayLimit) {
|
|
28932
|
+
throw new RangeError("Array limit exceeded. Only " + options2.arrayLimit + " element" + (options2.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
|
|
28933
|
+
}
|
|
28934
|
+
target[nextConflict] = source;
|
|
28935
|
+
markConflict(target, nextConflict);
|
|
28897
28936
|
} else if (options2 && options2.strictMerge) {
|
|
28898
|
-
|
|
28937
|
+
var conflict = limitedPair(target, source, options2);
|
|
28938
|
+
return isArray(conflict) ? markConflict(conflict, 1) : conflict;
|
|
28899
28939
|
} else if (options2 && (options2.plainObjects || options2.allowPrototypes) || !has3.call(Object.prototype, source)) {
|
|
28900
28940
|
target[source] = true;
|
|
28901
28941
|
}
|
|
28902
28942
|
} else {
|
|
28903
|
-
return
|
|
28943
|
+
return limitedPair(target, source, options2);
|
|
28904
28944
|
}
|
|
28905
28945
|
return target;
|
|
28906
28946
|
}
|
|
@@ -28926,6 +28966,9 @@ var require_utils = __commonJS({
|
|
|
28926
28966
|
var mergeTarget = target;
|
|
28927
28967
|
if (isArray(target) && !isArray(source)) {
|
|
28928
28968
|
mergeTarget = arrayToObject(target, options2);
|
|
28969
|
+
if (isConflict(target)) {
|
|
28970
|
+
markConflict(mergeTarget, target.length - 1);
|
|
28971
|
+
}
|
|
28929
28972
|
}
|
|
28930
28973
|
if (isArray(target) && isArray(source)) {
|
|
28931
28974
|
source.forEach(function(item, i) {
|
|
@@ -28956,7 +28999,7 @@ var require_utils = __commonJS({
|
|
|
28956
28999
|
setProperty(acc, key, value);
|
|
28957
29000
|
}
|
|
28958
29001
|
if (isOverflow(source) && !isOverflow(acc)) {
|
|
28959
|
-
markOverflow(acc, getMaxIndex(source));
|
|
29002
|
+
markOverflow(acc, maxNumericIndex(acc, getMaxIndex(source)));
|
|
28960
29003
|
}
|
|
28961
29004
|
if (isOverflow(acc)) {
|
|
28962
29005
|
var keyNum = parseInt(key, 10);
|
|
@@ -28964,6 +29007,12 @@ var require_utils = __commonJS({
|
|
|
28964
29007
|
setMaxIndex(acc, keyNum);
|
|
28965
29008
|
}
|
|
28966
29009
|
}
|
|
29010
|
+
if (isConflict(acc)) {
|
|
29011
|
+
var conflictKey = parseInt(key, 10);
|
|
29012
|
+
if (String(conflictKey) === key && conflictKey > getConflictIndex(acc)) {
|
|
29013
|
+
markConflict(acc, conflictKey);
|
|
29014
|
+
}
|
|
29015
|
+
}
|
|
28967
29016
|
return acc;
|
|
28968
29017
|
}, mergeTarget);
|
|
28969
29018
|
};
|
|
@@ -28974,6 +29023,9 @@ var require_utils = __commonJS({
|
|
|
28974
29023
|
}, target);
|
|
28975
29024
|
};
|
|
28976
29025
|
var decode = function(str, defaultDecoder, charset) {
|
|
29026
|
+
if (typeof str === "string" && str.indexOf("%") === -1) {
|
|
29027
|
+
return str.indexOf("+") === -1 ? str : str.replace(/\+/g, " ");
|
|
29028
|
+
}
|
|
28977
29029
|
var strWithoutPlus = str.replace(/\+/g, " ");
|
|
28978
29030
|
if (charset === "iso-8859-1") {
|
|
28979
29031
|
return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
|
|
@@ -28984,6 +29036,52 @@ var require_utils = __commonJS({
|
|
|
28984
29036
|
return strWithoutPlus;
|
|
28985
29037
|
}
|
|
28986
29038
|
};
|
|
29039
|
+
var hasToPrimitive = typeof Symbol === "function" && typeof Symbol.toPrimitive === "symbol";
|
|
29040
|
+
var arrayJoin = Array.prototype.join;
|
|
29041
|
+
var arrayToString = Array.prototype.toString;
|
|
29042
|
+
var objectToString = Object.prototype.toString;
|
|
29043
|
+
var toCoercible = function toCoercible2(value, joining) {
|
|
29044
|
+
if (!value || typeof value !== "object" && typeof value !== "function") {
|
|
29045
|
+
return value;
|
|
29046
|
+
}
|
|
29047
|
+
if (hasToPrimitive && value[Symbol.toPrimitive] != null) {
|
|
29048
|
+
return value;
|
|
29049
|
+
}
|
|
29050
|
+
if (isArray(value) && value.toString === arrayToString && value.join === arrayJoin) {
|
|
29051
|
+
var ancestors = joining || getSideChannel();
|
|
29052
|
+
if (ancestors.has(value)) {
|
|
29053
|
+
return "";
|
|
29054
|
+
}
|
|
29055
|
+
ancestors.set(value, true);
|
|
29056
|
+
var copy;
|
|
29057
|
+
for (var i = 0; i < value.length; i += 1) {
|
|
29058
|
+
var item = value[i];
|
|
29059
|
+
var coerced = toCoercible2(item, ancestors);
|
|
29060
|
+
if (!copy && coerced !== item) {
|
|
29061
|
+
copy = [];
|
|
29062
|
+
for (var j = 0; j < i; j += 1) {
|
|
29063
|
+
copy[j] = value[j];
|
|
29064
|
+
}
|
|
29065
|
+
}
|
|
29066
|
+
if (copy) {
|
|
29067
|
+
copy[i] = coerced;
|
|
29068
|
+
}
|
|
29069
|
+
}
|
|
29070
|
+
ancestors["delete"](value);
|
|
29071
|
+
return copy || value;
|
|
29072
|
+
}
|
|
29073
|
+
if (typeof value.toString === "function") {
|
|
29074
|
+
return value;
|
|
29075
|
+
}
|
|
29076
|
+
var valueOf = value.valueOf;
|
|
29077
|
+
if (typeof valueOf === "function") {
|
|
29078
|
+
var primitive = valueOf.call(value);
|
|
29079
|
+
if (!primitive || typeof primitive !== "object" && typeof primitive !== "function") {
|
|
29080
|
+
return String(primitive);
|
|
29081
|
+
}
|
|
29082
|
+
}
|
|
29083
|
+
return objectToString.call(value);
|
|
29084
|
+
};
|
|
28987
29085
|
var limit = 1024;
|
|
28988
29086
|
var encode = function encode2(str, defaultEncoder, charset, kind, format) {
|
|
28989
29087
|
if (str.length === 0) {
|
|
@@ -28993,12 +29091,12 @@ var require_utils = __commonJS({
|
|
|
28993
29091
|
if (typeof str === "symbol") {
|
|
28994
29092
|
string = Symbol.prototype.toString.call(str);
|
|
28995
29093
|
} else if (typeof str !== "string") {
|
|
28996
|
-
string = String(str);
|
|
29094
|
+
string = String(toCoercible(str));
|
|
28997
29095
|
}
|
|
28998
29096
|
if (charset === "iso-8859-1") {
|
|
28999
29097
|
return escape(string).replace(/%u[0-9a-f]{4}/gi, function($0) {
|
|
29000
29098
|
return "%26%23" + parseInt($0.slice(2), 16) + "%3B";
|
|
29001
|
-
});
|
|
29099
|
+
}).replace(/\+/g, "%2B");
|
|
29002
29100
|
}
|
|
29003
29101
|
var out = "";
|
|
29004
29102
|
for (var j = 0; j < string.length; j += limit) {
|
|
@@ -29110,7 +29208,8 @@ var require_utils = __commonJS({
|
|
|
29110
29208
|
isRegExp,
|
|
29111
29209
|
markOverflow,
|
|
29112
29210
|
maybeMap,
|
|
29113
|
-
merge
|
|
29211
|
+
merge,
|
|
29212
|
+
toCoercible
|
|
29114
29213
|
};
|
|
29115
29214
|
}
|
|
29116
29215
|
});
|
|
@@ -29225,17 +29324,17 @@ var require_stringify = __commonJS({
|
|
|
29225
29324
|
if (generateArrayPrefix === "comma" && isArray(obj)) {
|
|
29226
29325
|
if (encodeValuesOnly && encoder) {
|
|
29227
29326
|
obj = utils.maybeMap(obj, function(v) {
|
|
29228
|
-
return v == null ? v : encoder(v);
|
|
29327
|
+
return v == null ? v : encoder(v, defaults.encoder, charset, "value", format);
|
|
29229
29328
|
});
|
|
29230
29329
|
}
|
|
29231
|
-
objKeys = [{ value: obj.length > 0 ? obj.join(",") || null : void 0 }];
|
|
29330
|
+
objKeys = [{ value: obj.length > 0 ? utils.toCoercible(obj).join(",") || null : void 0 }];
|
|
29232
29331
|
} else if (isArray(filter2)) {
|
|
29233
29332
|
objKeys = filter2;
|
|
29234
29333
|
} else {
|
|
29235
29334
|
var keys2 = Object.keys(obj);
|
|
29236
29335
|
objKeys = sort ? keys2.sort(sort) : keys2;
|
|
29237
29336
|
}
|
|
29238
|
-
var encodedPrefix =
|
|
29337
|
+
var encodedPrefix = String(prefix);
|
|
29239
29338
|
var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + "[]" : encodedPrefix;
|
|
29240
29339
|
if (allowEmptyArrays && isArray(obj) && obj.length === 0 && Object.keys(obj).length === 0) {
|
|
29241
29340
|
return adjustedPrefix + "[]";
|
|
@@ -29306,7 +29405,7 @@ var require_stringify = __commonJS({
|
|
|
29306
29405
|
filter2 = opts.filter;
|
|
29307
29406
|
}
|
|
29308
29407
|
var arrayFormat;
|
|
29309
|
-
if (opts.arrayFormat
|
|
29408
|
+
if (has3.call(arrayPrefixGenerators, opts.arrayFormat)) {
|
|
29310
29409
|
arrayFormat = opts.arrayFormat;
|
|
29311
29410
|
} else if ("indices" in opts) {
|
|
29312
29411
|
arrayFormat = opts.indices ? "indices" : "repeat";
|
|
@@ -29416,9 +29515,53 @@ var require_stringify = __commonJS({
|
|
|
29416
29515
|
var require_parse = __commonJS({
|
|
29417
29516
|
"tnp/node_modules/qs/lib/parse.js"(exports2, module2) {
|
|
29418
29517
|
"use strict";
|
|
29518
|
+
var getSideChannel = require_side_channel();
|
|
29419
29519
|
var utils = require_utils();
|
|
29420
29520
|
var has3 = Object.prototype.hasOwnProperty;
|
|
29421
29521
|
var isArray = Array.isArray;
|
|
29522
|
+
var getPrototypeOf = Object.getPrototypeOf;
|
|
29523
|
+
var isPlainContainer = function isPlainContainer2(value) {
|
|
29524
|
+
if (!value || typeof value !== "object") {
|
|
29525
|
+
return false;
|
|
29526
|
+
}
|
|
29527
|
+
if (isArray(value)) {
|
|
29528
|
+
return true;
|
|
29529
|
+
}
|
|
29530
|
+
var proto = getPrototypeOf(value);
|
|
29531
|
+
return proto === Object.prototype || proto === null;
|
|
29532
|
+
};
|
|
29533
|
+
var emptyCopyOf = function emptyCopyOf2(value) {
|
|
29534
|
+
if (isArray(value)) {
|
|
29535
|
+
var arr = [];
|
|
29536
|
+
arr.length = value.length;
|
|
29537
|
+
return arr;
|
|
29538
|
+
}
|
|
29539
|
+
return getPrototypeOf(value) === null ? { __proto__: null } : {};
|
|
29540
|
+
};
|
|
29541
|
+
var copyInput = function copyInput2(input) {
|
|
29542
|
+
var copies = getSideChannel();
|
|
29543
|
+
var result2 = {};
|
|
29544
|
+
var queue = [{ source: input, target: result2 }];
|
|
29545
|
+
for (var i = 0; i < queue.length; ++i) {
|
|
29546
|
+
var source = queue[i].source;
|
|
29547
|
+
var target = queue[i].target;
|
|
29548
|
+
var keys2 = Object.keys(source);
|
|
29549
|
+
for (var j = 0; j < keys2.length; ++j) {
|
|
29550
|
+
var value = source[keys2[j]];
|
|
29551
|
+
if (isPlainContainer(value)) {
|
|
29552
|
+
if (!copies.has(value)) {
|
|
29553
|
+
var copy = emptyCopyOf(value);
|
|
29554
|
+
copies.set(value, copy);
|
|
29555
|
+
queue[queue.length] = { source: value, target: copy };
|
|
29556
|
+
}
|
|
29557
|
+
target[keys2[j]] = copies.get(value);
|
|
29558
|
+
} else {
|
|
29559
|
+
target[keys2[j]] = value;
|
|
29560
|
+
}
|
|
29561
|
+
}
|
|
29562
|
+
}
|
|
29563
|
+
return result2;
|
|
29564
|
+
};
|
|
29422
29565
|
var defaults = {
|
|
29423
29566
|
allowDots: false,
|
|
29424
29567
|
allowEmptyArrays: false,
|
|
@@ -29505,6 +29648,7 @@ var require_parse = __commonJS({
|
|
|
29505
29648
|
var part = parts[i];
|
|
29506
29649
|
var bracketEqualsPos = part.indexOf("]=");
|
|
29507
29650
|
var pos = bracketEqualsPos === -1 ? part.indexOf("=") : bracketEqualsPos + 1;
|
|
29651
|
+
var isEmptyBracketKey = pos > 1 && part.slice(pos - 2, pos) === "[]";
|
|
29508
29652
|
var key;
|
|
29509
29653
|
var val;
|
|
29510
29654
|
if (pos === -1) {
|
|
@@ -29528,7 +29672,7 @@ var require_parse = __commonJS({
|
|
|
29528
29672
|
if (val && options2.interpretNumericEntities && charset === "iso-8859-1") {
|
|
29529
29673
|
val = interpretNumericEntities(String(val));
|
|
29530
29674
|
}
|
|
29531
|
-
if (
|
|
29675
|
+
if (isEmptyBracketKey) {
|
|
29532
29676
|
val = isArray(val) ? [val] : val;
|
|
29533
29677
|
}
|
|
29534
29678
|
if (options2.comma && isArray(val) && val.length > options2.arrayLimit) {
|
|
@@ -29536,7 +29680,7 @@ var require_parse = __commonJS({
|
|
|
29536
29680
|
}
|
|
29537
29681
|
if (key !== null) {
|
|
29538
29682
|
var existing = has3.call(obj, key);
|
|
29539
|
-
if (existing && (options2.duplicates === "combine" ||
|
|
29683
|
+
if (existing && (options2.duplicates === "combine" || isEmptyBracketKey)) {
|
|
29540
29684
|
obj[key] = utils.combine(
|
|
29541
29685
|
obj[key],
|
|
29542
29686
|
val,
|
|
@@ -29597,8 +29741,35 @@ var require_parse = __commonJS({
|
|
|
29597
29741
|
}
|
|
29598
29742
|
return leaf;
|
|
29599
29743
|
};
|
|
29744
|
+
var topLevelDotsToBrackets = function topLevelDotsToBrackets2(key) {
|
|
29745
|
+
var result2 = "";
|
|
29746
|
+
var depth = 0;
|
|
29747
|
+
for (var i = 0; i < key.length; i += 1) {
|
|
29748
|
+
var cu = key.charCodeAt(i);
|
|
29749
|
+
if (cu === 91) {
|
|
29750
|
+
depth += 1;
|
|
29751
|
+
result2 += "[";
|
|
29752
|
+
} else if (cu === 93) {
|
|
29753
|
+
if (depth > 0) {
|
|
29754
|
+
depth -= 1;
|
|
29755
|
+
}
|
|
29756
|
+
result2 += "]";
|
|
29757
|
+
} else if (cu === 46 && depth === 0 && i + 1 < key.length && key.charCodeAt(i + 1) !== 46 && key.charCodeAt(i + 1) !== 91) {
|
|
29758
|
+
var start = i + 1;
|
|
29759
|
+
var j = start;
|
|
29760
|
+
while (j < key.length && key.charCodeAt(j) !== 46 && key.charCodeAt(j) !== 91) {
|
|
29761
|
+
j += 1;
|
|
29762
|
+
}
|
|
29763
|
+
result2 += "[" + key.slice(start, j) + "]";
|
|
29764
|
+
i = j - 1;
|
|
29765
|
+
} else {
|
|
29766
|
+
result2 += key.charAt(i);
|
|
29767
|
+
}
|
|
29768
|
+
}
|
|
29769
|
+
return result2;
|
|
29770
|
+
};
|
|
29600
29771
|
var splitKeyIntoSegments = function splitKeyIntoSegments2(originalKey, options2) {
|
|
29601
|
-
var key = options2.allowDots ? originalKey
|
|
29772
|
+
var key = options2.allowDots ? topLevelDotsToBrackets(originalKey) : originalKey;
|
|
29602
29773
|
if (options2.depth <= 0) {
|
|
29603
29774
|
if (!options2.plainObjects && has3.call(Object.prototype, key)) {
|
|
29604
29775
|
if (!options2.allowPrototypes) {
|
|
@@ -29724,7 +29895,7 @@ var require_parse = __commonJS({
|
|
|
29724
29895
|
if (str === "" || str === null || typeof str === "undefined") {
|
|
29725
29896
|
return options2.plainObjects ? { __proto__: null } : {};
|
|
29726
29897
|
}
|
|
29727
|
-
var tempObj = typeof str === "string" ? parseValues(str, options2) : str;
|
|
29898
|
+
var tempObj = typeof str === "string" ? parseValues(str, options2) : copyInput(str);
|
|
29728
29899
|
var obj = options2.plainObjects ? { __proto__: null } : {};
|
|
29729
29900
|
var keys2 = Object.keys(tempObj);
|
|
29730
29901
|
for (var i = 0; i < keys2.length; ++i) {
|
|
@@ -209508,7 +209679,8 @@ var require_constants15 = __commonJS({
|
|
|
209508
209679
|
"tnp/node_modules/taon/lib/constants.js"(exports2) {
|
|
209509
209680
|
"use strict";
|
|
209510
209681
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
209511
|
-
exports2.Replecables = exports2.apiPrefix = exports2.TaonBaseStorageRepositoryClassName = exports2.TaonBaseRepositoryClassName = exports2.CURRENT_HOST_URL = exports2.CURRENT_HOST_BACKEND_PORT = exports2.TAON_CONTEXT = exports2.TaonEntityKeysToOmitArr = void 0;
|
|
209682
|
+
exports2.Replecables = exports2.apiPrefix = exports2.TaonBaseStorageRepositoryClassName = exports2.TaonBaseRepositoryClassName = exports2.CURRENT_HOST_URL = exports2.CURRENT_HOST_BACKEND_PORT = exports2.TAON_CONTEXT = exports2.TaonEntityKeysToOmitArr = exports2.TAON_MIGRATION_META_TABLE_NAME = void 0;
|
|
209683
|
+
exports2.TAON_MIGRATION_META_TABLE_NAME = "TAON_MIGRATION_META";
|
|
209512
209684
|
exports2.TaonEntityKeysToOmitArr = [
|
|
209513
209685
|
"ctrl",
|
|
209514
209686
|
"clone",
|
|
@@ -211993,6 +212165,9 @@ var require_new_mapping = __commonJS({
|
|
|
211993
212165
|
}
|
|
211994
212166
|
function decodeMappingForHeaderJson(instanceOrClass, options2) {
|
|
211995
212167
|
options2 = options2 || {};
|
|
212168
|
+
if (lib_22._.isNumber(instanceOrClass) || lib_22._.isBoolean(instanceOrClass)) {
|
|
212169
|
+
return;
|
|
212170
|
+
}
|
|
211996
212171
|
if (Array.isArray(instanceOrClass) && !options2.useFirstArrayItemClassNameForAllElements) {
|
|
211997
212172
|
const tokens = instanceOrClass.map(getClassNameTokenFromItem);
|
|
211998
212173
|
return { "[]": rleEncodeTokens(tokens) };
|
|
@@ -309783,6 +309958,7 @@ var require_DataSource = __commonJS({
|
|
|
309783
309958
|
var DriverUtils_1 = require_DriverUtils();
|
|
309784
309959
|
var InstanceChecker_1 = require_InstanceChecker();
|
|
309785
309960
|
var constants_12 = require_constants16();
|
|
309961
|
+
var lib_13 = require_lib31();
|
|
309786
309962
|
var DataSource = class {
|
|
309787
309963
|
"@instanceof" = Symbol.for("DataSource");
|
|
309788
309964
|
SelectQueryBuilder = SelectQueryBuilder_1.SelectQueryBuilder;
|
|
@@ -310187,6 +310363,9 @@ var require_DataSource = __commonJS({
|
|
|
310187
310363
|
return this.entityMetadatas.find((metadata) => {
|
|
310188
310364
|
if (metadata.target === target)
|
|
310189
310365
|
return true;
|
|
310366
|
+
if (metadata.givenTableName === target[lib_13.CoreModels.ClassNameStaticProperty]) {
|
|
310367
|
+
return true;
|
|
310368
|
+
}
|
|
310190
310369
|
if (InstanceChecker_1.InstanceChecker.isEntitySchema(target)) {
|
|
310191
310370
|
return metadata.name === target.options.name;
|
|
310192
310371
|
}
|
|
@@ -312960,130 +313139,6 @@ var require_cloudflare_express_fake_server = __commonJS({
|
|
|
312960
313139
|
}
|
|
312961
313140
|
});
|
|
312962
313141
|
|
|
312963
|
-
// tnp/node_modules/taon/lib/models.js
|
|
312964
|
-
var require_models2 = __commonJS({
|
|
312965
|
-
"tnp/node_modules/taon/lib/models.js"(exports2) {
|
|
312966
|
-
"use strict";
|
|
312967
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
312968
|
-
exports2.Models = exports2.TaonTempRoutesFolder = exports2.TaonTempDatabasesFolder = exports2.BaseTaonClassesNames = exports2.TaonRestResponseWrapper = void 0;
|
|
312969
|
-
var lib_13 = require_lib36();
|
|
312970
|
-
var lib_22 = require_lib31();
|
|
312971
|
-
var TaonRestResponseWrapper = class extends lib_13.RestResponseWrapper {
|
|
312972
|
-
};
|
|
312973
|
-
exports2.TaonRestResponseWrapper = TaonRestResponseWrapper;
|
|
312974
|
-
exports2.BaseTaonClassesNames = [
|
|
312975
|
-
"BaseCrudController",
|
|
312976
|
-
"BaseController",
|
|
312977
|
-
"BaseAbstractEntity",
|
|
312978
|
-
"BaseEntity",
|
|
312979
|
-
"BaseContext",
|
|
312980
|
-
"BaseCustomRepository",
|
|
312981
|
-
"BaseFileUploadMiddleware",
|
|
312982
|
-
"BaseMiddleware",
|
|
312983
|
-
"BaseClass",
|
|
312984
|
-
"BaseInjector",
|
|
312985
|
-
"BaseMigration",
|
|
312986
|
-
"BaseProvider",
|
|
312987
|
-
"BaseRepository",
|
|
312988
|
-
"BaseSubscriberForEntity",
|
|
312989
|
-
"BaseCliWorkerController",
|
|
312990
|
-
"PortsController",
|
|
312991
|
-
"PortsContext"
|
|
312992
|
-
];
|
|
312993
|
-
exports2.TaonTempDatabasesFolder = "databases";
|
|
312994
|
-
exports2.TaonTempRoutesFolder = "routes";
|
|
312995
|
-
var Models;
|
|
312996
|
-
(function(Models2) {
|
|
312997
|
-
Models2.DatabasesFolder = exports2.TaonTempDatabasesFolder;
|
|
312998
|
-
let ClassType;
|
|
312999
|
-
(function(ClassType2) {
|
|
313000
|
-
ClassType2["ENTITY"] = "ENTITY";
|
|
313001
|
-
ClassType2["CONTROLLER"] = "CONTROLLER";
|
|
313002
|
-
ClassType2["REPOSITORY"] = "REPOSITORY";
|
|
313003
|
-
ClassType2["PROVIDER"] = "PROVIDER";
|
|
313004
|
-
ClassType2["SUBSCRIBER"] = "SUBSCRIBER";
|
|
313005
|
-
ClassType2["MIGRATION"] = "MIGRATION";
|
|
313006
|
-
ClassType2["MIDDLEWARE"] = "MIDDLEWARE";
|
|
313007
|
-
})(ClassType = Models2.ClassType || (Models2.ClassType = {}));
|
|
313008
|
-
Models2.ClassTypeKey = {
|
|
313009
|
-
[ClassType.ENTITY]: "entities",
|
|
313010
|
-
[ClassType.CONTROLLER]: "controllers",
|
|
313011
|
-
[ClassType.REPOSITORY]: "repositories",
|
|
313012
|
-
[ClassType.PROVIDER]: "providers",
|
|
313013
|
-
[ClassType.SUBSCRIBER]: "subscribers",
|
|
313014
|
-
[ClassType.MIGRATION]: "migrations",
|
|
313015
|
-
[ClassType.MIDDLEWARE]: "middlewares"
|
|
313016
|
-
};
|
|
313017
|
-
let DBRecreateMode;
|
|
313018
|
-
(function(DBRecreateMode2) {
|
|
313019
|
-
DBRecreateMode2["DROP_DB_MIGRATIONS"] = "DROP_DB__RUN_MIGRATIONS";
|
|
313020
|
-
DBRecreateMode2["PRESERVE_DATA_MIGRATIONS"] = "PRESERVE_DATA__RUN_MIGRATIONS";
|
|
313021
|
-
})(DBRecreateMode = Models2.DBRecreateMode || (Models2.DBRecreateMode = {}));
|
|
313022
|
-
class DatabaseConfigTypeOrm {
|
|
313023
|
-
/**
|
|
313024
|
-
* database name
|
|
313025
|
-
*/
|
|
313026
|
-
database;
|
|
313027
|
-
/**
|
|
313028
|
-
* only for file base db: sqlite, sqljs
|
|
313029
|
-
*/
|
|
313030
|
-
location;
|
|
313031
|
-
synchronize;
|
|
313032
|
-
dropSchema;
|
|
313033
|
-
type;
|
|
313034
|
-
/**
|
|
313035
|
-
* Persists db on disk/local-storage if serverless db
|
|
313036
|
-
*/
|
|
313037
|
-
autoSave;
|
|
313038
|
-
/**
|
|
313039
|
-
* for websql db mode
|
|
313040
|
-
* true by default
|
|
313041
|
-
*/
|
|
313042
|
-
useLocalForage;
|
|
313043
|
-
logging;
|
|
313044
|
-
databasePort;
|
|
313045
|
-
databaseHost;
|
|
313046
|
-
databaseUsername;
|
|
313047
|
-
databasePassword;
|
|
313048
|
-
}
|
|
313049
|
-
Models2.DatabaseConfigTypeOrm = DatabaseConfigTypeOrm;
|
|
313050
|
-
class KVDatabaseConfig {
|
|
313051
|
-
static from(databasePartialConfig) {
|
|
313052
|
-
return lib_22._.merge(new KVDatabaseConfig(), databasePartialConfig);
|
|
313053
|
-
}
|
|
313054
|
-
}
|
|
313055
|
-
Models2.KVDatabaseConfig = KVDatabaseConfig;
|
|
313056
|
-
class DatabaseConfig extends DatabaseConfigTypeOrm {
|
|
313057
|
-
/**
|
|
313058
|
-
* Default value 'DROP_ALL'.
|
|
313059
|
-
*
|
|
313060
|
-
* Tell framework what is happening with db
|
|
313061
|
-
* when context is starting.
|
|
313062
|
-
*/
|
|
313063
|
-
recreateMode;
|
|
313064
|
-
static from(databasePartialConfig) {
|
|
313065
|
-
return lib_22._.merge(new DatabaseConfig(), databasePartialConfig);
|
|
313066
|
-
}
|
|
313067
|
-
get databaseConfigTypeORM() {
|
|
313068
|
-
const result2 = lib_22._.cloneDeep(this);
|
|
313069
|
-
if (result2.recreateMode) {
|
|
313070
|
-
if (result2.recreateMode === "DROP_DB__RUN_MIGRATIONS") {
|
|
313071
|
-
result2.synchronize = true;
|
|
313072
|
-
result2.dropSchema = true;
|
|
313073
|
-
} else if (result2.recreateMode === "PRESERVE_DATA__RUN_MIGRATIONS") {
|
|
313074
|
-
result2.synchronize = false;
|
|
313075
|
-
result2.dropSchema = false;
|
|
313076
|
-
}
|
|
313077
|
-
}
|
|
313078
|
-
delete result2.recreateMode;
|
|
313079
|
-
return result2;
|
|
313080
|
-
}
|
|
313081
|
-
}
|
|
313082
|
-
Models2.DatabaseConfig = DatabaseConfig;
|
|
313083
|
-
})(Models || (exports2.Models = Models = {}));
|
|
313084
|
-
}
|
|
313085
|
-
});
|
|
313086
|
-
|
|
313087
313142
|
// tnp/node_modules/taon/lib/decorators/decorator-abstract-opt.js
|
|
313088
313143
|
var require_decorator_abstract_opt = __commonJS({
|
|
313089
313144
|
"tnp/node_modules/taon/lib/decorators/decorator-abstract-opt.js"(exports2) {
|
|
@@ -313561,28 +313616,153 @@ var require_class_helpers = __commonJS({
|
|
|
313561
313616
|
}
|
|
313562
313617
|
});
|
|
313563
313618
|
|
|
313619
|
+
// tnp/node_modules/taon/lib/models.js
|
|
313620
|
+
var require_models2 = __commonJS({
|
|
313621
|
+
"tnp/node_modules/taon/lib/models.js"(exports2) {
|
|
313622
|
+
"use strict";
|
|
313623
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
313624
|
+
exports2.Models = exports2.TaonTempRoutesFolder = exports2.TaonTempDatabasesFolder = exports2.BaseTaonClassesNames = exports2.TaonRestResponseWrapper = void 0;
|
|
313625
|
+
var lib_13 = require_lib36();
|
|
313626
|
+
var lib_22 = require_lib31();
|
|
313627
|
+
var TaonRestResponseWrapper = class extends lib_13.RestResponseWrapper {
|
|
313628
|
+
};
|
|
313629
|
+
exports2.TaonRestResponseWrapper = TaonRestResponseWrapper;
|
|
313630
|
+
exports2.BaseTaonClassesNames = [
|
|
313631
|
+
"BaseCrudController",
|
|
313632
|
+
"BaseController",
|
|
313633
|
+
"BaseAbstractEntity",
|
|
313634
|
+
"BaseEntity",
|
|
313635
|
+
"BaseContext",
|
|
313636
|
+
"BaseCustomRepository",
|
|
313637
|
+
"BaseFileUploadMiddleware",
|
|
313638
|
+
"BaseMiddleware",
|
|
313639
|
+
"BaseClass",
|
|
313640
|
+
"BaseInjector",
|
|
313641
|
+
"BaseMigration",
|
|
313642
|
+
"BaseProvider",
|
|
313643
|
+
"BaseRepository",
|
|
313644
|
+
"BaseSubscriberForEntity",
|
|
313645
|
+
"BaseCliWorkerController",
|
|
313646
|
+
"PortsController",
|
|
313647
|
+
"PortsContext"
|
|
313648
|
+
];
|
|
313649
|
+
exports2.TaonTempDatabasesFolder = "databases";
|
|
313650
|
+
exports2.TaonTempRoutesFolder = "routes";
|
|
313651
|
+
var Models;
|
|
313652
|
+
(function(Models2) {
|
|
313653
|
+
Models2.DatabasesFolder = exports2.TaonTempDatabasesFolder;
|
|
313654
|
+
let ClassType;
|
|
313655
|
+
(function(ClassType2) {
|
|
313656
|
+
ClassType2["ENTITY"] = "ENTITY";
|
|
313657
|
+
ClassType2["CONTROLLER"] = "CONTROLLER";
|
|
313658
|
+
ClassType2["REPOSITORY"] = "REPOSITORY";
|
|
313659
|
+
ClassType2["PROVIDER"] = "PROVIDER";
|
|
313660
|
+
ClassType2["SUBSCRIBER"] = "SUBSCRIBER";
|
|
313661
|
+
ClassType2["MIGRATION"] = "MIGRATION";
|
|
313662
|
+
ClassType2["MIDDLEWARE"] = "MIDDLEWARE";
|
|
313663
|
+
})(ClassType = Models2.ClassType || (Models2.ClassType = {}));
|
|
313664
|
+
Models2.ClassTypeKey = {
|
|
313665
|
+
[ClassType.ENTITY]: "entities",
|
|
313666
|
+
[ClassType.CONTROLLER]: "controllers",
|
|
313667
|
+
[ClassType.REPOSITORY]: "repositories",
|
|
313668
|
+
[ClassType.PROVIDER]: "providers",
|
|
313669
|
+
[ClassType.SUBSCRIBER]: "subscribers",
|
|
313670
|
+
[ClassType.MIGRATION]: "migrations",
|
|
313671
|
+
[ClassType.MIDDLEWARE]: "middlewares"
|
|
313672
|
+
};
|
|
313673
|
+
let DBRecreateMode;
|
|
313674
|
+
(function(DBRecreateMode2) {
|
|
313675
|
+
DBRecreateMode2["DROP_DB_MIGRATIONS"] = "DROP_DB__RUN_MIGRATIONS";
|
|
313676
|
+
DBRecreateMode2["PRESERVE_DATA_MIGRATIONS"] = "PRESERVE_DATA__RUN_MIGRATIONS";
|
|
313677
|
+
})(DBRecreateMode = Models2.DBRecreateMode || (Models2.DBRecreateMode = {}));
|
|
313678
|
+
class DatabaseConfigTypeOrm {
|
|
313679
|
+
/**
|
|
313680
|
+
* database name
|
|
313681
|
+
*/
|
|
313682
|
+
database;
|
|
313683
|
+
/**
|
|
313684
|
+
* only for file base db: sqlite, sqljs
|
|
313685
|
+
*/
|
|
313686
|
+
location;
|
|
313687
|
+
synchronize;
|
|
313688
|
+
dropSchema;
|
|
313689
|
+
type;
|
|
313690
|
+
/**
|
|
313691
|
+
* Persists db on disk/local-storage if serverless db
|
|
313692
|
+
*/
|
|
313693
|
+
autoSave;
|
|
313694
|
+
/**
|
|
313695
|
+
* for websql db mode
|
|
313696
|
+
* true by default
|
|
313697
|
+
*/
|
|
313698
|
+
useLocalForage;
|
|
313699
|
+
logging;
|
|
313700
|
+
databasePort;
|
|
313701
|
+
databaseHost;
|
|
313702
|
+
databaseUsername;
|
|
313703
|
+
databasePassword;
|
|
313704
|
+
}
|
|
313705
|
+
Models2.DatabaseConfigTypeOrm = DatabaseConfigTypeOrm;
|
|
313706
|
+
class KVDatabaseConfig {
|
|
313707
|
+
static from(databasePartialConfig) {
|
|
313708
|
+
return lib_22._.merge(new KVDatabaseConfig(), databasePartialConfig);
|
|
313709
|
+
}
|
|
313710
|
+
}
|
|
313711
|
+
Models2.KVDatabaseConfig = KVDatabaseConfig;
|
|
313712
|
+
class DatabaseConfig extends DatabaseConfigTypeOrm {
|
|
313713
|
+
/**
|
|
313714
|
+
* Default value 'DROP_ALL'.
|
|
313715
|
+
*
|
|
313716
|
+
* Tell framework what is happening with db
|
|
313717
|
+
* when context is starting.
|
|
313718
|
+
*/
|
|
313719
|
+
recreateMode;
|
|
313720
|
+
static from(databasePartialConfig) {
|
|
313721
|
+
return lib_22._.merge(new DatabaseConfig(), databasePartialConfig);
|
|
313722
|
+
}
|
|
313723
|
+
get databaseConfigTypeORM() {
|
|
313724
|
+
const result2 = lib_22._.cloneDeep(this);
|
|
313725
|
+
if (result2.recreateMode) {
|
|
313726
|
+
if (result2.recreateMode === "DROP_DB__RUN_MIGRATIONS") {
|
|
313727
|
+
result2.synchronize = true;
|
|
313728
|
+
result2.dropSchema = true;
|
|
313729
|
+
} else if (result2.recreateMode === "PRESERVE_DATA__RUN_MIGRATIONS") {
|
|
313730
|
+
result2.synchronize = false;
|
|
313731
|
+
result2.dropSchema = false;
|
|
313732
|
+
}
|
|
313733
|
+
}
|
|
313734
|
+
delete result2.recreateMode;
|
|
313735
|
+
return result2;
|
|
313736
|
+
}
|
|
313737
|
+
}
|
|
313738
|
+
Models2.DatabaseConfig = DatabaseConfig;
|
|
313739
|
+
})(Models || (exports2.Models = Models = {}));
|
|
313740
|
+
}
|
|
313741
|
+
});
|
|
313742
|
+
|
|
313564
313743
|
// tnp/node_modules/taon/lib/context-db-migrations.js
|
|
313565
313744
|
var require_context_db_migrations = __commonJS({
|
|
313566
313745
|
"tnp/node_modules/taon/lib/context-db-migrations.js"(exports2) {
|
|
313567
313746
|
"use strict";
|
|
313568
313747
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
313569
313748
|
exports2.ContextDbMigrations = void 0;
|
|
313570
|
-
var lib_13 =
|
|
313571
|
-
var
|
|
313749
|
+
var lib_13 = require_lib40();
|
|
313750
|
+
var lib_22 = require_lib31();
|
|
313751
|
+
var constants_12 = require_constants15();
|
|
313572
313752
|
var class_helpers_1 = require_class_helpers();
|
|
313573
|
-
var
|
|
313753
|
+
var models_1 = require_models2();
|
|
313574
313754
|
var ContextDbMigrations = class {
|
|
313575
313755
|
ctx;
|
|
313576
313756
|
//#region fields
|
|
313577
313757
|
//#region fields / migration table name
|
|
313578
|
-
DEFAULT_MIGRATION_TABLE_NAME =
|
|
313758
|
+
DEFAULT_MIGRATION_TABLE_NAME = constants_12.TAON_MIGRATION_META_TABLE_NAME;
|
|
313579
313759
|
//#endregion
|
|
313580
313760
|
//#region fields / migration statuses
|
|
313581
313761
|
MIGRATION_STATUS_COMPLETED = "completed";
|
|
313582
313762
|
MIGRATION_STATUS_PENDING = "pending";
|
|
313583
313763
|
//#endregion
|
|
313584
313764
|
//#region fields / migration table schema
|
|
313585
|
-
table = new
|
|
313765
|
+
table = new lib_13.Table({
|
|
313586
313766
|
name: this.DEFAULT_MIGRATION_TABLE_NAME,
|
|
313587
313767
|
columns: [
|
|
313588
313768
|
{
|
|
@@ -313658,7 +313838,7 @@ var require_context_db_migrations = __commonJS({
|
|
|
313658
313838
|
}
|
|
313659
313839
|
try {
|
|
313660
313840
|
await queryRunner.createTable(this.table);
|
|
313661
|
-
await queryRunner.createIndex(this.DEFAULT_MIGRATION_TABLE_NAME, new
|
|
313841
|
+
await queryRunner.createIndex(this.DEFAULT_MIGRATION_TABLE_NAME, new lib_13.TableIndex({
|
|
313662
313842
|
name: "IDX_NAME",
|
|
313663
313843
|
columnNames: ["name"]
|
|
313664
313844
|
}));
|
|
@@ -313679,12 +313859,12 @@ var require_context_db_migrations = __commonJS({
|
|
|
313679
313859
|
if (this.ctx.isRemoteHost || !this.ctx.connection) {
|
|
313680
313860
|
return;
|
|
313681
313861
|
}
|
|
313682
|
-
if (!
|
|
313683
|
-
|
|
313862
|
+
if (!lib_22.UtilsMigrations.isValidTimestamp(timestamp)) {
|
|
313863
|
+
lib_22.Helpers.throwError(`Invalid timestamp provided for migration revert: ${timestamp}`);
|
|
313684
313864
|
}
|
|
313685
313865
|
const migrationsClassFns = this.ctx.getClassFunByArr(models_1.Models.ClassType.MIGRATION).reverse();
|
|
313686
313866
|
const migrationClassesInstancesToRevert = migrationsClassFns.map((classFn) => {
|
|
313687
|
-
const timestampFromClassName = Number(
|
|
313867
|
+
const timestampFromClassName = Number(lib_22.UtilsMigrations.getTimestampFromClassName(class_helpers_1.ClassHelpers.getName(classFn)));
|
|
313688
313868
|
if (timestampFromClassName <= timestamp) {
|
|
313689
313869
|
return null;
|
|
313690
313870
|
}
|
|
@@ -313966,7 +314146,7 @@ var require_entity_process = __commonJS({
|
|
|
313966
314146
|
response;
|
|
313967
314147
|
//#region fields
|
|
313968
314148
|
/**
|
|
313969
|
-
* Data to send
|
|
314149
|
+
* Data to send.
|
|
313970
314150
|
*/
|
|
313971
314151
|
data;
|
|
313972
314152
|
/**
|
|
@@ -313984,10 +314164,10 @@ var require_entity_process = __commonJS({
|
|
|
313984
314164
|
async run(resultFromControllerMethod) {
|
|
313985
314165
|
let advancedManipulation = false;
|
|
313986
314166
|
if (lib_32._.isFunction(resultFromControllerMethod)) {
|
|
313987
|
-
advancedManipulation = true;
|
|
313988
314167
|
const resultFn = resultFromControllerMethod;
|
|
313989
314168
|
await resultFn({
|
|
313990
314169
|
circResponse: (circData) => {
|
|
314170
|
+
advancedManipulation = true;
|
|
313991
314171
|
this.responseHandled = true;
|
|
313992
314172
|
const { circs, data } = (0, entity_process_helpers_1.applayTransformFn)(circData);
|
|
313993
314173
|
this.data = data;
|
|
@@ -313996,9 +314176,9 @@ var require_entity_process = __commonJS({
|
|
|
313996
314176
|
}
|
|
313997
314177
|
this.send(advancedManipulation);
|
|
313998
314178
|
},
|
|
313999
|
-
streamResponse: (
|
|
314179
|
+
streamResponse: async (options2) => {
|
|
314000
314180
|
this.responseHandled = true;
|
|
314001
|
-
this.streamResponse(
|
|
314181
|
+
await this.streamResponse(options2);
|
|
314002
314182
|
}
|
|
314003
314183
|
});
|
|
314004
314184
|
return;
|
|
@@ -314011,15 +314191,97 @@ var require_entity_process = __commonJS({
|
|
|
314011
314191
|
}
|
|
314012
314192
|
//#endregion
|
|
314013
314193
|
//#region stream response
|
|
314014
|
-
streamResponse(
|
|
314015
|
-
stream
|
|
314194
|
+
async streamResponse(options2) {
|
|
314195
|
+
const { stream, statusCode = 200, contentType = "application/octet-stream", filename, disposition = filename ? "attachment" : void 0, contentLength, headers = {} } = options2;
|
|
314196
|
+
if (this.response.headersSent) {
|
|
314197
|
+
throw new Error("[taon] Cannot start stream response - response headers were already sent.");
|
|
314198
|
+
}
|
|
314199
|
+
this.response.status(statusCode);
|
|
314200
|
+
this.response.setHeader("Content-Type", contentType);
|
|
314201
|
+
if (!lib_32._.isNil(contentLength)) {
|
|
314202
|
+
this.response.setHeader("Content-Length", String(contentLength));
|
|
314203
|
+
}
|
|
314204
|
+
if (disposition) {
|
|
314205
|
+
const value = filename ? `${disposition}; filename="${this.escapeHeaderFilename(filename)}"` : disposition;
|
|
314206
|
+
this.response.setHeader("Content-Disposition", value);
|
|
314207
|
+
}
|
|
314208
|
+
for (const [headerName, headerValue] of Object.entries(headers)) {
|
|
314209
|
+
this.response.setHeader(headerName, headerValue);
|
|
314210
|
+
}
|
|
314211
|
+
const reader = stream.getReader();
|
|
314212
|
+
let clientDisconnected = false;
|
|
314213
|
+
let streamCompleted = false;
|
|
314214
|
+
const onResponseClose = () => {
|
|
314215
|
+
if (!streamCompleted) {
|
|
314216
|
+
clientDisconnected = true;
|
|
314217
|
+
void reader.cancel(new Error("[taon] HTTP client disconnected during stream response."));
|
|
314218
|
+
}
|
|
314219
|
+
};
|
|
314220
|
+
this.response.once("close", onResponseClose);
|
|
314221
|
+
try {
|
|
314222
|
+
while (true) {
|
|
314223
|
+
const { done, value } = await reader.read();
|
|
314224
|
+
if (done) {
|
|
314225
|
+
streamCompleted = true;
|
|
314226
|
+
break;
|
|
314227
|
+
}
|
|
314228
|
+
if (clientDisconnected || this.response.destroyed) {
|
|
314229
|
+
break;
|
|
314230
|
+
}
|
|
314231
|
+
if (!value || value.byteLength === 0) {
|
|
314232
|
+
continue;
|
|
314233
|
+
}
|
|
314234
|
+
const canContinue = this.response.write(Buffer.from(value));
|
|
314235
|
+
if (!canContinue) {
|
|
314236
|
+
await this.waitForDrainOrClose();
|
|
314237
|
+
}
|
|
314238
|
+
}
|
|
314239
|
+
if (streamCompleted && !clientDisconnected && !this.response.destroyed && !this.response.writableEnded) {
|
|
314240
|
+
this.response.end();
|
|
314241
|
+
}
|
|
314242
|
+
} catch (error2) {
|
|
314243
|
+
if (clientDisconnected || this.response.destroyed) {
|
|
314244
|
+
return;
|
|
314245
|
+
}
|
|
314016
314246
|
if (!this.response.headersSent) {
|
|
314017
314247
|
this.response.status(500).end();
|
|
314018
314248
|
return;
|
|
314019
314249
|
}
|
|
314020
|
-
this.response.destroy(error2);
|
|
314250
|
+
this.response.destroy(error2 instanceof Error ? error2 : new Error(`[taon] Stream response failed: ${String(error2)}`));
|
|
314251
|
+
} finally {
|
|
314252
|
+
this.response.off("close", onResponseClose);
|
|
314253
|
+
try {
|
|
314254
|
+
reader.releaseLock();
|
|
314255
|
+
} catch {
|
|
314256
|
+
}
|
|
314257
|
+
}
|
|
314258
|
+
}
|
|
314259
|
+
waitForDrainOrClose() {
|
|
314260
|
+
return new Promise((resolve, reject2) => {
|
|
314261
|
+
const onDrain = () => {
|
|
314262
|
+
cleanup();
|
|
314263
|
+
resolve();
|
|
314264
|
+
};
|
|
314265
|
+
const onClose = () => {
|
|
314266
|
+
cleanup();
|
|
314267
|
+
resolve();
|
|
314268
|
+
};
|
|
314269
|
+
const onError = (error2) => {
|
|
314270
|
+
cleanup();
|
|
314271
|
+
reject2(error2);
|
|
314272
|
+
};
|
|
314273
|
+
const cleanup = () => {
|
|
314274
|
+
this.response.off("drain", onDrain);
|
|
314275
|
+
this.response.off("close", onClose);
|
|
314276
|
+
this.response.off("error", onError);
|
|
314277
|
+
};
|
|
314278
|
+
this.response.once("drain", onDrain);
|
|
314279
|
+
this.response.once("close", onClose);
|
|
314280
|
+
this.response.once("error", onError);
|
|
314021
314281
|
});
|
|
314022
|
-
|
|
314282
|
+
}
|
|
314283
|
+
escapeHeaderFilename(filename) {
|
|
314284
|
+
return filename.replace(/[\r\n]/g, "").replace(/\\/g, "_").replace(/"/g, "'");
|
|
314023
314285
|
}
|
|
314024
314286
|
//#endregion
|
|
314025
314287
|
//#region set headers
|
|
@@ -317978,7 +318240,6 @@ var require_taon_helpers = __commonJS({
|
|
|
317978
318240
|
"use strict";
|
|
317979
318241
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
317980
318242
|
exports2.TaonHelpers = void 0;
|
|
317981
|
-
var JSON52 = require_lib17();
|
|
317982
318243
|
var lib_13 = require_lib31();
|
|
317983
318244
|
var class_helpers_1 = require_class_helpers();
|
|
317984
318245
|
var TaonHelpers;
|
|
@@ -318013,7 +318274,7 @@ var require_taon_helpers = __commonJS({
|
|
|
318013
318274
|
return false;
|
|
318014
318275
|
}
|
|
318015
318276
|
try {
|
|
318016
|
-
const t =
|
|
318277
|
+
const t = JSON.parse(param);
|
|
318017
318278
|
return t;
|
|
318018
318279
|
} catch (e) {
|
|
318019
318280
|
return param;
|
|
@@ -344610,6 +344871,18 @@ var require_endpoint_context = __commonJS({
|
|
|
344610
344871
|
this.onlyMigrationRun = initOptions.onlyMigrationRun;
|
|
344611
344872
|
this.onlyMigrationRevertToTimestamp = initOptions.onlyMigrationRevertToTimestamp;
|
|
344612
344873
|
this.config = this.configFn({});
|
|
344874
|
+
if (lib_122.UtilsOs.isRunningInCloudflareWorker() && !initOptions.initFromRecrusiveContextResovle) {
|
|
344875
|
+
const TAON_WORKER_INSTANCE_ID = crypto.randomUUID();
|
|
344876
|
+
console.log(`
|
|
344877
|
+
|
|
344878
|
+
[WORKER START] instance=${TAON_WORKER_INSTANCE_ID}
|
|
344879
|
+
frontendHost: ${this.config.frontendHost}
|
|
344880
|
+
frontendHostPortNumber: ${this.config.frontendHostPortNumber}
|
|
344881
|
+
host: ${this.config.host}
|
|
344882
|
+
hostPortNumber: ${this.config.hostPortNumber}
|
|
344883
|
+
|
|
344884
|
+
`);
|
|
344885
|
+
}
|
|
344613
344886
|
this.useSession = lib_14._.isBoolean(this.config.useSession) ? this.config.useSession : true;
|
|
344614
344887
|
if (lib_14._.isBoolean(this.cloneOptions.overrideUseSession)) {
|
|
344615
344888
|
this.useSession = this.cloneOptions.overrideUseSession;
|
|
@@ -345811,9 +346084,10 @@ var require_endpoint_context = __commonJS({
|
|
|
345811
346084
|
};
|
|
345812
346085
|
methodConfig.calculatedMiddlewares = Object.values(methodConfig.calculatedMiddlewaresMethodObj || {});
|
|
345813
346086
|
const httpMethodType = methodConfig.type;
|
|
345814
|
-
const
|
|
345815
|
-
const
|
|
346087
|
+
const expressPath = this.getExpressPath(classConfig, methodConfig);
|
|
346088
|
+
const controllerInstance = this.getInstanceBy(controllerClassFn);
|
|
345816
346089
|
if (lib_122.UtilsOs.isNode || lib_122.UtilsOs.isWebSQL) {
|
|
346090
|
+
controllerInstance.__config__ = classConfig;
|
|
345817
346091
|
const route = this.initServer(httpMethodType, methodConfig, classConfig, expressPath, controllerClassFn, intOpt.overrideExpressApp);
|
|
345818
346092
|
this.activeRoutes.push({
|
|
345819
346093
|
expressPath: route.expressPath,
|
|
@@ -345822,6 +346096,7 @@ var require_endpoint_context = __commonJS({
|
|
|
345822
346096
|
}
|
|
345823
346097
|
const shouldInitClient = lib_122.UtilsOs.isBrowser || this.isRemoteHost || lib_122.UtilsOs.isWebSQL;
|
|
345824
346098
|
if (shouldInitClient) {
|
|
346099
|
+
controllerInstance.__config__ = classConfig;
|
|
345825
346100
|
this.initClient(controllerClassFn, httpMethodType, methodConfig, expressPath);
|
|
345826
346101
|
}
|
|
345827
346102
|
}
|
|
@@ -345831,6 +346106,13 @@ var require_endpoint_context = __commonJS({
|
|
|
345831
346106
|
}
|
|
345832
346107
|
}
|
|
345833
346108
|
//#endregion
|
|
346109
|
+
//#region methods & getters / get express path
|
|
346110
|
+
getExpressPath(classConfig, methodConfig) {
|
|
346111
|
+
const globalPathPart = this.isRunningInsideDocker || !this.frontendHostUri?.origin?.includes("localhost") ? `${this.uriPathnameOrNothingIfRoot.replace(/\/$/, "")}/${constants_12.apiPrefix}/${this.contextName}`.replace(/\/\//, "/") : "";
|
|
346112
|
+
const expressPath = methodConfig.global ? `${globalPathPart}/${methodConfig.path?.replace(/\/$/, "")}`.replace(/\/\//, "/") : taon_helpers_1.TaonHelpers.getExpressPath(classConfig, methodConfig);
|
|
346113
|
+
return expressPath;
|
|
346114
|
+
}
|
|
346115
|
+
//#endregion
|
|
345834
346116
|
//#region methods & getters / write active routes
|
|
345835
346117
|
writeActiveRoutes() {
|
|
345836
346118
|
if (this.isRemoteHost || this.isRunOrRevertOnlyMigrationAppStart) {
|
|
@@ -345928,7 +346210,11 @@ var require_endpoint_context = __commonJS({
|
|
|
345928
346210
|
res.send(`Hello, world from context ${this.contextName}`);
|
|
345929
346211
|
});
|
|
345930
346212
|
app.use(bodyParser.urlencoded({ extended: true }));
|
|
345931
|
-
app.use(bodyParser.json(
|
|
346213
|
+
app.use(bodyParser.json({
|
|
346214
|
+
verify: (req, _res, body) => {
|
|
346215
|
+
req.rawBody = body;
|
|
346216
|
+
}
|
|
346217
|
+
}));
|
|
345932
346218
|
app.use(methodOverride());
|
|
345933
346219
|
app.use(cookieParser());
|
|
345934
346220
|
if (this.useSession) {
|
|
@@ -346025,7 +346311,7 @@ var require_endpoint_context = __commonJS({
|
|
|
346025
346311
|
const ipcKeyName = taon_helpers_1.TaonHelpers.ipcKeyNameRequest(target, methodConfig, expressPath);
|
|
346026
346312
|
const electron = require("electron");
|
|
346027
346313
|
electron.ipcMain.on(ipcKeyName, async (event, paramsFromBrowser) => {
|
|
346028
|
-
const responseJsonData = await getResult(paramsFromBrowser, void 0, void 0, { t });
|
|
346314
|
+
const responseJsonData = await getResult(paramsFromBrowser, void 0, void 0, { t, expressPath });
|
|
346029
346315
|
const sendToIpsMainOn = taon_helpers_1.TaonHelpers.ipcKeyNameResponse(target, methodConfig, expressPath);
|
|
346030
346316
|
event.sender.send(sendToIpsMainOn, responseJsonData);
|
|
346031
346317
|
});
|
|
@@ -346080,15 +346366,41 @@ var require_endpoint_context = __commonJS({
|
|
|
346080
346366
|
if (bodyParamsToProcess.length > 0) {
|
|
346081
346367
|
const isUsingWholeBody = !lib_14._.isUndefined(bodyParamsToProcess.find((c) => !c.paramName));
|
|
346082
346368
|
if (isUsingWholeBody && bodyParamsToProcess.length > 1) {
|
|
346083
|
-
|
|
346369
|
+
const notEmpty = bodyParamsToProcess.filter((f) => !!f.paramName).map((c) => `@Body('${c.paramName}') ${c.paramName}`).join(", ");
|
|
346370
|
+
throw new Error(`
|
|
346371
|
+
|
|
346372
|
+
You are using more than ONE body param @Body() without name.
|
|
346373
|
+
|
|
346374
|
+
Or
|
|
346375
|
+
|
|
346376
|
+
your are overriding method with wrong params (like below)
|
|
346377
|
+
|
|
346378
|
+
class ParentClass {
|
|
346379
|
+
...
|
|
346380
|
+
@${methodConfig.type?.toUpperCase()}()
|
|
346381
|
+
${methodConfig.methodName}(@Body()) {
|
|
346382
|
+
// parent method
|
|
346383
|
+
}
|
|
346384
|
+
...
|
|
346385
|
+
}
|
|
346386
|
+
|
|
346387
|
+
class ${classConfig.className} extends AnyParentClass {
|
|
346388
|
+
...
|
|
346389
|
+
@${methodConfig.type?.toUpperCase()}()
|
|
346390
|
+
${methodConfig.methodName}(${notEmpty}) { // ERROR
|
|
346391
|
+
// your overrided method
|
|
346392
|
+
}
|
|
346393
|
+
...
|
|
346394
|
+
}
|
|
346395
|
+
`);
|
|
346084
346396
|
}
|
|
346085
346397
|
if (isUsingWholeBody) {
|
|
346086
346398
|
try {
|
|
346087
|
-
const mappinForEntityBody = JSON.parse(taon_helpers_1.TaonHelpers.firstStringOrElemFromArray(req.headers[symbols_1.Symbols.old.MAPPING_CONFIG_HEADER_BODY_PARAMS]));
|
|
346399
|
+
const mappinForEntityBody = JSON.parse(taon_helpers_1.TaonHelpers.firstStringOrElemFromArray(req.headers[symbols_1.Symbols.old.MAPPING_CONFIG_HEADER_BODY_PARAMS]) ?? "{}");
|
|
346088
346400
|
tBody = (0, lib_32.encodeMapping)(tBody, mappinForEntityBody);
|
|
346089
346401
|
if (req.headers[symbols_1.Symbols.old.CIRCURAL_OBJECTS_MAP_BODY_PARAM]) {
|
|
346090
346402
|
try {
|
|
346091
|
-
const circs = JSON.parse(taon_helpers_1.TaonHelpers.firstStringOrElemFromArray(req.headers[symbols_1.Symbols.old.CIRCURAL_OBJECTS_MAP_BODY_PARAM]));
|
|
346403
|
+
const circs = JSON.parse(taon_helpers_1.TaonHelpers.firstStringOrElemFromArray(req.headers[symbols_1.Symbols.old.CIRCURAL_OBJECTS_MAP_BODY_PARAM]) ?? "{}");
|
|
346092
346404
|
tBody = lib_13.JSON10.applyCircularMapping(tBody, circs);
|
|
346093
346405
|
} catch (e) {
|
|
346094
346406
|
console.error(e);
|
|
@@ -346101,7 +346413,7 @@ var require_endpoint_context = __commonJS({
|
|
|
346101
346413
|
for (const bodyParamToProcess of bodyParamsToProcess) {
|
|
346102
346414
|
try {
|
|
346103
346415
|
const paramName = bodyParamToProcess.paramName;
|
|
346104
|
-
const mappingForEntityBodyForParam = JSON.parse(taon_helpers_1.TaonHelpers.firstStringOrElemFromArray(req.headers[`${symbols_1.Symbols.old.MAPPING_CONFIG_HEADER_BODY_PARAMS}${paramName.toLowerCase()}`]));
|
|
346416
|
+
const mappingForEntityBodyForParam = JSON.parse(taon_helpers_1.TaonHelpers.firstStringOrElemFromArray(req.headers[`${symbols_1.Symbols.old.MAPPING_CONFIG_HEADER_BODY_PARAMS}${paramName.toLowerCase()}`]) ?? "{}");
|
|
346105
346417
|
tBody[paramName] = (0, lib_32.encodeMapping)(tBody[paramName], mappingForEntityBodyForParam);
|
|
346106
346418
|
} catch (e) {
|
|
346107
346419
|
console.error(e);
|
|
@@ -346117,11 +346429,11 @@ var require_endpoint_context = __commonJS({
|
|
|
346117
346429
|
}
|
|
346118
346430
|
if (isUsingWholeQueryParamBody) {
|
|
346119
346431
|
try {
|
|
346120
|
-
const entity = JSON.parse(taon_helpers_1.TaonHelpers.firstStringOrElemFromArray(req.headers[symbols_1.Symbols.old.MAPPING_CONFIG_HEADER_QUERY_PARAMS]));
|
|
346432
|
+
const entity = JSON.parse(taon_helpers_1.TaonHelpers.firstStringOrElemFromArray(req.headers[symbols_1.Symbols.old.MAPPING_CONFIG_HEADER_QUERY_PARAMS]) ?? "{}");
|
|
346121
346433
|
tQuery = taon_helpers_1.TaonHelpers.parseJSONwithStringJSONs((0, lib_32.encodeMapping)(tQuery, entity));
|
|
346122
346434
|
if (req.headers[symbols_1.Symbols.old.CIRCURAL_OBJECTS_MAP_QUERY_PARAM]) {
|
|
346123
346435
|
try {
|
|
346124
|
-
const circs = JSON.parse(taon_helpers_1.TaonHelpers.firstStringOrElemFromArray(req.headers[symbols_1.Symbols.old.CIRCURAL_OBJECTS_MAP_QUERY_PARAM]));
|
|
346436
|
+
const circs = JSON.parse(taon_helpers_1.TaonHelpers.firstStringOrElemFromArray(req.headers[symbols_1.Symbols.old.CIRCURAL_OBJECTS_MAP_QUERY_PARAM]) ?? "{}");
|
|
346125
346437
|
tQuery = lib_13.JSON10.applyCircularMapping(tQuery, circs);
|
|
346126
346438
|
} catch (e) {
|
|
346127
346439
|
console.error(e);
|
|
@@ -346134,7 +346446,7 @@ var require_endpoint_context = __commonJS({
|
|
|
346134
346446
|
for (const queryParm of queryParamsToProcess) {
|
|
346135
346447
|
try {
|
|
346136
346448
|
const queryParamName = queryParm.paramName;
|
|
346137
|
-
const entityForParam = JSON.parse(taon_helpers_1.TaonHelpers.firstStringOrElemFromArray(req.headers[`${symbols_1.Symbols.old.MAPPING_CONFIG_HEADER_QUERY_PARAMS}${queryParamName.toLowerCase()}`]));
|
|
346449
|
+
const entityForParam = JSON.parse(taon_helpers_1.TaonHelpers.firstStringOrElemFromArray(req.headers[`${symbols_1.Symbols.old.MAPPING_CONFIG_HEADER_QUERY_PARAMS}${queryParamName.toLowerCase()}`]) ?? "{}");
|
|
346138
346450
|
let beforeTransofrm = tQuery[queryParamName];
|
|
346139
346451
|
if (lib_14._.isString(beforeTransofrm)) {
|
|
346140
346452
|
try {
|
|
@@ -346180,7 +346492,7 @@ var require_endpoint_context = __commonJS({
|
|
|
346180
346492
|
});
|
|
346181
346493
|
const resolvedParams = args.reverse().map((v) => taon_helpers_1.TaonHelpers.tryTransformParam(v));
|
|
346182
346494
|
try {
|
|
346183
|
-
const resultFromCtrlExec = await getResult(resolvedParams, req, res, { bodyFormDataFiles, t });
|
|
346495
|
+
const resultFromCtrlExec = await getResult(resolvedParams, req, res, { bodyFormDataFiles, t, expressPath });
|
|
346184
346496
|
if (res.headersSent) {
|
|
346185
346497
|
return;
|
|
346186
346498
|
}
|
|
@@ -356475,70 +356787,118 @@ var require_base_repository = __commonJS({
|
|
|
356475
356787
|
return this.repo.insert(entity);
|
|
356476
356788
|
}
|
|
356477
356789
|
//#endregion
|
|
356478
|
-
//#region crud operations / typeorm / update
|
|
356479
|
-
|
|
356790
|
+
//#region crud operations / typeorm / update
|
|
356791
|
+
/**
|
|
356792
|
+
* Updates entity/entities partially.
|
|
356793
|
+
*
|
|
356794
|
+
* This follows native TypeORM update semantics:
|
|
356795
|
+
* - executes a direct UPDATE query
|
|
356796
|
+
* - does not handle cascades or relations
|
|
356797
|
+
* - does not reload or return the updated entity
|
|
356798
|
+
*/
|
|
356799
|
+
update(criteria, partialEntity) {
|
|
356800
|
+
return this.repo.update(criteria, partialEntity);
|
|
356801
|
+
}
|
|
356802
|
+
//#endregion
|
|
356803
|
+
//#region crud operations / typeorm / update
|
|
356804
|
+
/**
|
|
356805
|
+
* Updates entity partially by id.
|
|
356806
|
+
*
|
|
356807
|
+
* Convenience wrapper around update().
|
|
356808
|
+
* Uses native TypeORM update semantics.
|
|
356809
|
+
*/
|
|
356810
|
+
/**
|
|
356811
|
+
* Updates an entity by id and returns the updated entity.
|
|
356812
|
+
*/
|
|
356813
|
+
async updateById(id, partialEntity, options2) {
|
|
356814
|
+
const entity = await this.repo.preload({
|
|
356815
|
+
id,
|
|
356816
|
+
...partialEntity
|
|
356817
|
+
});
|
|
356818
|
+
if (!entity) {
|
|
356819
|
+
throw new Error(`Entity with id "${id}" not found.`);
|
|
356820
|
+
}
|
|
356821
|
+
await this.repo.save(entity);
|
|
356822
|
+
return this.repo.findOne({
|
|
356823
|
+
where: { id },
|
|
356824
|
+
relations: options2?.relations
|
|
356825
|
+
});
|
|
356826
|
+
}
|
|
356827
|
+
//#endregion
|
|
356828
|
+
//#region crud operations / shallow update
|
|
356829
|
+
shallowUpdateAllowedColumnTypes = [
|
|
356830
|
+
"simple-json",
|
|
356831
|
+
"simple-array",
|
|
356832
|
+
"json"
|
|
356833
|
+
];
|
|
356834
|
+
/**
|
|
356835
|
+
* Taon helper for updating simple entity columns without relations.
|
|
356836
|
+
*
|
|
356837
|
+
* Object values are ignored unless the corresponding database column
|
|
356838
|
+
* explicitly supports them (for example JSON/simple-json/simple-array).
|
|
356839
|
+
*
|
|
356840
|
+
* The entity is reloaded and returned after the update.
|
|
356841
|
+
*/
|
|
356842
|
+
async shallowUpdate(item) {
|
|
356480
356843
|
const { id } = item;
|
|
356481
|
-
return
|
|
356844
|
+
return this.shallowUpdateById(id, item);
|
|
356482
356845
|
}
|
|
356483
|
-
|
|
356484
|
-
|
|
356485
|
-
|
|
356846
|
+
/**
|
|
356847
|
+
* Taon helper for updating simple entity columns without relations.
|
|
356848
|
+
*
|
|
356849
|
+
* Only properties mapped to own database columns are considered.
|
|
356850
|
+
* Primary/index keys listed in INDEX_KEYS_NO_FOR_UPDATE are ignored.
|
|
356851
|
+
*
|
|
356852
|
+
* The entity is reloaded and returned after the update.
|
|
356853
|
+
*/
|
|
356854
|
+
async shallowUpdateById(id, item) {
|
|
356855
|
+
const partialEntity = {};
|
|
356486
356856
|
for (const key in item) {
|
|
356487
|
-
|
|
356488
|
-
|
|
356489
|
-
allowedPropsToUpdate.push(key);
|
|
356857
|
+
if (!Object.prototype.hasOwnProperty.call(item, key)) {
|
|
356858
|
+
continue;
|
|
356490
356859
|
}
|
|
356491
|
-
|
|
356492
|
-
|
|
356493
|
-
|
|
356494
|
-
|
|
356495
|
-
|
|
356496
|
-
|
|
356497
|
-
id
|
|
356498
|
-
}, {
|
|
356499
|
-
[key]: toSet
|
|
356500
|
-
});
|
|
356860
|
+
if (INDEX_KEYS_NO_FOR_UPDATE.includes(key.toLowerCase())) {
|
|
356861
|
+
continue;
|
|
356862
|
+
}
|
|
356863
|
+
const metadataColumn = this.repo.metadata.ownColumns.find((column) => column.propertyName === key);
|
|
356864
|
+
if (!metadataColumn) {
|
|
356865
|
+
continue;
|
|
356501
356866
|
}
|
|
356867
|
+
const value = item[key];
|
|
356868
|
+
if (value !== null && typeof value === "object" && !this.shallowUpdateAllowedColumnTypes.includes(metadataColumn.type)) {
|
|
356869
|
+
continue;
|
|
356870
|
+
}
|
|
356871
|
+
partialEntity[key] = value;
|
|
356872
|
+
}
|
|
356873
|
+
if (Object.keys(partialEntity).length > 0) {
|
|
356874
|
+
await this.repo.update({ id }, partialEntity);
|
|
356502
356875
|
}
|
|
356503
|
-
|
|
356876
|
+
const model = await this.repo.findOne({
|
|
356504
356877
|
where: { id }
|
|
356505
356878
|
});
|
|
356506
356879
|
return model;
|
|
356507
356880
|
}
|
|
356508
|
-
|
|
356881
|
+
/**
|
|
356882
|
+
* Buld update the same items
|
|
356883
|
+
*/
|
|
356884
|
+
async bulkUpdate(items, options2) {
|
|
356509
356885
|
const models = [];
|
|
356510
356886
|
for (let index = 0; index < items.length; index++) {
|
|
356511
356887
|
const item = items[index];
|
|
356512
356888
|
const { id } = item;
|
|
356513
|
-
const model = await this.updateById(id, item);
|
|
356889
|
+
const model = await this.updateById(id, item, options2);
|
|
356514
356890
|
models.push(model);
|
|
356515
356891
|
}
|
|
356516
356892
|
return { models };
|
|
356517
356893
|
}
|
|
356518
|
-
|
|
356519
|
-
|
|
356520
|
-
|
|
356521
|
-
|
|
356522
|
-
|
|
356523
|
-
|
|
356524
|
-
|
|
356525
|
-
|
|
356526
|
-
// update(
|
|
356527
|
-
// criteria:
|
|
356528
|
-
// | string
|
|
356529
|
-
// | string[]
|
|
356530
|
-
// | number
|
|
356531
|
-
// | number[]
|
|
356532
|
-
// | Date
|
|
356533
|
-
// | Date[]
|
|
356534
|
-
// | ObjectID
|
|
356535
|
-
// | ObjectID[]
|
|
356536
|
-
// | FindOptionsWhere<Entity>,
|
|
356537
|
-
// partialEntity: QueryDeepPartialEntity<Entity>,
|
|
356538
|
-
// ): Promise<UpdateResult> {
|
|
356539
|
-
// return this.repo.update(criteria, partialEntity);
|
|
356540
|
-
// }
|
|
356541
|
-
//#endregion
|
|
356894
|
+
async bulkShallowUpdate(items) {
|
|
356895
|
+
const models = [];
|
|
356896
|
+
for (const item of items) {
|
|
356897
|
+
const model = await this.shallowUpdate(item);
|
|
356898
|
+
models.push(model);
|
|
356899
|
+
}
|
|
356900
|
+
return models;
|
|
356901
|
+
}
|
|
356542
356902
|
//#endregion
|
|
356543
356903
|
//#region crud operations / typeorm / upsert
|
|
356544
356904
|
/**
|
|
@@ -356846,7 +357206,6 @@ var require_base_controller = __commonJS({
|
|
|
356846
357206
|
get R2() {
|
|
356847
357207
|
return this.ctx?.R2;
|
|
356848
357208
|
}
|
|
356849
|
-
//#endregion
|
|
356850
357209
|
//#region hook before each reaquest
|
|
356851
357210
|
/**
|
|
356852
357211
|
* Use this methods for find grain authentication, logs or a
|
|
@@ -356872,6 +357231,14 @@ var require_base_controller = __commonJS({
|
|
|
356872
357231
|
async afterAllCtxInited(options2) {
|
|
356873
357232
|
}
|
|
356874
357233
|
//#endregion
|
|
357234
|
+
getThisControllerMethodFullUrl(methodName) {
|
|
357235
|
+
const isLocalhost = this.ctx.frontendHostUri.origin.includes("://localhost:");
|
|
357236
|
+
const origin2 = isLocalhost ? this.ctx.uri.origin : this.ctx.frontendHostUri.origin;
|
|
357237
|
+
const classConfig = this.__config__;
|
|
357238
|
+
const methodConfig = classConfig.methods[methodName];
|
|
357239
|
+
const expressPath = this.ctx.getExpressPath(classConfig, methodConfig);
|
|
357240
|
+
return `${origin2}${expressPath}`;
|
|
357241
|
+
}
|
|
356875
357242
|
//#region wait for proper status change
|
|
356876
357243
|
// async check() {
|
|
356877
357244
|
// await this._waitForProperStatusChange({
|
|
@@ -357320,7 +357687,7 @@ var require_build_info_auto_generated = __commonJS({
|
|
|
357320
357687
|
exports2.BUILD_BASE_HREF = "";
|
|
357321
357688
|
exports2.PROJECT_NPM_NAME = "@taon-dev/i18n";
|
|
357322
357689
|
exports2.CURRENT_PACKAGE_TAON_VERSION = "v21";
|
|
357323
|
-
exports2.CURRENT_PACKAGE_VERSION = "21.0.
|
|
357690
|
+
exports2.CURRENT_PACKAGE_VERSION = "21.0.54";
|
|
357324
357691
|
}
|
|
357325
357692
|
});
|
|
357326
357693
|
|
|
@@ -357511,7 +357878,7 @@ ${text.trim()}` : text;
|
|
|
357511
357878
|
protectInterpolation(text) {
|
|
357512
357879
|
const replacements = [];
|
|
357513
357880
|
const preparedText = text.replace(/\[\[[\s\S]*?\]\]/g, (originalValue) => {
|
|
357514
|
-
const placeholder = `
|
|
357881
|
+
const placeholder = `TAONINTERPOLATION${replacements.length}PLACEHOLDER`;
|
|
357515
357882
|
replacements.push({
|
|
357516
357883
|
placeholder,
|
|
357517
357884
|
originalValue
|
|
@@ -357524,7 +357891,9 @@ ${text.trim()}` : text;
|
|
|
357524
357891
|
let result2 = translatedText;
|
|
357525
357892
|
for (const replacement of replacements) {
|
|
357526
357893
|
if (!result2.includes(replacement.placeholder)) {
|
|
357527
|
-
|
|
357894
|
+
console.error(`Translation model removed interpolation placeholder "${replacement.placeholder}" while translating "${text}". Appending "${replacement.originalValue}" manually.`);
|
|
357895
|
+
result2 = `${result2.trimEnd()} ${replacement.originalValue}`;
|
|
357896
|
+
continue;
|
|
357528
357897
|
}
|
|
357529
357898
|
result2 = result2.replaceAll(replacement.placeholder, replacement.originalValue);
|
|
357530
357899
|
}
|
|
@@ -388134,7 +388503,14 @@ var require_base_storage_backend = __commonJS({
|
|
|
388134
388503
|
//#endregion
|
|
388135
388504
|
//#region path helpers / normalize key
|
|
388136
388505
|
normalizeKey(key) {
|
|
388137
|
-
|
|
388506
|
+
const normalized = key.replace(/\\/g, "/").replace(/^\/+/, "").replace(/\/+/g, "/");
|
|
388507
|
+
if (normalized.split("/").some((part) => part === "." || part === "..")) {
|
|
388508
|
+
index_1.Taon.error({
|
|
388509
|
+
message: "Invalid storage key.",
|
|
388510
|
+
status: 400
|
|
388511
|
+
});
|
|
388512
|
+
}
|
|
388513
|
+
return normalized;
|
|
388138
388514
|
}
|
|
388139
388515
|
//#endregion
|
|
388140
388516
|
//#endregion
|
|
@@ -388167,7 +388543,7 @@ var require_base_storage_backend = __commonJS({
|
|
|
388167
388543
|
await this.uploadCloudflare(key, data, options2);
|
|
388168
388544
|
return;
|
|
388169
388545
|
}
|
|
388170
|
-
await this.uploadNode(key, data);
|
|
388546
|
+
await this.uploadNode(key, data, options2);
|
|
388171
388547
|
}
|
|
388172
388548
|
//#endregion
|
|
388173
388549
|
//#region methods / uplaod cloudflare
|
|
@@ -388188,28 +388564,27 @@ var require_base_storage_backend = __commonJS({
|
|
|
388188
388564
|
}
|
|
388189
388565
|
//#endregion
|
|
388190
388566
|
//#region methods / upload node
|
|
388191
|
-
async uploadNode(key, data) {
|
|
388567
|
+
async uploadNode(key, data, options2 = {}) {
|
|
388192
388568
|
const absPath = this.getFileAbsPathInBucket(key);
|
|
388193
388569
|
await lib_13.fse.promises.mkdir(lib_13.path.dirname(absPath), {
|
|
388194
388570
|
recursive: true
|
|
388195
388571
|
});
|
|
388196
388572
|
if (data instanceof node_stream_1.Readable) {
|
|
388197
388573
|
await (0, promises_1.pipeline)(data, lib_13.fse.createWriteStream(absPath));
|
|
388198
|
-
|
|
388199
|
-
}
|
|
388200
|
-
if (data instanceof ReadableStream) {
|
|
388574
|
+
} else if (data instanceof ReadableStream) {
|
|
388201
388575
|
await (0, promises_1.pipeline)(node_stream_1.Readable.fromWeb(data), lib_13.fse.createWriteStream(absPath));
|
|
388202
|
-
|
|
388203
|
-
}
|
|
388204
|
-
if (data instanceof Blob) {
|
|
388576
|
+
} else if (data instanceof Blob) {
|
|
388205
388577
|
await lib_13.fse.promises.writeFile(absPath, Buffer.from(await data.arrayBuffer()));
|
|
388206
|
-
|
|
388207
|
-
}
|
|
388208
|
-
if (data instanceof ArrayBuffer) {
|
|
388578
|
+
} else if (data instanceof ArrayBuffer) {
|
|
388209
388579
|
await lib_13.fse.promises.writeFile(absPath, Buffer.from(data));
|
|
388210
|
-
|
|
388580
|
+
} else {
|
|
388581
|
+
await lib_13.fse.promises.writeFile(absPath, typeof data === "string" ? data : Buffer.from(data));
|
|
388211
388582
|
}
|
|
388212
|
-
await
|
|
388583
|
+
await this.writeNodeMetadata(absPath, {
|
|
388584
|
+
fileName: options2.fileName,
|
|
388585
|
+
contentType: options2.contentType,
|
|
388586
|
+
metadata: options2.metadata
|
|
388587
|
+
});
|
|
388213
388588
|
}
|
|
388214
388589
|
//#endregion
|
|
388215
388590
|
//#region methods / storage exists
|
|
@@ -388227,6 +388602,117 @@ var require_base_storage_backend = __commonJS({
|
|
|
388227
388602
|
}
|
|
388228
388603
|
}
|
|
388229
388604
|
//#endregion
|
|
388605
|
+
//#region methods / download storage
|
|
388606
|
+
async storageOpenDownload(key, range2) {
|
|
388607
|
+
key = this.normalizeKey(key);
|
|
388608
|
+
if (lib_22.UtilsOs.isRunningInCloudflareWorker()) {
|
|
388609
|
+
const storageKey = this.getFileRelativePathInBucket(key);
|
|
388610
|
+
const object2 = await this.cloudflareBucket.get(storageKey, range2 ? {
|
|
388611
|
+
range: {
|
|
388612
|
+
offset: range2.start,
|
|
388613
|
+
length: range2.end - range2.start + 1
|
|
388614
|
+
}
|
|
388615
|
+
} : void 0);
|
|
388616
|
+
if (!object2) {
|
|
388617
|
+
return void 0;
|
|
388618
|
+
}
|
|
388619
|
+
const reader = object2.body.getReader();
|
|
388620
|
+
const body2 = new ReadableStream({
|
|
388621
|
+
async pull(controller) {
|
|
388622
|
+
const { done, value } = await reader.read();
|
|
388623
|
+
if (done) {
|
|
388624
|
+
controller.close();
|
|
388625
|
+
} else {
|
|
388626
|
+
controller.enqueue(value);
|
|
388627
|
+
}
|
|
388628
|
+
},
|
|
388629
|
+
cancel(reason) {
|
|
388630
|
+
return reader.cancel(reason);
|
|
388631
|
+
}
|
|
388632
|
+
});
|
|
388633
|
+
return {
|
|
388634
|
+
body: body2,
|
|
388635
|
+
size: object2.size,
|
|
388636
|
+
contentLength: range2 ? range2.end - range2.start + 1 : object2.size,
|
|
388637
|
+
contentType: object2.httpMetadata?.contentType || this.inferContentType(key),
|
|
388638
|
+
fileName: this.safeFileName(object2.customMetadata?.["fileName"] || this.fileNameForKey(key))
|
|
388639
|
+
};
|
|
388640
|
+
}
|
|
388641
|
+
const absPath = this.getFileAbsPathInBucket(key);
|
|
388642
|
+
let stat;
|
|
388643
|
+
try {
|
|
388644
|
+
stat = await lib_13.fse.promises.stat(absPath);
|
|
388645
|
+
} catch (error2) {
|
|
388646
|
+
if (error2.code === "ENOENT") {
|
|
388647
|
+
return void 0;
|
|
388648
|
+
}
|
|
388649
|
+
throw error2;
|
|
388650
|
+
}
|
|
388651
|
+
if (!stat.isFile()) {
|
|
388652
|
+
return void 0;
|
|
388653
|
+
}
|
|
388654
|
+
const metadata = await this.readNodeMetadata(absPath);
|
|
388655
|
+
const start = range2?.start ?? 0;
|
|
388656
|
+
const end = range2?.end ?? Math.max(0, stat.size - 1);
|
|
388657
|
+
const nodeStream = lib_13.fse.createReadStream(absPath, range2 ? { start, end } : void 0);
|
|
388658
|
+
const body = node_stream_1.Readable.toWeb(nodeStream);
|
|
388659
|
+
return {
|
|
388660
|
+
body,
|
|
388661
|
+
size: stat.size,
|
|
388662
|
+
contentLength: range2 ? end - start + 1 : stat.size,
|
|
388663
|
+
contentType: metadata.contentType || this.inferContentType(key),
|
|
388664
|
+
fileName: this.safeFileName(metadata.fileName || this.fileNameForKey(key))
|
|
388665
|
+
};
|
|
388666
|
+
}
|
|
388667
|
+
//#endregion
|
|
388668
|
+
//#region methods / node metadata
|
|
388669
|
+
nodeMetadataPath(absPath) {
|
|
388670
|
+
return `${absPath}.taon-meta.json`;
|
|
388671
|
+
}
|
|
388672
|
+
fileNameForKey(key) {
|
|
388673
|
+
return lib_13.path.basename(key).replace(/^[0-9a-f-]{36}__/i, "");
|
|
388674
|
+
}
|
|
388675
|
+
safeFileName(fileName) {
|
|
388676
|
+
return fileName.replace(/\\/g, "/").split("/").pop()?.replace(/^[0-9a-f-]{36}__/i, "") || "download";
|
|
388677
|
+
}
|
|
388678
|
+
inferContentType(key) {
|
|
388679
|
+
const types = {
|
|
388680
|
+
".aac": "audio/aac",
|
|
388681
|
+
".flac": "audio/flac",
|
|
388682
|
+
".m4a": "audio/mp4",
|
|
388683
|
+
".mid": "audio/midi",
|
|
388684
|
+
".midi": "audio/midi",
|
|
388685
|
+
".mkv": "video/x-matroska",
|
|
388686
|
+
".mov": "video/quicktime",
|
|
388687
|
+
".mp3": "audio/mpeg",
|
|
388688
|
+
".mp4": "video/mp4",
|
|
388689
|
+
".mpeg": "video/mpeg",
|
|
388690
|
+
".mpg": "video/mpeg",
|
|
388691
|
+
".oga": "audio/ogg",
|
|
388692
|
+
".ogg": "audio/ogg",
|
|
388693
|
+
".ogv": "video/ogg",
|
|
388694
|
+
".opus": "audio/opus",
|
|
388695
|
+
".wav": "audio/wav",
|
|
388696
|
+
".weba": "audio/webm",
|
|
388697
|
+
".webm": "video/webm",
|
|
388698
|
+
".wma": "audio/x-ms-wma"
|
|
388699
|
+
};
|
|
388700
|
+
return types[lib_13.path.extname(key).toLowerCase()];
|
|
388701
|
+
}
|
|
388702
|
+
async readNodeMetadata(absPath) {
|
|
388703
|
+
try {
|
|
388704
|
+
return JSON.parse(await lib_13.fse.promises.readFile(this.nodeMetadataPath(absPath), "utf8"));
|
|
388705
|
+
} catch (error2) {
|
|
388706
|
+
if (error2.code === "ENOENT") {
|
|
388707
|
+
return {};
|
|
388708
|
+
}
|
|
388709
|
+
throw error2;
|
|
388710
|
+
}
|
|
388711
|
+
}
|
|
388712
|
+
async writeNodeMetadata(absPath, metadata) {
|
|
388713
|
+
await lib_13.fse.promises.writeFile(this.nodeMetadataPath(absPath), JSON.stringify(metadata), "utf8");
|
|
388714
|
+
}
|
|
388715
|
+
//#endregion
|
|
388230
388716
|
//#region methods / storage delete
|
|
388231
388717
|
async storageDelete(key) {
|
|
388232
388718
|
key = this.normalizeKey(key);
|
|
@@ -388238,6 +388724,7 @@ var require_base_storage_backend = __commonJS({
|
|
|
388238
388724
|
return true;
|
|
388239
388725
|
}
|
|
388240
388726
|
await lib_13.fse.promises.unlink(this.getFileAbsPathInBucket(key));
|
|
388727
|
+
await lib_13.fse.remove(`${this.getFileAbsPathInBucket(key)}.taon-meta.json`);
|
|
388241
388728
|
return true;
|
|
388242
388729
|
}
|
|
388243
388730
|
//#endregion
|
|
@@ -388250,6 +388737,7 @@ var require_base_storage_backend = __commonJS({
|
|
|
388250
388737
|
await this.storageUploadFromNodeTempFile(key, file, options2);
|
|
388251
388738
|
}
|
|
388252
388739
|
//#endregion
|
|
388740
|
+
//#region mehods / storage upload from node temp file
|
|
388253
388741
|
async storageUploadFromNodeTempFile(key, file, options2) {
|
|
388254
388742
|
const stream = lib_13.fse.createReadStream(file.tempKeyOrPath);
|
|
388255
388743
|
try {
|
|
@@ -388258,6 +388746,8 @@ var require_base_storage_backend = __commonJS({
|
|
|
388258
388746
|
await lib_13.fse.remove(file.tempKeyOrPath);
|
|
388259
388747
|
}
|
|
388260
388748
|
}
|
|
388749
|
+
//#endregion
|
|
388750
|
+
//#region mehods / storage uplaod from cloudflare temp file
|
|
388261
388751
|
async storageUploadFromCloudflareTempFile(key, file, options2) {
|
|
388262
388752
|
const tempStorage = lib_13.GlobalStorage.get("TAON_TEMP_STORAGE");
|
|
388263
388753
|
const object2 = await tempStorage.get(file.tempKeyOrPath);
|
|
@@ -388270,6 +388760,7 @@ var require_base_storage_backend = __commonJS({
|
|
|
388270
388760
|
await tempStorage.delete(file.tempKeyOrPath);
|
|
388271
388761
|
}
|
|
388272
388762
|
}
|
|
388763
|
+
//#endregion
|
|
388273
388764
|
//#region methods / storage metadata
|
|
388274
388765
|
async storageGetMetadata(key) {
|
|
388275
388766
|
key = this.normalizeKey(key);
|
|
@@ -388282,8 +388773,8 @@ var require_base_storage_backend = __commonJS({
|
|
|
388282
388773
|
return {
|
|
388283
388774
|
key,
|
|
388284
388775
|
storageKey,
|
|
388285
|
-
fileName: object2.customMetadata?.["fileName"] ||
|
|
388286
|
-
contentType: object2.httpMetadata?.contentType,
|
|
388776
|
+
fileName: this.safeFileName(object2.customMetadata?.["fileName"] || this.fileNameForKey(key)),
|
|
388777
|
+
contentType: object2.httpMetadata?.contentType || this.inferContentType(key),
|
|
388287
388778
|
size: object2.size,
|
|
388288
388779
|
lastModified: object2.uploaded,
|
|
388289
388780
|
etag: object2.httpEtag,
|
|
@@ -388296,15 +388787,21 @@ var require_base_storage_backend = __commonJS({
|
|
|
388296
388787
|
if (!stat.isFile()) {
|
|
388297
388788
|
return void 0;
|
|
388298
388789
|
}
|
|
388790
|
+
const metadata = await this.readNodeMetadata(absPath);
|
|
388299
388791
|
return {
|
|
388300
388792
|
key,
|
|
388301
388793
|
storageKey: this.getFileRelativePathInBucket(key),
|
|
388302
|
-
fileName:
|
|
388794
|
+
fileName: this.safeFileName(metadata.fileName || this.fileNameForKey(key)),
|
|
388795
|
+
contentType: metadata.contentType || this.inferContentType(key),
|
|
388796
|
+
metadata: metadata.metadata,
|
|
388303
388797
|
size: stat.size,
|
|
388304
388798
|
lastModified: stat.mtime
|
|
388305
388799
|
};
|
|
388306
|
-
} catch {
|
|
388307
|
-
|
|
388800
|
+
} catch (error2) {
|
|
388801
|
+
if (error2.code === "ENOENT") {
|
|
388802
|
+
return void 0;
|
|
388803
|
+
}
|
|
388804
|
+
throw error2;
|
|
388308
388805
|
}
|
|
388309
388806
|
}
|
|
388310
388807
|
//#endregion
|
|
@@ -388352,6 +388849,12 @@ var require_base_storage_backend = __commonJS({
|
|
|
388352
388849
|
recursive: true
|
|
388353
388850
|
});
|
|
388354
388851
|
await lib_13.fse.promises.copyFile(sourceAbsPath, destinationAbsPath);
|
|
388852
|
+
const sourceMetadata = await this.readNodeMetadata(sourceAbsPath);
|
|
388853
|
+
if (Object.keys(sourceMetadata).length) {
|
|
388854
|
+
await this.writeNodeMetadata(destinationAbsPath, sourceMetadata);
|
|
388855
|
+
} else {
|
|
388856
|
+
await lib_13.fse.remove(`${destinationAbsPath}.taon-meta.json`);
|
|
388857
|
+
}
|
|
388355
388858
|
}
|
|
388356
388859
|
return await this.storageGetMetadata(destinationKey);
|
|
388357
388860
|
}
|
|
@@ -388396,14 +388899,24 @@ var require_base_storage_backend = __commonJS({
|
|
|
388396
388899
|
if (options2.overwrite && await this.storageExists(destinationKey)) {
|
|
388397
388900
|
await lib_13.fse.promises.unlink(destinationAbsPath);
|
|
388398
388901
|
}
|
|
388902
|
+
await lib_13.fse.remove(`${destinationAbsPath}.taon-meta.json`);
|
|
388399
388903
|
try {
|
|
388400
388904
|
await lib_13.fse.promises.rename(sourceAbsPath, destinationAbsPath);
|
|
388905
|
+
const sourceMetadataPath = `${sourceAbsPath}.taon-meta.json`;
|
|
388906
|
+
if (await lib_13.fse.pathExists(sourceMetadataPath)) {
|
|
388907
|
+
await lib_13.fse.promises.rename(sourceMetadataPath, `${destinationAbsPath}.taon-meta.json`);
|
|
388908
|
+
}
|
|
388401
388909
|
} catch (error2) {
|
|
388402
388910
|
if (error2?.code !== "EXDEV") {
|
|
388403
388911
|
throw error2;
|
|
388404
388912
|
}
|
|
388405
388913
|
await lib_13.fse.promises.copyFile(sourceAbsPath, destinationAbsPath);
|
|
388914
|
+
const sourceMetadata = await this.readNodeMetadata(sourceAbsPath);
|
|
388915
|
+
if (Object.keys(sourceMetadata).length) {
|
|
388916
|
+
await this.writeNodeMetadata(destinationAbsPath, sourceMetadata);
|
|
388917
|
+
}
|
|
388406
388918
|
await lib_13.fse.promises.unlink(sourceAbsPath);
|
|
388919
|
+
await lib_13.fse.remove(`${sourceAbsPath}.taon-meta.json`);
|
|
388407
388920
|
}
|
|
388408
388921
|
}
|
|
388409
388922
|
return await this.storageGetMetadata(destinationKey);
|
|
@@ -388435,8 +388948,8 @@ var require_base_storage_backend = __commonJS({
|
|
|
388435
388948
|
return {
|
|
388436
388949
|
key,
|
|
388437
388950
|
storageKey: object2.key,
|
|
388438
|
-
fileName: object2.customMetadata?.["fileName"] ||
|
|
388439
|
-
contentType: object2.httpMetadata?.contentType,
|
|
388951
|
+
fileName: this.safeFileName(object2.customMetadata?.["fileName"] || this.fileNameForKey(key)),
|
|
388952
|
+
contentType: object2.httpMetadata?.contentType || this.inferContentType(key),
|
|
388440
388953
|
size: object2.size,
|
|
388441
388954
|
lastModified: object2.uploaded,
|
|
388442
388955
|
etag: object2.httpEtag,
|
|
@@ -388468,18 +388981,17 @@ var require_base_storage_backend = __commonJS({
|
|
|
388468
388981
|
if (!entry.isFile()) {
|
|
388469
388982
|
continue;
|
|
388470
388983
|
}
|
|
388984
|
+
if (entry.name.endsWith(".taon-meta.json")) {
|
|
388985
|
+
continue;
|
|
388986
|
+
}
|
|
388471
388987
|
const key = this.normalizeKey(lib_13.path.relative(controllerRoot, absPath));
|
|
388472
388988
|
if (prefix && !key.startsWith(prefix)) {
|
|
388473
388989
|
continue;
|
|
388474
388990
|
}
|
|
388475
|
-
const
|
|
388476
|
-
|
|
388477
|
-
|
|
388478
|
-
|
|
388479
|
-
fileName: entry.name,
|
|
388480
|
-
size: stat.size,
|
|
388481
|
-
lastModified: stat.mtime
|
|
388482
|
-
});
|
|
388991
|
+
const metadata = await this.storageGetMetadata(key);
|
|
388992
|
+
if (metadata) {
|
|
388993
|
+
result2.push(metadata);
|
|
388994
|
+
}
|
|
388483
388995
|
if (options2.limit && result2.length >= options2.limit) {
|
|
388484
388996
|
return;
|
|
388485
388997
|
}
|
|
@@ -388503,27 +389015,37 @@ var require_base_storage_controller_ts_en_US_i18n_data = __commonJS({
|
|
|
388503
389015
|
"tags": [
|
|
388504
389016
|
{
|
|
388505
389017
|
"gettextString": 'Invalid or not provided "key" parameter',
|
|
388506
|
-
"lineNumber":
|
|
389018
|
+
"lineNumber": 73
|
|
388507
389019
|
},
|
|
388508
389020
|
{
|
|
388509
389021
|
"gettextString": 'Invalid or not provided "key" parameter',
|
|
388510
|
-
"lineNumber":
|
|
389022
|
+
"lineNumber": 166
|
|
388511
389023
|
},
|
|
388512
389024
|
{
|
|
388513
389025
|
"gettextString": 'Invalid or not provided "key" parameter',
|
|
388514
|
-
"lineNumber":
|
|
389026
|
+
"lineNumber": 186
|
|
388515
389027
|
},
|
|
388516
389028
|
{
|
|
388517
389029
|
"gettextString": 'Invalid or not provided "key" parameter',
|
|
388518
|
-
"lineNumber":
|
|
389030
|
+
"lineNumber": 207
|
|
388519
389031
|
},
|
|
388520
389032
|
{
|
|
388521
389033
|
"gettextString": 'Invalid or not provided "key" parameter',
|
|
388522
|
-
"lineNumber":
|
|
389034
|
+
"lineNumber": 394
|
|
388523
389035
|
},
|
|
388524
389036
|
{
|
|
388525
389037
|
"gettextString": 'Invalid or not provided "key" parameter',
|
|
388526
|
-
"lineNumber":
|
|
389038
|
+
"lineNumber": 428
|
|
389039
|
+
},
|
|
389040
|
+
{
|
|
389041
|
+
"gettextString": "Invalid or expired storage download token.",
|
|
389042
|
+
"lineNumber": 83,
|
|
389043
|
+
"translation": "Invalid or expired storage download token."
|
|
389044
|
+
},
|
|
389045
|
+
{
|
|
389046
|
+
"gettextString": "A valid storage download token is required.",
|
|
389047
|
+
"lineNumber": 89,
|
|
389048
|
+
"translation": "A valid storage download token is required."
|
|
388527
389049
|
}
|
|
388528
389050
|
]
|
|
388529
389051
|
};
|
|
@@ -388540,27 +389062,37 @@ var require_base_storage_controller_ts_pl_PL_i18n_data = __commonJS({
|
|
|
388540
389062
|
"tags": [
|
|
388541
389063
|
{
|
|
388542
389064
|
"gettextString": 'Invalid or not provided "key" parameter',
|
|
388543
|
-
"lineNumber":
|
|
389065
|
+
"lineNumber": 73
|
|
388544
389066
|
},
|
|
388545
389067
|
{
|
|
388546
389068
|
"gettextString": 'Invalid or not provided "key" parameter',
|
|
388547
|
-
"lineNumber":
|
|
389069
|
+
"lineNumber": 166
|
|
388548
389070
|
},
|
|
388549
389071
|
{
|
|
388550
389072
|
"gettextString": 'Invalid or not provided "key" parameter',
|
|
388551
|
-
"lineNumber":
|
|
389073
|
+
"lineNumber": 186
|
|
388552
389074
|
},
|
|
388553
389075
|
{
|
|
388554
389076
|
"gettextString": 'Invalid or not provided "key" parameter',
|
|
388555
|
-
"lineNumber":
|
|
389077
|
+
"lineNumber": 207
|
|
388556
389078
|
},
|
|
388557
389079
|
{
|
|
388558
389080
|
"gettextString": 'Invalid or not provided "key" parameter',
|
|
388559
|
-
"lineNumber":
|
|
389081
|
+
"lineNumber": 394
|
|
388560
389082
|
},
|
|
388561
389083
|
{
|
|
388562
389084
|
"gettextString": 'Invalid or not provided "key" parameter',
|
|
388563
|
-
"lineNumber":
|
|
389085
|
+
"lineNumber": 428
|
|
389086
|
+
},
|
|
389087
|
+
{
|
|
389088
|
+
"gettextString": "Invalid or expired storage download token.",
|
|
389089
|
+
"lineNumber": 83,
|
|
389090
|
+
"translation": "Nieprawid\u0142owy lub wygas\u0142y token pobierania pliku z magazynu."
|
|
389091
|
+
},
|
|
389092
|
+
{
|
|
389093
|
+
"gettextString": "A valid storage download token is required.",
|
|
389094
|
+
"lineNumber": 89,
|
|
389095
|
+
"translation": "Wymagany jest prawid\u0142owy token pobierania pliku z magazynu."
|
|
388564
389096
|
}
|
|
388565
389097
|
]
|
|
388566
389098
|
};
|
|
@@ -388590,7 +389122,6 @@ var require_base_storage_controller = __commonJS({
|
|
|
388590
389122
|
var lib_13 = require_lib43();
|
|
388591
389123
|
var lib_22 = require_lib36();
|
|
388592
389124
|
var lib_32 = require_lib31();
|
|
388593
|
-
var lib_42 = require_lib31();
|
|
388594
389125
|
var controller_decorator_1 = require_controller_decorator();
|
|
388595
389126
|
var http_methods_decorators_1 = require_http_methods_decorators();
|
|
388596
389127
|
var http_params_decorators_1 = require_http_params_decorators();
|
|
@@ -388603,12 +389134,15 @@ var require_base_storage_controller = __commonJS({
|
|
|
388603
389134
|
var TaonBaseStorageController = class TaonBaseStorageController extends base_controller_1.TaonBaseController {
|
|
388604
389135
|
// taonStorageRepository = this.injectCustomRepo(TaonBaseStorageRepository);
|
|
388605
389136
|
storage = new base_storage_backend_1.TaonBaseStorageBackend(this);
|
|
389137
|
+
storageObjectExists(key) {
|
|
389138
|
+
return this.storage.storageExists(key);
|
|
389139
|
+
}
|
|
388606
389140
|
//#region API / download
|
|
388607
389141
|
/**
|
|
388608
389142
|
* This method is only for nodejs???
|
|
388609
389143
|
*/
|
|
388610
|
-
download(key) {
|
|
388611
|
-
return async (
|
|
389144
|
+
download(key, token, download = false) {
|
|
389145
|
+
return async (req, res) => {
|
|
388612
389146
|
if (!key) {
|
|
388613
389147
|
index_1.Taon.error({
|
|
388614
389148
|
status: (0, http_status_1.getStatusCode)(http_status_1.HttpStatusEnum.FORBIDDEN),
|
|
@@ -388616,35 +389150,59 @@ var require_base_storage_controller = __commonJS({
|
|
|
388616
389150
|
});
|
|
388617
389151
|
}
|
|
388618
389152
|
key = this.storage.normalizeKey(key);
|
|
388619
|
-
if (
|
|
388620
|
-
|
|
388621
|
-
|
|
388622
|
-
|
|
388623
|
-
|
|
388624
|
-
}
|
|
388625
|
-
return object2.body;
|
|
388626
|
-
}
|
|
388627
|
-
const absPath = this.storage.getFileAbsPathInBucket(key);
|
|
388628
|
-
if (!lib_32.fse.existsSync(absPath)) {
|
|
388629
|
-
throw new Error(`Storage object not found: ${key}`);
|
|
388630
|
-
}
|
|
388631
|
-
const nodeStream = lib_32.fse.createReadStream(absPath);
|
|
388632
|
-
return new ReadableStream({
|
|
388633
|
-
start(controller) {
|
|
388634
|
-
nodeStream.on("data", (chunk2) => {
|
|
388635
|
-
controller.enqueue(typeof chunk2 === "string" ? Buffer.from(chunk2) : new Uint8Array(chunk2));
|
|
389153
|
+
if (token) {
|
|
389154
|
+
if (!await this.verifyStorageDownloadToken({ key, token })) {
|
|
389155
|
+
index_1.Taon.error({
|
|
389156
|
+
status: (0, http_status_1.getStatusCode)(http_status_1.HttpStatusEnum.FORBIDDEN),
|
|
389157
|
+
message: t.gettext("Invalid or expired storage download token.")
|
|
388636
389158
|
});
|
|
388637
|
-
nodeStream.on("end", () => {
|
|
388638
|
-
controller.close();
|
|
388639
|
-
});
|
|
388640
|
-
nodeStream.on("error", (error2) => {
|
|
388641
|
-
controller.error(error2);
|
|
388642
|
-
});
|
|
388643
|
-
},
|
|
388644
|
-
cancel() {
|
|
388645
|
-
nodeStream.destroy();
|
|
388646
389159
|
}
|
|
388647
|
-
})
|
|
389160
|
+
} else if (!await this.isPublicStorageKey(key)) {
|
|
389161
|
+
index_1.Taon.error({
|
|
389162
|
+
status: (0, http_status_1.getStatusCode)(http_status_1.HttpStatusEnum.FORBIDDEN),
|
|
389163
|
+
message: t.gettext("A valid storage download token is required.")
|
|
389164
|
+
});
|
|
389165
|
+
}
|
|
389166
|
+
const storedMetadata = await this.storage.storageGetMetadata(key);
|
|
389167
|
+
if (!storedMetadata) {
|
|
389168
|
+
index_1.Taon.error({
|
|
389169
|
+
message: `Storage object not found: ${key}`,
|
|
389170
|
+
status: 404
|
|
389171
|
+
});
|
|
389172
|
+
}
|
|
389173
|
+
const rangeHeader = req.headers.range;
|
|
389174
|
+
const range2 = rangeHeader ? parseStorageRange(rangeHeader, storedMetadata.size) : void 0;
|
|
389175
|
+
if (rangeHeader && !range2) {
|
|
389176
|
+
res.status(416);
|
|
389177
|
+
res.setHeader("Accept-Ranges", "bytes");
|
|
389178
|
+
res.setHeader("Content-Range", `bytes */${storedMetadata.size}`);
|
|
389179
|
+
return new ReadableStream({
|
|
389180
|
+
start(controller) {
|
|
389181
|
+
controller.close();
|
|
389182
|
+
}
|
|
389183
|
+
});
|
|
389184
|
+
}
|
|
389185
|
+
const metadata = await this.storage.storageOpenDownload(key, range2);
|
|
389186
|
+
if (!metadata) {
|
|
389187
|
+
index_1.Taon.error({
|
|
389188
|
+
message: `Storage object not found: ${key}`,
|
|
389189
|
+
status: 404
|
|
389190
|
+
});
|
|
389191
|
+
}
|
|
389192
|
+
res.setHeader("Accept-Ranges", "bytes");
|
|
389193
|
+
res.setHeader("Content-Length", String(metadata.contentLength));
|
|
389194
|
+
res.setHeader("Content-Type", metadata.contentType || "application/octet-stream");
|
|
389195
|
+
res.setHeader("X-Content-Type-Options", "nosniff");
|
|
389196
|
+
res.setHeader("Cache-Control", token ? "private, no-store" : "public, max-age=300");
|
|
389197
|
+
if (download) {
|
|
389198
|
+
const fileName = (metadata.fileName || "download").replace(/[\r\n"]/g, "_");
|
|
389199
|
+
res.setHeader("Content-Disposition", `attachment; filename="${fileName}"`);
|
|
389200
|
+
}
|
|
389201
|
+
if (rangeHeader) {
|
|
389202
|
+
res.status(206);
|
|
389203
|
+
res.setHeader("Content-Range", `bytes ${range2.start}-${range2.end}/${metadata.size}`);
|
|
389204
|
+
}
|
|
389205
|
+
return metadata.body;
|
|
388648
389206
|
};
|
|
388649
389207
|
}
|
|
388650
389208
|
//#endregion
|
|
@@ -388706,7 +389264,7 @@ var require_base_storage_controller = __commonJS({
|
|
|
388706
389264
|
for (const file of bodyFormDataFiles) {
|
|
388707
389265
|
const key = this.storage.normalizeKey(file.fileName);
|
|
388708
389266
|
await this.storage.storageUploadFromTempFile(key, file, {
|
|
388709
|
-
fileName: file.fileName,
|
|
389267
|
+
fileName: file.originalFileName || file.fileName,
|
|
388710
389268
|
contentType: file.mimeType
|
|
388711
389269
|
});
|
|
388712
389270
|
const object2 = await this.storage.storageGetMetadata(key);
|
|
@@ -388739,7 +389297,7 @@ var require_base_storage_controller = __commonJS({
|
|
|
388739
389297
|
notFound: []
|
|
388740
389298
|
};
|
|
388741
389299
|
const normalizedKeys = keys2.map((key) => this.storage.normalizeKey(key));
|
|
388742
|
-
if (
|
|
389300
|
+
if (lib_32.UtilsOs.isRunningInCloudflareWorker()) {
|
|
388743
389301
|
const existence = await Promise.all(normalizedKeys.map(async (key) => ({
|
|
388744
389302
|
key,
|
|
388745
389303
|
exists: await this.storage.storageExists(key)
|
|
@@ -388817,6 +389375,18 @@ var require_base_storage_controller = __commonJS({
|
|
|
388817
389375
|
});
|
|
388818
389376
|
};
|
|
388819
389377
|
}
|
|
389378
|
+
/**
|
|
389379
|
+
* Validate a private download token for this controller and exact key.
|
|
389380
|
+
*/
|
|
389381
|
+
async verifyStorageDownloadToken(options2) {
|
|
389382
|
+
return false;
|
|
389383
|
+
}
|
|
389384
|
+
/**
|
|
389385
|
+
* Public storage access must be explicitly opted into by the controller.
|
|
389386
|
+
*/
|
|
389387
|
+
async isPublicStorageKey(key) {
|
|
389388
|
+
return false;
|
|
389389
|
+
}
|
|
388820
389390
|
};
|
|
388821
389391
|
exports2.TaonBaseStorageController = TaonBaseStorageController;
|
|
388822
389392
|
__decorate2([
|
|
@@ -388826,8 +389396,10 @@ var require_base_storage_controller = __commonJS({
|
|
|
388826
389396
|
//#endregion
|
|
388827
389397
|
}),
|
|
388828
389398
|
__param2(0, (0, http_params_decorators_1.Query)("key")),
|
|
389399
|
+
__param2(1, (0, http_params_decorators_1.Query)("token")),
|
|
389400
|
+
__param2(2, (0, http_params_decorators_1.Query)("download")),
|
|
388829
389401
|
__metadata2("design:type", Function),
|
|
388830
|
-
__metadata2("design:paramtypes", [String]),
|
|
389402
|
+
__metadata2("design:paramtypes", [String, String, Object]),
|
|
388831
389403
|
__metadata2("design:returntype", Object)
|
|
388832
389404
|
], TaonBaseStorageController.prototype, "download", null);
|
|
388833
389405
|
__decorate2([
|
|
@@ -388913,6 +389485,30 @@ var require_base_storage_controller = __commonJS({
|
|
|
388913
389485
|
className: "TaonBaseStorageController"
|
|
388914
389486
|
})
|
|
388915
389487
|
], TaonBaseStorageController);
|
|
389488
|
+
function parseStorageRange(header, size2) {
|
|
389489
|
+
const match = /^bytes=(\d*)-(\d*)$/.exec(header.trim());
|
|
389490
|
+
if (!match || size2 <= 0) {
|
|
389491
|
+
return void 0;
|
|
389492
|
+
}
|
|
389493
|
+
const [, startText, endText] = match;
|
|
389494
|
+
let start;
|
|
389495
|
+
let end;
|
|
389496
|
+
if (!startText) {
|
|
389497
|
+
const suffixLength = Number(endText);
|
|
389498
|
+
if (!Number.isSafeInteger(suffixLength) || suffixLength <= 0) {
|
|
389499
|
+
return void 0;
|
|
389500
|
+
}
|
|
389501
|
+
start = Math.max(0, size2 - suffixLength);
|
|
389502
|
+
end = size2 - 1;
|
|
389503
|
+
} else {
|
|
389504
|
+
start = Number(startText);
|
|
389505
|
+
end = endText ? Number(endText) : size2 - 1;
|
|
389506
|
+
}
|
|
389507
|
+
if (!Number.isSafeInteger(start) || !Number.isSafeInteger(end) || start < 0 || end < start || start >= size2) {
|
|
389508
|
+
return void 0;
|
|
389509
|
+
}
|
|
389510
|
+
return { start, end: Math.min(end, size2 - 1) };
|
|
389511
|
+
}
|
|
388916
389512
|
}
|
|
388917
389513
|
});
|
|
388918
389514
|
|
|
@@ -389153,28 +389749,44 @@ var require_base_crud_controller = __commonJS({
|
|
|
389153
389749
|
}
|
|
389154
389750
|
//#endregion
|
|
389155
389751
|
//#region update by id
|
|
389156
|
-
updateById(id, item) {
|
|
389752
|
+
updateById(id, item, options2) {
|
|
389157
389753
|
return async () => {
|
|
389158
|
-
const model = await this.db.updateById(id, item);
|
|
389754
|
+
const model = await this.db.updateById(id, item, options2);
|
|
389159
389755
|
return model;
|
|
389160
389756
|
};
|
|
389161
389757
|
}
|
|
389162
389758
|
//#endregion
|
|
389163
389759
|
//#region patch by id
|
|
389164
|
-
patchById(id, item) {
|
|
389760
|
+
patchById(id, item, options2) {
|
|
389761
|
+
return async () => {
|
|
389762
|
+
const model = await this.db.updateById(id, item, options2);
|
|
389763
|
+
return model;
|
|
389764
|
+
};
|
|
389765
|
+
}
|
|
389766
|
+
//#endregion
|
|
389767
|
+
//#region update by id
|
|
389768
|
+
shallowUpdateById(id, item) {
|
|
389165
389769
|
return async () => {
|
|
389166
|
-
const model = await this.db.
|
|
389770
|
+
const model = await this.db.shallowUpdateById(id, item);
|
|
389771
|
+
return model;
|
|
389772
|
+
};
|
|
389773
|
+
}
|
|
389774
|
+
//#endregion
|
|
389775
|
+
//#region update by id
|
|
389776
|
+
shallowPatchById(id, item) {
|
|
389777
|
+
return async () => {
|
|
389778
|
+
const model = await this.db.shallowUpdateById(id, item);
|
|
389167
389779
|
return model;
|
|
389168
389780
|
};
|
|
389169
389781
|
}
|
|
389170
389782
|
//#endregion
|
|
389171
389783
|
//#region bulk update
|
|
389172
|
-
|
|
389784
|
+
bulkShallowUpdate(items) {
|
|
389173
389785
|
return async () => {
|
|
389174
389786
|
if (!Array.isArray(items) || items?.length === 0) {
|
|
389175
389787
|
return [];
|
|
389176
389788
|
}
|
|
389177
|
-
const
|
|
389789
|
+
const models = await this.db.bulkShallowUpdate(items);
|
|
389178
389790
|
return models;
|
|
389179
389791
|
};
|
|
389180
389792
|
}
|
|
@@ -389221,7 +389833,7 @@ var require_base_crud_controller = __commonJS({
|
|
|
389221
389833
|
exports2.TaonBaseCrudController = TaonBaseCrudController;
|
|
389222
389834
|
__decorate2([
|
|
389223
389835
|
(0, http_methods_decorators_1.GET)(),
|
|
389224
|
-
__param2(0, (0, http_params_decorators_1.Query)(
|
|
389836
|
+
__param2(0, (0, http_params_decorators_1.Query)("id")),
|
|
389225
389837
|
__param2(1, (0, http_params_decorators_1.Query)(`property`)),
|
|
389226
389838
|
__param2(2, (0, http_params_decorators_1.Query)("alreadyLength")),
|
|
389227
389839
|
__metadata2("design:type", Function),
|
|
@@ -389230,14 +389842,14 @@ var require_base_crud_controller = __commonJS({
|
|
|
389230
389842
|
], TaonBaseCrudController.prototype, "bufforedChanges", null);
|
|
389231
389843
|
__decorate2([
|
|
389232
389844
|
(0, http_methods_decorators_1.GET)(),
|
|
389233
|
-
__param2(0, (0, http_params_decorators_1.Query)()),
|
|
389845
|
+
__param2(0, (0, http_params_decorators_1.Query)("queryJson")),
|
|
389234
389846
|
__metadata2("design:type", Function),
|
|
389235
389847
|
__metadata2("design:paramtypes", [Object]),
|
|
389236
389848
|
__metadata2("design:returntype", Object)
|
|
389237
389849
|
], TaonBaseCrudController.prototype, "paginationQuery", null);
|
|
389238
389850
|
__decorate2([
|
|
389239
389851
|
(0, http_methods_decorators_1.POST)(),
|
|
389240
|
-
__param2(0, (0, http_params_decorators_1.Body)()),
|
|
389852
|
+
__param2(0, (0, http_params_decorators_1.Body)("query")),
|
|
389241
389853
|
__metadata2("design:type", Function),
|
|
389242
389854
|
__metadata2("design:paramtypes", [Object]),
|
|
389243
389855
|
__metadata2("design:returntype", Object)
|
|
@@ -389250,44 +389862,62 @@ var require_base_crud_controller = __commonJS({
|
|
|
389250
389862
|
], TaonBaseCrudController.prototype, "getAll", null);
|
|
389251
389863
|
__decorate2([
|
|
389252
389864
|
(0, http_methods_decorators_1.GET)(),
|
|
389253
|
-
__param2(0, (0, http_params_decorators_1.Query)(
|
|
389865
|
+
__param2(0, (0, http_params_decorators_1.Query)("id")),
|
|
389254
389866
|
__metadata2("design:type", Function),
|
|
389255
389867
|
__metadata2("design:paramtypes", [Object]),
|
|
389256
389868
|
__metadata2("design:returntype", Object)
|
|
389257
389869
|
], TaonBaseCrudController.prototype, "getBy", null);
|
|
389258
389870
|
__decorate2([
|
|
389259
389871
|
(0, http_methods_decorators_1.PUT)(),
|
|
389260
|
-
__param2(0, (0, http_params_decorators_1.Query)(
|
|
389261
|
-
__param2(1, (0, http_params_decorators_1.Body)()),
|
|
389872
|
+
__param2(0, (0, http_params_decorators_1.Query)("id")),
|
|
389873
|
+
__param2(1, (0, http_params_decorators_1.Body)("item")),
|
|
389874
|
+
__param2(2, (0, http_params_decorators_1.Body)("options")),
|
|
389262
389875
|
__metadata2("design:type", Function),
|
|
389263
|
-
__metadata2("design:paramtypes", [Object, Object]),
|
|
389876
|
+
__metadata2("design:paramtypes", [Object, Object, Object]),
|
|
389264
389877
|
__metadata2("design:returntype", Object)
|
|
389265
389878
|
], TaonBaseCrudController.prototype, "updateById", null);
|
|
389266
389879
|
__decorate2([
|
|
389267
389880
|
(0, http_methods_decorators_1.PATCH)(),
|
|
389268
|
-
__param2(0, (0, http_params_decorators_1.Query)(
|
|
389269
|
-
__param2(1, (0, http_params_decorators_1.Body)()),
|
|
389881
|
+
__param2(0, (0, http_params_decorators_1.Query)("id")),
|
|
389882
|
+
__param2(1, (0, http_params_decorators_1.Body)("item")),
|
|
389883
|
+
__param2(2, (0, http_params_decorators_1.Body)("options")),
|
|
389270
389884
|
__metadata2("design:type", Function),
|
|
389271
|
-
__metadata2("design:paramtypes", [Object, Object]),
|
|
389885
|
+
__metadata2("design:paramtypes", [Object, Object, Object]),
|
|
389272
389886
|
__metadata2("design:returntype", Object)
|
|
389273
389887
|
], TaonBaseCrudController.prototype, "patchById", null);
|
|
389274
389888
|
__decorate2([
|
|
389275
389889
|
(0, http_methods_decorators_1.PUT)(),
|
|
389276
|
-
__param2(0, (0, http_params_decorators_1.
|
|
389890
|
+
__param2(0, (0, http_params_decorators_1.Query)("id")),
|
|
389891
|
+
__param2(1, (0, http_params_decorators_1.Body)("item")),
|
|
389892
|
+
__metadata2("design:type", Function),
|
|
389893
|
+
__metadata2("design:paramtypes", [Object, Object]),
|
|
389894
|
+
__metadata2("design:returntype", Object)
|
|
389895
|
+
], TaonBaseCrudController.prototype, "shallowUpdateById", null);
|
|
389896
|
+
__decorate2([
|
|
389897
|
+
(0, http_methods_decorators_1.PUT)(),
|
|
389898
|
+
__param2(0, (0, http_params_decorators_1.Query)("id")),
|
|
389899
|
+
__param2(1, (0, http_params_decorators_1.Body)("item")),
|
|
389900
|
+
__metadata2("design:type", Function),
|
|
389901
|
+
__metadata2("design:paramtypes", [Object, Object]),
|
|
389902
|
+
__metadata2("design:returntype", Object)
|
|
389903
|
+
], TaonBaseCrudController.prototype, "shallowPatchById", null);
|
|
389904
|
+
__decorate2([
|
|
389905
|
+
(0, http_methods_decorators_1.PUT)(),
|
|
389906
|
+
__param2(0, (0, http_params_decorators_1.Body)("items")),
|
|
389277
389907
|
__metadata2("design:type", Function),
|
|
389278
389908
|
__metadata2("design:paramtypes", [Array]),
|
|
389279
389909
|
__metadata2("design:returntype", Object)
|
|
389280
|
-
], TaonBaseCrudController.prototype, "
|
|
389910
|
+
], TaonBaseCrudController.prototype, "bulkShallowUpdate", null);
|
|
389281
389911
|
__decorate2([
|
|
389282
389912
|
(0, http_methods_decorators_1.DELETE)(),
|
|
389283
|
-
__param2(0, (0, http_params_decorators_1.Query)(
|
|
389913
|
+
__param2(0, (0, http_params_decorators_1.Query)("id")),
|
|
389284
389914
|
__metadata2("design:type", Function),
|
|
389285
389915
|
__metadata2("design:paramtypes", [Object]),
|
|
389286
389916
|
__metadata2("design:returntype", Object)
|
|
389287
389917
|
], TaonBaseCrudController.prototype, "deleteById", null);
|
|
389288
389918
|
__decorate2([
|
|
389289
389919
|
(0, http_methods_decorators_1.DELETE)(),
|
|
389290
|
-
__param2(0, (0, http_params_decorators_1.Query)(
|
|
389920
|
+
__param2(0, (0, http_params_decorators_1.Query)("ids")),
|
|
389291
389921
|
__metadata2("design:type", Function),
|
|
389292
389922
|
__metadata2("design:paramtypes", [Array]),
|
|
389293
389923
|
__metadata2("design:returntype", Object)
|
|
@@ -389300,16 +389930,16 @@ var require_base_crud_controller = __commonJS({
|
|
|
389300
389930
|
], TaonBaseCrudController.prototype, "clearTable", null);
|
|
389301
389931
|
__decorate2([
|
|
389302
389932
|
(0, http_methods_decorators_1.POST)(),
|
|
389303
|
-
__param2(0, (0, http_params_decorators_1.Body)()),
|
|
389933
|
+
__param2(0, (0, http_params_decorators_1.Body)("item")),
|
|
389304
389934
|
__metadata2("design:type", Function),
|
|
389305
389935
|
__metadata2("design:paramtypes", [Object]),
|
|
389306
389936
|
__metadata2("design:returntype", Object)
|
|
389307
389937
|
], TaonBaseCrudController.prototype, "save", null);
|
|
389308
389938
|
__decorate2([
|
|
389309
389939
|
(0, http_methods_decorators_1.POST)(),
|
|
389310
|
-
__param2(0, (0, http_params_decorators_1.Body)()),
|
|
389940
|
+
__param2(0, (0, http_params_decorators_1.Body)("items")),
|
|
389311
389941
|
__metadata2("design:type", Function),
|
|
389312
|
-
__metadata2("design:paramtypes", [
|
|
389942
|
+
__metadata2("design:paramtypes", [Array]),
|
|
389313
389943
|
__metadata2("design:returntype", Object)
|
|
389314
389944
|
], TaonBaseCrudController.prototype, "bulkCreate", null);
|
|
389315
389945
|
exports2.TaonBaseCrudController = TaonBaseCrudController = __decorate2([
|
|
@@ -389860,10 +390490,13 @@ var require_cloudflare_create_worker = __commonJS({
|
|
|
389860
390490
|
headers: (0, cross_origin_1.corsHeaders)(cloudflareRequest)
|
|
389861
390491
|
});
|
|
389862
390492
|
}
|
|
389863
|
-
const
|
|
390493
|
+
const requestForParsing = cloudflareRequest.clone();
|
|
390494
|
+
const requestForRawBody = cloudflareRequest.clone();
|
|
389864
390495
|
let parsedBody;
|
|
390496
|
+
let rawBody;
|
|
389865
390497
|
try {
|
|
389866
|
-
parsedBody = await (0, parse_body_1.parseBody)(
|
|
390498
|
+
parsedBody = await (0, parse_body_1.parseBody)(requestForParsing);
|
|
390499
|
+
rawBody = new Uint8Array(await requestForRawBody.arrayBuffer());
|
|
389867
390500
|
} catch (err) {
|
|
389868
390501
|
return new Response(JSON.stringify({
|
|
389869
390502
|
error: "Bad Request",
|
|
@@ -389911,6 +390544,7 @@ var require_cloudflare_create_worker = __commonJS({
|
|
|
389911
390544
|
const value = cloudflareRequest.headers.get("x-forwarded-for") || "";
|
|
389912
390545
|
return value.split(",").map((v) => v.trim()).filter(Boolean);
|
|
389913
390546
|
})(),
|
|
390547
|
+
rawBody,
|
|
389914
390548
|
raw: cloudflareRequest
|
|
389915
390549
|
};
|
|
389916
390550
|
if (fakeExpressRequest.body?._method) {
|
|
@@ -390415,7 +391049,7 @@ var require_build_info_auto_generated2 = __commonJS({
|
|
|
390415
391049
|
exports2.BUILD_BASE_HREF = "";
|
|
390416
391050
|
exports2.PROJECT_NPM_NAME = "tnp";
|
|
390417
391051
|
exports2.CURRENT_PACKAGE_TAON_VERSION = "v21";
|
|
390418
|
-
exports2.CURRENT_PACKAGE_VERSION = "21.0.
|
|
391052
|
+
exports2.CURRENT_PACKAGE_VERSION = "21.0.296";
|
|
390419
391053
|
}
|
|
390420
391054
|
});
|
|
390421
391055
|
|
|
@@ -397570,7 +398204,7 @@ var require_linked_project = __commonJS({
|
|
|
397570
398204
|
omitRootFoldersThatStartWith: ["tmp-", ".", "dist-"]
|
|
397571
398205
|
}).filter((folderAbsPath) => {
|
|
397572
398206
|
if (lib_13.notAllowedNames.includes(lib_22.path.basename(folderAbsPath))) {
|
|
397573
|
-
lib_13.Helpers.
|
|
398207
|
+
lib_13.Helpers.log(`[${lib_13.config.frameworkName}-helpers][linked-projects] Skipping folder ${folderAbsPath} because it has not allowed name`);
|
|
397574
398208
|
return false;
|
|
397575
398209
|
}
|
|
397576
398210
|
if (checkAlsoNonRepos && lib_13.Helpers.exists([folderAbsPath, lib_13.config.file.taon_jsonc]) && !!lib_13.Helpers.readJsonC([folderAbsPath, lib_13.config.file.taon_jsonc])?.type && lib_13.Helpers.exists([folderAbsPath, lib_13.config.file.package_json])) {
|
|
@@ -400004,7 +400638,7 @@ var require_build_info_auto_generated3 = __commonJS({
|
|
|
400004
400638
|
exports2.BUILD_BASE_HREF = "";
|
|
400005
400639
|
exports2.PROJECT_NPM_NAME = "tnp-helpers";
|
|
400006
400640
|
exports2.CURRENT_PACKAGE_TAON_VERSION = "v21";
|
|
400007
|
-
exports2.CURRENT_PACKAGE_VERSION = "21.0.
|
|
400641
|
+
exports2.CURRENT_PACKAGE_VERSION = "21.0.131";
|
|
400008
400642
|
}
|
|
400009
400643
|
});
|
|
400010
400644
|
|
|
@@ -404475,7 +405109,7 @@ var require_commit_data = __commonJS({
|
|
|
404475
405109
|
"tnp/node_modules/tnp-helpers/lib/base/commit-data.js"(exports2) {
|
|
404476
405110
|
"use strict";
|
|
404477
405111
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
404478
|
-
exports2.CommitData = void 0;
|
|
405112
|
+
exports2.CommitData = exports2.TypeOfMsgPrefixArr = void 0;
|
|
404479
405113
|
var lib_13 = require_lib31();
|
|
404480
405114
|
var lib_22 = require_lib31();
|
|
404481
405115
|
var index_1 = require_lib47();
|
|
@@ -404487,6 +405121,19 @@ var require_commit_data = __commonJS({
|
|
|
404487
405121
|
// 'GL',
|
|
404488
405122
|
// 'GITLAB',
|
|
404489
405123
|
];
|
|
405124
|
+
exports2.TypeOfMsgPrefixArr = [
|
|
405125
|
+
"fix",
|
|
405126
|
+
"build",
|
|
405127
|
+
"feat",
|
|
405128
|
+
"perf",
|
|
405129
|
+
"chore",
|
|
405130
|
+
"release",
|
|
405131
|
+
"docs",
|
|
405132
|
+
"test",
|
|
405133
|
+
"ci",
|
|
405134
|
+
"refactor",
|
|
405135
|
+
"style"
|
|
405136
|
+
];
|
|
404490
405137
|
var regexTeamsID = /[A-Z0-9]+\#/;
|
|
404491
405138
|
var regexCommitModuleInArgs = /\[[a-z|\-|\,]+\]/;
|
|
404492
405139
|
var regexCommitModuleInBranch = /\-\-[a-z|\-|\_]+\-\-/;
|
|
@@ -406138,36 +406785,49 @@ Please provide proper commit message for lastest changes in your project:
|
|
|
406138
406785
|
async pullProcess(options2 = {}) {
|
|
406139
406786
|
options2 = options2 || {};
|
|
406140
406787
|
options2.skipCloneGitChildren = !!options2.skipCloneGitChildren;
|
|
406141
|
-
|
|
406142
|
-
|
|
406143
|
-
|
|
406144
|
-
|
|
406145
|
-
|
|
406146
|
-
|
|
406147
|
-
|
|
406148
|
-
|
|
406149
|
-
|
|
406150
|
-
|
|
406151
|
-
|
|
406152
|
-
|
|
406153
|
-
|
|
406788
|
+
options2.projectsToTravel = options2.projectsToTravel || [];
|
|
406789
|
+
let { skipCloneGitChildren, setOrigin, startFrom } = options2;
|
|
406790
|
+
const processedForPull = "processedForPull";
|
|
406791
|
+
this.project.cache[processedForPull] = true;
|
|
406792
|
+
const coundProcessed = options2.projectsToTravel.filter((f) => f.cache[processedForPull]);
|
|
406793
|
+
const indexCurrent = options2.projectsToTravel.findIndex((c) => c.location === this.project.location);
|
|
406794
|
+
const indexStartFrom = options2.projectsToTravel.findIndex((c) => c.name === startFrom || c.nameForNpmPackage === startFrom);
|
|
406795
|
+
const shouldPullThisProject = !startFrom || indexCurrent >= indexStartFrom;
|
|
406796
|
+
lib_13.Helpers.info(lib_22.chalk.bold(`[Pull] Processing project ${coundProcessed.length}/${options2.projectsToTravel.length} [${this.project.name}${this.project.name !== this.project.nameForNpmPackage ? `(${this.project.nameForNpmPackage})` : ""}]`));
|
|
406797
|
+
if (shouldPullThisProject) {
|
|
406798
|
+
await this._beforePullProcessAction(setOrigin, skipCloneGitChildren);
|
|
406799
|
+
await this.setRemoteOriginType(setOrigin);
|
|
406800
|
+
let uncommitedChanges = this.project.git.thereAreSomeUncommitedChange;
|
|
406801
|
+
if (uncommitedChanges) {
|
|
406802
|
+
lib_13.Helpers.warn(`Stashing uncommit changes... in ${this.project.genericName}`);
|
|
406803
|
+
try {
|
|
406804
|
+
this.project.git.stageAllFiles();
|
|
406805
|
+
} catch (error2) {
|
|
406806
|
+
}
|
|
406807
|
+
try {
|
|
406808
|
+
this.project.git.stash();
|
|
406809
|
+
} catch (error2) {
|
|
406810
|
+
}
|
|
406154
406811
|
}
|
|
406812
|
+
await this.project.git.pullCurrentBranch({
|
|
406813
|
+
askToRetry: true,
|
|
406814
|
+
defaultHardResetCommits: 5
|
|
406815
|
+
});
|
|
406816
|
+
await this._afterPullProcessAction(setOrigin, skipCloneGitChildren);
|
|
406155
406817
|
}
|
|
406156
|
-
await this.project.git.pullCurrentBranch({
|
|
406157
|
-
askToRetry: true,
|
|
406158
|
-
defaultHardResetCommits: 5
|
|
406159
|
-
});
|
|
406160
|
-
await this._afterPullProcessAction(setOrigin, skipCloneGitChildren);
|
|
406161
406818
|
const location2 = this.project.location;
|
|
406162
406819
|
this.project.ins.unload(this);
|
|
406163
406820
|
this.project.ins.add(this.project.ins.From(location2));
|
|
406164
406821
|
await this.project.linkedProjects.saveLocationToDB();
|
|
406165
406822
|
if (this.automaticallyAddAllChangesWhenPushingToGit() || options2.updateType === "first-level" || options2.updateType === "deep") {
|
|
406823
|
+
const projectsToVisit = options2.projectsToTravel || [];
|
|
406824
|
+
delete options2.projectsToTravel;
|
|
406166
406825
|
const optForChildren = lib_32._.cloneDeep(options2);
|
|
406167
406826
|
if (options2.updateType === "first-level") {
|
|
406168
406827
|
optForChildren.updateType = "only-this";
|
|
406169
406828
|
}
|
|
406170
406829
|
for (const child of this.gitChildren) {
|
|
406830
|
+
optForChildren.projectsToTravel = projectsToVisit;
|
|
406171
406831
|
await child.git.pullProcess(optForChildren);
|
|
406172
406832
|
}
|
|
406173
406833
|
}
|
|
@@ -406250,67 +406910,76 @@ Please provide proper commit message for lastest changes in your project:
|
|
|
406250
406910
|
}
|
|
406251
406911
|
//#region methods & getters / push process
|
|
406252
406912
|
async pushProcess(options2 = {}) {
|
|
406253
|
-
let { force = false, typeofCommit, skipLint, forcePushNoQuestion, origin: origin2 = "origin", exitCallBack, askToConfirmPush, askToConfirmCommit, updateType, askToConfirmBranchChange, args = [], commitMessageRequired, overrideCommitMessage, setOrigin, currentOrigin, mergeUpdateCommits } = options2;
|
|
406254
|
-
|
|
406255
|
-
|
|
406256
|
-
|
|
406257
|
-
const
|
|
406258
|
-
|
|
406259
|
-
|
|
406260
|
-
|
|
406261
|
-
|
|
406262
|
-
|
|
406263
|
-
|
|
406264
|
-
|
|
406265
|
-
|
|
406266
|
-
|
|
406267
|
-
|
|
406268
|
-
|
|
406269
|
-
|
|
406270
|
-
|
|
406271
|
-
|
|
406272
|
-
|
|
406273
|
-
|
|
406274
|
-
|
|
406913
|
+
let { force = false, typeofCommit, skipLint, forcePushNoQuestion, origin: origin2 = "origin", exitCallBack, askToConfirmPush, askToConfirmCommit, updateType, askToConfirmBranchChange, args = [], commitMessageRequired, overrideCommitMessage, startFrom, setOrigin, currentOrigin, mergeUpdateCommits } = options2;
|
|
406914
|
+
options2.projectsToTravel = options2.projectsToTravel || [];
|
|
406915
|
+
const processedForPull = "processedForPush";
|
|
406916
|
+
this.project.cache[processedForPull] = true;
|
|
406917
|
+
const coundProcessed = options2.projectsToTravel.filter((f) => f.cache[processedForPull]);
|
|
406918
|
+
const indexCurrent = options2.projectsToTravel.findIndex((c) => c.location === this.project.location);
|
|
406919
|
+
const indexStartFrom = options2.projectsToTravel.findIndex((c) => c.name === startFrom || c.nameForNpmPackage === startFrom);
|
|
406920
|
+
const shouldPushThisProject = !startFrom || indexCurrent >= indexStartFrom;
|
|
406921
|
+
lib_13.Helpers.info(lib_22.chalk.bold(`[Push] Processing project ${coundProcessed.length}/${options2.projectsToTravel.length} [${this.project.name}${this.project.name !== this.project.nameForNpmPackage ? `(${this.project.nameForNpmPackage})` : ""}]`));
|
|
406922
|
+
if (shouldPushThisProject) {
|
|
406923
|
+
await this._beforePushProcessAction(setOrigin);
|
|
406924
|
+
await this.setRemoteOriginType(setOrigin);
|
|
406925
|
+
await this.project.linkedProjects.saveLocationToDB();
|
|
406926
|
+
const commitData = await this._getCommitMessage(typeofCommit, args, commitMessageRequired, currentOrigin);
|
|
406927
|
+
if (mergeUpdateCommits && this.project.git.stagedFiles.length > 0) {
|
|
406928
|
+
lib_13.Helpers.logInfo(`Pushing detailed changes to project: ${this.project.genericName}`);
|
|
406929
|
+
lib_13.Helpers.logInfo(`Modified files... `);
|
|
406930
|
+
lib_13.Helpers.logInfo([...this.project.git.stagedFiles].map((f) => ` - ${lib_22.chalk.underline(f)}`).join("\n"));
|
|
406931
|
+
while (true) {
|
|
406932
|
+
const mergeAction = {
|
|
406933
|
+
useUpdateCommit: {
|
|
406934
|
+
name: `Use temporary update commit "${index_1.HelpersTaon.git.getACTION_MSG_RESET_GIT_HARD_COMMIT()}" and force push`
|
|
406935
|
+
},
|
|
406936
|
+
provideCommitMessage: {
|
|
406937
|
+
name: "Provide commit message and force push"
|
|
406938
|
+
},
|
|
406939
|
+
resetRemoveChanges: {
|
|
406940
|
+
name: "Reset/remove changes and force push"
|
|
406941
|
+
},
|
|
406942
|
+
openInVscode: {
|
|
406943
|
+
name: "Open project in vscode"
|
|
406944
|
+
}
|
|
406945
|
+
};
|
|
406946
|
+
const action = force ? "useUpdateCommit" : await lib_32.UtilsTerminal.select({
|
|
406947
|
+
choices: mergeAction,
|
|
406948
|
+
question: "What to do ?"
|
|
406949
|
+
});
|
|
406950
|
+
if (action === "openInVscode") {
|
|
406951
|
+
await this.project.openInEditor();
|
|
406952
|
+
continue;
|
|
406275
406953
|
}
|
|
406276
|
-
|
|
406277
|
-
|
|
406278
|
-
|
|
406279
|
-
|
|
406280
|
-
|
|
406281
|
-
|
|
406282
|
-
|
|
406283
|
-
|
|
406284
|
-
|
|
406285
|
-
|
|
406286
|
-
|
|
406287
|
-
|
|
406288
|
-
|
|
406289
|
-
|
|
406290
|
-
|
|
406291
|
-
|
|
406292
|
-
|
|
406293
|
-
|
|
406294
|
-
|
|
406295
|
-
|
|
406296
|
-
|
|
406297
|
-
|
|
406298
|
-
|
|
406299
|
-
|
|
406300
|
-
overrideCommitMessage = await lib_32.UtilsTerminal.input({
|
|
406301
|
-
question: `Please provide commit message for current changes:`,
|
|
406302
|
-
defaultValue: "update"
|
|
406303
|
-
});
|
|
406304
|
-
} catch (error2) {
|
|
406954
|
+
if (action === "resetRemoveChanges") {
|
|
406955
|
+
force = true;
|
|
406956
|
+
forcePushNoQuestion = true;
|
|
406957
|
+
this.project.git.resetHard();
|
|
406958
|
+
break;
|
|
406959
|
+
}
|
|
406960
|
+
if (action === "useUpdateCommit") {
|
|
406961
|
+
force = true;
|
|
406962
|
+
forcePushNoQuestion = true;
|
|
406963
|
+
overrideCommitMessage = index_1.HelpersTaon.git.getACTION_MSG_RESET_GIT_HARD_COMMIT();
|
|
406964
|
+
}
|
|
406965
|
+
if (action === "provideCommitMessage") {
|
|
406966
|
+
force = true;
|
|
406967
|
+
forcePushNoQuestion = true;
|
|
406968
|
+
try {
|
|
406969
|
+
overrideCommitMessage = await lib_32.UtilsTerminal.input({
|
|
406970
|
+
question: `Please provide commit message for current changes:`,
|
|
406971
|
+
defaultValue: "update"
|
|
406972
|
+
});
|
|
406973
|
+
} catch (error2) {
|
|
406974
|
+
}
|
|
406975
|
+
}
|
|
406976
|
+
if (overrideCommitMessage) {
|
|
406977
|
+
break;
|
|
406305
406978
|
}
|
|
406306
|
-
}
|
|
406307
|
-
if (overrideCommitMessage) {
|
|
406308
|
-
break;
|
|
406309
406979
|
}
|
|
406310
406980
|
}
|
|
406311
|
-
|
|
406312
|
-
|
|
406313
|
-
lib_13.Helpers.info(`
|
|
406981
|
+
if (commitData.typeOfCommit === "feature" && commitData.jiraNumbers?.length === 1 && commitData.issuesFromOtherProjects?.length === 0) {
|
|
406982
|
+
lib_13.Helpers.info(`
|
|
406314
406983
|
|
|
406315
406984
|
You current feature branch "${this.project.git.currentBranchName}"
|
|
406316
406985
|
doesn't have ${lib_22.chalk.bold("main-issue")} and ${lib_22.chalk.bold("sub-issue")} inlcueded.
|
|
@@ -406318,13 +406987,13 @@ Please provide proper commit message for lastest changes in your project:
|
|
|
406318
406987
|
Proper example: feature/JIRANUM-<number-of-sub-issue>-JIRANUM-<number-of-main-issue>-commit-name
|
|
406319
406988
|
|
|
406320
406989
|
`);
|
|
406321
|
-
|
|
406322
|
-
|
|
406990
|
+
if (!await lib_13.Helpers.questionYesNo("Continue without sub-issue?")) {
|
|
406991
|
+
process.exit(0);
|
|
406992
|
+
}
|
|
406323
406993
|
}
|
|
406324
|
-
|
|
406325
|
-
|
|
406326
|
-
|
|
406327
|
-
lib_13.Helpers.error(`
|
|
406994
|
+
if (!this.automaticallyAddAllChangesWhenPushingToGit()) {
|
|
406995
|
+
if (commitData.commitMessage?.split(":").map((p) => p.trim()).every((p) => p === this.project.git.currentBranchName)) {
|
|
406996
|
+
lib_13.Helpers.error(`
|
|
406328
406997
|
|
|
406329
406998
|
Please provide more specific commit message than branch name
|
|
406330
406999
|
or maybe you forgot ?
|
|
@@ -406332,41 +407001,41 @@ Please provide proper commit message for lastest changes in your project:
|
|
|
406332
407001
|
- JIRA ISSUE? (example JIRA-1234)
|
|
406333
407002
|
|
|
406334
407003
|
`, false, true);
|
|
407004
|
+
}
|
|
406335
407005
|
}
|
|
406336
|
-
|
|
406337
|
-
|
|
406338
|
-
|
|
406339
|
-
|
|
406340
|
-
|
|
406341
|
-
|
|
406342
|
-
|
|
406343
|
-
|
|
406344
|
-
|
|
406345
|
-
|
|
406346
|
-
|
|
406347
|
-
|
|
406348
|
-
|
|
406349
|
-
|
|
406350
|
-
|
|
406351
|
-
await this.project.lint(options2);
|
|
406352
|
-
break;
|
|
406353
|
-
} catch (error2) {
|
|
406354
|
-
lib_13.Helpers.warn("Fix your code...");
|
|
406355
|
-
if (!await index_1.HelpersTaon.consoleGui.question.yesNo("Try again lint before commit ?")) {
|
|
407006
|
+
if (this.skipLintOnPush()) {
|
|
407007
|
+
skipLint = true;
|
|
407008
|
+
}
|
|
407009
|
+
if (commitData.typeOfCommit === "release") {
|
|
407010
|
+
skipLint = true;
|
|
407011
|
+
}
|
|
407012
|
+
const numberOfStagedFiles = this.project.git.stagedFiles.length;
|
|
407013
|
+
if (numberOfStagedFiles === 0) {
|
|
407014
|
+
lib_13.Helpers.warn(`No staged files...`);
|
|
407015
|
+
skipLint = true;
|
|
407016
|
+
}
|
|
407017
|
+
if (!skipLint) {
|
|
407018
|
+
while (true) {
|
|
407019
|
+
try {
|
|
407020
|
+
await this.project.lint(options2);
|
|
406356
407021
|
break;
|
|
407022
|
+
} catch (error2) {
|
|
407023
|
+
lib_13.Helpers.warn("Fix your code...");
|
|
407024
|
+
if (!await index_1.HelpersTaon.consoleGui.question.yesNo("Try again lint before commit ?")) {
|
|
407025
|
+
break;
|
|
407026
|
+
}
|
|
406357
407027
|
}
|
|
406358
407028
|
}
|
|
406359
407029
|
}
|
|
406360
|
-
|
|
406361
|
-
|
|
406362
|
-
|
|
406363
|
-
|
|
406364
|
-
|
|
406365
|
-
|
|
406366
|
-
|
|
406367
|
-
|
|
406368
|
-
|
|
406369
|
-
lib_13.Helpers.info(`
|
|
407030
|
+
if (this.project.useFeatureInBranchNameForTests() && commitData.typeOfCommit === "test") {
|
|
407031
|
+
commitData.useFeatureBranchForTestBranch = true;
|
|
407032
|
+
}
|
|
407033
|
+
if (!commitData.isActionCommit) {
|
|
407034
|
+
const commitMessageFromBranch = (await commit_data_1.CommitData.getFromBranch(commitData.branchName, {
|
|
407035
|
+
currentOrigin,
|
|
407036
|
+
jiraIssuesAreOutsideBrackets: this.project.git.jiraIssuesAreOutsideBrackets()
|
|
407037
|
+
})).commitMessage;
|
|
407038
|
+
lib_13.Helpers.info(`
|
|
406370
407039
|
|
|
406371
407040
|
PROJECT: ${this.project.genericName}
|
|
406372
407041
|
|
|
@@ -406376,8 +407045,8 @@ Please provide proper commit message for lastest changes in your project:
|
|
|
406376
407045
|
(generated branches from metadata not allowed for this project)
|
|
406377
407046
|
|
|
406378
407047
|
`}`);
|
|
406379
|
-
|
|
406380
|
-
|
|
407048
|
+
if (!overrideCommitMessage && commitMessageFromBranch !== commitData.commitMessage) {
|
|
407049
|
+
lib_13.Helpers.logWarn(`Commit from args and commit from branch are different
|
|
406381
407050
|
commit message from args: ${commitData.commitMessage}
|
|
406382
407051
|
commit message from branch: ${commitMessageFromBranch}
|
|
406383
407052
|
|
|
@@ -406385,72 +407054,76 @@ Please provide proper commit message for lastest changes in your project:
|
|
|
406385
407054
|
commit changes in one commit message
|
|
406386
407055
|
|
|
406387
407056
|
`);
|
|
406388
|
-
|
|
406389
|
-
|
|
406390
|
-
|
|
406391
|
-
|
|
406392
|
-
|
|
406393
|
-
|
|
406394
|
-
|
|
407057
|
+
} else {
|
|
407058
|
+
lib_13.Helpers.logInfo(lib_22.chalk.gray(`Commit from args and commit from branch are the same...`));
|
|
407059
|
+
}
|
|
407060
|
+
const lastCommitMessage = this.project.git.lastCommitMessage();
|
|
407061
|
+
if (lastCommitMessage && [commitData.commitMessage, overrideCommitMessage].filter((f) => !!f).some((m) => m === lastCommitMessage)) {
|
|
407062
|
+
if (await lib_13.Helpers.questionYesNo("Soft reset last commit with same message ?")) {
|
|
407063
|
+
this.project.git.resetSoftHEAD(1);
|
|
407064
|
+
}
|
|
407065
|
+
}
|
|
407066
|
+
if (!await lib_13.Helpers.questionYesNo("Commit and push this ?")) {
|
|
407067
|
+
exitCallBack();
|
|
406395
407068
|
}
|
|
406396
407069
|
}
|
|
406397
|
-
if (
|
|
406398
|
-
|
|
407070
|
+
if (this.automaticallyAddAllChangesWhenPushingToGit()) {
|
|
407071
|
+
this.project.git.stageAllFiles();
|
|
406399
407072
|
}
|
|
406400
|
-
|
|
406401
|
-
|
|
406402
|
-
|
|
406403
|
-
|
|
406404
|
-
|
|
406405
|
-
|
|
406406
|
-
|
|
406407
|
-
|
|
406408
|
-
|
|
406409
|
-
|
|
406410
|
-
|
|
407073
|
+
if (this.useGitBranchesAsMetadataForCommits() && !overrideCommitMessage) {
|
|
407074
|
+
lib_13.Helpers.info("Checkingout branches (if needed)...");
|
|
407075
|
+
if (this.project.git.currentBranchName?.trim() !== commitData.branchName) {
|
|
407076
|
+
if (askToConfirmBranchChange) {
|
|
407077
|
+
lib_13.Helpers.info(`Changing branch to: ${commitData.branchName}`);
|
|
407078
|
+
if (!await lib_13.Helpers.questionYesNo("Confirm branch change ?")) {
|
|
407079
|
+
exitCallBack();
|
|
407080
|
+
}
|
|
407081
|
+
}
|
|
407082
|
+
try {
|
|
407083
|
+
this.project.git.checkout(commitData.branchName, {
|
|
407084
|
+
createBranchIfNotExists: true
|
|
407085
|
+
});
|
|
407086
|
+
} catch (error2) {
|
|
407087
|
+
lib_13.Helpers.error("Please modyfiy you commit message or delete branch,");
|
|
406411
407088
|
}
|
|
406412
407089
|
}
|
|
406413
|
-
|
|
406414
|
-
|
|
406415
|
-
|
|
406416
|
-
|
|
406417
|
-
|
|
406418
|
-
lib_13.Helpers.error("Please modyfiy you commit message or delete branch,");
|
|
407090
|
+
}
|
|
407091
|
+
if (askToConfirmCommit) {
|
|
407092
|
+
lib_13.Helpers.info(`Commit message: ${overrideCommitMessage ? overrideCommitMessage : commitData.commitMessage}`);
|
|
407093
|
+
if (!await lib_13.Helpers.questionYesNo("Confirm commit ?")) {
|
|
407094
|
+
exitCallBack();
|
|
406419
407095
|
}
|
|
406420
407096
|
}
|
|
406421
|
-
|
|
406422
|
-
|
|
406423
|
-
|
|
406424
|
-
|
|
406425
|
-
exitCallBack();
|
|
407097
|
+
try {
|
|
407098
|
+
this.project.git.commit(overrideCommitMessage ? overrideCommitMessage : commitData.commitMessage);
|
|
407099
|
+
} catch (error2) {
|
|
407100
|
+
lib_13.Helpers.warn(`Not commiting anything... `);
|
|
406426
407101
|
}
|
|
406427
|
-
|
|
406428
|
-
|
|
406429
|
-
|
|
406430
|
-
|
|
406431
|
-
lib_13.Helpers.warn(`Not commiting anything... `);
|
|
406432
|
-
}
|
|
406433
|
-
if (askToConfirmPush) {
|
|
406434
|
-
if (!await lib_13.Helpers.questionYesNo("Confirm push ?")) {
|
|
406435
|
-
exitCallBack();
|
|
407102
|
+
if (askToConfirmPush) {
|
|
407103
|
+
if (!await lib_13.Helpers.questionYesNo("Confirm push ?")) {
|
|
407104
|
+
exitCallBack();
|
|
407105
|
+
}
|
|
406436
407106
|
}
|
|
407107
|
+
await this.project.git.pushCurrentBranch({
|
|
407108
|
+
force,
|
|
407109
|
+
origin: origin2,
|
|
407110
|
+
forcePushNoQuestion,
|
|
407111
|
+
askToRetry: true
|
|
407112
|
+
});
|
|
406437
407113
|
}
|
|
406438
|
-
await this.project.git.pushCurrentBranch({
|
|
406439
|
-
force,
|
|
406440
|
-
origin: origin2,
|
|
406441
|
-
forcePushNoQuestion,
|
|
406442
|
-
askToRetry: true
|
|
406443
|
-
});
|
|
406444
407114
|
if (this.automaticallyAddAllChangesWhenPushingToGit() || updateType === "first-level" || updateType === "deep") {
|
|
406445
407115
|
if (this.project.linkedProjects.getLinkedProjectsConfig().skipRecrusivePush) {
|
|
406446
407116
|
lib_13.Helpers.warn(`Skipping recrusive (children) push for ${this.project.genericName}`);
|
|
406447
407117
|
return;
|
|
406448
407118
|
}
|
|
406449
407119
|
const optForChildren = lib_32._.cloneDeep(options2);
|
|
407120
|
+
const projectsToVisit = options2.projectsToTravel || [];
|
|
407121
|
+
delete options2.projectsToTravel;
|
|
406450
407122
|
if (updateType === "first-level") {
|
|
406451
407123
|
optForChildren.updateType = "only-this";
|
|
406452
407124
|
}
|
|
406453
407125
|
for (const child of this.gitChildren) {
|
|
407126
|
+
optForChildren.projectsToTravel = projectsToVisit;
|
|
406454
407127
|
if (mergeUpdateCommits) {
|
|
406455
407128
|
await child.git.meltActionCommits();
|
|
406456
407129
|
}
|
|
@@ -426144,14 +426817,36 @@ var require_base_global_command_line = __commonJS({
|
|
|
426144
426817
|
async pulDeep() {
|
|
426145
426818
|
await this.pullDeep();
|
|
426146
426819
|
}
|
|
426820
|
+
_countChildren(firstLevel = false) {
|
|
426821
|
+
const reposLocations = [];
|
|
426822
|
+
const queue = [this.project];
|
|
426823
|
+
while (queue.length > 0) {
|
|
426824
|
+
const proj = queue.shift();
|
|
426825
|
+
if (!proj) {
|
|
426826
|
+
continue;
|
|
426827
|
+
}
|
|
426828
|
+
if (!reposLocations.includes(proj.location)) {
|
|
426829
|
+
reposLocations.push(proj.location);
|
|
426830
|
+
}
|
|
426831
|
+
const children = (proj.children || []).filter((c) => c.git.isGitRoot);
|
|
426832
|
+
if (!firstLevel) {
|
|
426833
|
+
queue.push(...children);
|
|
426834
|
+
}
|
|
426835
|
+
}
|
|
426836
|
+
return reposLocations.map((location2) => this.project.ins.From(location2));
|
|
426837
|
+
}
|
|
426147
426838
|
async pullDeep(options2) {
|
|
426148
426839
|
options2 = options2 || {};
|
|
426149
426840
|
if (!await this.cwdIsProject({ requireProjectWithGitRoot: true })) {
|
|
426150
426841
|
return;
|
|
426151
426842
|
}
|
|
426152
426843
|
lib_92.GlobalTaskManager.start(constants_12.PULL_ACTION_NAME);
|
|
426844
|
+
const projectsToTravel = this._countChildren();
|
|
426153
426845
|
await this.project.git.pullProcess({
|
|
426154
426846
|
setOrigin: this.params["setOrigin"],
|
|
426847
|
+
projectsToTravel,
|
|
426848
|
+
// @ts-ignore
|
|
426849
|
+
startFrom: this.params.startFrom,
|
|
426155
426850
|
...options2
|
|
426156
426851
|
});
|
|
426157
426852
|
lib_92.GlobalTaskManager.stop(constants_12.PULL_ACTION_NAME, () => {
|
|
@@ -426164,8 +426859,10 @@ var require_base_global_command_line = __commonJS({
|
|
|
426164
426859
|
if (!await this.cwdIsProject({ requireProjectWithGitRoot: true })) {
|
|
426165
426860
|
return;
|
|
426166
426861
|
}
|
|
426862
|
+
const projectsToTravel = this._countChildren(true);
|
|
426167
426863
|
await this.project.git.pullProcess({
|
|
426168
426864
|
setOrigin: this.params["setOrigin"],
|
|
426865
|
+
projectsToTravel,
|
|
426169
426866
|
updateType: "first-level"
|
|
426170
426867
|
});
|
|
426171
426868
|
this._exit();
|
|
@@ -426522,6 +427219,7 @@ ${lastCommitMessage}
|
|
|
426522
427219
|
return;
|
|
426523
427220
|
}
|
|
426524
427221
|
await this._preventPushPullFromNotCorrectBranch();
|
|
427222
|
+
const projectsToTravel = this._countChildren(options2?.updateType === "first-level");
|
|
426525
427223
|
if (!options2.overrideCommitMessage && this.project.git.useBranchNameDirectlyAsCommitMessage()) {
|
|
426526
427224
|
const jiraNumbers = commit_data_1.CommitData.extractAndOrderJiraNumbers(this.args.join(" "));
|
|
426527
427225
|
lib_22.Helpers.info(`Using branch name directly as commit message.
|
|
@@ -426538,6 +427236,9 @@ ${lastCommitMessage}
|
|
|
426538
427236
|
await this.project.git.pushProcess({
|
|
426539
427237
|
...options2,
|
|
426540
427238
|
forcePushNoQuestion: options2.force,
|
|
427239
|
+
projectsToTravel,
|
|
427240
|
+
// @ts-ignore
|
|
427241
|
+
startFrom: this.params.startFrom,
|
|
426541
427242
|
args: options2?.overrideCommitMessage ? (options2?.overrideCommitMessage || "").split(" ") : this.args,
|
|
426542
427243
|
exitCallBack: () => {
|
|
426543
427244
|
this._exit();
|
|
@@ -430500,6 +431201,61 @@ export * from './${folder}';
|
|
|
430500
431201
|
}
|
|
430501
431202
|
});
|
|
430502
431203
|
|
|
431204
|
+
// tnp/tmp-local-copyto-proj-dist/node_modules/tnp/lib/project/abstract/artifacts/angular-node-app/artifact-angular-node-app-helpers.js
|
|
431205
|
+
var require_artifact_angular_node_app_helpers = __commonJS({
|
|
431206
|
+
"tnp/tmp-local-copyto-proj-dist/node_modules/tnp/lib/project/abstract/artifacts/angular-node-app/artifact-angular-node-app-helpers.js"(exports2) {
|
|
431207
|
+
"use strict";
|
|
431208
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
431209
|
+
exports2.ArtifactsAngularNodeAppHelpers = void 0;
|
|
431210
|
+
var lib_13 = require_lib31();
|
|
431211
|
+
var constants_12 = require_constants20();
|
|
431212
|
+
var ArtifactsAngularNodeAppHelpers;
|
|
431213
|
+
(function(ArtifactsAngularNodeAppHelpers2) {
|
|
431214
|
+
ArtifactsAngularNodeAppHelpers2.updateReleasDotEnv = async (contextsNames, localReleaseOutputBasePath, project, releaseOptions) => {
|
|
431215
|
+
const useDomain = releaseOptions.website.useDomain;
|
|
431216
|
+
const domain = releaseOptions.website.domain;
|
|
431217
|
+
for (let i = 0; i < contextsNames.length; i++) {
|
|
431218
|
+
const contextRealIndex = i + 1;
|
|
431219
|
+
const contextName = contextsNames[i].contextName;
|
|
431220
|
+
const taskNameBackendReleasePort = `docker release ${domain} ${releaseOptions.release.releaseType} backend port for ${contextName} (n=${contextRealIndex})`;
|
|
431221
|
+
const portBackendRelease = await project.registerAndAssignPort(taskNameBackendReleasePort);
|
|
431222
|
+
const taskNameFrontendreleasePort = `docker release ${domain} ${releaseOptions.release.releaseType} frontend port for ${contextName} (n=${contextRealIndex})`;
|
|
431223
|
+
const portFrontendRelease = await project.registerAndAssignPort(taskNameFrontendreleasePort);
|
|
431224
|
+
const domainForContextFE = useDomain ? domain : `http://localhost:${portFrontendRelease}`;
|
|
431225
|
+
const domainForContextBE = useDomain ? domain : `http://localhost:${portBackendRelease}`;
|
|
431226
|
+
lib_13.UtilsDotFile.setValuesKeysFromObject([localReleaseOutputBasePath, constants_12.dotEnvFile], {
|
|
431227
|
+
[`HOST_BACKEND_PORT_${contextRealIndex}`]: portBackendRelease,
|
|
431228
|
+
[`HOST_URL_${contextRealIndex}`]: domainForContextBE,
|
|
431229
|
+
[`FRONTEND_NORMAL_APP_PORT_${contextRealIndex}`]: portFrontendRelease,
|
|
431230
|
+
[`FRONTEND_HOST_URL_${contextRealIndex}`]: domainForContextFE,
|
|
431231
|
+
...i === 0 ? {
|
|
431232
|
+
[`HOST_BACKEND_PORT`]: portBackendRelease,
|
|
431233
|
+
[`HOST_URL`]: domainForContextBE,
|
|
431234
|
+
[`FRONTEND_NORMAL_APP_PORT`]: portFrontendRelease,
|
|
431235
|
+
[`FRONTEND_HOST_URL`]: domainForContextFE
|
|
431236
|
+
} : {}
|
|
431237
|
+
});
|
|
431238
|
+
lib_13.UtilsDotFile.setCommentToKeyInDotFile([localReleaseOutputBasePath, constants_12.dotEnvFile], `HOST_BACKEND_PORT_${contextRealIndex}`, `${lib_13.CoreModels.tagForTaskName}="${taskNameBackendReleasePort}"`);
|
|
431239
|
+
if (i === 0) {
|
|
431240
|
+
lib_13.UtilsDotFile.setCommentToKeyInDotFile([localReleaseOutputBasePath, constants_12.dotEnvFile], `HOST_BACKEND_PORT`, `${lib_13.CoreModels.tagForTaskName}="${taskNameBackendReleasePort}"`);
|
|
431241
|
+
}
|
|
431242
|
+
lib_13.UtilsDotFile.setCommentToKeyInDotFile([localReleaseOutputBasePath, constants_12.dotEnvFile], `FRONTEND_NORMAL_APP_PORT_${contextRealIndex}`, `${lib_13.CoreModels.tagForTaskName}="${taskNameFrontendreleasePort}"`);
|
|
431243
|
+
}
|
|
431244
|
+
if (!useDomain) {
|
|
431245
|
+
lib_13.UtilsDotFile.addCommentAtTheBeginningOfDotFile([localReleaseOutputBasePath, constants_12.dotEnvFile], `HINT! IF YOU NEED DOMAIN USE userDomain=true in env.ts`);
|
|
431246
|
+
}
|
|
431247
|
+
if (!releaseOptions.build.cloudflare) {
|
|
431248
|
+
lib_13.UtilsDotFile.setValueToDotFile([localReleaseOutputBasePath, ".env"], "COMPOSE_PROJECT_NAME", ("TaonDeployment__" + lib_13._.camelCase(releaseOptions.website.domain) + `__v${lib_13._.kebabCase(project.packageJson.version)}__release-type-${releaseOptions.release.releaseType}--env--${!releaseOptions.release.envName || releaseOptions.release.envName === "__" ? "default" : releaseOptions.release.envName}${releaseOptions.release.envNumber || ""}`).toLowerCase());
|
|
431249
|
+
}
|
|
431250
|
+
if (!releaseOptions.build.cloudflare) {
|
|
431251
|
+
lib_13.UtilsDotFile.setValueToDotFile([localReleaseOutputBasePath, constants_12.dotEnvFile], "BUILD_DATE", `${(0, lib_13.dateformat)(/* @__PURE__ */ new Date(), "dd-mm-yyyy_HH:MM:ss")}`);
|
|
431252
|
+
lib_13.UtilsDotFile.setValueToDotFile([localReleaseOutputBasePath, constants_12.dotEnvFile], "NODE_ENV", `production`);
|
|
431253
|
+
}
|
|
431254
|
+
};
|
|
431255
|
+
})(ArtifactsAngularNodeAppHelpers || (exports2.ArtifactsAngularNodeAppHelpers = ArtifactsAngularNodeAppHelpers = {}));
|
|
431256
|
+
}
|
|
431257
|
+
});
|
|
431258
|
+
|
|
430503
431259
|
// tnp/tmp-local-copyto-proj-dist/node_modules/tnp/lib/project/abstract/cloud-flare-projects/cloud-flare-project.js
|
|
430504
431260
|
var require_cloud_flare_project = __commonJS({
|
|
430505
431261
|
"tnp/tmp-local-copyto-proj-dist/node_modules/tnp/lib/project/abstract/cloud-flare-projects/cloud-flare-project.js"(exports2) {
|
|
@@ -430510,6 +431266,7 @@ var require_cloud_flare_project = __commonJS({
|
|
|
430510
431266
|
var lib_22 = require_lib31();
|
|
430511
431267
|
var lib_32 = require_lib47();
|
|
430512
431268
|
var constants_12 = require_constants20();
|
|
431269
|
+
var artifact_angular_node_app_helpers_1 = require_artifact_angular_node_app_helpers();
|
|
430513
431270
|
var cloud_flare_projects_utils_1 = require_cloud_flare_projects_utils();
|
|
430514
431271
|
var CloudFlareSubProject = class {
|
|
430515
431272
|
absLocationPath;
|
|
@@ -430676,7 +431433,7 @@ var require_cloud_flare_project = __commonJS({
|
|
|
430676
431433
|
}
|
|
430677
431434
|
await cloud_flare_projects_utils_1.CloudFlarePorjectsUtils.loginCliCloudFlare();
|
|
430678
431435
|
await this.addKVDb();
|
|
430679
|
-
await this.deployment();
|
|
431436
|
+
await this.deployment(opt.releaseOptions);
|
|
430680
431437
|
const secretsData = this.apiSecretsKeyData();
|
|
430681
431438
|
if (secretsData.length > 0) {
|
|
430682
431439
|
if (await lib_22.UtilsTerminal.confirm({
|
|
@@ -430710,7 +431467,7 @@ var require_cloud_flare_project = __commonJS({
|
|
|
430710
431467
|
}
|
|
430711
431468
|
//#endregion
|
|
430712
431469
|
//#region deplyment to cloud flare
|
|
430713
|
-
async deployment() {
|
|
431470
|
+
async deployment(releaseOptions) {
|
|
430714
431471
|
await this.init();
|
|
430715
431472
|
await cloud_flare_projects_utils_1.CloudFlarePorjectsUtils.loginCliCloudFlare();
|
|
430716
431473
|
lib_22.Helpers.taskStarted(`STARTING DEPLOYMENT OF WORKER ${this.cwdWorker}`);
|
|
@@ -430725,12 +431482,32 @@ var require_cloud_flare_project = __commonJS({
|
|
|
430725
431482
|
});
|
|
430726
431483
|
const masterKey = (await ctrl.getMasterPassword(this.taonParentProject.location).request()).body.text;
|
|
430727
431484
|
lib_22.UtilsFilesFoldersSync.writeFile([this.cwdWorker, ".env"], `${lib_22.UtilsSecretEnv.MASTER_PASS_KEY}="${masterKey}"`);
|
|
431485
|
+
const contextsNames = this.taonParentProject.framework.getAllDetectedTaonContexts({
|
|
431486
|
+
skipLibFolder: true
|
|
431487
|
+
});
|
|
431488
|
+
releaseOptions.build.cloudflare = true;
|
|
431489
|
+
if (!releaseOptions.website.useDomain) {
|
|
431490
|
+
releaseOptions.website.useDomain = true;
|
|
431491
|
+
releaseOptions.website.domain = this.workerUrl;
|
|
431492
|
+
}
|
|
431493
|
+
await artifact_angular_node_app_helpers_1.ArtifactsAngularNodeAppHelpers.updateReleasDotEnv(contextsNames, this.cwdWorker, this.taonParentProject, releaseOptions);
|
|
430728
431494
|
const data = await lib_22.UtilsExecProc.spawnAsync(`npm-run wrangler deploy --secrets-file .env`, {
|
|
430729
431495
|
cwd: this.cwdWorker
|
|
430730
431496
|
}).getOutput();
|
|
430731
431497
|
const accountName = cloud_flare_projects_utils_1.CloudFlarePorjectsUtils.extractWorkersDevInfo(data.stdout + data.stderr);
|
|
430732
431498
|
lib_22.Helpers.removeFileIfExists([this.cwdWorker, ".env"]);
|
|
430733
|
-
lib_22.Helpers.taskDone(`
|
|
431499
|
+
lib_22.Helpers.taskDone(`
|
|
431500
|
+
|
|
431501
|
+
DONE DEPLOYMENT on acccount name "${accountName}"
|
|
431502
|
+
|
|
431503
|
+
|
|
431504
|
+
YOU WEBSITE IS AVAILABLE HERE:
|
|
431505
|
+
|
|
431506
|
+
${this.workerUrl}
|
|
431507
|
+
|
|
431508
|
+
|
|
431509
|
+
|
|
431510
|
+
`);
|
|
430734
431511
|
this.taonParentProject.taonJson.setCloudFlareAccountSubdomain(accountName);
|
|
430735
431512
|
break;
|
|
430736
431513
|
} catch (error2) {
|
|
@@ -430950,6 +431727,7 @@ var require_cloud_flare_custom_worker = __commonJS({
|
|
|
430950
431727
|
});
|
|
430951
431728
|
}
|
|
430952
431729
|
//#endregion
|
|
431730
|
+
//#region API / get files for branding worker
|
|
430953
431731
|
getFilesForBrandingWorker() {
|
|
430954
431732
|
const filesForBranding = [
|
|
430955
431733
|
...super.getFilesForBrandingWorker(),
|
|
@@ -431098,7 +431876,7 @@ var require_build_info_auto_generated4 = __commonJS({
|
|
|
431098
431876
|
exports2.BUILD_BASE_HREF = "";
|
|
431099
431877
|
exports2.PROJECT_NPM_NAME = "@taon-dev/api-workers";
|
|
431100
431878
|
exports2.CURRENT_PACKAGE_TAON_VERSION = "v21";
|
|
431101
|
-
exports2.CURRENT_PACKAGE_VERSION = "21.0.
|
|
431879
|
+
exports2.CURRENT_PACKAGE_VERSION = "21.0.22";
|
|
431102
431880
|
}
|
|
431103
431881
|
});
|
|
431104
431882
|
|
|
@@ -431972,7 +432750,7 @@ var require_build_info_auto_generated5 = __commonJS({
|
|
|
431972
432750
|
exports2.BUILD_BASE_HREF = "";
|
|
431973
432751
|
exports2.PROJECT_NPM_NAME = "@taon-dev/cloud";
|
|
431974
432752
|
exports2.CURRENT_PACKAGE_TAON_VERSION = "v21";
|
|
431975
|
-
exports2.CURRENT_PACKAGE_VERSION = "21.0.
|
|
432753
|
+
exports2.CURRENT_PACKAGE_VERSION = "21.0.242";
|
|
431976
432754
|
}
|
|
431977
432755
|
});
|
|
431978
432756
|
|
|
@@ -432797,7 +433575,7 @@ var require_processes_repository = __commonJS({
|
|
|
432797
433575
|
throw new Error(`No process with id ${processId}`);
|
|
432798
433576
|
}
|
|
432799
433577
|
await callback(proc);
|
|
432800
|
-
await this.
|
|
433578
|
+
await this.shallowUpdate(proc);
|
|
432801
433579
|
this.ctx.realtimeServer.triggerEntityPropertyChanges(proc, "outputLast40lines");
|
|
432802
433580
|
}
|
|
432803
433581
|
};
|
|
@@ -438306,6 +439084,7 @@ var require_artifact_angular_node_app = __commonJS({
|
|
|
438306
439084
|
var production_build_1 = require_production_build();
|
|
438307
439085
|
var base_artifact_1 = require_base_artifact();
|
|
438308
439086
|
var inside_struct_electron_1 = require_inside_struct_electron();
|
|
439087
|
+
var artifact_angular_node_app_helpers_1 = require_artifact_angular_node_app_helpers();
|
|
438309
439088
|
var app_hosts_recreate_helper_1 = require_app_hosts_recreate_helper();
|
|
438310
439089
|
var basename_manager_1 = require_basename_manager();
|
|
438311
439090
|
var inside_struct_app_1 = require_inside_struct_app();
|
|
@@ -438756,41 +439535,7 @@ var require_artifact_angular_node_app = __commonJS({
|
|
|
438756
439535
|
const contextsNames = this.project.framework.getAllDetectedTaonContexts({
|
|
438757
439536
|
skipLibFolder: true
|
|
438758
439537
|
});
|
|
438759
|
-
|
|
438760
|
-
const domain = releaseOptions.website.domain;
|
|
438761
|
-
for (let i = 0; i < contextsNames.length; i++) {
|
|
438762
|
-
const contextRealIndex = i + 1;
|
|
438763
|
-
const contextName = contextsNames[i].contextName;
|
|
438764
|
-
const taskNameBackendReleasePort = `docker release ${domain} ${releaseOptions.release.releaseType} backend port for ${contextName} (n=${contextRealIndex})`;
|
|
438765
|
-
const portBackendRelease = await this.project.registerAndAssignPort(taskNameBackendReleasePort);
|
|
438766
|
-
const taskNameFrontendreleasePort = `docker release ${domain} ${releaseOptions.release.releaseType} frontend port for ${contextName} (n=${contextRealIndex})`;
|
|
438767
|
-
const portFrontendRelease = await this.project.registerAndAssignPort(taskNameFrontendreleasePort);
|
|
438768
|
-
const domainForContextFE = useDomain ? domain : `http://localhost:${portFrontendRelease}`;
|
|
438769
|
-
const domainForContextBE = useDomain ? domain : `http://localhost:${portBackendRelease}`;
|
|
438770
|
-
lib_52.UtilsDotFile.setValuesKeysFromObject([localReleaseOutputBasePath, constants_12.dotEnvFile], {
|
|
438771
|
-
[`HOST_BACKEND_PORT_${contextRealIndex}`]: portBackendRelease,
|
|
438772
|
-
[`HOST_URL_${contextRealIndex}`]: domainForContextBE,
|
|
438773
|
-
[`FRONTEND_NORMAL_APP_PORT_${contextRealIndex}`]: portFrontendRelease,
|
|
438774
|
-
[`FRONTEND_HOST_URL_${contextRealIndex}`]: domainForContextFE,
|
|
438775
|
-
...i === 0 ? {
|
|
438776
|
-
[`HOST_BACKEND_PORT`]: portBackendRelease,
|
|
438777
|
-
[`HOST_URL`]: domainForContextBE,
|
|
438778
|
-
[`FRONTEND_NORMAL_APP_PORT`]: portFrontendRelease,
|
|
438779
|
-
[`FRONTEND_HOST_URL`]: domainForContextFE
|
|
438780
|
-
} : {}
|
|
438781
|
-
});
|
|
438782
|
-
lib_52.UtilsDotFile.setCommentToKeyInDotFile([localReleaseOutputBasePath, constants_12.dotEnvFile], `HOST_BACKEND_PORT_${contextRealIndex}`, `${lib_32.CoreModels.tagForTaskName}="${taskNameBackendReleasePort}"`);
|
|
438783
|
-
if (i === 0) {
|
|
438784
|
-
lib_52.UtilsDotFile.setCommentToKeyInDotFile([localReleaseOutputBasePath, constants_12.dotEnvFile], `HOST_BACKEND_PORT`, `${lib_32.CoreModels.tagForTaskName}="${taskNameBackendReleasePort}"`);
|
|
438785
|
-
}
|
|
438786
|
-
lib_52.UtilsDotFile.setCommentToKeyInDotFile([localReleaseOutputBasePath, constants_12.dotEnvFile], `FRONTEND_NORMAL_APP_PORT_${contextRealIndex}`, `${lib_32.CoreModels.tagForTaskName}="${taskNameFrontendreleasePort}"`);
|
|
438787
|
-
}
|
|
438788
|
-
if (!useDomain) {
|
|
438789
|
-
lib_52.UtilsDotFile.addCommentAtTheBeginningOfDotFile([localReleaseOutputBasePath, constants_12.dotEnvFile], `HINT! IF YOU NEED DOMAIN USE userDomain=true in env.ts`);
|
|
438790
|
-
}
|
|
438791
|
-
lib_52.UtilsDotFile.setValueToDotFile([localReleaseOutputBasePath, ".env"], "COMPOSE_PROJECT_NAME", ("TaonDeployment__" + lib_32._.camelCase(releaseOptions.website.domain) + `__v${lib_32._.kebabCase(this.project.packageJson.version)}__release-type-${releaseOptions.release.releaseType}--env--${!releaseOptions.release.envName || releaseOptions.release.envName === "__" ? "default" : releaseOptions.release.envName}${releaseOptions.release.envNumber || ""}`).toLowerCase());
|
|
438792
|
-
lib_52.UtilsDotFile.setValueToDotFile([localReleaseOutputBasePath, constants_12.dotEnvFile], "BUILD_DATE", `${(0, lib_32.dateformat)(/* @__PURE__ */ new Date(), "dd-mm-yyyy_HH:MM:ss")}`);
|
|
438793
|
-
lib_52.UtilsDotFile.setValueToDotFile([localReleaseOutputBasePath, constants_12.dotEnvFile], "NODE_ENV", `production`);
|
|
439538
|
+
await artifact_angular_node_app_helpers_1.ArtifactsAngularNodeAppHelpers.updateReleasDotEnv(contextsNames, localReleaseOutputBasePath, this.project, releaseOptions);
|
|
438794
439539
|
const allValuesDotEnv = lib_52.UtilsDotFile.getValuesKeysAsJsonObject([
|
|
438795
439540
|
localReleaseOutputBasePath,
|
|
438796
439541
|
constants_12.dotEnvFile
|
|
@@ -438944,7 +439689,7 @@ ${dockerComposeYmlFileContent}
|
|
|
438944
439689
|
message: "Press any key to start deployment to cloudflare"
|
|
438945
439690
|
});
|
|
438946
439691
|
}
|
|
438947
|
-
await worker.deployment();
|
|
439692
|
+
await worker.deployment(releaseOptions);
|
|
438948
439693
|
}
|
|
438949
439694
|
//#endregion
|
|
438950
439695
|
//#region deploy to cloud
|
|
@@ -447898,131 +448643,141 @@ var require_index_cjs4 = __commonJS({
|
|
|
447898
448643
|
if (tight) markTightParagraphs(state, listTokIdx);
|
|
447899
448644
|
return true;
|
|
447900
448645
|
}
|
|
448646
|
+
var MAX_LABEL_LENGTH = 999;
|
|
448647
|
+
function countCodePoints(str) {
|
|
448648
|
+
let length = str.length;
|
|
448649
|
+
for (let i = 0; i < str.length - 1; i++) {
|
|
448650
|
+
const high = str.charCodeAt(i);
|
|
448651
|
+
if (high < 55296 || high > 56319) continue;
|
|
448652
|
+
const low = str.charCodeAt(i + 1);
|
|
448653
|
+
if (low >= 56320 && low <= 57343) {
|
|
448654
|
+
length--;
|
|
448655
|
+
i++;
|
|
448656
|
+
}
|
|
448657
|
+
}
|
|
448658
|
+
return length;
|
|
448659
|
+
}
|
|
448660
|
+
function lineEnd(state, line2) {
|
|
448661
|
+
return Math.min(state.eMarks[line2] + 1, state.src.length);
|
|
448662
|
+
}
|
|
448663
|
+
function getNextLinePos(state, nextLine) {
|
|
448664
|
+
const endLine = state.lineMax;
|
|
448665
|
+
if (nextLine >= endLine || state.isEmpty(nextLine)) return -1;
|
|
448666
|
+
let isContinuation = false;
|
|
448667
|
+
if (state.sCount[nextLine] - state.blkIndent > 3) isContinuation = true;
|
|
448668
|
+
if (state.sCount[nextLine] < 0) isContinuation = true;
|
|
448669
|
+
if (!isContinuation) {
|
|
448670
|
+
const terminatorRules = state.md.block.ruler.getRules("reference");
|
|
448671
|
+
const oldParentType = state.parentType;
|
|
448672
|
+
state.parentType = "reference";
|
|
448673
|
+
let terminate = false;
|
|
448674
|
+
for (let i = 0, l2 = terminatorRules.length; i < l2; i++) if (terminatorRules[i](state, nextLine, endLine, true)) {
|
|
448675
|
+
terminate = true;
|
|
448676
|
+
break;
|
|
448677
|
+
}
|
|
448678
|
+
state.parentType = oldParentType;
|
|
448679
|
+
if (terminate) return -1;
|
|
448680
|
+
}
|
|
448681
|
+
return state.bMarks[nextLine] + state.tShift[nextLine];
|
|
448682
|
+
}
|
|
447901
448683
|
function reference(state, startLine, _endLine, silent) {
|
|
448684
|
+
const src = state.src;
|
|
447902
448685
|
let pos = state.bMarks[startLine] + state.tShift[startLine];
|
|
447903
|
-
let max2 = state.eMarks[startLine];
|
|
447904
448686
|
let nextLine = startLine + 1;
|
|
447905
448687
|
if (state.sCount[startLine] - state.blkIndent >= 4) return false;
|
|
447906
|
-
if (
|
|
447907
|
-
|
|
447908
|
-
|
|
447909
|
-
if (nextLine2 >= endLine || state.isEmpty(nextLine2)) return null;
|
|
447910
|
-
let isContinuation = false;
|
|
447911
|
-
if (state.sCount[nextLine2] - state.blkIndent > 3) isContinuation = true;
|
|
447912
|
-
if (state.sCount[nextLine2] < 0) isContinuation = true;
|
|
447913
|
-
if (!isContinuation) {
|
|
447914
|
-
const terminatorRules = state.md.block.ruler.getRules("reference");
|
|
447915
|
-
const oldParentType = state.parentType;
|
|
447916
|
-
state.parentType = "reference";
|
|
447917
|
-
let terminate = false;
|
|
447918
|
-
for (let i = 0, l2 = terminatorRules.length; i < l2; i++) if (terminatorRules[i](state, nextLine2, endLine, true)) {
|
|
447919
|
-
terminate = true;
|
|
447920
|
-
break;
|
|
447921
|
-
}
|
|
447922
|
-
state.parentType = oldParentType;
|
|
447923
|
-
if (terminate) return null;
|
|
447924
|
-
}
|
|
447925
|
-
const pos2 = state.bMarks[nextLine2] + state.tShift[nextLine2];
|
|
447926
|
-
const max3 = state.eMarks[nextLine2];
|
|
447927
|
-
return state.src.slice(pos2, max3 + 1);
|
|
447928
|
-
}
|
|
447929
|
-
let str = state.src.slice(pos, max2 + 1);
|
|
447930
|
-
max2 = str.length;
|
|
448688
|
+
if (src.charCodeAt(pos) !== 91) return false;
|
|
448689
|
+
let max2 = lineEnd(state, startLine);
|
|
448690
|
+
let rawLabel = "";
|
|
447931
448691
|
let labelEnd = -1;
|
|
447932
|
-
|
|
447933
|
-
|
|
448692
|
+
let segmentStart = ++pos;
|
|
448693
|
+
while (pos < max2) {
|
|
448694
|
+
if (rawLabel.length + pos - segmentStart > MAX_LABEL_LENGTH * 2) return false;
|
|
448695
|
+
let ch = src.charCodeAt(pos);
|
|
447934
448696
|
if (ch === 91) return false;
|
|
447935
|
-
|
|
448697
|
+
if (ch === 93) {
|
|
447936
448698
|
labelEnd = pos;
|
|
447937
448699
|
break;
|
|
447938
|
-
} else if (ch === 10) {
|
|
447939
|
-
const lineContent = getNextLine(nextLine);
|
|
447940
|
-
if (lineContent !== null) {
|
|
447941
|
-
str += lineContent;
|
|
447942
|
-
max2 = str.length;
|
|
447943
|
-
nextLine++;
|
|
447944
|
-
}
|
|
447945
|
-
} else if (ch === 92) {
|
|
447946
|
-
pos++;
|
|
447947
|
-
if (pos < max2 && str.charCodeAt(pos) === 10) {
|
|
447948
|
-
const lineContent = getNextLine(nextLine);
|
|
447949
|
-
if (lineContent !== null) {
|
|
447950
|
-
str += lineContent;
|
|
447951
|
-
max2 = str.length;
|
|
447952
|
-
nextLine++;
|
|
447953
|
-
}
|
|
447954
|
-
}
|
|
447955
448700
|
}
|
|
448701
|
+
if (ch === 92) ch = src.charCodeAt(++pos);
|
|
448702
|
+
if (ch === 10 && pos < max2) {
|
|
448703
|
+
const nextPos = getNextLinePos(state, nextLine);
|
|
448704
|
+
if (nextPos < 0) return false;
|
|
448705
|
+
rawLabel += src.slice(segmentStart, max2);
|
|
448706
|
+
pos = segmentStart = nextPos;
|
|
448707
|
+
max2 = lineEnd(state, nextLine++);
|
|
448708
|
+
continue;
|
|
448709
|
+
}
|
|
448710
|
+
pos++;
|
|
447956
448711
|
}
|
|
447957
|
-
if (labelEnd < 0 ||
|
|
447958
|
-
|
|
447959
|
-
|
|
448712
|
+
if (labelEnd < 0 || src.charCodeAt(labelEnd + 1) !== 58) return false;
|
|
448713
|
+
rawLabel += src.slice(segmentStart, labelEnd);
|
|
448714
|
+
if (rawLabel.length > MAX_LABEL_LENGTH && countCodePoints(rawLabel) > MAX_LABEL_LENGTH) return false;
|
|
448715
|
+
pos = labelEnd + 2;
|
|
448716
|
+
while (pos < max2) {
|
|
448717
|
+
const ch = src.charCodeAt(pos);
|
|
447960
448718
|
if (ch === 10) {
|
|
447961
|
-
const
|
|
447962
|
-
if (
|
|
447963
|
-
|
|
447964
|
-
|
|
447965
|
-
|
|
447966
|
-
|
|
447967
|
-
|
|
447968
|
-
|
|
447969
|
-
}
|
|
447970
|
-
const destRes = state.md.helpers.parseLinkDestination(str, pos, max2);
|
|
448719
|
+
const nextPos = getNextLinePos(state, nextLine);
|
|
448720
|
+
if (nextPos < 0) break;
|
|
448721
|
+
pos = nextPos;
|
|
448722
|
+
max2 = lineEnd(state, nextLine++);
|
|
448723
|
+
} else if (isSpace(ch)) pos++;
|
|
448724
|
+
else break;
|
|
448725
|
+
}
|
|
448726
|
+
const destRes = state.md.helpers.parseLinkDestination(src, pos, max2);
|
|
447971
448727
|
if (!destRes.ok) return false;
|
|
447972
448728
|
const href = state.md.normalizeLink(destRes.str);
|
|
447973
448729
|
if (!state.md.validateLink(href)) return false;
|
|
447974
448730
|
pos = destRes.pos;
|
|
447975
448731
|
const destEndPos = pos;
|
|
448732
|
+
const destEndMax = max2;
|
|
447976
448733
|
const destEndLineNo = nextLine;
|
|
447977
|
-
|
|
447978
|
-
|
|
447979
|
-
const ch = str.charCodeAt(pos);
|
|
448734
|
+
while (pos < max2) {
|
|
448735
|
+
const ch = src.charCodeAt(pos);
|
|
447980
448736
|
if (ch === 10) {
|
|
447981
|
-
const
|
|
447982
|
-
if (
|
|
447983
|
-
|
|
447984
|
-
|
|
447985
|
-
|
|
447986
|
-
|
|
447987
|
-
|
|
447988
|
-
|
|
447989
|
-
|
|
447990
|
-
let titleRes = state.md.helpers.parseLinkTitle(str, pos, max2);
|
|
448737
|
+
const nextPos = getNextLinePos(state, nextLine);
|
|
448738
|
+
if (nextPos < 0) break;
|
|
448739
|
+
pos = nextPos;
|
|
448740
|
+
max2 = lineEnd(state, nextLine++);
|
|
448741
|
+
} else if (isSpace(ch)) pos++;
|
|
448742
|
+
else break;
|
|
448743
|
+
}
|
|
448744
|
+
const titleStart = pos;
|
|
448745
|
+
let titleRes = state.md.helpers.parseLinkTitle(src, pos, max2);
|
|
447991
448746
|
while (titleRes.can_continue) {
|
|
447992
|
-
const
|
|
447993
|
-
if (
|
|
447994
|
-
|
|
447995
|
-
|
|
447996
|
-
|
|
447997
|
-
nextLine++;
|
|
447998
|
-
titleRes = state.md.helpers.parseLinkTitle(str, pos, max2, titleRes);
|
|
448747
|
+
const nextPos = getNextLinePos(state, nextLine);
|
|
448748
|
+
if (nextPos < 0) break;
|
|
448749
|
+
pos = nextPos;
|
|
448750
|
+
max2 = lineEnd(state, nextLine++);
|
|
448751
|
+
titleRes = state.md.helpers.parseLinkTitle(src, pos, max2, titleRes);
|
|
447999
448752
|
}
|
|
448000
448753
|
let title;
|
|
448001
|
-
if (
|
|
448754
|
+
if (titleStart !== destEndPos && titleRes.ok) {
|
|
448002
448755
|
title = titleRes.str;
|
|
448003
448756
|
pos = titleRes.pos;
|
|
448004
448757
|
} else {
|
|
448005
448758
|
title = "";
|
|
448006
448759
|
pos = destEndPos;
|
|
448760
|
+
max2 = destEndMax;
|
|
448007
448761
|
nextLine = destEndLineNo;
|
|
448008
448762
|
}
|
|
448009
448763
|
while (pos < max2) {
|
|
448010
|
-
if (!isSpace(
|
|
448764
|
+
if (!isSpace(src.charCodeAt(pos))) break;
|
|
448011
448765
|
pos++;
|
|
448012
448766
|
}
|
|
448013
|
-
if (pos < max2 &&
|
|
448767
|
+
if (pos < max2 && src.charCodeAt(pos) !== 10) {
|
|
448014
448768
|
if (title) {
|
|
448015
448769
|
title = "";
|
|
448016
448770
|
pos = destEndPos;
|
|
448771
|
+
max2 = destEndMax;
|
|
448017
448772
|
nextLine = destEndLineNo;
|
|
448018
448773
|
while (pos < max2) {
|
|
448019
|
-
if (!isSpace(
|
|
448774
|
+
if (!isSpace(src.charCodeAt(pos))) break;
|
|
448020
448775
|
pos++;
|
|
448021
448776
|
}
|
|
448022
448777
|
}
|
|
448023
448778
|
}
|
|
448024
|
-
if (pos < max2 &&
|
|
448025
|
-
const label = normalizeReference(
|
|
448779
|
+
if (pos < max2 && src.charCodeAt(pos) !== 10) return false;
|
|
448780
|
+
const label = normalizeReference(rawLabel);
|
|
448026
448781
|
if (!label) return false;
|
|
448027
448782
|
if (silent) return true;
|
|
448028
448783
|
if (typeof state.env.references === "undefined") state.env.references = {};
|
|
@@ -448097,7 +448852,6 @@ var require_index_cjs4 = __commonJS({
|
|
|
448097
448852
|
"track",
|
|
448098
448853
|
"ul"
|
|
448099
448854
|
];
|
|
448100
|
-
var HTML_TAG_RE = /* @__PURE__ */ new RegExp(`^(?:<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`);
|
|
448101
448855
|
var HTML_OPEN_CLOSE_TAG_RE = /* @__PURE__ */ new RegExp(`^(?:<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>)`);
|
|
448102
448856
|
var HTML_SEQUENCES = [
|
|
448103
448857
|
[
|
|
@@ -448402,6 +449156,7 @@ var require_index_cjs4 = __commonJS({
|
|
|
448402
449156
|
this._prev_delimiters = [];
|
|
448403
449157
|
this.backticks = {};
|
|
448404
449158
|
this.backticksScanned = false;
|
|
449159
|
+
this.skipHtmlSpecial = false;
|
|
448405
449160
|
this.linkLevel = 0;
|
|
448406
449161
|
}
|
|
448407
449162
|
StateInline.prototype.pushPending = function() {
|
|
@@ -449006,22 +449761,53 @@ var require_index_cjs4 = __commonJS({
|
|
|
449006
449761
|
const lc = ch | 32;
|
|
449007
449762
|
return lc >= 97 && lc <= 122;
|
|
449008
449763
|
}
|
|
449764
|
+
function scanSpecial(state, pos) {
|
|
449765
|
+
const src = state.src;
|
|
449766
|
+
let start;
|
|
449767
|
+
let terminator;
|
|
449768
|
+
if (src.startsWith("<!--", pos)) {
|
|
449769
|
+
if (src.startsWith(">", pos + 4)) return pos + 5;
|
|
449770
|
+
if (src.startsWith("->", pos + 4)) return pos + 6;
|
|
449771
|
+
start = pos + 4;
|
|
449772
|
+
terminator = "-->";
|
|
449773
|
+
} else if (src.startsWith("<![CDATA[", pos)) {
|
|
449774
|
+
start = pos + 9;
|
|
449775
|
+
terminator = "]]>";
|
|
449776
|
+
} else if (src.charCodeAt(pos + 1) === 63) {
|
|
449777
|
+
start = pos + 2;
|
|
449778
|
+
terminator = "?>";
|
|
449779
|
+
} else if (isLetter(src.charCodeAt(pos + 2))) {
|
|
449780
|
+
start = pos + 3;
|
|
449781
|
+
terminator = ">";
|
|
449782
|
+
} else return -1;
|
|
449783
|
+
if (state.skipHtmlSpecial) return -1;
|
|
449784
|
+
const end = src.indexOf(terminator, start);
|
|
449785
|
+
if (end < 0) {
|
|
449786
|
+
state.skipHtmlSpecial = true;
|
|
449787
|
+
return -1;
|
|
449788
|
+
}
|
|
449789
|
+
return end + terminator.length;
|
|
449790
|
+
}
|
|
449009
449791
|
function html_inline(state, silent) {
|
|
449010
449792
|
if (!state.md.options.html) return false;
|
|
449011
449793
|
const max2 = state.posMax;
|
|
449012
449794
|
const pos = state.pos;
|
|
449013
449795
|
if (state.src.charCodeAt(pos) !== 60 || pos + 2 >= max2) return false;
|
|
449796
|
+
let end;
|
|
449014
449797
|
const ch = state.src.charCodeAt(pos + 1);
|
|
449015
|
-
if (ch
|
|
449016
|
-
|
|
449017
|
-
|
|
449798
|
+
if (ch === 33 || ch === 63) end = scanSpecial(state, pos);
|
|
449799
|
+
else if (ch === 47 || isLetter(ch)) {
|
|
449800
|
+
const match = state.src.slice(pos).match(HTML_OPEN_CLOSE_TAG_RE);
|
|
449801
|
+
end = match ? pos + match[0].length : -1;
|
|
449802
|
+
} else return false;
|
|
449803
|
+
if (end < 0) return false;
|
|
449018
449804
|
if (!silent) {
|
|
449019
449805
|
const token = state.push("html_inline", "", 0);
|
|
449020
|
-
token.content =
|
|
449806
|
+
token.content = state.src.slice(pos, end);
|
|
449021
449807
|
if (isLinkOpen(token.content)) state.linkLevel++;
|
|
449022
449808
|
if (isLinkClose(token.content)) state.linkLevel--;
|
|
449023
449809
|
}
|
|
449024
|
-
state.pos
|
|
449810
|
+
state.pos = end;
|
|
449025
449811
|
return true;
|
|
449026
449812
|
}
|
|
449027
449813
|
var DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i;
|
|
@@ -451069,6 +451855,7 @@ var require_artifacts_manager = __commonJS({
|
|
|
451069
451855
|
var options_1 = require_options2();
|
|
451070
451856
|
var templates_1 = require_templates5();
|
|
451071
451857
|
var cloud_flare_projects_utils_1 = require_cloud_flare_projects_utils();
|
|
451858
|
+
var project_1 = require_project();
|
|
451072
451859
|
var artifacts_helpers_1 = require_artifacts_helpers();
|
|
451073
451860
|
var ArtifactManager = class _ArtifactManager {
|
|
451074
451861
|
artifact;
|
|
@@ -451290,11 +452077,14 @@ ${content2}`;
|
|
|
451290
452077
|
await this.project.nodeModules.makeSureInstalled();
|
|
451291
452078
|
}
|
|
451292
452079
|
if (this.project.framework.isStandaloneProject) {
|
|
451293
|
-
|
|
451294
|
-
|
|
451295
|
-
|
|
451296
|
-
this.project.
|
|
451297
|
-
|
|
452080
|
+
const toInitLink = lib_32.Utils.uniqArray([
|
|
452081
|
+
this.project.framework.coreContainer,
|
|
452082
|
+
project_1.Project.ins.homeDirCoreContainer(this.project.framework.frameworkVersion),
|
|
452083
|
+
...this.project.taonJson.isUsingOwnNodeModulesInsteadCoreContainer ? [this.project] : []
|
|
452084
|
+
], "location");
|
|
452085
|
+
for (const container of toInitLink) {
|
|
452086
|
+
this.project.artifactsManager.artifact.npmLibAndCliTool.copyNpmDistLibManager.addSrcJSToDestination(container);
|
|
452087
|
+
this.project.artifactsManager.artifact.npmLibAndCliTool.copyNpmDistLibManager.addSourceSymlinks(container);
|
|
451298
452088
|
}
|
|
451299
452089
|
await this.project.subProject?.repo.initAll();
|
|
451300
452090
|
let missingDependencies = [];
|
|
@@ -451454,10 +452244,13 @@ ${missingDependencies.map((d) => `- ${lib_32.chalk.bold(d)}`).join("\n")}`, fals
|
|
|
451454
452244
|
|
|
451455
452245
|
Please use commands:
|
|
451456
452246
|
|
|
452247
|
+
# building /src code in watch mode (tsc, ng build)
|
|
451457
452248
|
${lib_22.config.frameworkName} build:watch:lib
|
|
451458
|
-
${lib_22.config.frameworkName}
|
|
451459
|
-
|
|
451460
|
-
|
|
452249
|
+
${lib_22.config.frameworkName} bwl # short version
|
|
452250
|
+
|
|
452251
|
+
# building 'ng serve'
|
|
452252
|
+
${lib_22.config.frameworkName} app
|
|
452253
|
+
${lib_22.config.frameworkName} a # short version
|
|
451461
452254
|
|
|
451462
452255
|
`, false, true);
|
|
451463
452256
|
} else {
|
|
@@ -451551,6 +452344,7 @@ ${missingDependencies.map((d) => `- ${lib_32.chalk.bold(d)}`).join("\n")}`, fals
|
|
|
451551
452344
|
if (allCustomWorkers.length === 0 && item.releaseType === options_1.ReleaseType.MANUAL_CLOUDFLARE) {
|
|
451552
452345
|
await this.project.subProject.addAndConfigure({
|
|
451553
452346
|
skipDeployment: true,
|
|
452347
|
+
releaseOptions,
|
|
451554
452348
|
projectType: constants_12.TempalteSubprojectType.TAON_CUSTOM_CLOUDFLARE_WORKER,
|
|
451555
452349
|
projectEnvironmentNameWithNumber: item.envName ? `${item.envName}${item.envNumber ?? ""}` : void 0
|
|
451556
452350
|
});
|
|
@@ -460802,6 +461596,7 @@ ${lib_22.chalk.bold.green("Local release")} => use current git repo for storing
|
|
|
460802
461596
|
if (allCustomWorkers.length === 0) {
|
|
460803
461597
|
await this.project.subProject.addAndConfigure({
|
|
460804
461598
|
skipDeployment: true,
|
|
461599
|
+
releaseOptions: envOptions,
|
|
460805
461600
|
projectType: constants_12.TempalteSubprojectType.TAON_CUSTOM_CLOUDFLARE_WORKER
|
|
460806
461601
|
});
|
|
460807
461602
|
}
|
|
@@ -461808,10 +462603,10 @@ var require_sub_project = __commonJS({
|
|
|
461808
462603
|
}
|
|
461809
462604
|
//#endregion
|
|
461810
462605
|
//#region PUBLIC API / deploy worker
|
|
461811
|
-
async deployWorker() {
|
|
462606
|
+
async deployWorker(envOptions) {
|
|
461812
462607
|
while (true) {
|
|
461813
462608
|
const chosenProject = await this.selectAnyProject();
|
|
461814
|
-
await chosenProject.deployment();
|
|
462609
|
+
await chosenProject.deployment(envOptions);
|
|
461815
462610
|
const again = await lib_32.UtilsTerminal.confirm({
|
|
461816
462611
|
message: `Would you like to deploy any project again ?`,
|
|
461817
462612
|
defaultValue: true
|
|
@@ -462981,6 +463776,10 @@ ${notVerfiedDeps.map((c) => `- ${c}`).join("\n")}
|
|
|
462981
463776
|
async build(buildOptions) {
|
|
462982
463777
|
this.warnAboutNotVerifiedWhenProdBuild(buildOptions);
|
|
462983
463778
|
buildOptions = options_1.EnvOptions.from(buildOptions);
|
|
463779
|
+
const pathToSourceLinked = this.ins.homeDirCoreContainer(this.framework.frameworkVersion).nodeModules.pathFor([this.nameForNpmPackage, constants_12.sourceLinkInNodeModules]);
|
|
463780
|
+
if (!lib_52.Helpers.exists(pathToSourceLinked)) {
|
|
463781
|
+
this.removeFile(constants_12.tmpAlreadyStartedCopyManager);
|
|
463782
|
+
}
|
|
462984
463783
|
let skipProjectsNames = [];
|
|
462985
463784
|
if (this.framework.isStandaloneProject) {
|
|
462986
463785
|
await this.artifactsManager.build(buildOptions);
|
|
@@ -463593,16 +464392,20 @@ var require_vscode_menu_items = __commonJS({
|
|
|
463593
464392
|
// ),
|
|
463594
464393
|
//#endregion
|
|
463595
464394
|
//#region items with actions / clear
|
|
463596
|
-
new ProjectItem(
|
|
463597
|
-
|
|
463598
|
-
|
|
463599
|
-
|
|
463600
|
-
|
|
463601
|
-
|
|
463602
|
-
|
|
463603
|
-
|
|
463604
|
-
|
|
463605
|
-
|
|
464395
|
+
// new ProjectItem(
|
|
464396
|
+
// `$ ${FRAMEWORK_NAME} clear`,
|
|
464397
|
+
// vscode.TreeItemCollapsibleState.None,
|
|
464398
|
+
// {
|
|
464399
|
+
// iconPath: null,
|
|
464400
|
+
// project: CURRENT_PROJECT,
|
|
464401
|
+
// triggerActionOnClick: project => {
|
|
464402
|
+
// runInTerminal(`${FRAMEWORK_NAME} clear`);
|
|
464403
|
+
// if (project?.location) {
|
|
464404
|
+
// focustFirstElement();
|
|
464405
|
+
// }
|
|
464406
|
+
// },
|
|
464407
|
+
// },
|
|
464408
|
+
// ),
|
|
463606
464409
|
//#endregion
|
|
463607
464410
|
//#region items with actions / melt
|
|
463608
464411
|
// new ProjectItem(
|
|
@@ -480510,6 +481313,7 @@ var require_cli_GLOBAL = __commonJS({
|
|
|
480510
481313
|
var lib_112 = require_lib47();
|
|
480511
481314
|
var lib_122 = require_lib47();
|
|
480512
481315
|
var ts_json_schema_generator_1 = require_dist10();
|
|
481316
|
+
var app_utils_1 = require_app_utils();
|
|
480513
481317
|
var build_info__auto_generated_1 = require_build_info_auto_generated2();
|
|
480514
481318
|
var constants_12 = require_constants20();
|
|
480515
481319
|
var options_1 = require_options2();
|
|
@@ -481822,11 +482626,116 @@ ${error2 instanceof Error ? error2.stack || error2.message : String(error2)}`, f
|
|
|
481822
482626
|
//#endregion
|
|
481823
482627
|
// }
|
|
481824
482628
|
//#endregion
|
|
482629
|
+
//#region git
|
|
482630
|
+
async git() {
|
|
482631
|
+
lib_72.UtilsTerminal.clearConsole();
|
|
482632
|
+
let children = this.project.children;
|
|
482633
|
+
children = (0, app_utils_1.filterChildren)(this.project, children, options_1.EnvOptions.from({
|
|
482634
|
+
container: {
|
|
482635
|
+
skipReleased: true
|
|
482636
|
+
}
|
|
482637
|
+
}), {
|
|
482638
|
+
isForRelease: true
|
|
482639
|
+
});
|
|
482640
|
+
lib_112.Helpers.info(`
|
|
482641
|
+
|
|
482642
|
+
Found ${children.length} with git changes.
|
|
482643
|
+
|
|
482644
|
+
`);
|
|
482645
|
+
for (let index = 0; index < children.length; index++) {
|
|
482646
|
+
const child = children[index];
|
|
482647
|
+
const changes = lib_52.Utils.uniqArray([
|
|
482648
|
+
...child.git.listOfCurrentGitChanges.created,
|
|
482649
|
+
...child.git.listOfCurrentGitChanges.modified,
|
|
482650
|
+
...child.git.listOfCurrentGitChanges.deleted
|
|
482651
|
+
]);
|
|
482652
|
+
console.info(`${index + 1}. ${lib_52.chalk.bold(child.name)}${child.name !== child.name ? `(${child.nameForNpmPackage})` : ""} ${changes.length > 0 ? `${lib_52.chalk.red("changed files " + changes.length.toString())}` : ""} `);
|
|
482653
|
+
let commitIndex = 0;
|
|
482654
|
+
while (true) {
|
|
482655
|
+
let message = "";
|
|
482656
|
+
try {
|
|
482657
|
+
message = await child.git.getCommitMessageByIndex(commitIndex++);
|
|
482658
|
+
} catch (error2) {
|
|
482659
|
+
break;
|
|
482660
|
+
}
|
|
482661
|
+
if (!message || message?.startsWith("release: ")) {
|
|
482662
|
+
break;
|
|
482663
|
+
}
|
|
482664
|
+
message = message.replace(new RegExp(`^(${lib_112.TypeOfMsgPrefixArr.join("|")}):`), (_3, prefix) => `${lib_52.chalk.bold(prefix)}:`);
|
|
482665
|
+
console.log(` ${lib_52.chalk.blue(message)}`);
|
|
482666
|
+
}
|
|
482667
|
+
}
|
|
482668
|
+
this._exit();
|
|
482669
|
+
}
|
|
482670
|
+
//#endregion
|
|
482671
|
+
//#region envs
|
|
481825
482672
|
envs() {
|
|
481826
482673
|
const environments = this.project.releaseProcess.getEnvNamesByArtifact(this.firstArg);
|
|
481827
482674
|
console.log({ environments });
|
|
481828
482675
|
this._exit(0);
|
|
481829
482676
|
}
|
|
482677
|
+
//#endregion
|
|
482678
|
+
//#region install
|
|
482679
|
+
async install() {
|
|
482680
|
+
const coreContainer = this.project.framework.coreContainer;
|
|
482681
|
+
coreContainer.taonJson.saveToDisk("before install");
|
|
482682
|
+
const allPackages = this.project.nodeModules.getAllPackagesNames({
|
|
482683
|
+
followSymlinks: false
|
|
482684
|
+
});
|
|
482685
|
+
const deps = coreContainer.packageJson.dependencies;
|
|
482686
|
+
const depsKeys = Object.keys(deps);
|
|
482687
|
+
const notInstalled = depsKeys.filter((key) => !coreContainer.nodeModules.hasPackageInstalled(key));
|
|
482688
|
+
if (!notInstalled.length) {
|
|
482689
|
+
lib_112.Helpers.info(`All dependencies are installed.`);
|
|
482690
|
+
this._exit();
|
|
482691
|
+
}
|
|
482692
|
+
for (const key of notInstalled) {
|
|
482693
|
+
console.log(`Package not installed: ${key}`);
|
|
482694
|
+
const tempCatalogForInstallation = this.project.pathFor([
|
|
482695
|
+
`tmp-temp-npm-install`,
|
|
482696
|
+
(/* @__PURE__ */ new Date()).getTime().toString()
|
|
482697
|
+
]);
|
|
482698
|
+
lib_112.Helpers.remove(tempCatalogForInstallation);
|
|
482699
|
+
lib_112.Helpers.mkdirp(tempCatalogForInstallation);
|
|
482700
|
+
lib_112.Helpers.run(`npm init -y`, {
|
|
482701
|
+
cwd: tempCatalogForInstallation
|
|
482702
|
+
}).sync();
|
|
482703
|
+
lib_112.Helpers.run(`npm install ${key}`, {
|
|
482704
|
+
cwd: tempCatalogForInstallation
|
|
482705
|
+
}).sync();
|
|
482706
|
+
const conflictingFiles = [];
|
|
482707
|
+
const projFromTemp = this.ins.From(tempCatalogForInstallation);
|
|
482708
|
+
const allPackagesFromTemp = projFromTemp.nodeModules.getAllPackagesNames({
|
|
482709
|
+
followSymlinks: false
|
|
482710
|
+
});
|
|
482711
|
+
for (const nodeModulesKey of allPackagesFromTemp) {
|
|
482712
|
+
if (allPackages.includes(nodeModulesKey)) {
|
|
482713
|
+
conflictingFiles.push(nodeModulesKey);
|
|
482714
|
+
}
|
|
482715
|
+
console.log(`Found new package in node_modules: ${nodeModulesKey}`);
|
|
482716
|
+
}
|
|
482717
|
+
if (conflictingFiles.length > 0) {
|
|
482718
|
+
lib_112.Helpers.error(`Conflicting packages found: ${conflictingFiles.join(", ")}`, false, true);
|
|
482719
|
+
} else {
|
|
482720
|
+
const toCopy = lib_52.Utils.uniqArray([
|
|
482721
|
+
this.project.framework.coreContainer,
|
|
482722
|
+
project_1.Project.ins.homeDirCoreContainer(this.project.framework.frameworkVersion),
|
|
482723
|
+
...this.project.taonJson.isUsingOwnNodeModulesInsteadCoreContainer ? [this.project] : []
|
|
482724
|
+
], "location").map((c) => this.ins.From(c.location));
|
|
482725
|
+
for (const npmPackageName of allPackagesFromTemp) {
|
|
482726
|
+
for (const coreContainer2 of toCopy) {
|
|
482727
|
+
lib_112.Helpers.info(`Copying ${lib_52.chalk.bold(`${npmPackageName}`)} to project: ${coreContainer2.location} `);
|
|
482728
|
+
lib_22.UtilsFilesFoldersSync.copy(projFromTemp.nodeModules.pathFor(npmPackageName), coreContainer2.nodeModules.pathFor(npmPackageName), {
|
|
482729
|
+
recursive: true,
|
|
482730
|
+
overwrite: true
|
|
482731
|
+
});
|
|
482732
|
+
}
|
|
482733
|
+
}
|
|
482734
|
+
lib_112.Helpers.taskDone(`Finished copying packages from temporary installation.`);
|
|
482735
|
+
}
|
|
482736
|
+
}
|
|
482737
|
+
this._exit();
|
|
482738
|
+
}
|
|
481830
482739
|
};
|
|
481831
482740
|
exports2.$Global = $Global;
|
|
481832
482741
|
__decorate2([
|
|
@@ -484458,25 +485367,29 @@ var require_cli_SUB_PROJECT = __commonJS({
|
|
|
484458
485367
|
if (overrideSelect) {
|
|
484459
485368
|
overrideSelect = void 0;
|
|
484460
485369
|
}
|
|
485370
|
+
const releaseOptions = this.params.clone({
|
|
485371
|
+
build: {
|
|
485372
|
+
...this.params.build,
|
|
485373
|
+
cloudflare: true
|
|
485374
|
+
}
|
|
485375
|
+
});
|
|
484461
485376
|
if (select === "info") {
|
|
484462
485377
|
await this.project.subProject.getInfo();
|
|
484463
485378
|
} else if (select === "addDeploy") {
|
|
484464
|
-
await this.project.subProject.addAndConfigure(
|
|
485379
|
+
await this.project.subProject.addAndConfigure({
|
|
485380
|
+
releaseOptions
|
|
485381
|
+
});
|
|
484465
485382
|
await this.project.init();
|
|
484466
485383
|
} else if (select === "add") {
|
|
484467
485384
|
await this.project.subProject.addAndConfigure({
|
|
484468
|
-
skipDeployment: true
|
|
485385
|
+
skipDeployment: true,
|
|
485386
|
+
releaseOptions
|
|
484469
485387
|
});
|
|
484470
485388
|
await this.project.init();
|
|
484471
485389
|
} else if (select === "dev") {
|
|
484472
485390
|
await this.project.subProject.startInDevMode({
|
|
484473
485391
|
projectName: this.secondArg ? lib_13.path.basename(this.secondArg?.trim()) : void 0,
|
|
484474
|
-
envOptions:
|
|
484475
|
-
build: {
|
|
484476
|
-
...this.params.build,
|
|
484477
|
-
cloudflare: true
|
|
484478
|
-
}
|
|
484479
|
-
})
|
|
485392
|
+
envOptions: releaseOptions
|
|
484480
485393
|
});
|
|
484481
485394
|
} else if (select === "teststripe") {
|
|
484482
485395
|
await this.project.subProject.testStripeProjectWithExampleData();
|
|
@@ -484485,7 +485398,7 @@ var require_cli_SUB_PROJECT = __commonJS({
|
|
|
484485
485398
|
} else if (select === "secrets") {
|
|
484486
485399
|
await this.project.subProject.setWorkerSecrets();
|
|
484487
485400
|
} else if (select === "deploy") {
|
|
484488
|
-
await this.project.subProject.deployWorker();
|
|
485401
|
+
await this.project.subProject.deployWorker(releaseOptions);
|
|
484489
485402
|
} else if (select === "initall") {
|
|
484490
485403
|
await this.project.subProject.repo.initAll();
|
|
484491
485404
|
} else if (select === "login") {
|