@solana-mobile/dapp-store-publishing-tools 0.9.4 → 0.10.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/CoreUtils.js +4 -4
- package/lib/create/AppCore.js +3 -3
- package/lib/create/PublisherCore.js +3 -3
- package/lib/create/ReleaseCore.js +14 -14
- package/lib/generated/appJsonMetadata.d.js +1 -1
- package/lib/generated/publisherJsonMetadata.d.js +1 -1
- package/lib/generated/releaseJsonMetadata.d.js +1 -1
- package/lib/publish/PublishCoreAttestation.js +3 -3
- package/lib/publish/PublishCoreRemove.js +4 -4
- package/lib/publish/PublishCoreSubmit.js +26 -10
- package/lib/publish/PublishCoreSupport.js +4 -4
- package/lib/publish/PublishCoreUpdate.js +26 -10
- package/lib/publish/dapp_publisher_portal.js +19 -7
- package/lib/validate/CoreValidation.js +1 -1
- package/package.json +1 -1
- package/src/CoreUtils.ts +1 -1
- package/src/create/ReleaseCore.ts +1 -1
- package/src/generated/appJsonMetadata.d.ts +1 -1
- package/src/generated/publisherJsonMetadata.d.ts +1 -1
- package/src/generated/releaseJsonMetadata.d.ts +1 -1
- package/src/publish/PublishCoreSubmit.ts +25 -2
- package/src/publish/PublishCoreUpdate.ts +25 -2
- package/src/publish/dapp_publisher_portal.ts +22 -4
- package/src/types.ts +6 -0
package/lib/CoreUtils.js
CHANGED
|
@@ -94,13 +94,13 @@ function _ts_generator(thisArg, body) {
|
|
|
94
94
|
trys: [],
|
|
95
95
|
ops: []
|
|
96
96
|
};
|
|
97
|
-
return
|
|
97
|
+
return g = {
|
|
98
98
|
next: verb(0),
|
|
99
99
|
"throw": verb(1),
|
|
100
100
|
"return": verb(2)
|
|
101
101
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
102
102
|
return this;
|
|
103
|
-
}), g
|
|
103
|
+
}), g;
|
|
104
104
|
function verb(n) {
|
|
105
105
|
return function(v) {
|
|
106
106
|
return step([
|
|
@@ -184,11 +184,11 @@ export var Constants = function Constants() {
|
|
|
184
184
|
"use strict";
|
|
185
185
|
_class_call_check(this, Constants);
|
|
186
186
|
};
|
|
187
|
-
_define_property(Constants, "PUBLISHING_SCHEMA_VER", "0.
|
|
187
|
+
_define_property(Constants, "PUBLISHING_SCHEMA_VER", "0.3.0");
|
|
188
188
|
export var truncateAddress = function(address) {
|
|
189
189
|
return "".concat(address.slice(0, 4), "...").concat(address.slice(address.length - 4, address.length));
|
|
190
190
|
};
|
|
191
|
-
export var mintNft = function() {
|
|
191
|
+
export var mintNft = /*#__PURE__*/ function() {
|
|
192
192
|
var _ref = _async_to_generator(function(metaplex, json, createNftInput, priorityFeeLamports) {
|
|
193
193
|
var uri, computeBudget, txBuilder, microLamportsPerCU;
|
|
194
194
|
return _ts_generator(this, function(_state) {
|
package/lib/create/AppCore.js
CHANGED
|
@@ -37,13 +37,13 @@ function _ts_generator(thisArg, body) {
|
|
|
37
37
|
trys: [],
|
|
38
38
|
ops: []
|
|
39
39
|
};
|
|
40
|
-
return
|
|
40
|
+
return g = {
|
|
41
41
|
next: verb(0),
|
|
42
42
|
"throw": verb(1),
|
|
43
43
|
"return": verb(2)
|
|
44
44
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
45
45
|
return this;
|
|
46
|
-
}), g
|
|
46
|
+
}), g;
|
|
47
47
|
function verb(n) {
|
|
48
48
|
return function(v) {
|
|
49
49
|
return step([
|
|
@@ -149,7 +149,7 @@ export var createAppJson = function(app, publisherAddress) {
|
|
|
149
149
|
};
|
|
150
150
|
return appMetadata;
|
|
151
151
|
};
|
|
152
|
-
export var createApp = function() {
|
|
152
|
+
export var createApp = /*#__PURE__*/ function() {
|
|
153
153
|
var _ref = _async_to_generator(function(param, param1) {
|
|
154
154
|
var publisherMintAddress, mintAddress, appDetails, priorityFeeLamports, metaplex, publisher, appJson, txBuilder;
|
|
155
155
|
return _ts_generator(this, function(_state) {
|
|
@@ -37,13 +37,13 @@ function _ts_generator(thisArg, body) {
|
|
|
37
37
|
trys: [],
|
|
38
38
|
ops: []
|
|
39
39
|
};
|
|
40
|
-
return
|
|
40
|
+
return g = {
|
|
41
41
|
next: verb(0),
|
|
42
42
|
"throw": verb(1),
|
|
43
43
|
"return": verb(2)
|
|
44
44
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
45
45
|
return this;
|
|
46
|
-
}), g
|
|
46
|
+
}), g;
|
|
47
47
|
function verb(n) {
|
|
48
48
|
return function(v) {
|
|
49
49
|
return step([
|
|
@@ -153,7 +153,7 @@ export var createPublisherJson = function(publisher) {
|
|
|
153
153
|
};
|
|
154
154
|
return publisherMetadata;
|
|
155
155
|
};
|
|
156
|
-
export var createPublisher = function() {
|
|
156
|
+
export var createPublisher = /*#__PURE__*/ function() {
|
|
157
157
|
var _ref = _async_to_generator(function(param, param1) {
|
|
158
158
|
var mintAddress, publisherDetails, priorityFeeLamports, metaplex, publisherJson, txBuilder;
|
|
159
159
|
return _ts_generator(this, function(_state) {
|
|
@@ -26,7 +26,7 @@ function AsyncFromSyncIterator(s) {
|
|
|
26
26
|
};
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
return
|
|
29
|
+
return AsyncFromSyncIterator = function(s) {
|
|
30
30
|
this.s = s, this.n = s.next;
|
|
31
31
|
}, AsyncFromSyncIterator.prototype = {
|
|
32
32
|
s: null,
|
|
@@ -45,7 +45,7 @@ function AsyncFromSyncIterator(s) {
|
|
|
45
45
|
var thr = this.s.return;
|
|
46
46
|
return void 0 === thr ? Promise.reject(value) : AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments));
|
|
47
47
|
}
|
|
48
|
-
}, new AsyncFromSyncIterator(s)
|
|
48
|
+
}, new AsyncFromSyncIterator(s);
|
|
49
49
|
}
|
|
50
50
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
51
51
|
try {
|
|
@@ -176,13 +176,13 @@ function _ts_generator(thisArg, body) {
|
|
|
176
176
|
trys: [],
|
|
177
177
|
ops: []
|
|
178
178
|
};
|
|
179
|
-
return
|
|
179
|
+
return g = {
|
|
180
180
|
next: verb(0),
|
|
181
181
|
"throw": verb(1),
|
|
182
182
|
"return": verb(2)
|
|
183
183
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
184
184
|
return this;
|
|
185
|
-
}), g
|
|
185
|
+
}), g;
|
|
186
186
|
function verb(n) {
|
|
187
187
|
return function(v) {
|
|
188
188
|
return step([
|
|
@@ -274,7 +274,7 @@ import { imageSize } from "image-size";
|
|
|
274
274
|
import getVideoDimensions from "get-video-dimensions";
|
|
275
275
|
var runImgSize = util.promisify(imageSize);
|
|
276
276
|
var debug = debugModule("RELEASE");
|
|
277
|
-
var getFileMetadata = function() {
|
|
277
|
+
var getFileMetadata = /*#__PURE__*/ function() {
|
|
278
278
|
var _ref = _async_to_generator(function(item) {
|
|
279
279
|
var _item_uri, file, mediaBuffer, size, hash, _item_uri1, _item_uri2, metadata;
|
|
280
280
|
return _ts_generator(this, function(_state) {
|
|
@@ -315,7 +315,7 @@ var getFileMetadata = function() {
|
|
|
315
315
|
return _ref.apply(this, arguments);
|
|
316
316
|
};
|
|
317
317
|
}();
|
|
318
|
-
var getMediaMetadata = function() {
|
|
318
|
+
var getMediaMetadata = /*#__PURE__*/ function() {
|
|
319
319
|
var _ref = _async_to_generator(function(item) {
|
|
320
320
|
var metadata, _item_uri, size, _size_width, _size_height, _item_uri1, size1, _size_width1, _size_height1;
|
|
321
321
|
return _ts_generator(this, function(_state) {
|
|
@@ -327,7 +327,7 @@ var getMediaMetadata = function() {
|
|
|
327
327
|
];
|
|
328
328
|
case 1:
|
|
329
329
|
metadata = _state.sent();
|
|
330
|
-
if (!(item.purpose == "screenshot" || item.purpose == "icon")) return [
|
|
330
|
+
if (!(item.purpose == "screenshot" || item.purpose == "icon" || item.purpose == "banner" || item.purpose == "featureGraphic")) return [
|
|
331
331
|
3,
|
|
332
332
|
3
|
|
333
333
|
];
|
|
@@ -369,7 +369,7 @@ var getMediaMetadata = function() {
|
|
|
369
369
|
return _ref.apply(this, arguments);
|
|
370
370
|
};
|
|
371
371
|
}();
|
|
372
|
-
export var createReleaseJson = function() {
|
|
372
|
+
export var createReleaseJson = /*#__PURE__*/ function() {
|
|
373
373
|
var _ref = _async_to_generator(function(param, publisherAddress) {
|
|
374
374
|
var releaseDetails, appDetails, publisherDetails, media, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, item, _, err, files, _iteratorAbruptCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, _value1, item1, _1, err1, releaseIcon, imgUri, tmpMedia, _2, releaseMetadata, _iteratorNormalCompletion, _didIteratorError2, _iteratorError2, _iterator2, _step2, _step_value, locale, strings, _strings_saga_features;
|
|
375
375
|
return _ts_generator(this, function(_state) {
|
|
@@ -641,11 +641,11 @@ export var createReleaseJson = function() {
|
|
|
641
641
|
;
|
|
642
642
|
// @ts-expect-error
|
|
643
643
|
releaseMetadata.extensions.i18n[locale] = {
|
|
644
|
-
"1": strings.long_description.replace(/^\s+|\s+$/g,
|
|
645
|
-
"2": strings.new_in_version.replace(/^\s+|\s+$/g,
|
|
646
|
-
"3": (_strings_saga_features = strings.saga_features) === null || _strings_saga_features === void 0 ? void 0 : _strings_saga_features.replace(/^\s+|\s+$/g,
|
|
647
|
-
"4": strings.name.replace(/^\s+|\s+$/g,
|
|
648
|
-
"5": strings.short_description.replace(/^\s+|\s+$/g,
|
|
644
|
+
"1": strings.long_description.replace(/^\s+|\s+$/g, ''),
|
|
645
|
+
"2": strings.new_in_version.replace(/^\s+|\s+$/g, ''),
|
|
646
|
+
"3": (_strings_saga_features = strings.saga_features) === null || _strings_saga_features === void 0 ? void 0 : _strings_saga_features.replace(/^\s+|\s+$/g, ''),
|
|
647
|
+
"4": strings.name.replace(/^\s+|\s+$/g, ''),
|
|
648
|
+
"5": strings.short_description.replace(/^\s+|\s+$/g, '')
|
|
649
649
|
};
|
|
650
650
|
}
|
|
651
651
|
} catch (err) {
|
|
@@ -673,7 +673,7 @@ export var createReleaseJson = function() {
|
|
|
673
673
|
return _ref.apply(this, arguments);
|
|
674
674
|
};
|
|
675
675
|
}();
|
|
676
|
-
export var createRelease = function() {
|
|
676
|
+
export var createRelease = /*#__PURE__*/ function() {
|
|
677
677
|
var _ref = _async_to_generator(function(param, param1) {
|
|
678
678
|
var appMintAddress, releaseMintAddress, releaseDetails, appDetails, publisherDetails, priorityFeeLamports, publisher, metaplex, releaseJson, suppressedJson, txBuilder;
|
|
679
679
|
return _ts_generator(this, function(_state) {
|
|
@@ -37,13 +37,13 @@ function _ts_generator(thisArg, body) {
|
|
|
37
37
|
trys: [],
|
|
38
38
|
ops: []
|
|
39
39
|
};
|
|
40
|
-
return
|
|
40
|
+
return g = {
|
|
41
41
|
next: verb(0),
|
|
42
42
|
"throw": verb(1),
|
|
43
43
|
"return": verb(2)
|
|
44
44
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
45
45
|
return this;
|
|
46
|
-
}), g
|
|
46
|
+
}), g;
|
|
47
47
|
function verb(n) {
|
|
48
48
|
return function(v) {
|
|
49
49
|
return step([
|
|
@@ -122,7 +122,7 @@ function _ts_generator(thisArg, body) {
|
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
export var createAttestationPayload = function() {
|
|
125
|
+
export var createAttestationPayload = /*#__PURE__*/ function() {
|
|
126
126
|
var _ref = _async_to_generator(function(connection, sign) {
|
|
127
127
|
var REQUEST_UNIQUE_ID_LEN, REQUEST_UNIQUE_ID_CHAR_SET, requestUniqueId, blockhash, attestation, signedAttestation;
|
|
128
128
|
return _ts_generator(this, function(_state) {
|
|
@@ -37,13 +37,13 @@ function _ts_generator(thisArg, body) {
|
|
|
37
37
|
trys: [],
|
|
38
38
|
ops: []
|
|
39
39
|
};
|
|
40
|
-
return
|
|
40
|
+
return g = {
|
|
41
41
|
next: verb(0),
|
|
42
42
|
"throw": verb(1),
|
|
43
43
|
"return": verb(2)
|
|
44
44
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
45
45
|
return this;
|
|
46
|
-
}), g
|
|
46
|
+
}), g;
|
|
47
47
|
function verb(n) {
|
|
48
48
|
return function(v) {
|
|
49
49
|
return step([
|
|
@@ -124,7 +124,7 @@ function _ts_generator(thisArg, body) {
|
|
|
124
124
|
}
|
|
125
125
|
import { createAttestationPayload } from "./PublishCoreAttestation.js";
|
|
126
126
|
import { CONTACT_OBJECT_ID, CONTACT_PROPERTY_COMPANY, CONTACT_PROPERTY_EMAIL, CONTACT_PROPERTY_WEBSITE, submitRequestToSolanaDappPublisherPortal, TICKET_OBJECT_ID, TICKET_PROPERTY_ATTESTATION_PAYLOAD, TICKET_PROPERTY_AUTHORIZED_REQUEST, TICKET_PROPERTY_CRITICAL_UPDATE, TICKET_PROPERTY_DAPP_COLLECTION_ACCOUNT_ADDRESS, TICKET_PROPERTY_DAPP_RELEASE_ACCOUNT_ADDRESS, TICKET_PROPERTY_REQUEST_UNIQUE_ID, URL_FORM_REMOVE } from "./dapp_publisher_portal.js";
|
|
127
|
-
var createRemoveRequest = function() {
|
|
127
|
+
var createRemoveRequest = /*#__PURE__*/ function() {
|
|
128
128
|
var _ref = _async_to_generator(function(connection, sign, appMintAddress, releaseMintAddress, publisherDetails, requestorIsAuthorized, criticalUpdate) {
|
|
129
129
|
var _ref, attestationPayload, requestUniqueId, request;
|
|
130
130
|
return _ts_generator(this, function(_state) {
|
|
@@ -198,7 +198,7 @@ var createRemoveRequest = function() {
|
|
|
198
198
|
return _ref.apply(this, arguments);
|
|
199
199
|
};
|
|
200
200
|
}();
|
|
201
|
-
export var publishRemove = function() {
|
|
201
|
+
export var publishRemove = /*#__PURE__*/ function() {
|
|
202
202
|
var _ref = _async_to_generator(function(publishSolanaNetworkInput, param, dryRun) {
|
|
203
203
|
var appMintAddress, releaseMintAddress, publisherDetails, requestorIsAuthorized, criticalUpdate, removeRequest;
|
|
204
204
|
return _ts_generator(this, function(_state) {
|
|
@@ -37,13 +37,13 @@ function _ts_generator(thisArg, body) {
|
|
|
37
37
|
trys: [],
|
|
38
38
|
ops: []
|
|
39
39
|
};
|
|
40
|
-
return
|
|
40
|
+
return g = {
|
|
41
41
|
next: verb(0),
|
|
42
42
|
"throw": verb(1),
|
|
43
43
|
"return": verb(2)
|
|
44
44
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
45
45
|
return this;
|
|
46
|
-
}), g
|
|
46
|
+
}), g;
|
|
47
47
|
function verb(n) {
|
|
48
48
|
return function(v) {
|
|
49
49
|
return step([
|
|
@@ -123,9 +123,9 @@ function _ts_generator(thisArg, body) {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
import { createAttestationPayload } from "./PublishCoreAttestation.js";
|
|
126
|
-
import { CONTACT_OBJECT_ID, CONTACT_PROPERTY_COMPANY, CONTACT_PROPERTY_EMAIL, CONTACT_PROPERTY_WEBSITE, submitRequestToSolanaDappPublisherPortal, TICKET_OBJECT_ID, TICKET_PROPERTY_ATTESTATION_PAYLOAD, TICKET_PROPERTY_AUTHORIZED_REQUEST, TICKET_PROPERTY_DAPP_COLLECTION_ACCOUNT_ADDRESS, TICKET_PROPERTY_DAPP_RELEASE_ACCOUNT_ADDRESS, TICKET_PROPERTY_GOOGLE_PLAY_STORE_PACKAGE_NAME, TICKET_PROPERTY_POLICY_COMPLIANT, TICKET_PROPERTY_REQUEST_UNIQUE_ID, TICKET_PROPERTY_TESTING_INSTRUCTIONS, URL_FORM_SUBMIT } from "./dapp_publisher_portal.js";
|
|
127
|
-
var createSubmitRequest = function() {
|
|
128
|
-
var _ref = _async_to_generator(function(connection, sign, appMintAddress, releaseMintAddress, publisherDetails, solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies, requestorIsAuthorized) {
|
|
126
|
+
import { CONTACT_OBJECT_ID, CONTACT_PROPERTY_COMPANY, CONTACT_PROPERTY_EMAIL, CONTACT_PROPERTY_WEBSITE, submitRequestToSolanaDappPublisherPortal, TICKET_OBJECT_ID, TICKET_PROPERTY_ALPHA_TEST, TICKET_PROPERTY_ALPHA_TESTERS, TICKET_PROPERTY_ATTESTATION_PAYLOAD, TICKET_PROPERTY_AUTHORIZED_REQUEST, TICKET_PROPERTY_DAPP_COLLECTION_ACCOUNT_ADDRESS, TICKET_PROPERTY_DAPP_RELEASE_ACCOUNT_ADDRESS, TICKET_PROPERTY_GOOGLE_PLAY_STORE_PACKAGE_NAME, TICKET_PROPERTY_POLICY_COMPLIANT, TICKET_PROPERTY_REQUEST_UNIQUE_ID, TICKET_PROPERTY_TESTING_INSTRUCTIONS, URL_FORM_SUBMIT } from "./dapp_publisher_portal.js";
|
|
127
|
+
var createSubmitRequest = /*#__PURE__*/ function() {
|
|
128
|
+
var _ref = _async_to_generator(function(connection, sign, appMintAddress, releaseMintAddress, publisherDetails, solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, alphaTest) {
|
|
129
129
|
var _ref, attestationPayload, requestUniqueId, request;
|
|
130
130
|
return _ts_generator(this, function(_state) {
|
|
131
131
|
switch(_state.label){
|
|
@@ -192,6 +192,13 @@ var createSubmitRequest = function() {
|
|
|
192
192
|
value: solanaMobileDappPublisherPortalDetails.google_store_package
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
|
+
if (alphaTest) {
|
|
196
|
+
request.fields.push({
|
|
197
|
+
objectTypeId: TICKET_OBJECT_ID,
|
|
198
|
+
name: TICKET_PROPERTY_ALPHA_TEST,
|
|
199
|
+
value: true
|
|
200
|
+
});
|
|
201
|
+
}
|
|
195
202
|
if (solanaMobileDappPublisherPortalDetails.testing_instructions !== undefined) {
|
|
196
203
|
request.fields.push({
|
|
197
204
|
objectTypeId: TICKET_OBJECT_ID,
|
|
@@ -199,6 +206,15 @@ var createSubmitRequest = function() {
|
|
|
199
206
|
value: solanaMobileDappPublisherPortalDetails.testing_instructions
|
|
200
207
|
});
|
|
201
208
|
}
|
|
209
|
+
if (solanaMobileDappPublisherPortalDetails.alpha_testers !== undefined && solanaMobileDappPublisherPortalDetails.alpha_testers.length > 0) {
|
|
210
|
+
request.fields.push({
|
|
211
|
+
objectTypeId: TICKET_OBJECT_ID,
|
|
212
|
+
name: TICKET_PROPERTY_ALPHA_TESTERS,
|
|
213
|
+
value: solanaMobileDappPublisherPortalDetails.alpha_testers.map(function(tester) {
|
|
214
|
+
return tester.address;
|
|
215
|
+
}).toString()
|
|
216
|
+
});
|
|
217
|
+
}
|
|
202
218
|
return [
|
|
203
219
|
2,
|
|
204
220
|
request
|
|
@@ -206,20 +222,20 @@ var createSubmitRequest = function() {
|
|
|
206
222
|
}
|
|
207
223
|
});
|
|
208
224
|
});
|
|
209
|
-
return function createSubmitRequest(connection, sign, appMintAddress, releaseMintAddress, publisherDetails, solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies, requestorIsAuthorized) {
|
|
225
|
+
return function createSubmitRequest(connection, sign, appMintAddress, releaseMintAddress, publisherDetails, solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, alphaTest) {
|
|
210
226
|
return _ref.apply(this, arguments);
|
|
211
227
|
};
|
|
212
228
|
}();
|
|
213
|
-
export var publishSubmit = function() {
|
|
229
|
+
export var publishSubmit = /*#__PURE__*/ function() {
|
|
214
230
|
var _ref = _async_to_generator(function(publishSolanaNetworkInput, param, dryRun) {
|
|
215
|
-
var appMintAddress, releaseMintAddress, publisherDetails, solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, submitRequest;
|
|
231
|
+
var appMintAddress, releaseMintAddress, publisherDetails, solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, alphaTest, submitRequest;
|
|
216
232
|
return _ts_generator(this, function(_state) {
|
|
217
233
|
switch(_state.label){
|
|
218
234
|
case 0:
|
|
219
|
-
appMintAddress = param.appMintAddress, releaseMintAddress = param.releaseMintAddress, publisherDetails = param.publisherDetails, solanaMobileDappPublisherPortalDetails = param.solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies = param.compliesWithSolanaDappStorePolicies, requestorIsAuthorized = param.requestorIsAuthorized;
|
|
235
|
+
appMintAddress = param.appMintAddress, releaseMintAddress = param.releaseMintAddress, publisherDetails = param.publisherDetails, solanaMobileDappPublisherPortalDetails = param.solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies = param.compliesWithSolanaDappStorePolicies, requestorIsAuthorized = param.requestorIsAuthorized, alphaTest = param.alphaTest;
|
|
220
236
|
return [
|
|
221
237
|
4,
|
|
222
|
-
createSubmitRequest(publishSolanaNetworkInput.connection, publishSolanaNetworkInput.sign, appMintAddress, releaseMintAddress, publisherDetails, solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies, requestorIsAuthorized)
|
|
238
|
+
createSubmitRequest(publishSolanaNetworkInput.connection, publishSolanaNetworkInput.sign, appMintAddress, releaseMintAddress, publisherDetails, solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, alphaTest)
|
|
223
239
|
];
|
|
224
240
|
case 1:
|
|
225
241
|
submitRequest = _state.sent();
|
|
@@ -37,13 +37,13 @@ function _ts_generator(thisArg, body) {
|
|
|
37
37
|
trys: [],
|
|
38
38
|
ops: []
|
|
39
39
|
};
|
|
40
|
-
return
|
|
40
|
+
return g = {
|
|
41
41
|
next: verb(0),
|
|
42
42
|
"throw": verb(1),
|
|
43
43
|
"return": verb(2)
|
|
44
44
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
45
45
|
return this;
|
|
46
|
-
}), g
|
|
46
|
+
}), g;
|
|
47
47
|
function verb(n) {
|
|
48
48
|
return function(v) {
|
|
49
49
|
return step([
|
|
@@ -124,7 +124,7 @@ function _ts_generator(thisArg, body) {
|
|
|
124
124
|
}
|
|
125
125
|
import { createAttestationPayload } from "./PublishCoreAttestation.js";
|
|
126
126
|
import { CONTACT_OBJECT_ID, CONTACT_PROPERTY_COMPANY, CONTACT_PROPERTY_EMAIL, CONTACT_PROPERTY_WEBSITE, submitRequestToSolanaDappPublisherPortal, TICKET_OBJECT_ID, TICKET_PROPERTY_ATTESTATION_PAYLOAD, TICKET_PROPERTY_AUTHORIZED_REQUEST, TICKET_PROPERTY_CONTENT, TICKET_PROPERTY_DAPP_COLLECTION_ACCOUNT_ADDRESS, TICKET_PROPERTY_DAPP_RELEASE_ACCOUNT_ADDRESS, TICKET_PROPERTY_REQUEST_UNIQUE_ID, URL_FORM_SUPPORT } from "./dapp_publisher_portal.js";
|
|
127
|
-
var createSupportRequest = function() {
|
|
127
|
+
var createSupportRequest = /*#__PURE__*/ function() {
|
|
128
128
|
var _ref = _async_to_generator(function(connection, sign, appMintAddress, releaseMintAddress, publisherDetails, requestorIsAuthorized, requestDetails) {
|
|
129
129
|
var _ref, attestationPayload, requestUniqueId;
|
|
130
130
|
return _ts_generator(this, function(_state) {
|
|
@@ -195,7 +195,7 @@ var createSupportRequest = function() {
|
|
|
195
195
|
return _ref.apply(this, arguments);
|
|
196
196
|
};
|
|
197
197
|
}();
|
|
198
|
-
export var publishSupport = function() {
|
|
198
|
+
export var publishSupport = /*#__PURE__*/ function() {
|
|
199
199
|
var _ref = _async_to_generator(function(publishSolanaNetworkInput, param, dryRun) {
|
|
200
200
|
var appMintAddress, releaseMintAddress, publisherDetails, requestorIsAuthorized, requestDetails, supportRequest;
|
|
201
201
|
return _ts_generator(this, function(_state) {
|
|
@@ -37,13 +37,13 @@ function _ts_generator(thisArg, body) {
|
|
|
37
37
|
trys: [],
|
|
38
38
|
ops: []
|
|
39
39
|
};
|
|
40
|
-
return
|
|
40
|
+
return g = {
|
|
41
41
|
next: verb(0),
|
|
42
42
|
"throw": verb(1),
|
|
43
43
|
"return": verb(2)
|
|
44
44
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
45
45
|
return this;
|
|
46
|
-
}), g
|
|
46
|
+
}), g;
|
|
47
47
|
function verb(n) {
|
|
48
48
|
return function(v) {
|
|
49
49
|
return step([
|
|
@@ -123,9 +123,9 @@ function _ts_generator(thisArg, body) {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
import { createAttestationPayload } from "./PublishCoreAttestation.js";
|
|
126
|
-
import { CONTACT_OBJECT_ID, CONTACT_PROPERTY_COMPANY, CONTACT_PROPERTY_EMAIL, CONTACT_PROPERTY_WEBSITE, submitRequestToSolanaDappPublisherPortal, TICKET_OBJECT_ID, TICKET_PROPERTY_ATTESTATION_PAYLOAD, TICKET_PROPERTY_AUTHORIZED_REQUEST, TICKET_PROPERTY_CRITICAL_UPDATE, TICKET_PROPERTY_DAPP_COLLECTION_ACCOUNT_ADDRESS, TICKET_PROPERTY_DAPP_RELEASE_ACCOUNT_ADDRESS, TICKET_PROPERTY_POLICY_COMPLIANT, TICKET_PROPERTY_REQUEST_UNIQUE_ID, TICKET_PROPERTY_TESTING_INSTRUCTIONS, URL_FORM_UPDATE } from "./dapp_publisher_portal.js";
|
|
127
|
-
var createUpdateRequest = function() {
|
|
128
|
-
var _ref = _async_to_generator(function(connection, sign, appMintAddress, releaseMintAddress, publisherDetails, solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, criticalUpdate) {
|
|
126
|
+
import { CONTACT_OBJECT_ID, CONTACT_PROPERTY_COMPANY, CONTACT_PROPERTY_EMAIL, CONTACT_PROPERTY_WEBSITE, submitRequestToSolanaDappPublisherPortal, TICKET_OBJECT_ID, TICKET_PROPERTY_ALPHA_TEST, TICKET_PROPERTY_ALPHA_TESTERS, TICKET_PROPERTY_ATTESTATION_PAYLOAD, TICKET_PROPERTY_AUTHORIZED_REQUEST, TICKET_PROPERTY_CRITICAL_UPDATE, TICKET_PROPERTY_DAPP_COLLECTION_ACCOUNT_ADDRESS, TICKET_PROPERTY_DAPP_RELEASE_ACCOUNT_ADDRESS, TICKET_PROPERTY_POLICY_COMPLIANT, TICKET_PROPERTY_REQUEST_UNIQUE_ID, TICKET_PROPERTY_TESTING_INSTRUCTIONS, URL_FORM_UPDATE } from "./dapp_publisher_portal.js";
|
|
127
|
+
var createUpdateRequest = /*#__PURE__*/ function() {
|
|
128
|
+
var _ref = _async_to_generator(function(connection, sign, appMintAddress, releaseMintAddress, publisherDetails, solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, criticalUpdate, alphaTest) {
|
|
129
129
|
var _ref, attestationPayload, requestUniqueId, request;
|
|
130
130
|
return _ts_generator(this, function(_state) {
|
|
131
131
|
switch(_state.label){
|
|
@@ -192,6 +192,13 @@ var createUpdateRequest = function() {
|
|
|
192
192
|
value: criticalUpdate
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
|
+
if (alphaTest) {
|
|
196
|
+
request.fields.push({
|
|
197
|
+
objectTypeId: TICKET_OBJECT_ID,
|
|
198
|
+
name: TICKET_PROPERTY_ALPHA_TEST,
|
|
199
|
+
value: true
|
|
200
|
+
});
|
|
201
|
+
}
|
|
195
202
|
if (solanaMobileDappPublisherPortalDetails.testing_instructions !== undefined) {
|
|
196
203
|
request.fields.push({
|
|
197
204
|
objectTypeId: TICKET_OBJECT_ID,
|
|
@@ -199,6 +206,15 @@ var createUpdateRequest = function() {
|
|
|
199
206
|
value: solanaMobileDappPublisherPortalDetails.testing_instructions
|
|
200
207
|
});
|
|
201
208
|
}
|
|
209
|
+
if (solanaMobileDappPublisherPortalDetails.alpha_testers !== undefined && solanaMobileDappPublisherPortalDetails.alpha_testers.length > 0) {
|
|
210
|
+
request.fields.push({
|
|
211
|
+
objectTypeId: TICKET_OBJECT_ID,
|
|
212
|
+
name: TICKET_PROPERTY_ALPHA_TESTERS,
|
|
213
|
+
value: solanaMobileDappPublisherPortalDetails.alpha_testers.map(function(tester) {
|
|
214
|
+
return tester.address;
|
|
215
|
+
}).toString()
|
|
216
|
+
});
|
|
217
|
+
}
|
|
202
218
|
return [
|
|
203
219
|
2,
|
|
204
220
|
request
|
|
@@ -206,20 +222,20 @@ var createUpdateRequest = function() {
|
|
|
206
222
|
}
|
|
207
223
|
});
|
|
208
224
|
});
|
|
209
|
-
return function createUpdateRequest(connection, sign, appMintAddress, releaseMintAddress, publisherDetails, solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, criticalUpdate) {
|
|
225
|
+
return function createUpdateRequest(connection, sign, appMintAddress, releaseMintAddress, publisherDetails, solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, criticalUpdate, alphaTest) {
|
|
210
226
|
return _ref.apply(this, arguments);
|
|
211
227
|
};
|
|
212
228
|
}();
|
|
213
|
-
export var publishUpdate = function() {
|
|
229
|
+
export var publishUpdate = /*#__PURE__*/ function() {
|
|
214
230
|
var _ref = _async_to_generator(function(publishSolanaNetworkInput, param, dryRun) {
|
|
215
|
-
var appMintAddress, releaseMintAddress, publisherDetails, solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, criticalUpdate, updateRequest;
|
|
231
|
+
var appMintAddress, releaseMintAddress, publisherDetails, solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, criticalUpdate, alphaTest, updateRequest;
|
|
216
232
|
return _ts_generator(this, function(_state) {
|
|
217
233
|
switch(_state.label){
|
|
218
234
|
case 0:
|
|
219
|
-
appMintAddress = param.appMintAddress, releaseMintAddress = param.releaseMintAddress, publisherDetails = param.publisherDetails, solanaMobileDappPublisherPortalDetails = param.solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies = param.compliesWithSolanaDappStorePolicies, requestorIsAuthorized = param.requestorIsAuthorized, criticalUpdate = param.criticalUpdate;
|
|
235
|
+
appMintAddress = param.appMintAddress, releaseMintAddress = param.releaseMintAddress, publisherDetails = param.publisherDetails, solanaMobileDappPublisherPortalDetails = param.solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies = param.compliesWithSolanaDappStorePolicies, requestorIsAuthorized = param.requestorIsAuthorized, criticalUpdate = param.criticalUpdate, alphaTest = param.alphaTest;
|
|
220
236
|
return [
|
|
221
237
|
4,
|
|
222
|
-
createUpdateRequest(publishSolanaNetworkInput.connection, publishSolanaNetworkInput.sign, appMintAddress, releaseMintAddress, publisherDetails, solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, criticalUpdate)
|
|
238
|
+
createUpdateRequest(publishSolanaNetworkInput.connection, publishSolanaNetworkInput.sign, appMintAddress, releaseMintAddress, publisherDetails, solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, criticalUpdate, alphaTest)
|
|
223
239
|
];
|
|
224
240
|
case 1:
|
|
225
241
|
updateRequest = _state.sent();
|
|
@@ -37,13 +37,13 @@ function _ts_generator(thisArg, body) {
|
|
|
37
37
|
trys: [],
|
|
38
38
|
ops: []
|
|
39
39
|
};
|
|
40
|
-
return
|
|
40
|
+
return g = {
|
|
41
41
|
next: verb(0),
|
|
42
42
|
"throw": verb(1),
|
|
43
43
|
"return": verb(2)
|
|
44
44
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
45
45
|
return this;
|
|
46
|
-
}), g
|
|
46
|
+
}), g;
|
|
47
47
|
function verb(n) {
|
|
48
48
|
return function(v) {
|
|
49
49
|
return step([
|
|
@@ -139,6 +139,8 @@ export var TICKET_PROPERTY_GOOGLE_PLAY_STORE_PACKAGE_NAME = "google_play_store_p
|
|
|
139
139
|
export var TICKET_PROPERTY_POLICY_COMPLIANT = "complies_with_solana_dapp_store_policies"; // boolean
|
|
140
140
|
export var TICKET_PROPERTY_REQUEST_UNIQUE_ID = "request_unique_id"; // string (32 base-10 digits)
|
|
141
141
|
export var TICKET_PROPERTY_TESTING_INSTRUCTIONS = "testing_instructions"; // string
|
|
142
|
+
export var TICKET_PROPERTY_ALPHA_TEST = "alpha_test"; // boolean
|
|
143
|
+
export var TICKET_PROPERTY_ALPHA_TESTERS = "alpha_testers"; // string
|
|
142
144
|
export var FORM_SUBMIT = "1464247f-6804-46e1-8114-952f372daa81";
|
|
143
145
|
export var FORM_UPDATE = "87b4cbe7-957f-495c-a132-8b789678883d";
|
|
144
146
|
export var FORM_REMOVE = "913a4e44-ec90-4db6-8aa9-c49f29b569b9";
|
|
@@ -147,7 +149,7 @@ export var URL_FORM_SUBMIT = "https://api.hsforms.com/submissions/v3/integration
|
|
|
147
149
|
export var URL_FORM_UPDATE = "https://api.hsforms.com/submissions/v3/integration/submit/".concat(PORTAL_ID, "/").concat(FORM_UPDATE);
|
|
148
150
|
export var URL_FORM_REMOVE = "https://api.hsforms.com/submissions/v3/integration/submit/".concat(PORTAL_ID, "/").concat(FORM_REMOVE);
|
|
149
151
|
export var URL_FORM_SUPPORT = "https://api.hsforms.com/submissions/v3/integration/submit/".concat(PORTAL_ID, "/").concat(FORM_SUPPORT);
|
|
150
|
-
export var submitRequestToSolanaDappPublisherPortal = function() {
|
|
152
|
+
export var submitRequestToSolanaDappPublisherPortal = /*#__PURE__*/ function() {
|
|
151
153
|
var _ref = _async_to_generator(function(request, url, dryRun) {
|
|
152
154
|
var config;
|
|
153
155
|
return _ts_generator(this, function(_state) {
|
|
@@ -168,14 +170,24 @@ export var submitRequestToSolanaDappPublisherPortal = function() {
|
|
|
168
170
|
return [
|
|
169
171
|
4,
|
|
170
172
|
axios(config).then(function(response) {
|
|
171
|
-
|
|
173
|
+
var isAlphaObject = request.fields.find(function(obj) {
|
|
174
|
+
return obj.name === TICKET_PROPERTY_ALPHA_TEST;
|
|
175
|
+
});
|
|
176
|
+
if (isAlphaObject !== undefined && isAlphaObject.value) {
|
|
177
|
+
var requestUniqueId = request.fields.find(function(obj) {
|
|
178
|
+
return obj.name === TICKET_PROPERTY_REQUEST_UNIQUE_ID;
|
|
179
|
+
}).value;
|
|
180
|
+
console.log("Your alpha submission has been received.\n" + "It will not be reviewed or published to users.\n" + "Use nonce '".concat(requestUniqueId, "' to launch alpha app.\n") + "This can only be used on devices for which the genesis token was listed in your 'config.yaml'");
|
|
181
|
+
} else {
|
|
182
|
+
console.info("dApp publisher portal response:", response.data);
|
|
183
|
+
}
|
|
172
184
|
}).catch(function(error) {
|
|
173
185
|
if (error.response) {
|
|
174
|
-
|
|
186
|
+
throw new Error("Failed to submit request\nError status code: ".concat(error.response.status, "\nError message: ").concat(error.response.data));
|
|
175
187
|
} else if (error.request) {
|
|
176
|
-
|
|
188
|
+
throw new Error("Failed to submit request: ".concat(error.request));
|
|
177
189
|
} else {
|
|
178
|
-
|
|
190
|
+
throw new Error("Failed to submit request: ".concat(error));
|
|
179
191
|
}
|
|
180
192
|
})
|
|
181
193
|
];
|
|
@@ -27,7 +27,7 @@ function _object_spread(target) {
|
|
|
27
27
|
return target;
|
|
28
28
|
}
|
|
29
29
|
import Ajv from "ajv";
|
|
30
|
-
import { readFile } from
|
|
30
|
+
import { readFile } from 'fs/promises';
|
|
31
31
|
var publisherSchema = JSON.parse((await readFile(new URL("../schemas/publisherJsonMetadata.json", import.meta.url))).toString());
|
|
32
32
|
var appSchema = JSON.parse((await readFile(new URL("../schemas/appJsonMetadata.json", import.meta.url))).toString());
|
|
33
33
|
var releaseSchema = JSON.parse((await readFile(new URL("../schemas/releaseJsonMetadata.json", import.meta.url))).toString());
|
package/package.json
CHANGED
package/src/CoreUtils.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type {
|
|
|
8
8
|
import { ComputeBudgetProgram } from "@solana/web3.js";
|
|
9
9
|
|
|
10
10
|
export class Constants {
|
|
11
|
-
static PUBLISHING_SCHEMA_VER = "0.
|
|
11
|
+
static PUBLISHING_SCHEMA_VER = "0.3.0";
|
|
12
12
|
}
|
|
13
13
|
export const truncateAddress = (address: string) => {
|
|
14
14
|
return `${address.slice(0, 4)}...${address.slice(
|
|
@@ -49,7 +49,7 @@ const getFileMetadata = async (item: Media | File) => {
|
|
|
49
49
|
const getMediaMetadata = async (item: Media) => {
|
|
50
50
|
const metadata = await getFileMetadata(item);
|
|
51
51
|
|
|
52
|
-
if (item.purpose == "screenshot" || item.purpose == "icon") {
|
|
52
|
+
if (item.purpose == "screenshot" || item.purpose == "icon" || item.purpose == "banner" || item.purpose == "featureGraphic") {
|
|
53
53
|
const size = await runImgSize(item.uri ?? "");
|
|
54
54
|
|
|
55
55
|
return {
|
|
@@ -8,6 +8,8 @@ import {
|
|
|
8
8
|
CONTACT_PROPERTY_WEBSITE,
|
|
9
9
|
submitRequestToSolanaDappPublisherPortal,
|
|
10
10
|
TICKET_OBJECT_ID,
|
|
11
|
+
TICKET_PROPERTY_ALPHA_TEST,
|
|
12
|
+
TICKET_PROPERTY_ALPHA_TESTERS,
|
|
11
13
|
TICKET_PROPERTY_ATTESTATION_PAYLOAD,
|
|
12
14
|
TICKET_PROPERTY_AUTHORIZED_REQUEST,
|
|
13
15
|
TICKET_PROPERTY_DAPP_COLLECTION_ACCOUNT_ADDRESS,
|
|
@@ -28,7 +30,8 @@ const createSubmitRequest = async (
|
|
|
28
30
|
publisherDetails: Publisher,
|
|
29
31
|
solanaMobileDappPublisherPortalDetails: SolanaMobileDappPublisherPortal,
|
|
30
32
|
compliesWithSolanaDappStorePolicies: boolean,
|
|
31
|
-
requestorIsAuthorized: boolean
|
|
33
|
+
requestorIsAuthorized: boolean,
|
|
34
|
+
alphaTest?: boolean
|
|
32
35
|
) => {
|
|
33
36
|
const { attestationPayload, requestUniqueId } = await createAttestationPayload(connection, sign);
|
|
34
37
|
|
|
@@ -90,6 +93,14 @@ const createSubmitRequest = async (
|
|
|
90
93
|
});
|
|
91
94
|
}
|
|
92
95
|
|
|
96
|
+
if (alphaTest) {
|
|
97
|
+
request.fields.push({
|
|
98
|
+
objectTypeId: TICKET_OBJECT_ID,
|
|
99
|
+
name: TICKET_PROPERTY_ALPHA_TEST,
|
|
100
|
+
value: true,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
93
104
|
if (solanaMobileDappPublisherPortalDetails.testing_instructions !== undefined) {
|
|
94
105
|
request.fields.push(
|
|
95
106
|
{
|
|
@@ -100,6 +111,14 @@ const createSubmitRequest = async (
|
|
|
100
111
|
);
|
|
101
112
|
}
|
|
102
113
|
|
|
114
|
+
if (solanaMobileDappPublisherPortalDetails.alpha_testers !== undefined && solanaMobileDappPublisherPortalDetails.alpha_testers.length > 0) {
|
|
115
|
+
request.fields.push({
|
|
116
|
+
objectTypeId: TICKET_OBJECT_ID,
|
|
117
|
+
name: TICKET_PROPERTY_ALPHA_TESTERS,
|
|
118
|
+
value: solanaMobileDappPublisherPortalDetails.alpha_testers.map(tester => tester.address).toString(),
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
103
122
|
return request;
|
|
104
123
|
};
|
|
105
124
|
|
|
@@ -110,6 +129,7 @@ export type PublishSubmitInput = {
|
|
|
110
129
|
solanaMobileDappPublisherPortalDetails: SolanaMobileDappPublisherPortal;
|
|
111
130
|
compliesWithSolanaDappStorePolicies: boolean;
|
|
112
131
|
requestorIsAuthorized: boolean;
|
|
132
|
+
alphaTest?: boolean;
|
|
113
133
|
};
|
|
114
134
|
|
|
115
135
|
export const publishSubmit = async (
|
|
@@ -121,6 +141,7 @@ export const publishSubmit = async (
|
|
|
121
141
|
solanaMobileDappPublisherPortalDetails,
|
|
122
142
|
compliesWithSolanaDappStorePolicies,
|
|
123
143
|
requestorIsAuthorized,
|
|
144
|
+
alphaTest,
|
|
124
145
|
} : PublishSubmitInput,
|
|
125
146
|
dryRun: boolean,
|
|
126
147
|
) => {
|
|
@@ -132,7 +153,9 @@ export const publishSubmit = async (
|
|
|
132
153
|
publisherDetails,
|
|
133
154
|
solanaMobileDappPublisherPortalDetails,
|
|
134
155
|
compliesWithSolanaDappStorePolicies,
|
|
135
|
-
requestorIsAuthorized
|
|
156
|
+
requestorIsAuthorized,
|
|
157
|
+
alphaTest
|
|
158
|
+
);
|
|
136
159
|
|
|
137
160
|
return submitRequestToSolanaDappPublisherPortal(submitRequest, URL_FORM_SUBMIT, dryRun);
|
|
138
161
|
};
|
|
@@ -8,6 +8,8 @@ import {
|
|
|
8
8
|
CONTACT_PROPERTY_WEBSITE,
|
|
9
9
|
submitRequestToSolanaDappPublisherPortal,
|
|
10
10
|
TICKET_OBJECT_ID,
|
|
11
|
+
TICKET_PROPERTY_ALPHA_TEST,
|
|
12
|
+
TICKET_PROPERTY_ALPHA_TESTERS,
|
|
11
13
|
TICKET_PROPERTY_ATTESTATION_PAYLOAD,
|
|
12
14
|
TICKET_PROPERTY_AUTHORIZED_REQUEST,
|
|
13
15
|
TICKET_PROPERTY_CRITICAL_UPDATE,
|
|
@@ -29,7 +31,8 @@ const createUpdateRequest = async (
|
|
|
29
31
|
solanaMobileDappPublisherPortalDetails: SolanaMobileDappPublisherPortal,
|
|
30
32
|
compliesWithSolanaDappStorePolicies: boolean,
|
|
31
33
|
requestorIsAuthorized: boolean,
|
|
32
|
-
criticalUpdate: boolean
|
|
34
|
+
criticalUpdate: boolean,
|
|
35
|
+
alphaTest?: boolean
|
|
33
36
|
) => {
|
|
34
37
|
const { attestationPayload, requestUniqueId } = await createAttestationPayload(connection, sign);
|
|
35
38
|
|
|
@@ -93,6 +96,14 @@ const createUpdateRequest = async (
|
|
|
93
96
|
);
|
|
94
97
|
}
|
|
95
98
|
|
|
99
|
+
if (alphaTest) {
|
|
100
|
+
request.fields.push({
|
|
101
|
+
objectTypeId: TICKET_OBJECT_ID,
|
|
102
|
+
name: TICKET_PROPERTY_ALPHA_TEST,
|
|
103
|
+
value: true,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
96
107
|
if (solanaMobileDappPublisherPortalDetails.testing_instructions !== undefined) {
|
|
97
108
|
request.fields.push(
|
|
98
109
|
{
|
|
@@ -103,6 +114,14 @@ const createUpdateRequest = async (
|
|
|
103
114
|
);
|
|
104
115
|
}
|
|
105
116
|
|
|
117
|
+
if (solanaMobileDappPublisherPortalDetails.alpha_testers !== undefined && solanaMobileDappPublisherPortalDetails.alpha_testers.length > 0) {
|
|
118
|
+
request.fields.push({
|
|
119
|
+
objectTypeId: TICKET_OBJECT_ID,
|
|
120
|
+
name: TICKET_PROPERTY_ALPHA_TESTERS,
|
|
121
|
+
value: solanaMobileDappPublisherPortalDetails.alpha_testers.map(tester => tester.address).toString(),
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
106
125
|
return request;
|
|
107
126
|
};
|
|
108
127
|
|
|
@@ -114,6 +133,7 @@ export type PublishUpdateInput = {
|
|
|
114
133
|
compliesWithSolanaDappStorePolicies: boolean;
|
|
115
134
|
requestorIsAuthorized: boolean;
|
|
116
135
|
criticalUpdate: boolean;
|
|
136
|
+
alphaTest?: boolean;
|
|
117
137
|
};
|
|
118
138
|
|
|
119
139
|
export const publishUpdate = async (
|
|
@@ -126,6 +146,7 @@ export const publishUpdate = async (
|
|
|
126
146
|
compliesWithSolanaDappStorePolicies,
|
|
127
147
|
requestorIsAuthorized,
|
|
128
148
|
criticalUpdate,
|
|
149
|
+
alphaTest,
|
|
129
150
|
} : PublishUpdateInput,
|
|
130
151
|
dryRun: boolean,
|
|
131
152
|
) => {
|
|
@@ -138,7 +159,9 @@ export const publishUpdate = async (
|
|
|
138
159
|
solanaMobileDappPublisherPortalDetails,
|
|
139
160
|
compliesWithSolanaDappStorePolicies,
|
|
140
161
|
requestorIsAuthorized,
|
|
141
|
-
criticalUpdate
|
|
162
|
+
criticalUpdate,
|
|
163
|
+
alphaTest
|
|
164
|
+
);
|
|
142
165
|
|
|
143
166
|
return submitRequestToSolanaDappPublisherPortal(updateRequest, URL_FORM_UPDATE, dryRun);
|
|
144
167
|
};
|
|
@@ -18,6 +18,8 @@ export const TICKET_PROPERTY_GOOGLE_PLAY_STORE_PACKAGE_NAME = "google_play_store
|
|
|
18
18
|
export const TICKET_PROPERTY_POLICY_COMPLIANT = "complies_with_solana_dapp_store_policies"; // boolean
|
|
19
19
|
export const TICKET_PROPERTY_REQUEST_UNIQUE_ID = "request_unique_id"; // string (32 base-10 digits)
|
|
20
20
|
export const TICKET_PROPERTY_TESTING_INSTRUCTIONS = "testing_instructions"; // string
|
|
21
|
+
export const TICKET_PROPERTY_ALPHA_TEST = "alpha_test"; // boolean
|
|
22
|
+
export const TICKET_PROPERTY_ALPHA_TESTERS = "alpha_testers"; // string
|
|
21
23
|
|
|
22
24
|
export const FORM_SUBMIT = "1464247f-6804-46e1-8114-952f372daa81";
|
|
23
25
|
export const FORM_UPDATE = "87b4cbe7-957f-495c-a132-8b789678883d";
|
|
@@ -46,15 +48,31 @@ export const submitRequestToSolanaDappPublisherPortal = async (
|
|
|
46
48
|
if (!dryRun) {
|
|
47
49
|
await axios(config)
|
|
48
50
|
.then((response) => {
|
|
49
|
-
|
|
51
|
+
const isAlphaObject = request.fields.find((obj: { objectTypeId: string, name: string; value: string}) => {
|
|
52
|
+
return obj.name === TICKET_PROPERTY_ALPHA_TEST
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
if (isAlphaObject !== undefined && isAlphaObject.value) {
|
|
56
|
+
const requestUniqueId = request.fields.find((obj: { objectTypeId: string, name: string; value: string}) => {
|
|
57
|
+
return obj.name === TICKET_PROPERTY_REQUEST_UNIQUE_ID
|
|
58
|
+
}).value
|
|
59
|
+
console.log(
|
|
60
|
+
`Your alpha submission has been received.\n` +
|
|
61
|
+
`It will not be reviewed or published to users.\n` +
|
|
62
|
+
`Use nonce '${requestUniqueId}' to launch alpha app.\n` +
|
|
63
|
+
`This can only be used on devices for which the genesis token was listed in your 'config.yaml'`
|
|
64
|
+
)
|
|
65
|
+
} else {
|
|
66
|
+
console.info(`dApp publisher portal response:`, response.data);
|
|
67
|
+
}
|
|
50
68
|
})
|
|
51
69
|
.catch((error) => {
|
|
52
70
|
if (error.response) {
|
|
53
|
-
|
|
71
|
+
throw new Error(`Failed to submit request\nError status code: ${error.response.status}\nError message: ${error.response.data}`);
|
|
54
72
|
} else if (error.request) {
|
|
55
|
-
|
|
73
|
+
throw new Error(`Failed to submit request: ${error.request}`);
|
|
56
74
|
} else {
|
|
57
|
-
|
|
75
|
+
throw new Error(`Failed to submit request: ${error}`);
|
|
58
76
|
}
|
|
59
77
|
});
|
|
60
78
|
} else {
|
package/src/types.ts
CHANGED
|
@@ -81,9 +81,15 @@ export type Release = {
|
|
|
81
81
|
};
|
|
82
82
|
};
|
|
83
83
|
|
|
84
|
+
export type AlphaTester = {
|
|
85
|
+
address: string;
|
|
86
|
+
comment: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
84
89
|
export type SolanaMobileDappPublisherPortal = {
|
|
85
90
|
google_store_package: string;
|
|
86
91
|
testing_instructions: string;
|
|
92
|
+
alpha_testers: AlphaTester[];
|
|
87
93
|
};
|
|
88
94
|
|
|
89
95
|
export type LastSubmittedVersionOnChain = {
|