@solana-mobile/dapp-store-cli 0.10.0 → 0.12.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 +468 -568
- package/lib/CliUtils.js +18 -33
- package/lib/__tests__/CliSetupTest.js +4 -27
- package/lib/commands/ValidateCommand.js +15 -40
- package/lib/commands/create/CreateCliApp.js +18 -30
- package/lib/commands/create/CreateCliRelease.js +24 -27
- package/lib/commands/create/index.js +0 -1
- package/lib/commands/publish/PublishCliRemove.js +11 -19
- package/lib/commands/publish/PublishCliSubmit.js +11 -19
- package/lib/commands/publish/PublishCliSupport.js +11 -19
- package/lib/commands/publish/PublishCliUpdate.js +11 -19
- package/lib/commands/utils.js +6 -14
- package/lib/config/PublishDetails.js +138 -259
- 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 +32 -32
- package/lib/upload/CachedStorageDriver.js +13 -19
- package/package.json +2 -2
- package/src/CliSetup.ts +5 -54
- 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/CreateCliRelease.ts +10 -1
- 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 +30 -58
- package/src/prebuild_schema/publishing_source.yaml +32 -32
- package/lib/commands/create/CreateCliPublisher.js +0 -237
- package/src/commands/create/CreateCliPublisher.ts +0 -87
|
@@ -28,7 +28,7 @@ function _async_to_generator(fn) {
|
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
function _ts_generator(thisArg, body) {
|
|
31
|
-
var f, y, t,
|
|
31
|
+
var f, y, t, _ = {
|
|
32
32
|
label: 0,
|
|
33
33
|
sent: function() {
|
|
34
34
|
if (t[0] & 1) throw t[1];
|
|
@@ -36,12 +36,8 @@ function _ts_generator(thisArg, body) {
|
|
|
36
36
|
},
|
|
37
37
|
trys: [],
|
|
38
38
|
ops: []
|
|
39
|
-
};
|
|
40
|
-
return g = {
|
|
41
|
-
next: verb(0),
|
|
42
|
-
"throw": verb(1),
|
|
43
|
-
"return": verb(2)
|
|
44
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
39
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
40
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
45
41
|
return this;
|
|
46
42
|
}), g;
|
|
47
43
|
function verb(n) {
|
|
@@ -54,7 +50,7 @@ function _ts_generator(thisArg, body) {
|
|
|
54
50
|
}
|
|
55
51
|
function step(op) {
|
|
56
52
|
if (f) throw new TypeError("Generator is already executing.");
|
|
57
|
-
while(_)try {
|
|
53
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
58
54
|
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;
|
|
59
55
|
if (y = 0, t) op = [
|
|
60
56
|
op[0] & 2,
|
|
@@ -127,13 +123,13 @@ import { publishSubmit } from "@solana-mobile/dapp-store-publishing-tools";
|
|
|
127
123
|
import nacl from "tweetnacl";
|
|
128
124
|
import { checkMintedStatus, showMessage } from "../../CliUtils.js";
|
|
129
125
|
import { loadPublishDetailsWithChecks, writeToPublishDetails } from "../../config/PublishDetails.js";
|
|
130
|
-
export var publishSubmitCommand =
|
|
131
|
-
var
|
|
132
|
-
|
|
126
|
+
export var publishSubmitCommand = function(param) {
|
|
127
|
+
var appMintAddress = param.appMintAddress, releaseMintAddress = param.releaseMintAddress, signer = param.signer, url = param.url, _param_dryRun = param.dryRun, dryRun = _param_dryRun === void 0 ? false : _param_dryRun, _param_compliesWithSolanaDappStorePolicies = param.compliesWithSolanaDappStorePolicies, compliesWithSolanaDappStorePolicies = _param_compliesWithSolanaDappStorePolicies === void 0 ? false : _param_compliesWithSolanaDappStorePolicies, _param_requestorIsAuthorized = param.requestorIsAuthorized, requestorIsAuthorized = _param_requestorIsAuthorized === void 0 ? false : _param_requestorIsAuthorized, alphaTest = param.alphaTest;
|
|
128
|
+
return _async_to_generator(function() {
|
|
129
|
+
var connection, _ref, publisherDetails, appDetails, releaseDetails, solanaMobileDappPublisherPortalDetails, lastUpdatedVersionOnStore, sign, appAddr, releaseAddr;
|
|
133
130
|
return _ts_generator(this, function(_state) {
|
|
134
131
|
switch(_state.label){
|
|
135
132
|
case 0:
|
|
136
|
-
appMintAddress = param.appMintAddress, releaseMintAddress = param.releaseMintAddress, signer = param.signer, url = param.url, _param_dryRun = param.dryRun, dryRun = _param_dryRun === void 0 ? false : _param_dryRun, _param_compliesWithSolanaDappStorePolicies = param.compliesWithSolanaDappStorePolicies, compliesWithSolanaDappStorePolicies = _param_compliesWithSolanaDappStorePolicies === void 0 ? false : _param_compliesWithSolanaDappStorePolicies, _param_requestorIsAuthorized = param.requestorIsAuthorized, requestorIsAuthorized = _param_requestorIsAuthorized === void 0 ? false : _param_requestorIsAuthorized, alphaTest = param.alphaTest;
|
|
137
133
|
showMessage("Publishing Estimates", "New app submissions take around 3-4 business days for review.", "warning");
|
|
138
134
|
if (!compliesWithSolanaDappStorePolicies) {
|
|
139
135
|
console.error("ERROR: Cannot submit a request for which the requestor does not attest that it complies with Solana dApp Store policies");
|
|
@@ -159,7 +155,6 @@ export var publishSubmitCommand = /*#__PURE__*/ function() {
|
|
|
159
155
|
sign = function(buf) {
|
|
160
156
|
return nacl.sign(buf, signer.secretKey);
|
|
161
157
|
};
|
|
162
|
-
pubAddr = publisherDetails.address;
|
|
163
158
|
appAddr = appMintAddress !== null && appMintAddress !== void 0 ? appMintAddress : appDetails.address;
|
|
164
159
|
releaseAddr = releaseMintAddress !== null && releaseMintAddress !== void 0 ? releaseMintAddress : releaseDetails.address;
|
|
165
160
|
if (lastUpdatedVersionOnStore != null && releaseAddr === lastUpdatedVersionOnStore.address) {
|
|
@@ -167,7 +162,7 @@ export var publishSubmitCommand = /*#__PURE__*/ function() {
|
|
|
167
162
|
}
|
|
168
163
|
return [
|
|
169
164
|
4,
|
|
170
|
-
checkMintedStatus(connection,
|
|
165
|
+
checkMintedStatus(connection, appAddr, releaseAddr)
|
|
171
166
|
];
|
|
172
167
|
case 2:
|
|
173
168
|
_state.sent();
|
|
@@ -209,8 +204,5 @@ export var publishSubmitCommand = /*#__PURE__*/ function() {
|
|
|
209
204
|
];
|
|
210
205
|
}
|
|
211
206
|
});
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
return _ref.apply(this, arguments);
|
|
215
|
-
};
|
|
216
|
-
}();
|
|
207
|
+
})();
|
|
208
|
+
};
|
|
@@ -28,7 +28,7 @@ function _async_to_generator(fn) {
|
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
function _ts_generator(thisArg, body) {
|
|
31
|
-
var f, y, t,
|
|
31
|
+
var f, y, t, _ = {
|
|
32
32
|
label: 0,
|
|
33
33
|
sent: function() {
|
|
34
34
|
if (t[0] & 1) throw t[1];
|
|
@@ -36,12 +36,8 @@ function _ts_generator(thisArg, body) {
|
|
|
36
36
|
},
|
|
37
37
|
trys: [],
|
|
38
38
|
ops: []
|
|
39
|
-
};
|
|
40
|
-
return g = {
|
|
41
|
-
next: verb(0),
|
|
42
|
-
"throw": verb(1),
|
|
43
|
-
"return": verb(2)
|
|
44
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
39
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
40
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
45
41
|
return this;
|
|
46
42
|
}), g;
|
|
47
43
|
function verb(n) {
|
|
@@ -54,7 +50,7 @@ function _ts_generator(thisArg, body) {
|
|
|
54
50
|
}
|
|
55
51
|
function step(op) {
|
|
56
52
|
if (f) throw new TypeError("Generator is already executing.");
|
|
57
|
-
while(_)try {
|
|
53
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
58
54
|
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;
|
|
59
55
|
if (y = 0, t) op = [
|
|
60
56
|
op[0] & 2,
|
|
@@ -127,13 +123,13 @@ import { publishSupport } from "@solana-mobile/dapp-store-publishing-tools";
|
|
|
127
123
|
import { checkMintedStatus } from "../../CliUtils.js";
|
|
128
124
|
import nacl from "tweetnacl";
|
|
129
125
|
import { loadPublishDetailsWithChecks } from "../../config/PublishDetails.js";
|
|
130
|
-
export var publishSupportCommand =
|
|
131
|
-
var
|
|
132
|
-
|
|
126
|
+
export var publishSupportCommand = function(param) {
|
|
127
|
+
var appMintAddress = param.appMintAddress, releaseMintAddress = param.releaseMintAddress, signer = param.signer, url = param.url, _param_dryRun = param.dryRun, dryRun = _param_dryRun === void 0 ? false : _param_dryRun, _param_requestorIsAuthorized = param.requestorIsAuthorized, requestorIsAuthorized = _param_requestorIsAuthorized === void 0 ? false : _param_requestorIsAuthorized, requestDetails = param.requestDetails;
|
|
128
|
+
return _async_to_generator(function() {
|
|
129
|
+
var connection, _ref, publisherDetails, appDetails, releaseDetails, sign, appAddr, releaseAddr;
|
|
133
130
|
return _ts_generator(this, function(_state) {
|
|
134
131
|
switch(_state.label){
|
|
135
132
|
case 0:
|
|
136
|
-
appMintAddress = param.appMintAddress, releaseMintAddress = param.releaseMintAddress, signer = param.signer, url = param.url, _param_dryRun = param.dryRun, dryRun = _param_dryRun === void 0 ? false : _param_dryRun, _param_requestorIsAuthorized = param.requestorIsAuthorized, requestorIsAuthorized = _param_requestorIsAuthorized === void 0 ? false : _param_requestorIsAuthorized, requestDetails = param.requestDetails;
|
|
137
133
|
if (!requestorIsAuthorized) {
|
|
138
134
|
console.error("ERROR: Cannot submit a request for which the requestor does not attest they are authorized to do so");
|
|
139
135
|
return [
|
|
@@ -152,12 +148,11 @@ export var publishSupportCommand = /*#__PURE__*/ function() {
|
|
|
152
148
|
sign = function(buf) {
|
|
153
149
|
return nacl.sign(buf, signer.secretKey);
|
|
154
150
|
};
|
|
155
|
-
pubAddr = publisherDetails.address;
|
|
156
151
|
appAddr = appMintAddress !== null && appMintAddress !== void 0 ? appMintAddress : appDetails.address;
|
|
157
152
|
releaseAddr = releaseMintAddress !== null && releaseMintAddress !== void 0 ? releaseMintAddress : releaseDetails.address;
|
|
158
153
|
return [
|
|
159
154
|
4,
|
|
160
|
-
checkMintedStatus(connection,
|
|
155
|
+
checkMintedStatus(connection, appAddr, releaseAddr)
|
|
161
156
|
];
|
|
162
157
|
case 2:
|
|
163
158
|
_state.sent();
|
|
@@ -181,8 +176,5 @@ export var publishSupportCommand = /*#__PURE__*/ function() {
|
|
|
181
176
|
];
|
|
182
177
|
}
|
|
183
178
|
});
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
return _ref.apply(this, arguments);
|
|
187
|
-
};
|
|
188
|
-
}();
|
|
179
|
+
})();
|
|
180
|
+
};
|
|
@@ -28,7 +28,7 @@ function _async_to_generator(fn) {
|
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
function _ts_generator(thisArg, body) {
|
|
31
|
-
var f, y, t,
|
|
31
|
+
var f, y, t, _ = {
|
|
32
32
|
label: 0,
|
|
33
33
|
sent: function() {
|
|
34
34
|
if (t[0] & 1) throw t[1];
|
|
@@ -36,12 +36,8 @@ function _ts_generator(thisArg, body) {
|
|
|
36
36
|
},
|
|
37
37
|
trys: [],
|
|
38
38
|
ops: []
|
|
39
|
-
};
|
|
40
|
-
return g = {
|
|
41
|
-
next: verb(0),
|
|
42
|
-
"throw": verb(1),
|
|
43
|
-
"return": verb(2)
|
|
44
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
39
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
40
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
45
41
|
return this;
|
|
46
42
|
}), g;
|
|
47
43
|
function verb(n) {
|
|
@@ -54,7 +50,7 @@ function _ts_generator(thisArg, body) {
|
|
|
54
50
|
}
|
|
55
51
|
function step(op) {
|
|
56
52
|
if (f) throw new TypeError("Generator is already executing.");
|
|
57
|
-
while(_)try {
|
|
53
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
58
54
|
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;
|
|
59
55
|
if (y = 0, t) op = [
|
|
60
56
|
op[0] & 2,
|
|
@@ -127,13 +123,13 @@ import { publishUpdate } from "@solana-mobile/dapp-store-publishing-tools";
|
|
|
127
123
|
import { checkMintedStatus, showMessage } from "../../CliUtils.js";
|
|
128
124
|
import nacl from "tweetnacl";
|
|
129
125
|
import { loadPublishDetailsWithChecks, writeToPublishDetails } from "../../config/PublishDetails.js";
|
|
130
|
-
export var publishUpdateCommand =
|
|
131
|
-
var
|
|
132
|
-
|
|
126
|
+
export var publishUpdateCommand = function(param) {
|
|
127
|
+
var appMintAddress = param.appMintAddress, releaseMintAddress = param.releaseMintAddress, signer = param.signer, url = param.url, _param_dryRun = param.dryRun, dryRun = _param_dryRun === void 0 ? false : _param_dryRun, _param_compliesWithSolanaDappStorePolicies = param.compliesWithSolanaDappStorePolicies, compliesWithSolanaDappStorePolicies = _param_compliesWithSolanaDappStorePolicies === void 0 ? false : _param_compliesWithSolanaDappStorePolicies, _param_requestorIsAuthorized = param.requestorIsAuthorized, requestorIsAuthorized = _param_requestorIsAuthorized === void 0 ? false : _param_requestorIsAuthorized, _param_critical = param.critical, critical = _param_critical === void 0 ? false : _param_critical, alphaTest = param.alphaTest;
|
|
128
|
+
return _async_to_generator(function() {
|
|
129
|
+
var connection, _ref, publisherDetails, appDetails, releaseDetails, solanaMobileDappPublisherPortalDetails, lastUpdatedVersionOnStore, sign, appAddr, releaseAddr;
|
|
133
130
|
return _ts_generator(this, function(_state) {
|
|
134
131
|
switch(_state.label){
|
|
135
132
|
case 0:
|
|
136
|
-
appMintAddress = param.appMintAddress, releaseMintAddress = param.releaseMintAddress, signer = param.signer, url = param.url, _param_dryRun = param.dryRun, dryRun = _param_dryRun === void 0 ? false : _param_dryRun, _param_compliesWithSolanaDappStorePolicies = param.compliesWithSolanaDappStorePolicies, compliesWithSolanaDappStorePolicies = _param_compliesWithSolanaDappStorePolicies === void 0 ? false : _param_compliesWithSolanaDappStorePolicies, _param_requestorIsAuthorized = param.requestorIsAuthorized, requestorIsAuthorized = _param_requestorIsAuthorized === void 0 ? false : _param_requestorIsAuthorized, _param_critical = param.critical, critical = _param_critical === void 0 ? false : _param_critical, alphaTest = param.alphaTest;
|
|
137
133
|
showMessage("Publishing Estimates", "App update approvals take around 1-2 business days for review.", "warning");
|
|
138
134
|
if (!compliesWithSolanaDappStorePolicies) {
|
|
139
135
|
console.error("ERROR: Cannot submit a request for which the requestor does not attest that it complies with Solana dApp Store policies");
|
|
@@ -161,7 +157,6 @@ export var publishUpdateCommand = /*#__PURE__*/ function() {
|
|
|
161
157
|
sign = function(buf) {
|
|
162
158
|
return nacl.sign(buf, signer.secretKey);
|
|
163
159
|
};
|
|
164
|
-
pubAddr = publisherDetails.address;
|
|
165
160
|
appAddr = appMintAddress !== null && appMintAddress !== void 0 ? appMintAddress : appDetails.address;
|
|
166
161
|
releaseAddr = releaseMintAddress !== null && releaseMintAddress !== void 0 ? releaseMintAddress : releaseDetails.address;
|
|
167
162
|
if (lastUpdatedVersionOnStore != null && releaseAddr === lastUpdatedVersionOnStore.address) {
|
|
@@ -169,7 +164,7 @@ export var publishUpdateCommand = /*#__PURE__*/ function() {
|
|
|
169
164
|
}
|
|
170
165
|
return [
|
|
171
166
|
4,
|
|
172
|
-
checkMintedStatus(connection,
|
|
167
|
+
checkMintedStatus(connection, appAddr, releaseAddr)
|
|
173
168
|
];
|
|
174
169
|
case 2:
|
|
175
170
|
_state.sent();
|
|
@@ -212,8 +207,5 @@ export var publishUpdateCommand = /*#__PURE__*/ function() {
|
|
|
212
207
|
];
|
|
213
208
|
}
|
|
214
209
|
});
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
return _ref.apply(this, arguments);
|
|
218
|
-
};
|
|
219
|
-
}();
|
|
210
|
+
})();
|
|
211
|
+
};
|
package/lib/commands/utils.js
CHANGED
|
@@ -35,7 +35,7 @@ function _instanceof(left, right) {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
function _ts_generator(thisArg, body) {
|
|
38
|
-
var f, y, t,
|
|
38
|
+
var f, y, t, _ = {
|
|
39
39
|
label: 0,
|
|
40
40
|
sent: function() {
|
|
41
41
|
if (t[0] & 1) throw t[1];
|
|
@@ -43,12 +43,8 @@ function _ts_generator(thisArg, body) {
|
|
|
43
43
|
},
|
|
44
44
|
trys: [],
|
|
45
45
|
ops: []
|
|
46
|
-
};
|
|
47
|
-
return g = {
|
|
48
|
-
next: verb(0),
|
|
49
|
-
"throw": verb(1),
|
|
50
|
-
"return": verb(2)
|
|
51
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
46
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
47
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
52
48
|
return this;
|
|
53
49
|
}), g;
|
|
54
50
|
function verb(n) {
|
|
@@ -61,7 +57,7 @@ function _ts_generator(thisArg, body) {
|
|
|
61
57
|
}
|
|
62
58
|
function step(op) {
|
|
63
59
|
if (f) throw new TypeError("Generator is already executing.");
|
|
64
|
-
while(_)try {
|
|
60
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
65
61
|
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;
|
|
66
62
|
if (y = 0, t) op = [
|
|
67
63
|
op[0] & 2,
|
|
@@ -132,10 +128,7 @@ function _ts_generator(thisArg, body) {
|
|
|
132
128
|
import { FailedToConfirmTransactionError } from "@metaplex-foundation/js";
|
|
133
129
|
import { TransactionExpiredBlockheightExceededError } from "@solana/web3.js";
|
|
134
130
|
export function sendAndConfirmTransaction(metaplex, builder) {
|
|
135
|
-
return
|
|
136
|
-
}
|
|
137
|
-
function _sendAndConfirmTransaction() {
|
|
138
|
-
_sendAndConfirmTransaction = _async_to_generator(function(metaplex, builder) {
|
|
131
|
+
return _async_to_generator(function() {
|
|
139
132
|
var i, e;
|
|
140
133
|
return _ts_generator(this, function(_state) {
|
|
141
134
|
switch(_state.label){
|
|
@@ -183,8 +176,7 @@ function _sendAndConfirmTransaction() {
|
|
|
183
176
|
throw new Error("Unable to send transaction. Please try later.");
|
|
184
177
|
}
|
|
185
178
|
});
|
|
186
|
-
});
|
|
187
|
-
return _sendAndConfirmTransaction.apply(this, arguments);
|
|
179
|
+
})();
|
|
188
180
|
}
|
|
189
181
|
function isTransientError(e) {
|
|
190
182
|
var _e_cause;
|