windmill-utils-internal 1.0.0
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/constants.d.ts +16 -0
- package/dist/constants.js +44 -0
- package/dist/gen/core/ApiError.d.ts +10 -0
- package/dist/gen/core/ApiError.js +20 -0
- package/dist/gen/core/ApiRequestOptions.d.ts +14 -0
- package/dist/gen/core/ApiRequestOptions.js +2 -0
- package/dist/gen/core/ApiResult.d.ts +7 -0
- package/dist/gen/core/ApiResult.js +2 -0
- package/dist/gen/core/CancelablePromise.d.ts +26 -0
- package/dist/gen/core/CancelablePromise.js +100 -0
- package/dist/gen/core/OpenAPI.d.ts +27 -0
- package/dist/gen/core/OpenAPI.js +39 -0
- package/dist/gen/core/request.d.ts +29 -0
- package/dist/gen/core/request.js +323 -0
- package/dist/gen/index.d.ts +5 -0
- package/dist/gen/index.js +27 -0
- package/dist/gen/services.gen.d.ts +4894 -0
- package/dist/gen/services.gen.js +10485 -0
- package/dist/gen/types.gen.d.ts +7319 -0
- package/dist/gen/types.gen.js +3 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +32 -0
- package/dist/inline-scripts/extractor.d.ts +30 -0
- package/dist/inline-scripts/extractor.js +85 -0
- package/dist/inline-scripts/index.d.ts +2 -0
- package/dist/inline-scripts/index.js +18 -0
- package/dist/inline-scripts/replacer.d.ts +16 -0
- package/dist/inline-scripts/replacer.js +97 -0
- package/dist/parse/index.d.ts +1 -0
- package/dist/parse/index.js +17 -0
- package/dist/parse/parse-schema.d.ts +93 -0
- package/dist/parse/parse-schema.js +205 -0
- package/dist/path-utils/index.d.ts +1 -0
- package/dist/path-utils/index.js +17 -0
- package/dist/path-utils/path-assigner.d.ts +28 -0
- package/dist/path-utils/path-assigner.js +60 -0
- package/package.json +24 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LANGUAGE_EXTENSIONS = void 0;
|
|
4
|
+
exports.getLanguageExtension = getLanguageExtension;
|
|
5
|
+
exports.assignPath = assignPath;
|
|
6
|
+
/**
|
|
7
|
+
* Mapping of supported languages to their file extensions
|
|
8
|
+
*/
|
|
9
|
+
exports.LANGUAGE_EXTENSIONS = {
|
|
10
|
+
python3: "py",
|
|
11
|
+
bun: "bun.ts",
|
|
12
|
+
deno: "deno.ts",
|
|
13
|
+
go: "go",
|
|
14
|
+
bash: "sh",
|
|
15
|
+
powershell: "ps1",
|
|
16
|
+
postgresql: "pg.sql",
|
|
17
|
+
mysql: "my.sql",
|
|
18
|
+
bigquery: "bq.sql",
|
|
19
|
+
oracledb: "odb.sql",
|
|
20
|
+
snowflake: "sf.sql",
|
|
21
|
+
mssql: "ms.sql",
|
|
22
|
+
graphql: "gql",
|
|
23
|
+
nativets: "native.ts",
|
|
24
|
+
frontend: "frontend.js",
|
|
25
|
+
php: "php",
|
|
26
|
+
rust: "rs",
|
|
27
|
+
csharp: "cs",
|
|
28
|
+
nu: "nu",
|
|
29
|
+
ansible: "playbook.yml",
|
|
30
|
+
java: "java",
|
|
31
|
+
duckdb: "duckdb.sql",
|
|
32
|
+
bunnative: "ts"
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Gets the appropriate file extension for a given programming language.
|
|
36
|
+
* Handles special cases for TypeScript variants based on the default runtime.
|
|
37
|
+
*
|
|
38
|
+
* @param language - The programming language to get extension for
|
|
39
|
+
* @param defaultTs - Default TypeScript runtime ("bun" or "deno")
|
|
40
|
+
* @returns File extension string (without the dot)
|
|
41
|
+
*/
|
|
42
|
+
function getLanguageExtension(language, defaultTs = "bun") {
|
|
43
|
+
if (language === defaultTs || language === "bunnative") {
|
|
44
|
+
return "ts";
|
|
45
|
+
}
|
|
46
|
+
return exports.LANGUAGE_EXTENSIONS[language] || "no_ext";
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Assigns a file path for an inline script based on its ID and language.
|
|
50
|
+
* Returns both the base path and extension as separate components.
|
|
51
|
+
*
|
|
52
|
+
* @param id - Unique identifier for the script
|
|
53
|
+
* @param language - Programming language of the script
|
|
54
|
+
* @param defaultTs - Default TypeScript runtime ("bun" or "deno")
|
|
55
|
+
* @returns Tuple containing [basePath, extension]
|
|
56
|
+
*/
|
|
57
|
+
function assignPath(id, language, defaultTs = "bun") {
|
|
58
|
+
const ext = getLanguageExtension(language, defaultTs);
|
|
59
|
+
return [`${id}.inline_script.`, ext];
|
|
60
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "windmill-utils-internal",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Internal utility functions for Windmill",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "./gen_wm_client.sh && tsc",
|
|
9
|
+
"build-mac": "./gen_wm_client-mac.sh && tsc",
|
|
10
|
+
"prepublishOnly": "npm run build"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"windmill"
|
|
14
|
+
],
|
|
15
|
+
"author": "Ruben Fiszel",
|
|
16
|
+
"license": "Apache 2.0",
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@types/node": "^24.1.0",
|
|
19
|
+
"typescript": "^5.0.0"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist/**/*"
|
|
23
|
+
]
|
|
24
|
+
}
|