@solana-mobile/dapp-store-cli 0.9.5 → 0.11.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/lib/CliSetup.js +470 -569
- package/lib/CliUtils.js +19 -34
- package/lib/__tests__/CliSetupTest.js +4 -27
- package/lib/commands/ValidateCommand.js +16 -41
- package/lib/commands/create/CreateCliApp.js +19 -31
- package/lib/commands/create/CreateCliRelease.js +17 -27
- package/lib/commands/create/index.js +0 -1
- package/lib/commands/publish/PublishCliRemove.js +12 -20
- package/lib/commands/publish/PublishCliSubmit.js +12 -20
- package/lib/commands/publish/PublishCliSupport.js +12 -20
- package/lib/commands/publish/PublishCliUpdate.js +12 -20
- package/lib/commands/scaffolding/ScaffoldInit.js +1 -1
- package/lib/commands/utils.js +6 -14
- package/lib/config/PublishDetails.js +219 -220
- package/lib/generated/config_obj.json +1 -1
- package/lib/generated/config_schema.json +1 -1
- package/lib/index.js +6 -14
- package/lib/package.json +2 -2
- package/lib/prebuild_schema/publishing_source.yaml +4 -4
- package/lib/prebuild_schema/schemagen.js +4 -4
- package/lib/upload/CachedStorageDriver.js +13 -19
- package/package.json +2 -2
- package/src/CliSetup.ts +5 -53
- package/src/CliUtils.ts +5 -11
- package/src/__tests__/CliSetupTest.ts +8 -43
- package/src/commands/ValidateCommand.ts +0 -20
- package/src/commands/create/CreateCliApp.ts +1 -8
- package/src/commands/create/index.ts +0 -1
- package/src/commands/publish/PublishCliRemove.ts +1 -2
- package/src/commands/publish/PublishCliSubmit.ts +1 -2
- package/src/commands/publish/PublishCliSupport.ts +1 -2
- package/src/commands/publish/PublishCliUpdate.ts +1 -2
- package/src/config/PublishDetails.ts +58 -61
- package/src/prebuild_schema/publishing_source.yaml +4 -4
- package/lib/commands/create/CreateCliPublisher.js +0 -237
- package/src/commands/create/CreateCliPublisher.ts +0 -87
|
@@ -112,7 +112,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
112
112
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
113
113
|
}
|
|
114
114
|
function _ts_generator(thisArg, body) {
|
|
115
|
-
var f, y, t,
|
|
115
|
+
var f, y, t, _ = {
|
|
116
116
|
label: 0,
|
|
117
117
|
sent: function() {
|
|
118
118
|
if (t[0] & 1) throw t[1];
|
|
@@ -120,14 +120,10 @@ function _ts_generator(thisArg, body) {
|
|
|
120
120
|
},
|
|
121
121
|
trys: [],
|
|
122
122
|
ops: []
|
|
123
|
-
};
|
|
124
|
-
return(g = {
|
|
125
|
-
next: verb(0),
|
|
126
|
-
"throw": verb(1),
|
|
127
|
-
"return": verb(2)
|
|
128
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
123
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
124
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
129
125
|
return this;
|
|
130
|
-
}), g
|
|
126
|
+
}), g;
|
|
131
127
|
function verb(n) {
|
|
132
128
|
return function(v) {
|
|
133
129
|
return step([
|
|
@@ -138,7 +134,7 @@ function _ts_generator(thisArg, body) {
|
|
|
138
134
|
}
|
|
139
135
|
function step(op) {
|
|
140
136
|
if (f) throw new TypeError("Generator is already executing.");
|
|
141
|
-
while(_)try {
|
|
137
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
142
138
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
143
139
|
if (y = 0, t) op = [
|
|
144
140
|
op[0] & 2,
|
|
@@ -209,7 +205,7 @@ function _ts_generator(thisArg, body) {
|
|
|
209
205
|
import { dump, load } from "js-yaml";
|
|
210
206
|
import Ajv from "ajv";
|
|
211
207
|
// eslint-disable-next-line require-extensions/require-extensions
|
|
212
|
-
import { readFile } from
|
|
208
|
+
import { readFile } from 'fs/promises';
|
|
213
209
|
var schemaJson = JSON.parse((await readFile(new URL("../generated/config_schema.json", import.meta.url))).toString());
|
|
214
210
|
import fs from "fs";
|
|
215
211
|
import path from "path";
|
|
@@ -236,8 +232,8 @@ var ajv = new Ajv({
|
|
|
236
232
|
strictTuples: false
|
|
237
233
|
});
|
|
238
234
|
var validate = ajv.compile(schemaJson);
|
|
239
|
-
export var loadPublishDetails = function() {
|
|
240
|
-
|
|
235
|
+
export var loadPublishDetails = function(configPath) {
|
|
236
|
+
return _async_to_generator(function() {
|
|
241
237
|
var configFile, valid;
|
|
242
238
|
return _ts_generator(this, function(_state) {
|
|
243
239
|
switch(_state.label){
|
|
@@ -259,25 +255,22 @@ export var loadPublishDetails = function() {
|
|
|
259
255
|
];
|
|
260
256
|
}
|
|
261
257
|
});
|
|
262
|
-
});
|
|
263
|
-
|
|
264
|
-
return _ref.apply(this, arguments);
|
|
265
|
-
};
|
|
266
|
-
}();
|
|
258
|
+
})();
|
|
259
|
+
};
|
|
267
260
|
export var loadPublishDetailsWithChecks = function() {
|
|
268
|
-
var
|
|
269
|
-
|
|
270
|
-
var
|
|
261
|
+
var buildToolsDir = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
|
|
262
|
+
return _async_to_generator(function() {
|
|
263
|
+
var _config_app_media_find, _config_app_media, _config_release_media_find, _config_release_media, _config_release_media_find1, _config_release_media1, _config_release_media_find2, _config_release_media2, _config_release_media3, _config_release_media4, config, apkEntry, apkPath, _, appIcon, iconPath, iconBuffer, releaseIcon, iconPath1, banner, bannerPath, featureGraphic, featureGraphicPath, screenshots, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, item, mediaPath, err, videos, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, video, mediaPath1, err, googlePkg, pkgCompare, alpha_testers, _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, wallet;
|
|
271
264
|
return _ts_generator(this, function(_state) {
|
|
272
265
|
switch(_state.label){
|
|
273
266
|
case 0:
|
|
274
|
-
buildToolsDir = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : null;
|
|
275
267
|
return [
|
|
276
268
|
4,
|
|
277
269
|
loadPublishDetails(Constants.getConfigFilePath())
|
|
278
270
|
];
|
|
279
271
|
case 1:
|
|
280
272
|
config = _state.sent();
|
|
273
|
+
// We validate that the config is going to have at least one installable asset
|
|
281
274
|
apkEntry = config.release.files.find(function(asset) {
|
|
282
275
|
return asset.purpose === "install";
|
|
283
276
|
});
|
|
@@ -298,17 +291,17 @@ export var loadPublishDetailsWithChecks = function() {
|
|
|
298
291
|
_.android_details = _state.sent();
|
|
299
292
|
_state.label = 3;
|
|
300
293
|
case 3:
|
|
301
|
-
|
|
294
|
+
appIcon = (_config_app_media = config.app.media) === null || _config_app_media === void 0 ? void 0 : (_config_app_media_find = _config_app_media.find(function(asset) {
|
|
302
295
|
return asset.purpose === "icon";
|
|
303
|
-
})) === null ||
|
|
304
|
-
if (!
|
|
296
|
+
})) === null || _config_app_media_find === void 0 ? void 0 : _config_app_media_find.uri;
|
|
297
|
+
if (!appIcon) return [
|
|
305
298
|
3,
|
|
306
299
|
6
|
|
307
300
|
];
|
|
308
|
-
iconPath = path.join(process.cwd(),
|
|
301
|
+
iconPath = path.join(process.cwd(), appIcon);
|
|
309
302
|
return [
|
|
310
303
|
4,
|
|
311
|
-
checkIconCompatibility(iconPath, "
|
|
304
|
+
checkIconCompatibility(iconPath, "App")
|
|
312
305
|
];
|
|
313
306
|
case 4:
|
|
314
307
|
_state.sent();
|
|
@@ -318,51 +311,65 @@ export var loadPublishDetailsWithChecks = function() {
|
|
|
318
311
|
];
|
|
319
312
|
case 5:
|
|
320
313
|
iconBuffer = _state.sent();
|
|
321
|
-
config.
|
|
314
|
+
config.app.icon = toMetaplexFile(iconBuffer, appIcon);
|
|
322
315
|
_state.label = 6;
|
|
323
316
|
case 6:
|
|
324
|
-
|
|
317
|
+
releaseIcon = (_config_release_media = config.release.media) === null || _config_release_media === void 0 ? void 0 : (_config_release_media_find = _config_release_media.find(function(asset) {
|
|
325
318
|
return asset.purpose === "icon";
|
|
326
|
-
})) === null ||
|
|
327
|
-
if (!
|
|
319
|
+
})) === null || _config_release_media_find === void 0 ? void 0 : _config_release_media_find.uri;
|
|
320
|
+
if (!releaseIcon) return [
|
|
328
321
|
3,
|
|
329
|
-
|
|
322
|
+
8
|
|
330
323
|
];
|
|
331
|
-
iconPath1 = path.join(process.cwd(),
|
|
324
|
+
iconPath1 = path.join(process.cwd(), releaseIcon);
|
|
332
325
|
return [
|
|
333
326
|
4,
|
|
334
|
-
checkIconCompatibility(iconPath1, "
|
|
327
|
+
checkIconCompatibility(iconPath1, "Release")
|
|
335
328
|
];
|
|
336
329
|
case 7:
|
|
337
330
|
_state.sent();
|
|
331
|
+
_state.label = 8;
|
|
332
|
+
case 8:
|
|
333
|
+
if (!appIcon && !releaseIcon) {
|
|
334
|
+
throw new Error("Please specify at least one media entry of type icon in your configuration file");
|
|
335
|
+
}
|
|
336
|
+
banner = (_config_release_media1 = config.release.media) === null || _config_release_media1 === void 0 ? void 0 : (_config_release_media_find1 = _config_release_media1.find(function(asset) {
|
|
337
|
+
return asset.purpose === "banner";
|
|
338
|
+
})) === null || _config_release_media_find1 === void 0 ? void 0 : _config_release_media_find1.uri;
|
|
339
|
+
if (!banner) return [
|
|
340
|
+
3,
|
|
341
|
+
10
|
|
342
|
+
];
|
|
343
|
+
bannerPath = path.join(process.cwd(), banner);
|
|
338
344
|
return [
|
|
339
345
|
4,
|
|
340
|
-
|
|
346
|
+
checkBannerCompatibility(bannerPath)
|
|
341
347
|
];
|
|
342
|
-
case 8:
|
|
343
|
-
iconBuffer1 = _state.sent();
|
|
344
|
-
config.app.icon = toMetaplexFile(iconBuffer1, appIcon);
|
|
345
|
-
_state.label = 9;
|
|
346
348
|
case 9:
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
})) === null || _config_release_media_find === void 0 ? void 0 : _config_release_media_find.uri;
|
|
350
|
-
if (!releaseIcon) return [
|
|
349
|
+
_state.sent();
|
|
350
|
+
return [
|
|
351
351
|
3,
|
|
352
352
|
11
|
|
353
353
|
];
|
|
354
|
-
|
|
354
|
+
case 10:
|
|
355
|
+
throw new Error("Please specify banner image of size 1200x600 in your configuration file");
|
|
356
|
+
case 11:
|
|
357
|
+
featureGraphic = (_config_release_media2 = config.release.media) === null || _config_release_media2 === void 0 ? void 0 : (_config_release_media_find2 = _config_release_media2.find(function(asset) {
|
|
358
|
+
return asset.purpose === "featureGraphic";
|
|
359
|
+
})) === null || _config_release_media_find2 === void 0 ? void 0 : _config_release_media_find2.uri;
|
|
360
|
+
if (!featureGraphic) return [
|
|
361
|
+
3,
|
|
362
|
+
13
|
|
363
|
+
];
|
|
364
|
+
featureGraphicPath = path.join(process.cwd(), featureGraphic);
|
|
355
365
|
return [
|
|
356
366
|
4,
|
|
357
|
-
|
|
367
|
+
checkFeatureGraphicCompatibility(featureGraphicPath)
|
|
358
368
|
];
|
|
359
|
-
case
|
|
369
|
+
case 12:
|
|
360
370
|
_state.sent();
|
|
361
|
-
_state.label =
|
|
362
|
-
case
|
|
363
|
-
if (!appIcon && !releaseIcon) {
|
|
364
|
-
throw new Error("Please specify at least one media entry of type icon in your configuration file");
|
|
365
|
-
}
|
|
371
|
+
_state.label = 13;
|
|
372
|
+
case 13:
|
|
366
373
|
config.release.media.forEach(function(item) {
|
|
367
374
|
var mediaPath = path.join(process.cwd(), item.uri);
|
|
368
375
|
if (!fs.existsSync(mediaPath)) {
|
|
@@ -375,56 +382,56 @@ export var loadPublishDetailsWithChecks = function() {
|
|
|
375
382
|
throw new Error("Please ensure the file ".concat(item.uri, " is a mp4."));
|
|
376
383
|
}
|
|
377
384
|
});
|
|
378
|
-
screenshots = (
|
|
385
|
+
screenshots = (_config_release_media3 = config.release.media) === null || _config_release_media3 === void 0 ? void 0 : _config_release_media3.filter(function(asset) {
|
|
379
386
|
return asset.purpose === "screenshot";
|
|
380
387
|
});
|
|
381
388
|
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
382
|
-
_state.label =
|
|
383
|
-
case
|
|
389
|
+
_state.label = 14;
|
|
390
|
+
case 14:
|
|
384
391
|
_state.trys.push([
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
392
|
+
14,
|
|
393
|
+
19,
|
|
394
|
+
20,
|
|
395
|
+
21
|
|
389
396
|
]);
|
|
390
397
|
_iterator = screenshots[Symbol.iterator]();
|
|
391
|
-
_state.label =
|
|
392
|
-
case
|
|
398
|
+
_state.label = 15;
|
|
399
|
+
case 15:
|
|
393
400
|
if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done)) return [
|
|
394
401
|
3,
|
|
395
|
-
|
|
402
|
+
18
|
|
396
403
|
];
|
|
397
404
|
item = _step.value;
|
|
398
405
|
mediaPath = path.join(process.cwd(), item.uri);
|
|
399
406
|
return [
|
|
400
407
|
4,
|
|
401
|
-
|
|
408
|
+
checkScreenshotDimensions(mediaPath)
|
|
402
409
|
];
|
|
403
|
-
case
|
|
410
|
+
case 16:
|
|
404
411
|
if (_state.sent()) {
|
|
405
412
|
throw new Error("Screenshot ".concat(mediaPath, " must be at least 1080px in width and height."));
|
|
406
413
|
}
|
|
407
|
-
_state.label =
|
|
408
|
-
case
|
|
414
|
+
_state.label = 17;
|
|
415
|
+
case 17:
|
|
409
416
|
_iteratorNormalCompletion = true;
|
|
410
417
|
return [
|
|
411
418
|
3,
|
|
412
|
-
|
|
419
|
+
15
|
|
413
420
|
];
|
|
414
|
-
case
|
|
421
|
+
case 18:
|
|
415
422
|
return [
|
|
416
423
|
3,
|
|
417
|
-
|
|
424
|
+
21
|
|
418
425
|
];
|
|
419
|
-
case
|
|
426
|
+
case 19:
|
|
420
427
|
err = _state.sent();
|
|
421
428
|
_didIteratorError = true;
|
|
422
429
|
_iteratorError = err;
|
|
423
430
|
return [
|
|
424
431
|
3,
|
|
425
|
-
|
|
432
|
+
21
|
|
426
433
|
];
|
|
427
|
-
case
|
|
434
|
+
case 20:
|
|
428
435
|
try {
|
|
429
436
|
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
430
437
|
_iterator.return();
|
|
@@ -437,57 +444,57 @@ export var loadPublishDetailsWithChecks = function() {
|
|
|
437
444
|
return [
|
|
438
445
|
7
|
|
439
446
|
];
|
|
440
|
-
case
|
|
441
|
-
videos = (
|
|
447
|
+
case 21:
|
|
448
|
+
videos = (_config_release_media4 = config.release.media) === null || _config_release_media4 === void 0 ? void 0 : _config_release_media4.filter(function(asset) {
|
|
442
449
|
return asset.purpose === "video";
|
|
443
450
|
});
|
|
444
451
|
_iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
445
|
-
_state.label =
|
|
446
|
-
case
|
|
452
|
+
_state.label = 22;
|
|
453
|
+
case 22:
|
|
447
454
|
_state.trys.push([
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
455
|
+
22,
|
|
456
|
+
27,
|
|
457
|
+
28,
|
|
458
|
+
29
|
|
452
459
|
]);
|
|
453
460
|
_iterator1 = videos[Symbol.iterator]();
|
|
454
|
-
_state.label =
|
|
455
|
-
case
|
|
461
|
+
_state.label = 23;
|
|
462
|
+
case 23:
|
|
456
463
|
if (!!(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done)) return [
|
|
457
464
|
3,
|
|
458
|
-
|
|
465
|
+
26
|
|
459
466
|
];
|
|
460
467
|
video = _step1.value;
|
|
461
468
|
mediaPath1 = path.join(process.cwd(), video.uri);
|
|
462
469
|
return [
|
|
463
470
|
4,
|
|
464
|
-
|
|
471
|
+
checkVideoDimensions(mediaPath1)
|
|
465
472
|
];
|
|
466
|
-
case
|
|
473
|
+
case 24:
|
|
467
474
|
if (_state.sent()) {
|
|
468
475
|
throw new Error("Video ".concat(mediaPath1, " must be at least 720px in width and height."));
|
|
469
476
|
}
|
|
470
|
-
_state.label =
|
|
471
|
-
case
|
|
477
|
+
_state.label = 25;
|
|
478
|
+
case 25:
|
|
472
479
|
_iteratorNormalCompletion1 = true;
|
|
473
480
|
return [
|
|
474
481
|
3,
|
|
475
|
-
|
|
482
|
+
23
|
|
476
483
|
];
|
|
477
|
-
case
|
|
484
|
+
case 26:
|
|
478
485
|
return [
|
|
479
486
|
3,
|
|
480
|
-
|
|
487
|
+
29
|
|
481
488
|
];
|
|
482
|
-
case
|
|
489
|
+
case 27:
|
|
483
490
|
err = _state.sent();
|
|
484
491
|
_didIteratorError1 = true;
|
|
485
492
|
_iteratorError1 = err;
|
|
486
493
|
return [
|
|
487
494
|
3,
|
|
488
|
-
|
|
495
|
+
29
|
|
489
496
|
];
|
|
490
|
-
case
|
|
497
|
+
case 28:
|
|
491
498
|
try {
|
|
492
499
|
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
493
500
|
_iterator1.return();
|
|
@@ -500,7 +507,7 @@ export var loadPublishDetailsWithChecks = function() {
|
|
|
500
507
|
return [
|
|
501
508
|
7
|
|
502
509
|
];
|
|
503
|
-
case
|
|
510
|
+
case 29:
|
|
504
511
|
if (screenshots.length + videos.length < 4) {
|
|
505
512
|
throw new Error("At least 4 screenshots or videos are required for publishing a new release. Found only ".concat(screenshots.length + videos.length));
|
|
506
513
|
}
|
|
@@ -548,13 +555,10 @@ export var loadPublishDetailsWithChecks = function() {
|
|
|
548
555
|
];
|
|
549
556
|
}
|
|
550
557
|
});
|
|
551
|
-
});
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
}();
|
|
556
|
-
var checkIconCompatibility = function() {
|
|
557
|
-
var _ref = _async_to_generator(function(path, typeString) {
|
|
558
|
+
})();
|
|
559
|
+
};
|
|
560
|
+
var checkIconCompatibility = function(path, typeString) {
|
|
561
|
+
return _async_to_generator(function() {
|
|
558
562
|
return _ts_generator(this, function(_state) {
|
|
559
563
|
switch(_state.label){
|
|
560
564
|
case 0:
|
|
@@ -574,11 +578,54 @@ var checkIconCompatibility = function() {
|
|
|
574
578
|
];
|
|
575
579
|
}
|
|
576
580
|
});
|
|
577
|
-
});
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
581
|
+
})();
|
|
582
|
+
};
|
|
583
|
+
var checkBannerCompatibility = function(path) {
|
|
584
|
+
return _async_to_generator(function() {
|
|
585
|
+
return _ts_generator(this, function(_state) {
|
|
586
|
+
switch(_state.label){
|
|
587
|
+
case 0:
|
|
588
|
+
if (!fs.existsSync(path) || !checkImageExtension(path)) {
|
|
589
|
+
throw new Error("Please check the path to your banner image and ensure the file is a jpeg, png, or webp file.");
|
|
590
|
+
}
|
|
591
|
+
return [
|
|
592
|
+
4,
|
|
593
|
+
checkBannerDimensions(path)
|
|
594
|
+
];
|
|
595
|
+
case 1:
|
|
596
|
+
if (_state.sent()) {
|
|
597
|
+
throw new Error("Banner must be 1200px by 600px.");
|
|
598
|
+
}
|
|
599
|
+
return [
|
|
600
|
+
2
|
|
601
|
+
];
|
|
602
|
+
}
|
|
603
|
+
});
|
|
604
|
+
})();
|
|
605
|
+
};
|
|
606
|
+
var checkFeatureGraphicCompatibility = function(path) {
|
|
607
|
+
return _async_to_generator(function() {
|
|
608
|
+
return _ts_generator(this, function(_state) {
|
|
609
|
+
switch(_state.label){
|
|
610
|
+
case 0:
|
|
611
|
+
if (!fs.existsSync(path) || !checkImageExtension(path)) {
|
|
612
|
+
throw new Error("Please check the path to your featureGraphic image and ensure the file is a jpeg, png, or webp file.");
|
|
613
|
+
}
|
|
614
|
+
return [
|
|
615
|
+
4,
|
|
616
|
+
checkFeatureGraphicDimensions(path)
|
|
617
|
+
];
|
|
618
|
+
case 1:
|
|
619
|
+
if (_state.sent()) {
|
|
620
|
+
throw new Error("Feature Graphic must be 1200px by 1200px.");
|
|
621
|
+
}
|
|
622
|
+
return [
|
|
623
|
+
2
|
|
624
|
+
];
|
|
625
|
+
}
|
|
626
|
+
});
|
|
627
|
+
})();
|
|
628
|
+
};
|
|
582
629
|
var checkImageExtension = function(uri) {
|
|
583
630
|
var fileExt = path.extname(uri).toLowerCase();
|
|
584
631
|
return fileExt == ".png" || fileExt == ".jpg" || fileExt == ".jpeg" || fileExt == ".webp";
|
|
@@ -609,8 +656,8 @@ var checkVideoExtension = function(uri) {
|
|
|
609
656
|
throw new Error("Please ensure all translations of short_description are between 0 and 30 characters");
|
|
610
657
|
}
|
|
611
658
|
};
|
|
612
|
-
var checkIconDimensions = function() {
|
|
613
|
-
|
|
659
|
+
var checkIconDimensions = function(iconPath) {
|
|
660
|
+
return _async_to_generator(function() {
|
|
614
661
|
var size, _size_width;
|
|
615
662
|
return _ts_generator(this, function(_state) {
|
|
616
663
|
switch(_state.label){
|
|
@@ -627,13 +674,10 @@ var checkIconDimensions = function() {
|
|
|
627
674
|
];
|
|
628
675
|
}
|
|
629
676
|
});
|
|
630
|
-
});
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
}();
|
|
635
|
-
var checkScreenshotSize = function() {
|
|
636
|
-
var _ref = _async_to_generator(function(imagePath) {
|
|
677
|
+
})();
|
|
678
|
+
};
|
|
679
|
+
var checkScreenshotDimensions = function(imagePath) {
|
|
680
|
+
return _async_to_generator(function() {
|
|
637
681
|
var size, _size_width, _size_height;
|
|
638
682
|
return _ts_generator(this, function(_state) {
|
|
639
683
|
switch(_state.label){
|
|
@@ -650,13 +694,50 @@ var checkScreenshotSize = function() {
|
|
|
650
694
|
];
|
|
651
695
|
}
|
|
652
696
|
});
|
|
653
|
-
});
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
697
|
+
})();
|
|
698
|
+
};
|
|
699
|
+
var checkBannerDimensions = function(imagePath) {
|
|
700
|
+
return _async_to_generator(function() {
|
|
701
|
+
var size, _size_width, _size_height;
|
|
702
|
+
return _ts_generator(this, function(_state) {
|
|
703
|
+
switch(_state.label){
|
|
704
|
+
case 0:
|
|
705
|
+
return [
|
|
706
|
+
4,
|
|
707
|
+
runImgSize(imagePath)
|
|
708
|
+
];
|
|
709
|
+
case 1:
|
|
710
|
+
size = _state.sent();
|
|
711
|
+
return [
|
|
712
|
+
2,
|
|
713
|
+
((_size_width = size === null || size === void 0 ? void 0 : size.width) !== null && _size_width !== void 0 ? _size_width : 0) != 1200 || ((_size_height = size === null || size === void 0 ? void 0 : size.height) !== null && _size_height !== void 0 ? _size_height : 0) != 600
|
|
714
|
+
];
|
|
715
|
+
}
|
|
716
|
+
});
|
|
717
|
+
})();
|
|
718
|
+
};
|
|
719
|
+
var checkFeatureGraphicDimensions = function(imagePath) {
|
|
720
|
+
return _async_to_generator(function() {
|
|
721
|
+
var size, _size_width, _size_height;
|
|
722
|
+
return _ts_generator(this, function(_state) {
|
|
723
|
+
switch(_state.label){
|
|
724
|
+
case 0:
|
|
725
|
+
return [
|
|
726
|
+
4,
|
|
727
|
+
runImgSize(imagePath)
|
|
728
|
+
];
|
|
729
|
+
case 1:
|
|
730
|
+
size = _state.sent();
|
|
731
|
+
return [
|
|
732
|
+
2,
|
|
733
|
+
((_size_width = size === null || size === void 0 ? void 0 : size.width) !== null && _size_width !== void 0 ? _size_width : 0) != 1200 || ((_size_height = size === null || size === void 0 ? void 0 : size.height) !== null && _size_height !== void 0 ? _size_height : 0) != 1200
|
|
734
|
+
];
|
|
735
|
+
}
|
|
736
|
+
});
|
|
737
|
+
})();
|
|
738
|
+
};
|
|
739
|
+
var checkVideoDimensions = function(imagePath) {
|
|
740
|
+
return _async_to_generator(function() {
|
|
660
741
|
var size, _size_width, _size_height;
|
|
661
742
|
return _ts_generator(this, function(_state) {
|
|
662
743
|
switch(_state.label){
|
|
@@ -673,13 +754,10 @@ var checkVideoSize = function() {
|
|
|
673
754
|
];
|
|
674
755
|
}
|
|
675
756
|
});
|
|
676
|
-
});
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
}();
|
|
681
|
-
var getAndroidDetails = function() {
|
|
682
|
-
var _ref = _async_to_generator(function(aaptDir, apkPath) {
|
|
757
|
+
})();
|
|
758
|
+
};
|
|
759
|
+
var getAndroidDetails = function(aaptDir, apkPath) {
|
|
760
|
+
return _async_to_generator(function() {
|
|
683
761
|
var stdout, appPackage, versionCode, versionName, minSdk, permissions, locales, isDebuggable, _locales_values, localeArray, localesSrc, _appPackage_, _minSdk_, _versionCode_, _versionName_, _tmp, e;
|
|
684
762
|
return _ts_generator(this, function(_state) {
|
|
685
763
|
switch(_state.label){
|
|
@@ -721,13 +799,9 @@ var getAndroidDetails = function() {
|
|
|
721
799
|
if (permissions.includes("android.permission.REQUEST_INSTALL_PACKAGES") || permissions.includes("android.permission.REQUEST_DELETE_PACKAGES")) {
|
|
722
800
|
showMessage("App requests install or delete permission", "App will be subject to additional security reviews for listing on Solana dApp Store and processing time may be beyond regular review time", "warning");
|
|
723
801
|
}
|
|
724
|
-
if (permissions.includes("com.solanamobile.seedvault.ACCESS_SEED_VAULT")) {
|
|
802
|
+
if (permissions.includes("com.solanamobile.seedvault.ACCESS_SEED_VAULT") || permissions.includes("com.solanamobile.seedvault.ACCESS_SEED_VAULT_PRIVILEGED")) {
|
|
725
803
|
showMessage("App requests Seed Vault permission", "If this is not a wallet application, your app maybe rejected from listing on Solana dApp Store.", "warning");
|
|
726
804
|
}
|
|
727
|
-
if (localeArray.length >= 60) {
|
|
728
|
-
showMessage("The bundle apk claims supports for following locales", "Claim for supported locales::\n" + localeArray + "\nIf this release does not support all these locales the release may be rejected" + "\nSee details at https://developer.android.com/guide/topics/resources/multilingual-support#design for configuring the supported locales", "warning");
|
|
729
|
-
}
|
|
730
|
-
checkAbis(apkPath);
|
|
731
805
|
_tmp = {
|
|
732
806
|
android_package: (_appPackage_ = appPackage === null || appPackage === void 0 ? void 0 : appPackage[1]) !== null && _appPackage_ !== void 0 ? _appPackage_ : "",
|
|
733
807
|
min_sdk: parseInt((_minSdk_ = minSdk === null || minSdk === void 0 ? void 0 : minSdk[1]) !== null && _minSdk_ !== void 0 ? _minSdk_ : "0", 10),
|
|
@@ -760,77 +834,10 @@ var getAndroidDetails = function() {
|
|
|
760
834
|
];
|
|
761
835
|
}
|
|
762
836
|
});
|
|
763
|
-
});
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
}();
|
|
768
|
-
var checkAbis = function() {
|
|
769
|
-
var _ref = _async_to_generator(function(apkPath) {
|
|
770
|
-
var stdout, amV7libs, x86libs, x8664libs, messages, e;
|
|
771
|
-
return _ts_generator(this, function(_state) {
|
|
772
|
-
switch(_state.label){
|
|
773
|
-
case 0:
|
|
774
|
-
_state.trys.push([
|
|
775
|
-
0,
|
|
776
|
-
2,
|
|
777
|
-
,
|
|
778
|
-
3
|
|
779
|
-
]);
|
|
780
|
-
return [
|
|
781
|
-
4,
|
|
782
|
-
runExec("zipinfo -s ".concat(apkPath, " | grep .so$"))
|
|
783
|
-
];
|
|
784
|
-
case 1:
|
|
785
|
-
stdout = _state.sent().stdout;
|
|
786
|
-
amV7libs = _to_consumable_array(stdout.matchAll(/lib\/armeabi-v7a\/(.*)/g)).flatMap(function(permission) {
|
|
787
|
-
return permission[1];
|
|
788
|
-
});
|
|
789
|
-
x86libs = _to_consumable_array(stdout.matchAll(/lib\/x86\/(.*)/g)).flatMap(function(permission) {
|
|
790
|
-
return permission[1];
|
|
791
|
-
});
|
|
792
|
-
x8664libs = _to_consumable_array(stdout.matchAll(/lib\/x86_64\/(.*)/g)).flatMap(function(permission) {
|
|
793
|
-
return permission[1];
|
|
794
|
-
});
|
|
795
|
-
if (amV7libs.length > 0 || x86libs.length > 0 || x8664libs.length > 0) {
|
|
796
|
-
messages = [
|
|
797
|
-
"Solana dApp Store only supports arm64-v8a abi.",
|
|
798
|
-
"Your apk file contains following unsupported abis"
|
|
799
|
-
].concat(_to_consumable_array(amV7libs.length > 0 ? [
|
|
800
|
-
"\narmeabi-v7a:\n" + amV7libs
|
|
801
|
-
] : []), _to_consumable_array(x86libs.length > 0 ? [
|
|
802
|
-
"\nx86:\n" + x86libs
|
|
803
|
-
] : []), _to_consumable_array(x8664libs.length > 0 ? [
|
|
804
|
-
"\nx86_64:\n" + x8664libs
|
|
805
|
-
] : []), [
|
|
806
|
-
"\n\nAlthough your app works fine on Saga, these library files are unused and increase the size of apk file making the download and update time longer for your app.",
|
|
807
|
-
"\n\nSee https://developer.android.com/games/optimize/64-bit#build-with-64-bit for how to optimize your app."
|
|
808
|
-
]).join("\n");
|
|
809
|
-
showMessage("Unsupported files found in apk", messages, "warning");
|
|
810
|
-
}
|
|
811
|
-
return [
|
|
812
|
-
3,
|
|
813
|
-
3
|
|
814
|
-
];
|
|
815
|
-
case 2:
|
|
816
|
-
e = _state.sent();
|
|
817
|
-
return [
|
|
818
|
-
3,
|
|
819
|
-
3
|
|
820
|
-
];
|
|
821
|
-
case 3:
|
|
822
|
-
return [
|
|
823
|
-
2
|
|
824
|
-
];
|
|
825
|
-
}
|
|
826
|
-
});
|
|
827
|
-
});
|
|
828
|
-
return function checkAbis(apkPath) {
|
|
829
|
-
return _ref.apply(this, arguments);
|
|
830
|
-
};
|
|
831
|
-
}();
|
|
832
|
-
export var extractCertFingerprint = function() {
|
|
833
|
-
var _ref = _async_to_generator(function(aaptDir, apkPath) {
|
|
837
|
+
})();
|
|
838
|
+
};
|
|
839
|
+
export var extractCertFingerprint = function(aaptDir, apkPath) {
|
|
840
|
+
return _async_to_generator(function() {
|
|
834
841
|
var stdout, regex, match;
|
|
835
842
|
return _ts_generator(this, function(_state) {
|
|
836
843
|
switch(_state.label){
|
|
@@ -856,18 +863,15 @@ export var extractCertFingerprint = function() {
|
|
|
856
863
|
];
|
|
857
864
|
}
|
|
858
865
|
});
|
|
859
|
-
});
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
var _ref = _async_to_generator(function(param) {
|
|
866
|
-
var publisher, app, release, lastSubmittedVersionOnChain, lastUpdatedVersionOnStore, currentConfig, _publisher_address, _app_address, _release_address, newConfig;
|
|
866
|
+
})();
|
|
867
|
+
};
|
|
868
|
+
export var writeToPublishDetails = function(param) {
|
|
869
|
+
var app = param.app, release = param.release, lastSubmittedVersionOnChain = param.lastSubmittedVersionOnChain, lastUpdatedVersionOnStore = param.lastUpdatedVersionOnStore;
|
|
870
|
+
return _async_to_generator(function() {
|
|
871
|
+
var currentConfig, _app_address, _release_address, newConfig;
|
|
867
872
|
return _ts_generator(this, function(_state) {
|
|
868
873
|
switch(_state.label){
|
|
869
874
|
case 0:
|
|
870
|
-
publisher = param.publisher, app = param.app, release = param.release, lastSubmittedVersionOnChain = param.lastSubmittedVersionOnChain, lastUpdatedVersionOnStore = param.lastUpdatedVersionOnStore;
|
|
871
875
|
return [
|
|
872
876
|
4,
|
|
873
877
|
loadPublishDetailsWithChecks()
|
|
@@ -877,9 +881,7 @@ export var writeToPublishDetails = function() {
|
|
|
877
881
|
delete currentConfig.publisher.icon;
|
|
878
882
|
delete currentConfig.app.icon;
|
|
879
883
|
newConfig = {
|
|
880
|
-
publisher:
|
|
881
|
-
address: (_publisher_address = publisher === null || publisher === void 0 ? void 0 : publisher.address) !== null && _publisher_address !== void 0 ? _publisher_address : currentConfig.publisher.address
|
|
882
|
-
}),
|
|
884
|
+
publisher: _object_spread({}, currentConfig.publisher),
|
|
883
885
|
app: _object_spread_props(_object_spread({}, currentConfig.app), {
|
|
884
886
|
address: (_app_address = app === null || app === void 0 ? void 0 : app.address) !== null && _app_address !== void 0 ? _app_address : currentConfig.app.address
|
|
885
887
|
}),
|
|
@@ -898,8 +900,5 @@ export var writeToPublishDetails = function() {
|
|
|
898
900
|
];
|
|
899
901
|
}
|
|
900
902
|
});
|
|
901
|
-
});
|
|
902
|
-
|
|
903
|
-
return _ref.apply(this, arguments);
|
|
904
|
-
};
|
|
905
|
-
}();
|
|
903
|
+
})();
|
|
904
|
+
};
|