@solana-mobile/dapp-store-cli 0.4.1 → 0.4.3
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/bin/dapp-store.js +1 -1
- package/lib/CliSetup.js +730 -0
- package/lib/CliUtils.js +309 -0
- package/lib/__tests__/CliSetupTest.js +140 -0
- package/lib/commands/ValidateCommand.js +201 -0
- package/lib/commands/create/CreateCliApp.js +240 -0
- package/lib/commands/create/CreateCliPublisher.js +238 -0
- package/lib/commands/create/CreateCliRelease.js +270 -0
- package/lib/commands/create/index.js +41 -0
- package/lib/{esm/commands → commands}/index.js +0 -1
- package/lib/commands/publish/PublishCliRemove.js +186 -0
- package/lib/commands/publish/PublishCliSubmit.js +192 -0
- package/lib/commands/publish/PublishCliSupport.js +186 -0
- package/lib/commands/publish/PublishCliUpdate.js +193 -0
- package/lib/commands/publish/index.js +22 -0
- package/lib/{esm/commands → commands}/scaffolding/ScaffoldInit.js +7 -6
- package/lib/{esm/commands → commands}/scaffolding/index.js +0 -1
- package/lib/config/EnvVariables.js +59 -0
- package/lib/config/PublishDetails.js +555 -0
- package/lib/config/S3StorageManager.js +93 -0
- package/lib/config/index.js +2 -0
- package/lib/generated/config_obj.json +1 -0
- package/lib/generated/config_schema.json +1 -0
- package/lib/index.js +148 -0
- package/lib/package.json +74 -0
- package/lib/prebuild_schema/publishing_source.yaml +46 -0
- package/lib/prebuild_schema/schemagen.js +20 -0
- package/lib/upload/CachedStorageDriver.js +307 -0
- package/lib/{esm/upload → upload}/index.js +0 -1
- package/package.json +21 -7
- package/src/CliSetup.ts +512 -0
- package/src/CliUtils.ts +68 -19
- package/src/__tests__/CliSetupTest.ts +212 -0
- package/src/commands/create/CreateCliApp.ts +6 -1
- package/src/commands/create/CreateCliPublisher.ts +6 -1
- package/src/commands/create/CreateCliRelease.ts +6 -1
- package/src/config/EnvVariables.ts +39 -0
- package/src/config/PublishDetails.ts +4 -6
- package/src/config/S3StorageManager.ts +47 -0
- package/src/config/index.ts +2 -0
- package/src/index.ts +3 -510
- package/lib/esm/CliUtils.js +0 -105
- package/lib/esm/CliUtils.js.map +0 -1
- package/lib/esm/commands/ValidateCommand.js +0 -42
- package/lib/esm/commands/ValidateCommand.js.map +0 -1
- package/lib/esm/commands/create/CreateCliApp.js +0 -41
- package/lib/esm/commands/create/CreateCliApp.js.map +0 -1
- package/lib/esm/commands/create/CreateCliPublisher.js +0 -36
- package/lib/esm/commands/create/CreateCliPublisher.js.map +0 -1
- package/lib/esm/commands/create/CreateCliRelease.js +0 -50
- package/lib/esm/commands/create/CreateCliRelease.js.map +0 -1
- package/lib/esm/commands/create/index.js +0 -44
- package/lib/esm/commands/create/index.js.map +0 -1
- package/lib/esm/commands/index.js.map +0 -1
- package/lib/esm/commands/publish/PublishCliRemove.js +0 -26
- package/lib/esm/commands/publish/PublishCliRemove.js.map +0 -1
- package/lib/esm/commands/publish/PublishCliSubmit.js +0 -31
- package/lib/esm/commands/publish/PublishCliSubmit.js.map +0 -1
- package/lib/esm/commands/publish/PublishCliSupport.js +0 -26
- package/lib/esm/commands/publish/PublishCliSupport.js.map +0 -1
- package/lib/esm/commands/publish/PublishCliUpdate.js +0 -32
- package/lib/esm/commands/publish/PublishCliUpdate.js.map +0 -1
- package/lib/esm/commands/publish/index.js +0 -25
- package/lib/esm/commands/publish/index.js.map +0 -1
- package/lib/esm/commands/scaffolding/ScaffoldInit.js.map +0 -1
- package/lib/esm/commands/scaffolding/index.js.map +0 -1
- package/lib/esm/config/PublishDetails.js +0 -178
- package/lib/esm/config/PublishDetails.js.map +0 -1
- package/lib/esm/generated/config_obj.json +0 -1
- package/lib/esm/generated/config_schema.json +0 -1
- package/lib/esm/index.js +0 -307
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/package.json +0 -60
- package/lib/esm/upload/CachedStorageDriver.js +0 -66
- package/lib/esm/upload/CachedStorageDriver.js.map +0 -1
- package/lib/esm/upload/index.js.map +0 -1
- package/lib/types/CliUtils.d.ts +0 -20
- package/lib/types/CliUtils.d.ts.map +0 -1
- package/lib/types/commands/ValidateCommand.d.ts +0 -6
- package/lib/types/commands/ValidateCommand.d.ts.map +0 -1
- package/lib/types/commands/create/CreateCliApp.d.ts +0 -12
- package/lib/types/commands/create/CreateCliApp.d.ts.map +0 -1
- package/lib/types/commands/create/CreateCliPublisher.d.ts +0 -9
- package/lib/types/commands/create/CreateCliPublisher.d.ts.map +0 -1
- package/lib/types/commands/create/CreateCliRelease.d.ts +0 -13
- package/lib/types/commands/create/CreateCliRelease.d.ts.map +0 -1
- package/lib/types/commands/create/index.d.ts +0 -4
- package/lib/types/commands/create/index.d.ts.map +0 -1
- package/lib/types/commands/index.d.ts +0 -4
- package/lib/types/commands/index.d.ts.map +0 -1
- package/lib/types/commands/publish/PublishCliRemove.d.ts +0 -13
- package/lib/types/commands/publish/PublishCliRemove.d.ts.map +0 -1
- package/lib/types/commands/publish/PublishCliSubmit.d.ts +0 -13
- package/lib/types/commands/publish/PublishCliSubmit.d.ts.map +0 -1
- package/lib/types/commands/publish/PublishCliSupport.d.ts +0 -13
- package/lib/types/commands/publish/PublishCliSupport.d.ts.map +0 -1
- package/lib/types/commands/publish/PublishCliUpdate.d.ts +0 -14
- package/lib/types/commands/publish/PublishCliUpdate.d.ts.map +0 -1
- package/lib/types/commands/publish/index.d.ts +0 -5
- package/lib/types/commands/publish/index.d.ts.map +0 -1
- package/lib/types/commands/scaffolding/ScaffoldInit.d.ts +0 -2
- package/lib/types/commands/scaffolding/ScaffoldInit.d.ts.map +0 -1
- package/lib/types/commands/scaffolding/index.d.ts +0 -2
- package/lib/types/commands/scaffolding/index.d.ts.map +0 -1
- package/lib/types/config/PublishDetails.d.ts +0 -17
- package/lib/types/config/PublishDetails.d.ts.map +0 -1
- package/lib/types/index.d.ts +0 -2
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/upload/CachedStorageDriver.d.ts +0 -30
- package/lib/types/upload/CachedStorageDriver.d.ts.map +0 -1
- package/lib/types/upload/index.d.ts +0 -2
- package/lib/types/upload/index.d.ts.map +0 -1
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
2
|
+
try {
|
|
3
|
+
var info = gen[key](arg);
|
|
4
|
+
var value = info.value;
|
|
5
|
+
} catch (error) {
|
|
6
|
+
reject(error);
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
if (info.done) {
|
|
10
|
+
resolve(value);
|
|
11
|
+
} else {
|
|
12
|
+
Promise.resolve(value).then(_next, _throw);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function _async_to_generator(fn) {
|
|
16
|
+
return function() {
|
|
17
|
+
var self = this, args = arguments;
|
|
18
|
+
return new Promise(function(resolve, reject) {
|
|
19
|
+
var gen = fn.apply(self, args);
|
|
20
|
+
function _next(value) {
|
|
21
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
22
|
+
}
|
|
23
|
+
function _throw(err) {
|
|
24
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
25
|
+
}
|
|
26
|
+
_next(undefined);
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function _ts_generator(thisArg, body) {
|
|
31
|
+
var f, y, t, g, _ = {
|
|
32
|
+
label: 0,
|
|
33
|
+
sent: function() {
|
|
34
|
+
if (t[0] & 1) throw t[1];
|
|
35
|
+
return t[1];
|
|
36
|
+
},
|
|
37
|
+
trys: [],
|
|
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() {
|
|
45
|
+
return this;
|
|
46
|
+
}), g);
|
|
47
|
+
function verb(n) {
|
|
48
|
+
return function(v) {
|
|
49
|
+
return step([
|
|
50
|
+
n,
|
|
51
|
+
v
|
|
52
|
+
]);
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function step(op) {
|
|
56
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
57
|
+
while(_)try {
|
|
58
|
+
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
|
+
if (y = 0, t) op = [
|
|
60
|
+
op[0] & 2,
|
|
61
|
+
t.value
|
|
62
|
+
];
|
|
63
|
+
switch(op[0]){
|
|
64
|
+
case 0:
|
|
65
|
+
case 1:
|
|
66
|
+
t = op;
|
|
67
|
+
break;
|
|
68
|
+
case 4:
|
|
69
|
+
_.label++;
|
|
70
|
+
return {
|
|
71
|
+
value: op[1],
|
|
72
|
+
done: false
|
|
73
|
+
};
|
|
74
|
+
case 5:
|
|
75
|
+
_.label++;
|
|
76
|
+
y = op[1];
|
|
77
|
+
op = [
|
|
78
|
+
0
|
|
79
|
+
];
|
|
80
|
+
continue;
|
|
81
|
+
case 7:
|
|
82
|
+
op = _.ops.pop();
|
|
83
|
+
_.trys.pop();
|
|
84
|
+
continue;
|
|
85
|
+
default:
|
|
86
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
87
|
+
_ = 0;
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
91
|
+
_.label = op[1];
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
95
|
+
_.label = t[1];
|
|
96
|
+
t = op;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
if (t && _.label < t[2]) {
|
|
100
|
+
_.label = t[2];
|
|
101
|
+
_.ops.push(op);
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
if (t[2]) _.ops.pop();
|
|
105
|
+
_.trys.pop();
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
op = body.call(thisArg, _);
|
|
109
|
+
} catch (e) {
|
|
110
|
+
op = [
|
|
111
|
+
6,
|
|
112
|
+
e
|
|
113
|
+
];
|
|
114
|
+
y = 0;
|
|
115
|
+
} finally{
|
|
116
|
+
f = t = 0;
|
|
117
|
+
}
|
|
118
|
+
if (op[0] & 5) throw op[1];
|
|
119
|
+
return {
|
|
120
|
+
value: op[0] ? op[1] : void 0,
|
|
121
|
+
done: true
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
import { Connection } from "@solana/web3.js";
|
|
126
|
+
import { publishSupport } from "@solana-mobile/dapp-store-publishing-tools";
|
|
127
|
+
import { checkMintedStatus } from "../../CliUtils.js";
|
|
128
|
+
import nacl from "tweetnacl";
|
|
129
|
+
import { loadPublishDetailsWithChecks } from "../../config/PublishDetails.js";
|
|
130
|
+
export var publishSupportCommand = function() {
|
|
131
|
+
var _ref = _async_to_generator(function(param) {
|
|
132
|
+
var appMintAddress, releaseMintAddress, signer, url, _param_dryRun, dryRun, _param_requestorIsAuthorized, requestorIsAuthorized, requestDetails, connection, _ref, publisherDetails, appDetails, releaseDetails, sign, pubAddr, appAddr, releaseAddr;
|
|
133
|
+
return _ts_generator(this, function(_state) {
|
|
134
|
+
switch(_state.label){
|
|
135
|
+
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
|
+
if (!requestorIsAuthorized) {
|
|
138
|
+
console.error("ERROR: Cannot submit a request for which the requestor does not attest they are authorized to do so");
|
|
139
|
+
return [
|
|
140
|
+
2
|
|
141
|
+
];
|
|
142
|
+
}
|
|
143
|
+
connection = new Connection(url);
|
|
144
|
+
return [
|
|
145
|
+
4,
|
|
146
|
+
loadPublishDetailsWithChecks()
|
|
147
|
+
];
|
|
148
|
+
case 1:
|
|
149
|
+
_ref = _state.sent(), publisherDetails = _ref.publisher, appDetails = _ref.app, releaseDetails = _ref.release;
|
|
150
|
+
sign = function(buf) {
|
|
151
|
+
return nacl.sign(buf, signer.secretKey);
|
|
152
|
+
};
|
|
153
|
+
pubAddr = publisherDetails.address;
|
|
154
|
+
appAddr = appMintAddress !== null && appMintAddress !== void 0 ? appMintAddress : appDetails.address;
|
|
155
|
+
releaseAddr = releaseMintAddress !== null && releaseMintAddress !== void 0 ? releaseMintAddress : releaseDetails.address;
|
|
156
|
+
return [
|
|
157
|
+
4,
|
|
158
|
+
checkMintedStatus(connection, pubAddr, appAddr, releaseAddr)
|
|
159
|
+
];
|
|
160
|
+
case 2:
|
|
161
|
+
_state.sent();
|
|
162
|
+
return [
|
|
163
|
+
4,
|
|
164
|
+
publishSupport({
|
|
165
|
+
connection: connection,
|
|
166
|
+
sign: sign
|
|
167
|
+
}, {
|
|
168
|
+
appMintAddress: appMintAddress !== null && appMintAddress !== void 0 ? appMintAddress : appDetails.address,
|
|
169
|
+
releaseMintAddress: releaseMintAddress !== null && releaseMintAddress !== void 0 ? releaseMintAddress : releaseDetails.address,
|
|
170
|
+
publisherDetails: publisherDetails,
|
|
171
|
+
requestorIsAuthorized: requestorIsAuthorized,
|
|
172
|
+
requestDetails: requestDetails
|
|
173
|
+
}, dryRun)
|
|
174
|
+
];
|
|
175
|
+
case 3:
|
|
176
|
+
_state.sent();
|
|
177
|
+
return [
|
|
178
|
+
2
|
|
179
|
+
];
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
return function publishSupportCommand(_) {
|
|
184
|
+
return _ref.apply(this, arguments);
|
|
185
|
+
};
|
|
186
|
+
}();
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
2
|
+
try {
|
|
3
|
+
var info = gen[key](arg);
|
|
4
|
+
var value = info.value;
|
|
5
|
+
} catch (error) {
|
|
6
|
+
reject(error);
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
if (info.done) {
|
|
10
|
+
resolve(value);
|
|
11
|
+
} else {
|
|
12
|
+
Promise.resolve(value).then(_next, _throw);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function _async_to_generator(fn) {
|
|
16
|
+
return function() {
|
|
17
|
+
var self = this, args = arguments;
|
|
18
|
+
return new Promise(function(resolve, reject) {
|
|
19
|
+
var gen = fn.apply(self, args);
|
|
20
|
+
function _next(value) {
|
|
21
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
22
|
+
}
|
|
23
|
+
function _throw(err) {
|
|
24
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
25
|
+
}
|
|
26
|
+
_next(undefined);
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function _ts_generator(thisArg, body) {
|
|
31
|
+
var f, y, t, g, _ = {
|
|
32
|
+
label: 0,
|
|
33
|
+
sent: function() {
|
|
34
|
+
if (t[0] & 1) throw t[1];
|
|
35
|
+
return t[1];
|
|
36
|
+
},
|
|
37
|
+
trys: [],
|
|
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() {
|
|
45
|
+
return this;
|
|
46
|
+
}), g);
|
|
47
|
+
function verb(n) {
|
|
48
|
+
return function(v) {
|
|
49
|
+
return step([
|
|
50
|
+
n,
|
|
51
|
+
v
|
|
52
|
+
]);
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function step(op) {
|
|
56
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
57
|
+
while(_)try {
|
|
58
|
+
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
|
+
if (y = 0, t) op = [
|
|
60
|
+
op[0] & 2,
|
|
61
|
+
t.value
|
|
62
|
+
];
|
|
63
|
+
switch(op[0]){
|
|
64
|
+
case 0:
|
|
65
|
+
case 1:
|
|
66
|
+
t = op;
|
|
67
|
+
break;
|
|
68
|
+
case 4:
|
|
69
|
+
_.label++;
|
|
70
|
+
return {
|
|
71
|
+
value: op[1],
|
|
72
|
+
done: false
|
|
73
|
+
};
|
|
74
|
+
case 5:
|
|
75
|
+
_.label++;
|
|
76
|
+
y = op[1];
|
|
77
|
+
op = [
|
|
78
|
+
0
|
|
79
|
+
];
|
|
80
|
+
continue;
|
|
81
|
+
case 7:
|
|
82
|
+
op = _.ops.pop();
|
|
83
|
+
_.trys.pop();
|
|
84
|
+
continue;
|
|
85
|
+
default:
|
|
86
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
87
|
+
_ = 0;
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
91
|
+
_.label = op[1];
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
95
|
+
_.label = t[1];
|
|
96
|
+
t = op;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
if (t && _.label < t[2]) {
|
|
100
|
+
_.label = t[2];
|
|
101
|
+
_.ops.push(op);
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
if (t[2]) _.ops.pop();
|
|
105
|
+
_.trys.pop();
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
op = body.call(thisArg, _);
|
|
109
|
+
} catch (e) {
|
|
110
|
+
op = [
|
|
111
|
+
6,
|
|
112
|
+
e
|
|
113
|
+
];
|
|
114
|
+
y = 0;
|
|
115
|
+
} finally{
|
|
116
|
+
f = t = 0;
|
|
117
|
+
}
|
|
118
|
+
if (op[0] & 5) throw op[1];
|
|
119
|
+
return {
|
|
120
|
+
value: op[0] ? op[1] : void 0,
|
|
121
|
+
done: true
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
import { Connection } from "@solana/web3.js";
|
|
126
|
+
import { publishUpdate } from "@solana-mobile/dapp-store-publishing-tools";
|
|
127
|
+
import { checkMintedStatus } from "../../CliUtils.js";
|
|
128
|
+
import nacl from "tweetnacl";
|
|
129
|
+
import { loadPublishDetailsWithChecks } from "../../config/PublishDetails.js";
|
|
130
|
+
export var publishUpdateCommand = function() {
|
|
131
|
+
var _ref = _async_to_generator(function(param) {
|
|
132
|
+
var appMintAddress, releaseMintAddress, signer, url, _param_dryRun, dryRun, _param_compliesWithSolanaDappStorePolicies, compliesWithSolanaDappStorePolicies, _param_requestorIsAuthorized, requestorIsAuthorized, _param_critical, critical, connection, _ref, publisherDetails, appDetails, releaseDetails, solanaMobileDappPublisherPortalDetails, sign, pubAddr, appAddr, releaseAddr;
|
|
133
|
+
return _ts_generator(this, function(_state) {
|
|
134
|
+
switch(_state.label){
|
|
135
|
+
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;
|
|
137
|
+
if (!compliesWithSolanaDappStorePolicies) {
|
|
138
|
+
console.error("ERROR: Cannot submit a request for which the requestor does not attest that it complies with Solana dApp Store policies");
|
|
139
|
+
return [
|
|
140
|
+
2
|
|
141
|
+
];
|
|
142
|
+
} else if (!requestorIsAuthorized) {
|
|
143
|
+
console.error("ERROR: Cannot submit a request for which the requestor does not attest they are authorized to do so");
|
|
144
|
+
return [
|
|
145
|
+
2
|
|
146
|
+
];
|
|
147
|
+
}
|
|
148
|
+
connection = new Connection(url);
|
|
149
|
+
return [
|
|
150
|
+
4,
|
|
151
|
+
loadPublishDetailsWithChecks()
|
|
152
|
+
];
|
|
153
|
+
case 1:
|
|
154
|
+
_ref = _state.sent(), publisherDetails = _ref.publisher, appDetails = _ref.app, releaseDetails = _ref.release, solanaMobileDappPublisherPortalDetails = _ref.solana_mobile_dapp_publisher_portal;
|
|
155
|
+
sign = function(buf) {
|
|
156
|
+
return nacl.sign(buf, signer.secretKey);
|
|
157
|
+
};
|
|
158
|
+
pubAddr = publisherDetails.address;
|
|
159
|
+
appAddr = appMintAddress !== null && appMintAddress !== void 0 ? appMintAddress : appDetails.address;
|
|
160
|
+
releaseAddr = releaseMintAddress !== null && releaseMintAddress !== void 0 ? releaseMintAddress : releaseDetails.address;
|
|
161
|
+
return [
|
|
162
|
+
4,
|
|
163
|
+
checkMintedStatus(connection, pubAddr, appAddr, releaseAddr)
|
|
164
|
+
];
|
|
165
|
+
case 2:
|
|
166
|
+
_state.sent();
|
|
167
|
+
return [
|
|
168
|
+
4,
|
|
169
|
+
publishUpdate({
|
|
170
|
+
connection: connection,
|
|
171
|
+
sign: sign
|
|
172
|
+
}, {
|
|
173
|
+
appMintAddress: appMintAddress !== null && appMintAddress !== void 0 ? appMintAddress : appDetails.address,
|
|
174
|
+
releaseMintAddress: releaseMintAddress !== null && releaseMintAddress !== void 0 ? releaseMintAddress : releaseDetails.address,
|
|
175
|
+
publisherDetails: publisherDetails,
|
|
176
|
+
solanaMobileDappPublisherPortalDetails: solanaMobileDappPublisherPortalDetails,
|
|
177
|
+
compliesWithSolanaDappStorePolicies: compliesWithSolanaDappStorePolicies,
|
|
178
|
+
requestorIsAuthorized: requestorIsAuthorized,
|
|
179
|
+
criticalUpdate: critical
|
|
180
|
+
}, dryRun)
|
|
181
|
+
];
|
|
182
|
+
case 3:
|
|
183
|
+
_state.sent();
|
|
184
|
+
return [
|
|
185
|
+
2
|
|
186
|
+
];
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
return function publishUpdateCommand(_) {
|
|
191
|
+
return _ref.apply(this, arguments);
|
|
192
|
+
};
|
|
193
|
+
}();
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from "./PublishCliRemove.js";
|
|
2
|
+
export * from "./PublishCliSubmit.js";
|
|
3
|
+
export * from "./PublishCliSupport.js";
|
|
4
|
+
export * from "./PublishCliUpdate.js"; /*
|
|
5
|
+
* Module responsible for submitting requests to the Solana dApp Store publisher portal
|
|
6
|
+
* Anything that is out-of-order will be prompted back into order
|
|
7
|
+
* And steps that happen more than once will do their best to remember as much information as possible.
|
|
8
|
+
* We will ask questions and do our best to answer anything that's already been configured, and prompt for anything that's not
|
|
9
|
+
*/ // We'll never ask for private keys or seed phrases
|
|
10
|
+
// You must use the same signer(s) when submitting requests to the publisher portal as was used to publish
|
|
11
|
+
// your app on-chain.
|
|
12
|
+
// The Solana Mobile dApp publisher portal supports 4 different requests: `submit`, `update`, `remove`, and `support`.
|
|
13
|
+
// Each request includes:
|
|
14
|
+
// - a 32-digit randomly generated unique identifier
|
|
15
|
+
// - an attestation payload, signed with the private key of the dApp collection update authority
|
|
16
|
+
// - the dApp release NFT address
|
|
17
|
+
// - contact and company information for the requestor
|
|
18
|
+
// - a self-attestation that the requestor is authorized to make this request
|
|
19
|
+
// - additional fields, specific to the request type in question
|
|
20
|
+
// We'll attempt to read as much as possible from a provided `.yml` file
|
|
21
|
+
// If there are provided folders that are well-structured, we'll opt to use that too.
|
|
22
|
+
// Requests and responses are logged to the console, to facilitate use in an automated CI/CD environment.
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { dump } from "js-yaml";
|
|
2
2
|
// eslint-disable-next-line require-extensions/require-extensions
|
|
3
|
-
import releaseSchema from "../../generated/config_obj.json" assert {
|
|
3
|
+
import releaseSchema from "../../generated/config_obj.json" assert {
|
|
4
|
+
type: "json"
|
|
5
|
+
};
|
|
4
6
|
import fs from "fs";
|
|
5
7
|
import { Constants } from "../../CliUtils.js";
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
export var initScaffold = function() {
|
|
9
|
+
var outputYaml = Constants.CONFIG_FILE_NAME;
|
|
10
|
+
var outFile = "".concat(process.cwd(), "/").concat(outputYaml);
|
|
9
11
|
if (fs.existsSync(outFile)) {
|
|
10
12
|
throw Error("Configuration file already present; please use to intialize a new config file.");
|
|
11
13
|
}
|
|
12
14
|
fs.writeFileSync(outFile, dump(releaseSchema));
|
|
13
|
-
return
|
|
15
|
+
return "Your configuration file was created: ".concat(outputYaml);
|
|
14
16
|
};
|
|
15
|
-
//# sourceMappingURL=ScaffoldInit.js.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
function _class_call_check(instance, Constructor) {
|
|
2
|
+
if (!(instance instanceof Constructor)) {
|
|
3
|
+
throw new TypeError("Cannot call a class as a function");
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
function _defineProperties(target, props) {
|
|
7
|
+
for(var i = 0; i < props.length; i++){
|
|
8
|
+
var descriptor = props[i];
|
|
9
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
10
|
+
descriptor.configurable = true;
|
|
11
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
12
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
16
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
17
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
18
|
+
return Constructor;
|
|
19
|
+
}
|
|
20
|
+
import * as dotenv from "dotenv";
|
|
21
|
+
export var EnvVariables = /*#__PURE__*/ function() {
|
|
22
|
+
"use strict";
|
|
23
|
+
function EnvVariables() {
|
|
24
|
+
_class_call_check(this, EnvVariables);
|
|
25
|
+
dotenv.config();
|
|
26
|
+
}
|
|
27
|
+
_create_class(EnvVariables, [
|
|
28
|
+
{
|
|
29
|
+
key: "hasAndroidTools",
|
|
30
|
+
get: function get() {
|
|
31
|
+
return process.env.ANDROID_TOOLS_DIR !== undefined;
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
key: "androidToolsDir",
|
|
36
|
+
get: function get() {
|
|
37
|
+
return process.env.ANDROID_TOOLS_DIR;
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
key: "hasS3EnvArgs",
|
|
42
|
+
get: function get() {
|
|
43
|
+
return process.env.STORAGE_TYPE == "s3" && process.env.S3_ACCESS_KEY != undefined && process.env.S3_SECRET_KEY != undefined && process.env.S3_BUCKET != undefined && process.env.S3_REGION != undefined;
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
key: "s3Config",
|
|
48
|
+
get: function get() {
|
|
49
|
+
return {
|
|
50
|
+
accessKey: process.env.S3_ACCESS_KEY,
|
|
51
|
+
secretKey: process.env.S3_SECRET_KEY,
|
|
52
|
+
bucketName: process.env.S3_BUCKET,
|
|
53
|
+
regionName: process.env.S3_REGION
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
]);
|
|
58
|
+
return EnvVariables;
|
|
59
|
+
}();
|