windmill-utils-internal 1.3.5 → 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/gen/core/OpenAPI.js +1 -1
- package/dist/cjs/gen/services.gen.d.ts +101 -2
- package/dist/cjs/gen/services.gen.js +223 -13
- package/dist/cjs/gen/types.gen.d.ts +340 -86
- package/dist/cjs/path-utils/path-assigner.d.ts +5 -0
- package/dist/cjs/path-utils/path-assigner.js +18 -2
- package/dist/esm/gen/core/OpenAPI.js +1 -1
- package/dist/esm/gen/services.gen.d.ts +101 -2
- package/dist/esm/gen/services.gen.js +201 -2
- package/dist/esm/gen/types.gen.d.ts +340 -86
- package/dist/esm/path-utils/path-assigner.d.ts +5 -0
- package/dist/esm/path-utils/path-assigner.js +17 -2
- package/package.json +1 -1
|
@@ -29,6 +29,11 @@ export declare const EXTENSION_TO_LANGUAGE: Record<string, SupportedLanguage>;
|
|
|
29
29
|
* @returns The language, or undefined if not recognized
|
|
30
30
|
*/
|
|
31
31
|
export declare function getLanguageFromExtension(ext: string, defaultTs?: "bun" | "deno"): SupportedLanguage | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Sanitizes a summary string for use as a filesystem-safe name.
|
|
34
|
+
* Removes or replaces characters that are invalid on common filesystems.
|
|
35
|
+
*/
|
|
36
|
+
export declare function sanitizeForFilesystem(summary: string): string;
|
|
32
37
|
export interface PathAssigner {
|
|
33
38
|
assignPath(summary: string | undefined, language: SupportedLanguage): [string, string];
|
|
34
39
|
}
|
|
@@ -93,6 +93,21 @@ export function getLanguageFromExtension(ext, defaultTs = "bun") {
|
|
|
93
93
|
}
|
|
94
94
|
return undefined;
|
|
95
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Sanitizes a summary string for use as a filesystem-safe name.
|
|
98
|
+
* Removes or replaces characters that are invalid on common filesystems.
|
|
99
|
+
*/
|
|
100
|
+
export function sanitizeForFilesystem(summary) {
|
|
101
|
+
return summary
|
|
102
|
+
.toLowerCase()
|
|
103
|
+
.replaceAll(" ", "_")
|
|
104
|
+
// Remove characters invalid on Windows/Unix/Mac: / \ : * ? " < > |
|
|
105
|
+
// Also remove control characters (0x00-0x1F) and DEL (0x7F)
|
|
106
|
+
// deno-lint-ignore no-control-regex
|
|
107
|
+
.replace(/[/\\:*?"<>|\x00-\x1f\x7f]/g, "")
|
|
108
|
+
// Trim leading/trailing dots and underscores (hidden files, Windows edge cases)
|
|
109
|
+
.replace(/^[._]+|[._]+$/g, "");
|
|
110
|
+
}
|
|
96
111
|
/**
|
|
97
112
|
* Creates a new path assigner for inline scripts.
|
|
98
113
|
*
|
|
@@ -110,7 +125,7 @@ export function newPathAssigner(defaultTs, options) {
|
|
|
110
125
|
const seen_names = new Set();
|
|
111
126
|
function assignPath(summary, language) {
|
|
112
127
|
let name;
|
|
113
|
-
name = summary
|
|
128
|
+
name = summary ? sanitizeForFilesystem(summary) : "";
|
|
114
129
|
let original_name = name;
|
|
115
130
|
if (name == "") {
|
|
116
131
|
original_name = INLINE_SCRIPT_PREFIX;
|
|
@@ -141,7 +156,7 @@ export function newRawAppPathAssigner(defaultTs) {
|
|
|
141
156
|
const seen_names = new Set();
|
|
142
157
|
function assignPath(summary, language) {
|
|
143
158
|
let name;
|
|
144
|
-
name = summary
|
|
159
|
+
name = summary ? sanitizeForFilesystem(summary) : "";
|
|
145
160
|
let original_name = name;
|
|
146
161
|
if (name == "") {
|
|
147
162
|
original_name = "runnable";
|