@inflector/aura 0.1.2 → 0.1.4
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 +7 -1
- package/dist/storage.d.ts +1 -1
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +2 -2
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -344,6 +344,10 @@ async function push() {
|
|
|
344
344
|
spin.stop("Schema missing", false);
|
|
345
345
|
return;
|
|
346
346
|
}
|
|
347
|
+
// Utility to convert all paths to POSIX (forward slash) format
|
|
348
|
+
function toPosixPath(p) {
|
|
349
|
+
return p.split('\\').join('/');
|
|
350
|
+
}
|
|
347
351
|
function collectFunctions(baseDir, baseRel = "") {
|
|
348
352
|
let results = {};
|
|
349
353
|
if (!fs.existsSync(baseDir) || !fs.statSync(baseDir).isDirectory()) {
|
|
@@ -351,7 +355,9 @@ async function push() {
|
|
|
351
355
|
}
|
|
352
356
|
for (const entry of fs.readdirSync(baseDir, { withFileTypes: true })) {
|
|
353
357
|
const entryPath = join(baseDir, entry.name);
|
|
354
|
-
|
|
358
|
+
// Always use POSIX-style for relPath
|
|
359
|
+
const relPathRaw = baseRel ? join(baseRel, entry.name) : entry.name;
|
|
360
|
+
const relPath = toPosixPath(relPathRaw);
|
|
355
361
|
if (entry.isDirectory()) {
|
|
356
362
|
Object.assign(results, collectFunctions(entryPath, relPath));
|
|
357
363
|
}
|
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;
|
package/dist/storage.d.ts.map
CHANGED
|
@@ -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;;;;;
|
|
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
|
});
|