windmill-utils-internal 1.3.4 → 1.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/config/config.js +16 -113
- package/dist/cjs/gen/core/OpenAPI.js +1 -1
- package/dist/cjs/gen/services.gen.d.ts +410 -56
- package/dist/cjs/gen/services.gen.js +835 -80
- package/dist/cjs/gen/types.gen.d.ts +1213 -188
- package/dist/cjs/inline-scripts/extractor.d.ts +6 -4
- package/dist/cjs/inline-scripts/extractor.js +10 -3
- package/dist/cjs/inline-scripts/replacer.d.ts +28 -1
- package/dist/cjs/inline-scripts/replacer.js +134 -0
- package/dist/cjs/path-utils/path-assigner.d.ts +5 -0
- package/dist/cjs/path-utils/path-assigner.js +18 -2
- package/dist/esm/config/config.js +13 -77
- package/dist/esm/gen/core/OpenAPI.js +1 -1
- package/dist/esm/gen/services.gen.d.ts +410 -56
- package/dist/esm/gen/services.gen.js +784 -67
- package/dist/esm/gen/types.gen.d.ts +1213 -188
- package/dist/esm/inline-scripts/extractor.d.ts +6 -4
- package/dist/esm/inline-scripts/extractor.js +10 -3
- package/dist/esm/inline-scripts/replacer.d.ts +28 -1
- package/dist/esm/inline-scripts/replacer.js +131 -0
- package/dist/esm/path-utils/path-assigner.d.ts +5 -0
- package/dist/esm/path-utils/path-assigner.js +17 -2
- package/package.json +2 -2
|
@@ -1,37 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
3
|
exports.WINDMILL_ACTIVE_INSTANCE_FILE = exports.INSTANCES_CONFIG_FILE = exports.WINDMILL_WORKSPACE_CONFIG_FILE = exports.WINDMILL_ACTIVE_WORKSPACE_FILE = exports.WINDMILL_CONFIG_DIR = void 0;
|
|
37
4
|
exports.getBaseConfigDir = getBaseConfigDir;
|
|
@@ -40,70 +7,26 @@ exports.getWorkspaceConfigFilePath = getWorkspaceConfigFilePath;
|
|
|
40
7
|
exports.getActiveWorkspaceConfigFilePath = getActiveWorkspaceConfigFilePath;
|
|
41
8
|
exports.getInstancesConfigFilePath = getInstancesConfigFilePath;
|
|
42
9
|
exports.getActiveInstanceFilePath = getActiveInstanceFilePath;
|
|
43
|
-
|
|
44
|
-
// @ts-ignore - Cross-platform runtime detection
|
|
45
|
-
const isDeno = typeof Deno !== "undefined";
|
|
46
|
-
// @ts-ignore - Cross-platform runtime detection
|
|
47
|
-
const isNode = typeof process !== "undefined" && process.versions?.node;
|
|
10
|
+
const promises_1 = require("node:fs/promises");
|
|
48
11
|
exports.WINDMILL_CONFIG_DIR = "windmill";
|
|
49
12
|
exports.WINDMILL_ACTIVE_WORKSPACE_FILE = "activeWorkspace";
|
|
50
13
|
exports.WINDMILL_WORKSPACE_CONFIG_FILE = "remotes.ndjson";
|
|
51
14
|
exports.INSTANCES_CONFIG_FILE = "instances.ndjson";
|
|
52
15
|
exports.WINDMILL_ACTIVE_INSTANCE_FILE = "activeInstance";
|
|
53
|
-
// Cross-platform environment variable access
|
|
54
16
|
function getEnv(key) {
|
|
55
|
-
|
|
56
|
-
// @ts-ignore - Deno API
|
|
57
|
-
return Deno.env.get(key);
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
// @ts-ignore - Node API
|
|
61
|
-
return process.env[key];
|
|
62
|
-
}
|
|
17
|
+
return process.env[key];
|
|
63
18
|
}
|
|
64
|
-
// Cross-platform OS detection with normalization
|
|
65
19
|
function getOS() {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
const platform = process.platform;
|
|
73
|
-
switch (platform) {
|
|
74
|
-
case "linux": return "linux";
|
|
75
|
-
case "darwin": return "darwin";
|
|
76
|
-
case "win32": return "windows"; // Normalize win32 to windows
|
|
77
|
-
default: return null;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return null;
|
|
81
|
-
}
|
|
82
|
-
// Cross-platform file system operations
|
|
83
|
-
async function stat(path) {
|
|
84
|
-
if (isDeno) {
|
|
85
|
-
// @ts-ignore - Deno API
|
|
86
|
-
return await Deno.stat(path);
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
// @ts-ignore - Node API
|
|
90
|
-
const fs = await Promise.resolve().then(() => __importStar(require('fs/promises')));
|
|
91
|
-
return await fs.stat(path);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
async function mkdir(path, options) {
|
|
95
|
-
if (isDeno) {
|
|
96
|
-
// @ts-ignore - Deno API
|
|
97
|
-
await Deno.mkdir(path, options);
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
// @ts-ignore - Node API
|
|
101
|
-
const fs = await Promise.resolve().then(() => __importStar(require('fs/promises')));
|
|
102
|
-
await fs.mkdir(path, options);
|
|
20
|
+
const platform = process.platform;
|
|
21
|
+
switch (platform) {
|
|
22
|
+
case "linux": return "linux";
|
|
23
|
+
case "darwin": return "darwin";
|
|
24
|
+
case "win32": return "windows";
|
|
25
|
+
default: return null;
|
|
103
26
|
}
|
|
104
27
|
}
|
|
105
28
|
function throwIfNotDirectory(fileInfo) {
|
|
106
|
-
if (!fileInfo.isDirectory) {
|
|
29
|
+
if (!fileInfo.isDirectory()) {
|
|
107
30
|
throw new Error("Path is not a directory");
|
|
108
31
|
}
|
|
109
32
|
}
|
|
@@ -157,45 +80,25 @@ function tmp_dir() {
|
|
|
157
80
|
}
|
|
158
81
|
async function ensureDir(dir) {
|
|
159
82
|
try {
|
|
160
|
-
const fileInfo = await stat(dir);
|
|
83
|
+
const fileInfo = await (0, promises_1.stat)(dir);
|
|
161
84
|
throwIfNotDirectory(fileInfo);
|
|
162
85
|
return;
|
|
163
86
|
}
|
|
164
87
|
catch (err) {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
// @ts-ignore - Deno API
|
|
168
|
-
if (!(err instanceof Deno.errors.NotFound)) {
|
|
169
|
-
throw err;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
else {
|
|
173
|
-
// Node.js error codes
|
|
174
|
-
if (err.code !== 'ENOENT') {
|
|
175
|
-
throw err;
|
|
176
|
-
}
|
|
88
|
+
if (err.code !== 'ENOENT') {
|
|
89
|
+
throw err;
|
|
177
90
|
}
|
|
178
91
|
}
|
|
179
92
|
// The dir doesn't exist. Create it.
|
|
180
93
|
// This can be racy. So we catch AlreadyExists and check stat again.
|
|
181
94
|
try {
|
|
182
|
-
await mkdir(dir, { recursive: true });
|
|
95
|
+
await (0, promises_1.mkdir)(dir, { recursive: true });
|
|
183
96
|
}
|
|
184
97
|
catch (err) {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
// @ts-ignore - Deno API
|
|
188
|
-
if (!(err instanceof Deno.errors.AlreadyExists)) {
|
|
189
|
-
throw err;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
else {
|
|
193
|
-
// Node.js error codes
|
|
194
|
-
if (err.code !== 'EEXIST') {
|
|
195
|
-
throw err;
|
|
196
|
-
}
|
|
98
|
+
if (err.code !== 'EEXIST') {
|
|
99
|
+
throw err;
|
|
197
100
|
}
|
|
198
|
-
const fileInfo = await stat(dir);
|
|
101
|
+
const fileInfo = await (0, promises_1.stat)(dir);
|
|
199
102
|
throwIfNotDirectory(fileInfo);
|
|
200
103
|
}
|
|
201
104
|
}
|