@devicecloud.dev/dcd 3.6.8 → 3.6.9
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/methods.d.ts +0 -1
- package/dist/methods.js +2 -33
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/dist/methods.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ export declare const typeSafeGet: <T extends keyof paths>(baseUrl: string, path:
|
|
|
14
14
|
headers?: HeadersInit;
|
|
15
15
|
}) => Promise<paths[T]["get"]["responses"]["200"]["content"]["application/json"]>;
|
|
16
16
|
export declare const toBuffer: (archive: archiver.Archiver) => Promise<Buffer<ArrayBuffer>>;
|
|
17
|
-
export declare const compressDir: (sourceDir: string) => Promise<Buffer<ArrayBuffer>>;
|
|
18
17
|
export declare const compressFolderToBlob: (sourceDir: string) => Promise<Blob>;
|
|
19
18
|
export declare const compressFilesFromRelativePath: (path: string, files: string[], commonRoot: string) => Promise<Buffer<ArrayBuffer>>;
|
|
20
19
|
export declare const verifyAppZip: (zipPath: string) => Promise<void>;
|
package/dist/methods.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.writeJSONFile = exports.getUploadStatus = exports.verifyAdditionalAppFiles = exports.uploadBinaries = exports.uploadBinary = exports.extractAppMetadataIos = exports.extractAppMetadataIosZip = exports.extractAppMetadataAndroid = exports.verifyAppZip = exports.compressFilesFromRelativePath = exports.compressFolderToBlob = exports.
|
|
3
|
+
exports.writeJSONFile = exports.getUploadStatus = exports.verifyAdditionalAppFiles = exports.uploadBinaries = exports.uploadBinary = exports.extractAppMetadataIos = exports.extractAppMetadataIosZip = exports.extractAppMetadataAndroid = exports.verifyAppZip = exports.compressFilesFromRelativePath = exports.compressFolderToBlob = exports.toBuffer = exports.typeSafeGet = exports.typeSafePostDownload = exports.typeSafePost = void 0;
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
5
|
const supabase_js_1 = require("@supabase/supabase-js");
|
|
6
6
|
// required polyfill for node 18
|
|
@@ -21,16 +21,6 @@ const path = require("path");
|
|
|
21
21
|
const node_path_1 = require("node:path");
|
|
22
22
|
const os = require("node:os");
|
|
23
23
|
const cloud_1 = require("./commands/cloud");
|
|
24
|
-
const PERMITTED_EXTENSIONS = new Set([
|
|
25
|
-
'yml',
|
|
26
|
-
'yaml',
|
|
27
|
-
'png',
|
|
28
|
-
'jpg',
|
|
29
|
-
'jpeg',
|
|
30
|
-
'gif',
|
|
31
|
-
'mp4',
|
|
32
|
-
'js',
|
|
33
|
-
]);
|
|
34
24
|
const typeSafePost = async (baseUrl, path, init) => {
|
|
35
25
|
const res = await fetch(baseUrl + path, {
|
|
36
26
|
...init,
|
|
@@ -96,27 +86,6 @@ const toBuffer = async (archive) => {
|
|
|
96
86
|
return Buffer.concat(chunks);
|
|
97
87
|
};
|
|
98
88
|
exports.toBuffer = toBuffer;
|
|
99
|
-
const compressDir = async (sourceDir) => {
|
|
100
|
-
// const output = createWriteStream(zipTargetPath);
|
|
101
|
-
const archive = archiver('zip', {
|
|
102
|
-
zlib: { level: 9 },
|
|
103
|
-
});
|
|
104
|
-
archive.on('error', (err) => {
|
|
105
|
-
throw err;
|
|
106
|
-
});
|
|
107
|
-
archive.directory(sourceDir, '.', (data) => {
|
|
108
|
-
if (data.name.split('/')[0] === 'node_modules')
|
|
109
|
-
return false;
|
|
110
|
-
if (PERMITTED_EXTENSIONS.has(data.name.split('.').pop())) {
|
|
111
|
-
return data;
|
|
112
|
-
}
|
|
113
|
-
return false;
|
|
114
|
-
});
|
|
115
|
-
const buffer = await (0, exports.toBuffer)(archive);
|
|
116
|
-
// await writeFile('./my-zip.zip', buffer);
|
|
117
|
-
return buffer;
|
|
118
|
-
};
|
|
119
|
-
exports.compressDir = compressDir;
|
|
120
89
|
const compressFolderToBlob = async (sourceDir) => {
|
|
121
90
|
const archive = archiver('zip', {
|
|
122
91
|
zlib: { level: 9 },
|
|
@@ -186,7 +155,7 @@ const parseInfoPlist = async (buffer) => {
|
|
|
186
155
|
const extractAppMetadataIosZip = async (appFilePath) => new Promise((resolve, reject) => {
|
|
187
156
|
const zip = new StreamZip({ file: appFilePath });
|
|
188
157
|
zip.on('ready', () => {
|
|
189
|
-
const infoPlist = Object.values(zip.entries()).find((e) => e.name.
|
|
158
|
+
const infoPlist = Object.values(zip.entries()).find((e) => e.name.endsWith('.app/Info.plist'));
|
|
190
159
|
if (!infoPlist) {
|
|
191
160
|
reject(new Error('Failed to find info plist'));
|
|
192
161
|
}
|
package/oclif.manifest.json
CHANGED