@solana-mobile/dapp-store-publishing-tools 0.9.4 → 0.9.5
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/publish/PublishCoreSubmit.js +22 -6
- package/lib/publish/PublishCoreUpdate.js +22 -6
- package/lib/publish/dapp_publisher_portal.js +13 -1
- package/package.json +1 -1
- package/src/publish/PublishCoreSubmit.ts +25 -2
- package/src/publish/PublishCoreUpdate.ts +25 -2
- package/src/publish/dapp_publisher_portal.ts +19 -1
- package/src/types.ts +6 -0
|
@@ -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";
|
|
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
127
|
var createSubmitRequest = function() {
|
|
128
|
-
var _ref = _async_to_generator(function(connection, sign, appMintAddress, releaseMintAddress, publisherDetails, solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies, requestorIsAuthorized) {
|
|
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
229
|
export var publishSubmit = 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();
|
|
@@ -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";
|
|
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
127
|
var createUpdateRequest = function() {
|
|
128
|
-
var _ref = _async_to_generator(function(connection, sign, appMintAddress, releaseMintAddress, publisherDetails, solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, criticalUpdate) {
|
|
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
229
|
export var publishUpdate = 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();
|
|
@@ -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";
|
|
@@ -168,7 +170,17 @@ 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
|
console.error("ERROR: failed to submit request to dApp publisher portal: ".concat(error.response.status, " /"), error.response.data);
|
package/package.json
CHANGED
|
@@ -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,7 +48,23 @@ 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) {
|
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 = {
|