@solana-mobile/dapp-store-cli 0.15.0 → 0.16.1

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.
Files changed (105) hide show
  1. package/bin/dapp-store.js +3 -1
  2. package/lib/CliSetup.js +304 -505
  3. package/lib/CliUtils.js +6 -376
  4. package/lib/__tests__/CliSetupTest.js +484 -74
  5. package/lib/cli/__tests__/parseErrors.test.js +25 -0
  6. package/lib/cli/__tests__/signer.test.js +436 -0
  7. package/lib/cli/constants.js +23 -0
  8. package/lib/cli/messages.js +21 -0
  9. package/lib/cli/parseErrors.js +41 -0
  10. package/lib/{commands/publish/PublishCliSupport.js → cli/selfUpdate.js} +72 -38
  11. package/lib/{commands/publish/PublishCliRemove.js → cli/signer.js} +35 -56
  12. package/lib/index.js +96 -5
  13. package/lib/package.json +5 -24
  14. package/lib/portal/__tests__/releaseMetadata.test.js +647 -0
  15. package/lib/portal/__tests__/translators.test.js +76 -0
  16. package/lib/portal/__tests__/workflowClient.test.js +457 -0
  17. package/lib/portal/attestationClient.js +143 -0
  18. package/lib/portal/files.js +64 -0
  19. package/lib/portal/http.js +364 -0
  20. package/lib/portal/records.js +64 -0
  21. package/lib/portal/releaseMetadata.js +748 -0
  22. package/lib/portal/translators.js +460 -0
  23. package/lib/portal/types.js +1 -0
  24. package/lib/portal/workflowClient.js +704 -0
  25. package/lib/publication/PublicationProgressReporter.js +1051 -0
  26. package/lib/publication/__tests__/PublicationProgressReporter.test.js +174 -0
  27. package/lib/{commands/ValidateCommand.js → publication/__tests__/fundingPreflight.test.js} +90 -66
  28. package/lib/publication/__tests__/publicationSummary.test.js +26 -0
  29. package/lib/publication/cliValidation.js +482 -0
  30. package/lib/publication/fundingPreflight.js +246 -0
  31. package/lib/publication/publicationSummary.js +99 -0
  32. package/lib/{commands/utils.js → publication/runPublicationWorkflow.js} +16 -46
  33. package/package.json +5 -24
  34. package/src/CliSetup.ts +370 -505
  35. package/src/CliUtils.ts +9 -233
  36. package/src/__tests__/CliSetupTest.ts +272 -120
  37. package/src/cli/__tests__/parseErrors.test.ts +34 -0
  38. package/src/cli/__tests__/signer.test.ts +359 -0
  39. package/src/cli/constants.ts +3 -0
  40. package/src/cli/messages.ts +27 -0
  41. package/src/cli/parseErrors.ts +62 -0
  42. package/src/cli/selfUpdate.ts +59 -0
  43. package/src/cli/signer.ts +38 -0
  44. package/src/index.ts +31 -4
  45. package/src/portal/__tests__/releaseMetadata.test.ts +508 -0
  46. package/src/portal/__tests__/translators.test.ts +82 -0
  47. package/src/portal/__tests__/workflowClient.test.ts +278 -0
  48. package/src/portal/attestationClient.ts +19 -0
  49. package/src/portal/files.ts +73 -0
  50. package/src/portal/http.ts +170 -0
  51. package/src/portal/records.ts +38 -0
  52. package/src/portal/releaseMetadata.ts +489 -0
  53. package/src/portal/translators.ts +750 -0
  54. package/src/portal/types.ts +27 -0
  55. package/src/portal/workflowClient.ts +575 -0
  56. package/src/publication/PublicationProgressReporter.ts +1026 -0
  57. package/src/publication/__tests__/PublicationProgressReporter.test.ts +210 -0
  58. package/src/publication/__tests__/fundingPreflight.test.ts +78 -0
  59. package/src/publication/__tests__/publicationSummary.test.ts +30 -0
  60. package/src/publication/cliValidation.ts +264 -0
  61. package/src/publication/fundingPreflight.ts +123 -0
  62. package/src/publication/publicationSummary.ts +26 -0
  63. package/src/publication/runPublicationWorkflow.ts +46 -0
  64. package/lib/commands/create/CreateCliApp.js +0 -223
  65. package/lib/commands/create/CreateCliRelease.js +0 -290
  66. package/lib/commands/create/index.js +0 -40
  67. package/lib/commands/index.js +0 -3
  68. package/lib/commands/publish/PublishCliSubmit.js +0 -208
  69. package/lib/commands/publish/PublishCliUpdate.js +0 -211
  70. package/lib/commands/publish/index.js +0 -22
  71. package/lib/commands/scaffolding/ScaffoldInit.js +0 -15
  72. package/lib/commands/scaffolding/index.js +0 -1
  73. package/lib/config/EnvVariables.js +0 -59
  74. package/lib/config/PublishDetails.js +0 -915
  75. package/lib/config/S3StorageManager.js +0 -93
  76. package/lib/config/index.js +0 -2
  77. package/lib/generated/config_obj.json +0 -1
  78. package/lib/generated/config_schema.json +0 -1
  79. package/lib/prebuild_schema/publishing_source.yaml +0 -64
  80. package/lib/prebuild_schema/schemagen.js +0 -25
  81. package/lib/upload/CachedStorageDriver.js +0 -293
  82. package/lib/upload/TurboStorageDriver.js +0 -718
  83. package/lib/upload/index.js +0 -2
  84. package/src/commands/ValidateCommand.ts +0 -82
  85. package/src/commands/create/CreateCliApp.ts +0 -93
  86. package/src/commands/create/CreateCliRelease.ts +0 -149
  87. package/src/commands/create/index.ts +0 -47
  88. package/src/commands/index.ts +0 -3
  89. package/src/commands/publish/PublishCliRemove.ts +0 -66
  90. package/src/commands/publish/PublishCliSubmit.ts +0 -93
  91. package/src/commands/publish/PublishCliSupport.ts +0 -66
  92. package/src/commands/publish/PublishCliUpdate.ts +0 -101
  93. package/src/commands/publish/index.ts +0 -29
  94. package/src/commands/scaffolding/ScaffoldInit.ts +0 -20
  95. package/src/commands/scaffolding/index.ts +0 -1
  96. package/src/commands/utils.ts +0 -33
  97. package/src/config/EnvVariables.ts +0 -39
  98. package/src/config/PublishDetails.ts +0 -456
  99. package/src/config/S3StorageManager.ts +0 -47
  100. package/src/config/index.ts +0 -2
  101. package/src/prebuild_schema/publishing_source.yaml +0 -64
  102. package/src/prebuild_schema/schemagen.js +0 -31
  103. package/src/upload/CachedStorageDriver.ts +0 -99
  104. package/src/upload/TurboStorageDriver.ts +0 -277
  105. package/src/upload/index.ts +0 -2
