@inflector/aura 0.1.1 → 0.1.3

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 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) {
@@ -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,CAkGvG"}
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: JSON.stringify(args ?? {}),
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
package/dist/storage.d.ts CHANGED
@@ -21,7 +21,7 @@ export declare const AuraStorage: (url: string, workspace: string, userAtom: any
21
21
  allowedTypes?: string[];
22
22
  }) => Promise<any[]>;
23
23
  Exists: (id: string) => Promise<boolean | undefined>;
24
- Download: (id: string, download?: boolean) => Promise<{
24
+ Download: (id: string, download?: boolean, asBase64?: boolean) => Promise<{
25
25
  blob: any;
26
26
  fileName: string;
27
27
  mimeType: any;
@@ -1 +1 @@
1
- {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":"AAAA,KAAK,QAAQ,GAAG;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,IAAI,CAAC;CACpB,CAAC;AAIF,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,EAAE,WAAW,MAAM,EAAE,UAAU,GAAG;oBAG1D,IAAI,WACH;QAAE,YAAY,CAAC,EAAE,OAAO,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE;eAkDhD,MAAM;iBAGE,MAAM;cAYT,MAAM;;6BAwBV,IAAI,EAAE,WACN;QAAE,YAAY,CAAC,EAAE,OAAO,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE;iBAuC5C,MAAM;mBAYJ,MAAM,aAAY,OAAO;;;;;CA6BrD,CAAA"}
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":"AAAA,KAAK,QAAQ,GAAG;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,IAAI,CAAC;CACpB,CAAC;AAIF,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,EAAE,WAAW,MAAM,EAAE,UAAU,GAAG;oBAG1D,IAAI,WACH;QAAE,YAAY,CAAC,EAAE,OAAO,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE;eAkDhD,MAAM;iBAGE,MAAM;cAYT,MAAM;;6BAwBV,IAAI,EAAE,WACN;QAAE,YAAY,CAAC,EAAE,OAAO,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE;iBAuC5C,MAAM;mBAYJ,MAAM,aAAY,OAAO,aAAmB,OAAO;;;;;CA6B/E,CAAA"}
package/dist/storage.js CHANGED
@@ -143,9 +143,9 @@ export const AuraStorage = (url, workspace, userAtom) => {
143
143
  withCredentials: true
144
144
  })).data;
145
145
  },
146
- Download: async (id, download = true) => {
146
+ Download: async (id, download = true, asBase64) => {
147
147
  try {
148
- const response = await axios.get(`${url}/api/storage/${workspace}/${id}?download=${download ? '1' : '0'}`, {
148
+ const response = await axios.get(`${url}/api/storage/${workspace}/${id}?download=${download ? '1' : '0'}&base64=${asBase64 ? '1' : '0'}`, {
149
149
  responseType: "blob",
150
150
  withCredentials: true
151
151
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inflector/aura",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",