@runeya/runeya 2.0.49 → 2.0.51
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/agent-manager-KX5MSTAK.js +7 -0
- package/{chunk-4AGTVGSH.js → chunk-NVKGIBJN.js} +23 -14
- package/chunk-NVKGIBJN.js.map +1 -0
- package/index.js +1 -1
- package/package.json +1 -1
- package/{src-WVK4WUI3.js → src-R6JOPDNL.js} +378 -402
- package/src-R6JOPDNL.js.map +1 -0
- package/agent-manager-JNA5ZALK.js +0 -7
- package/chunk-4AGTVGSH.js.map +0 -1
- package/src-WVK4WUI3.js.map +0 -1
- /package/{agent-manager-JNA5ZALK.js.map → agent-manager-KX5MSTAK.js.map} +0 -0
|
@@ -96,11 +96,8 @@ function vaultFor(target) {
|
|
|
96
96
|
var ORG_CLOUD_FILE = "cloud.json";
|
|
97
97
|
async function stampOrgCloud(orgId, cloudUrl) {
|
|
98
98
|
const root = orgVaultRoot(orgId);
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
await writeFile(join(root, ORG_CLOUD_FILE), JSON.stringify({ cloudUrl }, null, 2), "utf-8");
|
|
102
|
-
} catch {
|
|
103
|
-
}
|
|
99
|
+
await mkdir(root, { recursive: true });
|
|
100
|
+
await writeFile(join(root, ORG_CLOUD_FILE), JSON.stringify({ cloudUrl }, null, 2), "utf-8");
|
|
104
101
|
}
|
|
105
102
|
async function readOrgClouds() {
|
|
106
103
|
const orgsDir = join(machineRoot(), "orgs");
|
|
@@ -442,7 +439,7 @@ var agentStore = new AgentStore();
|
|
|
442
439
|
|
|
443
440
|
// ../server/src/services/service-store.ts
|
|
444
441
|
import { randomUUID as randomUUID3 } from "crypto";
|
|
445
|
-
import { readFile as readFile4, writeFile as writeFile4, rename as rename3, mkdir as mkdir4, chmod as chmod3 } from "fs/promises";
|
|
442
|
+
import { readFile as readFile4, writeFile as writeFile4, rename as rename3, mkdir as mkdir4, chmod as chmod3, rm as rm2 } from "fs/promises";
|
|
446
443
|
import { join as join3 } from "path";
|
|
447
444
|
|
|
448
445
|
// ../server/src/services/project-key.ts
|
|
@@ -555,7 +552,7 @@ function isVaultConflicted(root) {
|
|
|
555
552
|
|
|
556
553
|
// ../server/src/services/environment-store.ts
|
|
557
554
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
558
|
-
import { readFile as readFile3, writeFile as writeFile3, rename as rename2, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
|
|
555
|
+
import { readFile as readFile3, writeFile as writeFile3, rename as rename2, mkdir as mkdir3, chmod as chmod2, rm } from "fs/promises";
|
|
559
556
|
import { join as join2 } from "path";
|
|
560
557
|
|
|
561
558
|
// ../server/src/services/crypto-helpers.ts
|
|
@@ -2091,8 +2088,9 @@ var EnvironmentStore = class {
|
|
|
2091
2088
|
/**
|
|
2092
2089
|
* Write each vault that holds — or held — an environment.
|
|
2093
2090
|
*
|
|
2094
|
-
*
|
|
2095
|
-
*
|
|
2091
|
+
* A vault emptied by this save loses its file: an environment that moved to
|
|
2092
|
+
* another vault must not survive in the old one, and a `[]` left behind would
|
|
2093
|
+
* keep (or recreate) a `.runeya` in a directory that holds nothing.
|
|
2096
2094
|
*/
|
|
2097
2095
|
async save() {
|
|
2098
2096
|
const byRoot = /* @__PURE__ */ new Map();
|
|
@@ -2111,8 +2109,13 @@ var EnvironmentStore = class {
|
|
|
2111
2109
|
else byRoot.set(root, [prepared]);
|
|
2112
2110
|
}
|
|
2113
2111
|
for (const [root, environments] of byRoot) {
|
|
2114
|
-
await mkdir3(root, { recursive: true });
|
|
2115
2112
|
const filePath = this.getFilePath(root);
|
|
2113
|
+
if (environments.length === 0) {
|
|
2114
|
+
await rm(filePath, { force: true }).catch(() => {
|
|
2115
|
+
});
|
|
2116
|
+
continue;
|
|
2117
|
+
}
|
|
2118
|
+
await mkdir3(root, { recursive: true });
|
|
2116
2119
|
const tmpPath = filePath + ".tmp";
|
|
2117
2120
|
await writeFile3(tmpPath, JSON.stringify(environments, null, 2), "utf-8");
|
|
2118
2121
|
await rename2(tmpPath, filePath);
|
|
@@ -2514,8 +2517,9 @@ var ServiceStore = class {
|
|
|
2514
2517
|
/**
|
|
2515
2518
|
* Write each vault that holds — or held — a service.
|
|
2516
2519
|
*
|
|
2517
|
-
* A vault emptied by this save
|
|
2518
|
-
*
|
|
2520
|
+
* A vault emptied by this save loses its file: a service that moved to
|
|
2521
|
+
* another vault must not survive in the one it left, and a `[]` left behind
|
|
2522
|
+
* would keep (or recreate) a `.runeya` in a directory that holds nothing.
|
|
2519
2523
|
*/
|
|
2520
2524
|
async save() {
|
|
2521
2525
|
const byRoot = /* @__PURE__ */ new Map();
|
|
@@ -2534,8 +2538,13 @@ var ServiceStore = class {
|
|
|
2534
2538
|
else byRoot.set(root, [prepared]);
|
|
2535
2539
|
}
|
|
2536
2540
|
for (const [root, services] of byRoot) {
|
|
2537
|
-
await mkdir4(root, { recursive: true });
|
|
2538
2541
|
const filePath = this.getFilePath(root);
|
|
2542
|
+
if (services.length === 0) {
|
|
2543
|
+
await rm2(filePath, { force: true }).catch(() => {
|
|
2544
|
+
});
|
|
2545
|
+
continue;
|
|
2546
|
+
}
|
|
2547
|
+
await mkdir4(root, { recursive: true });
|
|
2539
2548
|
const tmpPath = filePath + ".tmp";
|
|
2540
2549
|
await writeFile4(tmpPath, JSON.stringify(services, null, 2), "utf-8");
|
|
2541
2550
|
await rename3(tmpPath, filePath);
|
|
@@ -3737,4 +3746,4 @@ export {
|
|
|
3737
3746
|
traefikManager,
|
|
3738
3747
|
agentManager
|
|
3739
3748
|
};
|
|
3740
|
-
//# sourceMappingURL=chunk-
|
|
3749
|
+
//# sourceMappingURL=chunk-NVKGIBJN.js.map
|