@@ -1,208 +0,0 @@
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, _ = {
32
- label: 0,
33
- sent: function() {
34
- if (t[0] & 1) throw t[1];
35
- return t[1];
36
- },
37
- trys: [],
38
- ops: []
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() {
41
- return this;
42
- }), g;
43
- function verb(n) {
44
- return function(v) {
45
- return step([
46
- n,
47
- v
48
- ]);
49
- };
50
- }
51
- function step(op) {
52
- if (f) throw new TypeError("Generator is already executing.");
53
- while(g && (g = 0, op[0] && (_ = 0)), _)try {
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;
55
- if (y = 0, t) op = [
56
- op[0] & 2,
57
- t.value
58
- ];
59
- switch(op[0]){
60
- case 0:
61
- case 1:
62
- t = op;
63
- break;
64
- case 4:
65
- _.label++;
66
- return {
67
- value: op[1],
68
- done: false
69
- };
70
- case 5:
71
- _.label++;
72
- y = op[1];
73
- op = [
74
- 0
75
- ];
76
- continue;
77
- case 7:
78
- op = _.ops.pop();
79
- _.trys.pop();
80
- continue;
81
- default:
82
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
83
- _ = 0;
84
- continue;
85
- }
86
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
87
- _.label = op[1];
88
- break;
89
- }
90
- if (op[0] === 6 && _.label < t[1]) {
91
- _.label = t[1];
92
- t = op;
93
- break;
94
- }
95
- if (t && _.label < t[2]) {
96
- _.label = t[2];
97
- _.ops.push(op);
98
- break;
99
- }
100
- if (t[2]) _.ops.pop();
101
- _.trys.pop();
102
- continue;
103
- }
104
- op = body.call(thisArg, _);
105
- } catch (e) {
106
- op = [
107
- 6,
108
- e
109
- ];
110
- y = 0;
111
- } finally{
112
- f = t = 0;
113
- }
114
- if (op[0] & 5) throw op[1];
115
- return {
116
- value: op[0] ? op[1] : void 0,
117
- done: true
118
- };
119
- }
120
- }
121
- import { Connection } from "@solana/web3.js";
122
- import { publishSubmit } from "@solana-mobile/dapp-store-publishing-tools";
123
- import nacl from "tweetnacl";
124
- import { checkMintedStatus, showMessage } from "../../CliUtils.js";
125
- import { loadPublishDetailsWithChecks, writeToPublishDetails } from "../../config/PublishDetails.js";
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;
130
- return _ts_generator(this, function(_state) {
131
- switch(_state.label){
132
- case 0:
133
- showMessage("Publishing Estimates", "New app submissions take around 3-4 business days for review.", "warning");
134
- if (!compliesWithSolanaDappStorePolicies) {
135
- console.error("ERROR: Cannot submit a request for which the requestor does not attest that it complies with Solana dApp Store policies");
136
- return [
137
- 2
138
- ];
139
- } else if (!requestorIsAuthorized) {
140
- console.error("ERROR: Cannot submit a request for which the requestor does not attest they are authorized to do so");
141
- return [
142
- 2
143
- ];
144
- }
145
- connection = new Connection(url);
146
- return [
147
- 4,
148
- loadPublishDetailsWithChecks()
149
- ];
150
- case 1:
151
- _ref = _state.sent(), publisherDetails = _ref.publisher, appDetails = _ref.app, releaseDetails = _ref.release, solanaMobileDappPublisherPortalDetails = _ref.solana_mobile_dapp_publisher_portal, lastUpdatedVersionOnStore = _ref.lastUpdatedVersionOnStore;
152
- if (alphaTest && solanaMobileDappPublisherPortalDetails.alpha_testers == undefined) {
153
- throw new Error("Alpha test submission without specifying any testers.\nAdd field alpha_testers in your 'config.yaml' file.");
154
- }
155
- sign = function(buf) {
156
- return nacl.sign(buf, signer.secretKey);
157
- };
158
- appAddr = appMintAddress !== null && appMintAddress !== void 0 ? appMintAddress : appDetails.address;
159
- releaseAddr = releaseMintAddress !== null && releaseMintAddress !== void 0 ? releaseMintAddress : releaseDetails.address;
160
- if (lastUpdatedVersionOnStore != null && releaseAddr === lastUpdatedVersionOnStore.address) {
161
- throw new Error("You've already submitted this version for review.");
162
- }
163
- return [
164
- 4,
165
- checkMintedStatus(connection, appAddr, releaseAddr)
166
- ];
167
- case 2:
168
- _state.sent();
169
- return [
170
- 4,
171
- publishSubmit({
172
- connection: connection,
173
- sign: sign
174
- }, {
175
- appMintAddress: appAddr,
176
- releaseMintAddress: releaseAddr,
177
- publisherDetails: publisherDetails,
178
- solanaMobileDappPublisherPortalDetails: solanaMobileDappPublisherPortalDetails,
179
- compliesWithSolanaDappStorePolicies: compliesWithSolanaDappStorePolicies,
180
- requestorIsAuthorized: requestorIsAuthorized,
181
- alphaTest: alphaTest
182
- }, dryRun)
183
- ];
184
- case 3:
185
- _state.sent();
186
- if (!!alphaTest) return [
187
- 3,
188
- 5
189
- ];
190
- return [
191
- 4,
192
- writeToPublishDetails({
193
- lastUpdatedVersionOnStore: {
194
- address: releaseAddr
195
- }
196
- })
197
- ];
198
- case 4:
199
- _state.sent();
200
- _state.label = 5;
201
- case 5:
202
- return [
203
- 2
204
- ];
205
- }
206
- });
207
- })();
208
- };
@@ -1,211 +0,0 @@
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, _ = {
32
- label: 0,
33
- sent: function() {
34
- if (t[0] & 1) throw t[1];
35
- return t[1];
36
- },
37
- trys: [],
38
- ops: []
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() {
41
- return this;
42
- }), g;
43
- function verb(n) {
44
- return function(v) {
45
- return step([
46
- n,
47
- v
48
- ]);
49
- };
50
- }
51
- function step(op) {
52
- if (f) throw new TypeError("Generator is already executing.");
53
- while(g && (g = 0, op[0] && (_ = 0)), _)try {
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;
55
- if (y = 0, t) op = [
56
- op[0] & 2,
57
- t.value
58
- ];
59
- switch(op[0]){
60
- case 0:
61
- case 1:
62
- t = op;
63
- break;
64
- case 4:
65
- _.label++;
66
- return {
67
- value: op[1],
68
- done: false
69
- };
70
- case 5:
71
- _.label++;
72
- y = op[1];
73
- op = [
74
- 0
75
- ];
76
- continue;
77
- case 7:
78
- op = _.ops.pop();
79
- _.trys.pop();
80
- continue;
81
- default:
82
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
83
- _ = 0;
84
- continue;
85
- }
86
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
87
- _.label = op[1];
88
- break;
89
- }
90
- if (op[0] === 6 && _.label < t[1]) {
91
- _.label = t[1];
92
- t = op;
93
- break;
94
- }
95
- if (t && _.label < t[2]) {
96
- _.label = t[2];
97
- _.ops.push(op);
98
- break;
99
- }
100
- if (t[2]) _.ops.pop();
101
- _.trys.pop();
102
- continue;
103
- }
104
- op = body.call(thisArg, _);
105
- } catch (e) {
106
- op = [
107
- 6,
108
- e
109
- ];
110
- y = 0;
111
- } finally{
112
- f = t = 0;
113
- }
114
- if (op[0] & 5) throw op[1];
115
- return {
116
- value: op[0] ? op[1] : void 0,
117
- done: true
118
- };
119
- }
120
- }
121
- import { Connection } from "@solana/web3.js";
122
- import { publishUpdate } from "@solana-mobile/dapp-store-publishing-tools";
123
- import { checkMintedStatus, showMessage } from "../../CliUtils.js";
124
- import nacl from "tweetnacl";
125
- import { loadPublishDetailsWithChecks, writeToPublishDetails } from "../../config/PublishDetails.js";
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;
130
- return _ts_generator(this, function(_state) {
131
- switch(_state.label){
132
- case 0:
133
- showMessage("Publishing Estimates", "App update approvals take around 1-2 business days for review.", "warning");
134
- if (!compliesWithSolanaDappStorePolicies) {
135
- console.error("ERROR: Cannot submit a request for which the requestor does not attest that it complies with Solana dApp Store policies");
136
- return [
137
- 2
138
- ];
139
- } else if (!requestorIsAuthorized) {
140
- console.error("ERROR: Cannot submit a request for which the requestor does not attest they are authorized to do so");
141
- return [
142
- 2
143
- ];
144
- }
145
- connection = new Connection(url, {
146
- commitment: "confirmed"
147
- });
148
- return [
149
- 4,
150
- loadPublishDetailsWithChecks()
151
- ];
152
- case 1:
153
- _ref = _state.sent(), publisherDetails = _ref.publisher, appDetails = _ref.app, releaseDetails = _ref.release, solanaMobileDappPublisherPortalDetails = _ref.solana_mobile_dapp_publisher_portal, lastUpdatedVersionOnStore = _ref.lastUpdatedVersionOnStore;
154
- if (alphaTest && solanaMobileDappPublisherPortalDetails.alpha_testers == undefined) {
155
- throw new Error("Alpha test submission without specifying any testers.\nAdd field alpha_testers in your 'config.yaml' file.");
156
- }
157
- sign = function(buf) {
158
- return nacl.sign(buf, signer.secretKey);
159
- };
160
- appAddr = appMintAddress !== null && appMintAddress !== void 0 ? appMintAddress : appDetails.address;
161
- releaseAddr = releaseMintAddress !== null && releaseMintAddress !== void 0 ? releaseMintAddress : releaseDetails.address;
162
- if (lastUpdatedVersionOnStore != null && releaseAddr === lastUpdatedVersionOnStore.address) {
163
- throw new Error("You've already submitted this version for review.");
164
- }
165
- return [
166
- 4,
167
- checkMintedStatus(connection, appAddr, releaseAddr)
168
- ];
169
- case 2:
170
- _state.sent();
171
- return [
172
- 4,
173
- publishUpdate({
174
- connection: connection,
175
- sign: sign
176
- }, {
177
- appMintAddress: appMintAddress !== null && appMintAddress !== void 0 ? appMintAddress : appDetails.address,
178
- releaseMintAddress: releaseMintAddress !== null && releaseMintAddress !== void 0 ? releaseMintAddress : releaseDetails.address,
179
- publisherDetails: publisherDetails,
180
- solanaMobileDappPublisherPortalDetails: solanaMobileDappPublisherPortalDetails,
181
- compliesWithSolanaDappStorePolicies: compliesWithSolanaDappStorePolicies,
182
- requestorIsAuthorized: requestorIsAuthorized,
183
- criticalUpdate: critical,
184
- alphaTest: alphaTest
185
- }, dryRun)
186
- ];
187
- case 3:
188
- _state.sent();
189
- if (!!alphaTest) return [
190
- 3,
191
- 5
192
- ];
193
- return [
194
- 4,
195
- writeToPublishDetails({
196
- lastUpdatedVersionOnStore: {
197
- address: releaseAddr
198
- }
199
- })
200
- ];
201
- case 4:
202
- _state.sent();
203
- _state.label = 5;
204
- case 5:
205
- return [
206
- 2
207
- ];
208
- }
209
- });
210
- })();
211
- };
@@ -1,22 +0,0 @@
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 +0,0 @@
1
- import { dump } from "js-yaml";
2
- import { readFile } from 'fs/promises';
3
- var releaseSchema = JSON.parse((await readFile(new URL("../../generated/config_obj.json", import.meta.url))).toString());
4
- import fs from "fs";
5
- import path from "path";
6
- import { Constants } from "../../CliUtils.js";
7
- export var initScaffold = function() {
8
- var outputYaml = Constants.CONFIG_FILE_NAME;
9
- var outFile = path.join(process.cwd(), outputYaml);
10
- if (fs.existsSync(outFile)) {
11
- throw Error("Configuration file already present; please use to intialize a new config file.");
12
- }
13
- fs.writeFileSync(outFile, dump(releaseSchema));
14
- return "Your configuration file was created: ".concat(outputYaml);
15
- };
@@ -1 +0,0 @@
1
- export * from "./ScaffoldInit.js";
@@ -1,59 +0,0 @@
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
- }();