@inflector/aura 0.1.1 → 0.1.2
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/bin.js +1 -1
- package/dist/function.d.ts.map +1 -1
- package/dist/function.js +9 -5
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -50,7 +50,7 @@ class Spinner {
|
|
|
50
50
|
function printBanner() {
|
|
51
51
|
console.log("");
|
|
52
52
|
console.log(chalk.bold.hex("#FFA500")(" A U R A ") + chalk.dim(" | Inflector CLI"));
|
|
53
|
-
console.log(chalk.dim("
|
|
53
|
+
console.log(chalk.dim(" ────────────────────────────"));
|
|
54
54
|
console.log("");
|
|
55
55
|
}
|
|
56
56
|
function printBox(title, content) {
|
package/dist/function.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function.d.ts","sourceRoot":"","sources":["../src/function.ts"],"names":[],"mappings":"AAAA,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,GAAG,
|
|
1
|
+
{"version":3,"file":"function.d.ts","sourceRoot":"","sources":["../src/function.ts"],"names":[],"mappings":"AAAA,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,GAAG,CAqGvG"}
|
package/dist/function.js
CHANGED
|
@@ -13,14 +13,18 @@ export function createFunctionHandler(baseUrl, workspace, functionsFolder) {
|
|
|
13
13
|
// 1. Remove 'async' here to prevent native Promise wrapping
|
|
14
14
|
apply(_, __, args) {
|
|
15
15
|
const url = [baseUrl, "api", "fn", workspace, ...path].join("/");
|
|
16
|
+
const isFormData = args != null && args.length === 1 && args[0] instanceof FormData;
|
|
17
|
+
const body = isFormData ? args[0] : JSON.stringify(args ?? {});
|
|
18
|
+
const headers = {
|
|
19
|
+
"Accept": "text/event-stream,application/json",
|
|
20
|
+
};
|
|
21
|
+
if (!isFormData)
|
|
22
|
+
headers["Content-Type"] = "application/json";
|
|
16
23
|
// 2. Start the fetch properly (without await)
|
|
17
24
|
const requestPromise = fetch(url, {
|
|
18
25
|
method: "POST",
|
|
19
|
-
body
|
|
20
|
-
headers
|
|
21
|
-
"Content-Type": "application/json",
|
|
22
|
-
"Accept": "text/event-stream,application/json",
|
|
23
|
-
},
|
|
26
|
+
body,
|
|
27
|
+
headers,
|
|
24
28
|
credentials: "include",
|
|
25
29
|
});
|
|
26
30
|
// 3. Return a custom "Thenable" object immediately
|