@solana-mobile/dapp-store-cli 0.4.2 → 0.5.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.
Files changed (112) hide show
  1. package/bin/dapp-store.js +1 -1
  2. package/lib/CliSetup.js +730 -0
  3. package/lib/CliUtils.js +309 -0
  4. package/lib/__tests__/CliSetupTest.js +140 -0
  5. package/lib/commands/ValidateCommand.js +201 -0
  6. package/lib/commands/create/CreateCliApp.js +240 -0
  7. package/lib/commands/create/CreateCliPublisher.js +238 -0
  8. package/lib/commands/create/CreateCliRelease.js +270 -0
  9. package/lib/commands/create/index.js +41 -0
  10. package/lib/{esm/commands → commands}/index.js +0 -1
  11. package/lib/commands/publish/PublishCliRemove.js +186 -0
  12. package/lib/commands/publish/PublishCliSubmit.js +192 -0
  13. package/lib/commands/publish/PublishCliSupport.js +186 -0
  14. package/lib/commands/publish/PublishCliUpdate.js +193 -0
  15. package/lib/commands/publish/index.js +22 -0
  16. package/lib/{esm/commands → commands}/scaffolding/ScaffoldInit.js +7 -6
  17. package/lib/{esm/commands → commands}/scaffolding/index.js +0 -1
  18. package/lib/config/EnvVariables.js +59 -0
  19. package/lib/config/PublishDetails.js +591 -0
  20. package/lib/config/S3StorageManager.js +93 -0
  21. package/lib/config/index.js +2 -0
  22. package/lib/generated/config_obj.json +1 -0
  23. package/lib/generated/config_schema.json +1 -0
  24. package/lib/index.js +148 -0
  25. package/lib/package.json +74 -0
  26. package/lib/prebuild_schema/publishing_source.yaml +46 -0
  27. package/lib/prebuild_schema/schemagen.js +20 -0
  28. package/lib/upload/CachedStorageDriver.js +307 -0
  29. package/lib/{esm/upload → upload}/index.js +0 -1
  30. package/package.json +21 -7
  31. package/src/CliSetup.ts +511 -0
  32. package/src/CliUtils.ts +64 -19
  33. package/src/__tests__/CliSetupTest.ts +212 -0
  34. package/src/commands/create/CreateCliApp.ts +6 -1
  35. package/src/commands/create/CreateCliPublisher.ts +6 -1
  36. package/src/commands/create/CreateCliRelease.ts +6 -1
  37. package/src/config/EnvVariables.ts +39 -0
  38. package/src/config/PublishDetails.ts +16 -2
  39. package/src/config/S3StorageManager.ts +47 -0
  40. package/src/config/index.ts +2 -0
  41. package/src/index.ts +3 -510
  42. package/lib/esm/CliUtils.js +0 -108
  43. package/lib/esm/CliUtils.js.map +0 -1
  44. package/lib/esm/commands/ValidateCommand.js +0 -42
  45. package/lib/esm/commands/ValidateCommand.js.map +0 -1
  46. package/lib/esm/commands/create/CreateCliApp.js +0 -41
  47. package/lib/esm/commands/create/CreateCliApp.js.map +0 -1
  48. package/lib/esm/commands/create/CreateCliPublisher.js +0 -36
  49. package/lib/esm/commands/create/CreateCliPublisher.js.map +0 -1
  50. package/lib/esm/commands/create/CreateCliRelease.js +0 -50
  51. package/lib/esm/commands/create/CreateCliRelease.js.map +0 -1
  52. package/lib/esm/commands/create/index.js +0 -44
  53. package/lib/esm/commands/create/index.js.map +0 -1
  54. package/lib/esm/commands/index.js.map +0 -1
  55. package/lib/esm/commands/publish/PublishCliRemove.js +0 -26
  56. package/lib/esm/commands/publish/PublishCliRemove.js.map +0 -1
  57. package/lib/esm/commands/publish/PublishCliSubmit.js +0 -31
  58. package/lib/esm/commands/publish/PublishCliSubmit.js.map +0 -1
  59. package/lib/esm/commands/publish/PublishCliSupport.js +0 -26
  60. package/lib/esm/commands/publish/PublishCliSupport.js.map +0 -1
  61. package/lib/esm/commands/publish/PublishCliUpdate.js +0 -32
  62. package/lib/esm/commands/publish/PublishCliUpdate.js.map +0 -1
  63. package/lib/esm/commands/publish/index.js +0 -25
  64. package/lib/esm/commands/publish/index.js.map +0 -1
  65. package/lib/esm/commands/scaffolding/ScaffoldInit.js.map +0 -1
  66. package/lib/esm/commands/scaffolding/index.js.map +0 -1
  67. package/lib/esm/config/PublishDetails.js +0 -177
  68. package/lib/esm/config/PublishDetails.js.map +0 -1
  69. package/lib/esm/generated/config_obj.json +0 -1
  70. package/lib/esm/generated/config_schema.json +0 -1
  71. package/lib/esm/index.js +0 -307
  72. package/lib/esm/index.js.map +0 -1
  73. package/lib/esm/package.json +0 -60
  74. package/lib/esm/upload/CachedStorageDriver.js +0 -66
  75. package/lib/esm/upload/CachedStorageDriver.js.map +0 -1
  76. package/lib/esm/upload/index.js.map +0 -1
  77. package/lib/types/CliUtils.d.ts +0 -21
  78. package/lib/types/CliUtils.d.ts.map +0 -1
  79. package/lib/types/commands/ValidateCommand.d.ts +0 -6
  80. package/lib/types/commands/ValidateCommand.d.ts.map +0 -1
  81. package/lib/types/commands/create/CreateCliApp.d.ts +0 -12
  82. package/lib/types/commands/create/CreateCliApp.d.ts.map +0 -1
  83. package/lib/types/commands/create/CreateCliPublisher.d.ts +0 -9
  84. package/lib/types/commands/create/CreateCliPublisher.d.ts.map +0 -1
  85. package/lib/types/commands/create/CreateCliRelease.d.ts +0 -13
  86. package/lib/types/commands/create/CreateCliRelease.d.ts.map +0 -1
  87. package/lib/types/commands/create/index.d.ts +0 -4
  88. package/lib/types/commands/create/index.d.ts.map +0 -1
  89. package/lib/types/commands/index.d.ts +0 -4
  90. package/lib/types/commands/index.d.ts.map +0 -1
  91. package/lib/types/commands/publish/PublishCliRemove.d.ts +0 -13
  92. package/lib/types/commands/publish/PublishCliRemove.d.ts.map +0 -1
  93. package/lib/types/commands/publish/PublishCliSubmit.d.ts +0 -13
  94. package/lib/types/commands/publish/PublishCliSubmit.d.ts.map +0 -1
  95. package/lib/types/commands/publish/PublishCliSupport.d.ts +0 -13
  96. package/lib/types/commands/publish/PublishCliSupport.d.ts.map +0 -1
  97. package/lib/types/commands/publish/PublishCliUpdate.d.ts +0 -14
  98. package/lib/types/commands/publish/PublishCliUpdate.d.ts.map +0 -1
  99. package/lib/types/commands/publish/index.d.ts +0 -5
  100. package/lib/types/commands/publish/index.d.ts.map +0 -1
  101. package/lib/types/commands/scaffolding/ScaffoldInit.d.ts +0 -2
  102. package/lib/types/commands/scaffolding/ScaffoldInit.d.ts.map +0 -1
  103. package/lib/types/commands/scaffolding/index.d.ts +0 -2
  104. package/lib/types/commands/scaffolding/index.d.ts.map +0 -1
  105. package/lib/types/config/PublishDetails.d.ts +0 -17
  106. package/lib/types/config/PublishDetails.d.ts.map +0 -1
  107. package/lib/types/index.d.ts +0 -2
  108. package/lib/types/index.d.ts.map +0 -1
  109. package/lib/types/upload/CachedStorageDriver.d.ts +0 -30
  110. package/lib/types/upload/CachedStorageDriver.d.ts.map +0 -1
  111. package/lib/types/upload/index.d.ts +0 -2
  112. package/lib/types/upload/index.d.ts.map +0 -1
package/lib/esm/index.js DELETED
@@ -1,307 +0,0 @@
1
- import { Command } from "commander";
2
- import { validateCommand } from "./commands/index.js";
3
- import { createAppCommand, createPublisherCommand, createReleaseCommand } from "./commands/create/index.js";
4
- import { publishRemoveCommand, publishSubmitCommand, publishSupportCommand, publishUpdateCommand } from "./commands/publish/index.js";
5
- import { checkForSelfUpdate, checkSubmissionNetwork, Constants, generateNetworkSuffix, parseKeypair, showMessage } from "./CliUtils.js";
6
- import * as dotenv from "dotenv";
7
- import { initScaffold } from "./commands/scaffolding/index.js";
8
- import { loadPublishDetails, loadPublishDetailsWithChecks } from "./config/PublishDetails.js";
9
- dotenv.config();
10
- const hasAddressInConfig = ({ address }) => {
11
- return !!address;
12
- };
13
- const program = new Command();
14
- function resolveBuildToolsPath(buildToolsPath) {
15
- // If a path was specified on the command line, use that
16
- if (buildToolsPath !== undefined) {
17
- return buildToolsPath;
18
- }
19
- // If a path is specified in a .env file, use that
20
- if (process.env.ANDROID_TOOLS_DIR !== undefined) {
21
- return process.env.ANDROID_TOOLS_DIR;
22
- }
23
- // No path was specified
24
- return;
25
- }
26
- /**
27
- * This method should be updated with each new release of the CLI, and just do nothing when there isn't anything to report
28
- */
29
- function latestReleaseMessage() {
30
- showMessage(`Publishing Tools Version ${Constants.CLI_VERSION}`, "- NOTE: In a future release, the maximum length for `short_description` will be reduced from 50 to 30 characters. We recommend updating all localized instances now.", "warning");
31
- }
32
- async function tryWithErrorMessage(block) {
33
- try {
34
- await block();
35
- }
36
- catch (e) {
37
- const errorMsg = e?.message ?? "";
38
- showMessage("Error", errorMsg, "error");
39
- }
40
- }
41
- async function main() {
42
- program
43
- .name("dapp-store")
44
- .version(Constants.CLI_VERSION)
45
- .description("CLI to assist with publishing to the Saga Dapp Store");
46
- const initCommand = program
47
- .command("init")
48
- .description("First-time initialization of tooling configuration")
49
- .action(async () => {
50
- tryWithErrorMessage(async () => {
51
- const msg = initScaffold();
52
- showMessage("Initialized", msg);
53
- });
54
- });
55
- const createCommand = program
56
- .command("create")
57
- .description("Create a `publisher`, `app`, or `release`");
58
- createCommand
59
- .command("publisher")
60
- .description("Create a publisher")
61
- .requiredOption("-k, --keypair <path-to-keypair-file>", "Path to keypair file")
62
- .option("-u, --url <url>", "RPC URL", Constants.DEFAULT_RPC_DEVNET)
63
- .option("-d, --dry-run", "Flag for dry run. Doesn't mint an NFT")
64
- .action(async ({ keypair, url, dryRun }) => {
65
- tryWithErrorMessage(async () => {
66
- latestReleaseMessage();
67
- await checkForSelfUpdate();
68
- const signer = parseKeypair(keypair);
69
- if (signer) {
70
- const result = await createPublisherCommand({ signer, url, dryRun });
71
- const displayUrl = `https://solscan.io/token/${result.publisherAddress}${generateNetworkSuffix(url)}`;
72
- const resultText = `Publisher NFT successfully minted:\n${displayUrl}`;
73
- showMessage("Success", resultText);
74
- }
75
- });
76
- });
77
- createCommand
78
- .command("app")
79
- .description("Create a app")
80
- .requiredOption("-k, --keypair <path-to-keypair-file>", "Path to keypair file")
81
- .option("-p, --publisher-mint-address <publisher-mint-address>", "The mint address of the publisher NFT")
82
- .option("-u, --url <url>", "RPC URL", Constants.DEFAULT_RPC_DEVNET)
83
- .option("-d, --dry-run", "Flag for dry run. Doesn't mint an NFT")
84
- .action(async ({ publisherMintAddress, keypair, url, dryRun }) => {
85
- tryWithErrorMessage(async () => {
86
- latestReleaseMessage();
87
- await checkForSelfUpdate();
88
- const config = await loadPublishDetailsWithChecks();
89
- if (!hasAddressInConfig(config.publisher) && !publisherMintAddress) {
90
- throw new Error("Either specify a publisher mint address in the config file or specify as a CLI argument to this command.");
91
- }
92
- const signer = parseKeypair(keypair);
93
- if (signer) {
94
- const result = await createAppCommand({
95
- publisherMintAddress: publisherMintAddress,
96
- signer,
97
- url,
98
- dryRun,
99
- });
100
- const displayUrl = `https://solscan.io/token/${result.appAddress}${generateNetworkSuffix(url)}`;
101
- const resultText = `App NFT successfully minted:\n${displayUrl}`;
102
- showMessage("Success", resultText);
103
- }
104
- });
105
- });
106
- createCommand
107
- .command("release")
108
- .description("Create a release")
109
- .requiredOption("-k, --keypair <path-to-keypair-file>", "Path to keypair file")
110
- .option("-a, --app-mint-address <app-mint-address>", "The mint address of the app NFT")
111
- .option("-u, --url <url>", "RPC URL", Constants.DEFAULT_RPC_DEVNET)
112
- .option("-d, --dry-run", "Flag for dry run. Doesn't mint an NFT")
113
- .option("-b, --build-tools-path <build-tools-path>", "Path to Android build tools which contains AAPT2")
114
- .action(async ({ appMintAddress, keypair, url, dryRun, buildToolsPath }) => {
115
- tryWithErrorMessage(async () => {
116
- latestReleaseMessage();
117
- await checkForSelfUpdate();
118
- const resolvedBuildToolsPath = resolveBuildToolsPath(buildToolsPath);
119
- if (resolvedBuildToolsPath === undefined) {
120
- throw new Error("Please specify an Android build tools directory in the .env file or via the command line argument.");
121
- }
122
- const config = await loadPublishDetailsWithChecks();
123
- if (!hasAddressInConfig(config.app) && !appMintAddress) {
124
- throw new Error("Either specify an app mint address in the config file or specify as a CLI argument to this command");
125
- }
126
- const signer = parseKeypair(keypair);
127
- if (signer) {
128
- const result = await createReleaseCommand({
129
- appMintAddress: appMintAddress,
130
- buildToolsPath: resolvedBuildToolsPath,
131
- signer,
132
- url,
133
- dryRun,
134
- });
135
- const displayUrl = `https://solscan.io/token/${result?.releaseAddress}${generateNetworkSuffix(url)}`;
136
- const resultText = `Release NFT successfully minted:\n${displayUrl}`;
137
- showMessage("Success", resultText);
138
- }
139
- });
140
- });
141
- program
142
- .command("validate")
143
- .description("Validates details prior to publishing")
144
- .requiredOption("-k, --keypair <path-to-keypair-file>", "Path to keypair file")
145
- .option("-b, --build-tools-path <build-tools-path>", "Path to Android build tools which contains AAPT2")
146
- .action(async ({ keypair, buildToolsPath }) => {
147
- tryWithErrorMessage(async () => {
148
- latestReleaseMessage();
149
- await checkForSelfUpdate();
150
- const resolvedBuildToolsPath = resolveBuildToolsPath(buildToolsPath);
151
- if (resolvedBuildToolsPath === undefined) {
152
- throw new Error("Please specify an Android build tools directory in the .env file or via the command line argument.");
153
- }
154
- const signer = parseKeypair(keypair);
155
- if (signer) {
156
- await validateCommand({
157
- signer,
158
- buildToolsPath: resolvedBuildToolsPath,
159
- });
160
- //TODO: Add pretty formatting here, but will require more work than other sections
161
- }
162
- });
163
- });
164
- const publishCommand = program
165
- .command("publish")
166
- .description("Submit a publishing request (`submit`, `update`, `remove`, or `support`) to the Solana Mobile dApp publisher portal");
167
- publishCommand
168
- .command("submit")
169
- .description("Submit a new app to the Solana Mobile dApp publisher portal")
170
- .requiredOption("-k, --keypair <path-to-keypair-file>", "Path to keypair file")
171
- .requiredOption("--complies-with-solana-dapp-store-policies", "An attestation that the app complies with the Solana dApp Store policies")
172
- .requiredOption("--requestor-is-authorized", "An attestation that the party making this Solana dApp publisher portal request is authorized to do so")
173
- .option("-a, --app-mint-address <app-mint-address>", "The mint address of the app NFT. If not specified, the value from your config file will be used.")
174
- .option("-r, --release-mint-address <release-mint-address>", "The mint address of the release NFT. If not specified, the value from your config file will be used.")
175
- .option("-u, --url <url>", "RPC URL", Constants.DEFAULT_RPC_DEVNET)
176
- .option("-d, --dry-run", "Flag for dry run. Doesn't submit the request to the publisher portal.")
177
- .action(async ({ appMintAddress, releaseMintAddress, keypair, url, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, dryRun, }) => {
178
- tryWithErrorMessage(async () => {
179
- await checkForSelfUpdate();
180
- await checkSubmissionNetwork(url);
181
- const config = await loadPublishDetails(Constants.getConfigFilePath());
182
- if (!hasAddressInConfig(config.release) && !releaseMintAddress) {
183
- throw new Error("Either specify a release mint address in the config file or specify as a CLI argument to this command.");
184
- }
185
- const signer = parseKeypair(keypair);
186
- if (signer) {
187
- await publishSubmitCommand({
188
- appMintAddress,
189
- releaseMintAddress,
190
- signer,
191
- url,
192
- dryRun,
193
- compliesWithSolanaDappStorePolicies,
194
- requestorIsAuthorized,
195
- });
196
- const resultText = "Successfully submitted to the Solana Mobile dApp publisher portal";
197
- showMessage("Success", resultText);
198
- }
199
- });
200
- });
201
- publishCommand
202
- .command("update")
203
- .description("Update an existing app on the Solana Mobile dApp publisher portal")
204
- .requiredOption("-k, --keypair <path-to-keypair-file>", "Path to keypair file")
205
- .requiredOption("--complies-with-solana-dapp-store-policies", "An attestation that the app complies with the Solana dApp Store policies")
206
- .requiredOption("--requestor-is-authorized", "An attestation that the party making this Solana dApp publisher portal request is authorized to do so")
207
- .option("-a, --app-mint-address <app-mint-address>", "The mint address of the app NFT. If not specified, the value from your config file will be used.")
208
- .option("-r, --release-mint-address <release-mint-address>", "The mint address of the release NFT. If not specified, the value from your config file will be used.")
209
- .option("-c, --critical", "Flag for a critical app update request")
210
- .option("-u, --url <url>", "RPC URL", Constants.DEFAULT_RPC_DEVNET)
211
- .option("-d, --dry-run", "Flag for dry run. Doesn't submit the request to the publisher portal.")
212
- .action(async ({ appMintAddress, releaseMintAddress, keypair, url, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, critical, dryRun, }) => {
213
- tryWithErrorMessage(async () => {
214
- await checkForSelfUpdate();
215
- await checkSubmissionNetwork(url);
216
- const config = await loadPublishDetails(Constants.getConfigFilePath());
217
- if (!hasAddressInConfig(config.release) && !releaseMintAddress) {
218
- throw new Error("Either specify a release mint address in the config file or specify as a CLI argument to this command.");
219
- }
220
- const signer = parseKeypair(keypair);
221
- if (signer) {
222
- await publishUpdateCommand({
223
- appMintAddress,
224
- releaseMintAddress,
225
- signer,
226
- url,
227
- dryRun,
228
- compliesWithSolanaDappStorePolicies,
229
- requestorIsAuthorized,
230
- critical,
231
- });
232
- const resultText = "dApp successfully updated on the publisher portal";
233
- showMessage("Success", resultText);
234
- }
235
- });
236
- });
237
- publishCommand
238
- .command("remove")
239
- .description("Remove an existing app from the Solana Mobile dApp publisher portal")
240
- .requiredOption("-k, --keypair <path-to-keypair-file>", "Path to keypair file")
241
- .requiredOption("--requestor-is-authorized", "An attestation that the party making this Solana dApp publisher portal request is authorized to do so")
242
- .option("-a, --app-mint-address <app-mint-address>", "The mint address of the app NFT. If not specified, the value from your config file will be used.")
243
- .option("-r, --release-mint-address <release-mint-address>", "The mint address of the release NFT. If not specified, the value from your config file will be used.")
244
- .option("-c, --critical", "Flag for a critical app removal request")
245
- .option("-u, --url <url>", "RPC URL", Constants.DEFAULT_RPC_DEVNET)
246
- .option("-d, --dry-run", "Flag for dry run. Doesn't submit the request to the publisher portal.")
247
- .action(async ({ appMintAddress, releaseMintAddress, keypair, url, requestorIsAuthorized, critical, dryRun, }) => {
248
- tryWithErrorMessage(async () => {
249
- await checkForSelfUpdate();
250
- await checkSubmissionNetwork(url);
251
- const config = await loadPublishDetails(Constants.getConfigFilePath());
252
- if (!hasAddressInConfig(config.release) && !releaseMintAddress) {
253
- throw new Error("Either specify a release mint address in the config file or specify as a CLI argument to this command.");
254
- }
255
- const signer = parseKeypair(keypair);
256
- if (signer) {
257
- await publishRemoveCommand({
258
- appMintAddress,
259
- releaseMintAddress,
260
- signer,
261
- url,
262
- dryRun,
263
- requestorIsAuthorized,
264
- critical,
265
- });
266
- const resultText = "dApp successfully removed from the publisher portal";
267
- showMessage("Success", resultText);
268
- }
269
- });
270
- });
271
- publishCommand
272
- .command("support <request_details>")
273
- .description("Submit a support request for an existing app on the Solana Mobile dApp publisher portal")
274
- .requiredOption("-k, --keypair <path-to-keypair-file>", "Path to keypair file")
275
- .requiredOption("--requestor-is-authorized", "An attestation that the party making this Solana dApp publisher portal request is authorized to do so")
276
- .option("-a, --app-mint-address <app-mint-address>", "The mint address of the app NFT. If not specified, the value from your config file will be used.")
277
- .option("-r, --release-mint-address <release-mint-address>", "The mint address of the release NFT. If not specified, the value from your config file will be used.")
278
- .option("-u, --url <url>", "RPC URL", Constants.DEFAULT_RPC_DEVNET)
279
- .option("-d, --dry-run", "Flag for dry run. Doesn't submit the request to the publisher portal.")
280
- .action(async (requestDetails, { appMintAddress, releaseMintAddress, keypair, url, requestorIsAuthorized, dryRun }) => {
281
- tryWithErrorMessage(async () => {
282
- await checkForSelfUpdate();
283
- await checkSubmissionNetwork(url);
284
- const config = await loadPublishDetails(Constants.getConfigFilePath());
285
- if (!hasAddressInConfig(config.release) && !releaseMintAddress) {
286
- throw new Error("Either specify a release mint address in the config file or specify as a CLI argument to this command.");
287
- }
288
- const signer = parseKeypair(keypair);
289
- if (signer) {
290
- await publishSupportCommand({
291
- appMintAddress,
292
- releaseMintAddress,
293
- signer,
294
- url,
295
- dryRun,
296
- requestorIsAuthorized,
297
- requestDetails,
298
- });
299
- const resultText = "Support request sent successfully";
300
- showMessage("Success", resultText);
301
- }
302
- });
303
- });
304
- await program.parseAsync(process.argv);
305
- }
306
- main();
307
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAC5G,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,SAAS,EACT,qBAAqB,EACrB,YAAY,EACZ,WAAW,EACZ,MAAM,eAAe,CAAC;AAIvB,OAAO,KAAK,MAAM,MAAM,QAAQ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MAAM,CACL,eAAe,EACf,uEAAuE,CACxE;SACA,MAAM,CACL,KAAK,EACH,cAAc,EACd,EAAE,cAAc,EAAE,kBAAkB,EAAE,OAAO,EAAE,GAAG,EAAE,qBAAqB,EAAE,MAAM,EAAE,EACnF,EAAE;QACF,mBAAmB,CAAC,KAAK,IAAI,EAAE;YAC7B,MAAM,kBAAkB,EAAE,CAAC;YAC3B,MAAM,sBAAsB,CAAC,GAAG,CAAC,CAAC;YAElC,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,SAAS,CAAC,iBAAiB,EAAE,CAAC,CAAA;YAEtE,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE;gBAC9D,MAAM,IAAI,KAAK,CAAC,wGAAwG,CAAC,CAAA;aAC1H;YAED,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;YACrC,IAAI,MAAM,EAAE;gBACV,MAAM,qBAAqB,CAAC;oBAC1B,cAAc;oBACd,kBAAkB;oBAClB,MAAM;oBACN,GAAG;oBACH,MAAM;oBACN,qBAAqB;oBACrB,cAAc;iBACf,CAAC,CAAC;gBAEH,MAAM,UAAU,GAAG,mCAAmC,CAAC;gBACvD,WAAW,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;aACpC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CACF,CAAC;IAEJ,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC;AACD,IAAI,EAAE,CAAC"}
@@ -1,60 +0,0 @@
1
- {
2
- "name": "@solana-mobile/dapp-store-cli",
3
- "version": "0.4.2",
4
- "license": "Apache-2.0",
5
- "type": "module",
6
- "sideEffects": false,
7
- "main": "./lib/cjs/index.js",
8
- "module": "./lib/esm/index.js",
9
- "types": "./lib/types/index.d.ts",
10
- "engines": {
11
- "node": ">=18"
12
- },
13
- "exports": {
14
- "import": "./lib/esm/index.js",
15
- "require": "./lib/cjs/index.js",
16
- "types": "./lib/types/index.d.ts"
17
- },
18
- "bin": {
19
- "dapp-store": "./bin/dapp-store.js"
20
- },
21
- "files": [
22
- "lib",
23
- "src",
24
- "LICENSE"
25
- ],
26
- "publishConfig": {
27
- "access": "public"
28
- },
29
- "scripts": {
30
- "clean": "shx mkdir -p lib && shx rm -rf lib",
31
- "prebuild": "pnpm run clean && node src/prebuild_schema/schemagen.js"
32
- },
33
- "devDependencies": {
34
- "@metaplex-foundation/js": "0.17.11",
35
- "@types/commander": "^2.12.2",
36
- "@types/debug": "^4.1.7",
37
- "@types/js-yaml": "^4.0.5",
38
- "@types/terminal-link": "^1.2.0",
39
- "@types/update-notifier": "^6.0.1",
40
- "shx": "^0.3.4"
41
- },
42
- "dependencies": {
43
- "@solana-mobile/dapp-store-publishing-tools": "workspace:0.4.2",
44
- "@solana/web3.js": "1.68.0",
45
- "@types/semver": "^7.3.13",
46
- "ajv": "^8.11.0",
47
- "boxen": "^7.0.1",
48
- "commander": "^9.4.1",
49
- "debug": "^4.3.4",
50
- "dotenv": "^16.0.3",
51
- "esm": "^3.2.25",
52
- "generate-schema": "^2.6.0",
53
- "image-size": "^1.0.2",
54
- "js-yaml": "^4.1.0",
55
- "semver": "^7.3.8",
56
- "terminal-link": "^3.0.0",
57
- "tweetnacl": "1.0.3",
58
- "update-notifier": "^6.0.2"
59
- }
60
- }
@@ -1,66 +0,0 @@
1
- import fs from "fs";
2
- import { createHash } from "crypto";
3
- // TODO(jon): We need to manage the removal / replacement of assets in the manifest
4
- export class CachedStorageDriver {
5
- constructor(storageDriver, { assetManifestPath }) {
6
- this.assetManifestPath = assetManifestPath;
7
- console.info({ loading: true });
8
- this.assetManifest = this.loadAssetManifest(assetManifestPath) ?? {
9
- schema_version: CachedStorageDriver.SCHEMA_VERSION,
10
- assets: {},
11
- };
12
- this.storageDriver = storageDriver;
13
- }
14
- async getUploadPrice(bytes) {
15
- return this.storageDriver.getUploadPrice(bytes);
16
- }
17
- loadAssetManifest(filename) {
18
- try {
19
- return JSON.parse(fs.readFileSync(filename, "utf-8"));
20
- }
21
- catch (error) {
22
- console.warn(`Failed opening ${filename}; initializing with a blank asset manifest`);
23
- return;
24
- }
25
- }
26
- uploadedAsset(filename, { sha256 }) {
27
- if (this.assetManifest.assets[filename]?.sha256 === sha256) {
28
- return this.assetManifest.assets[filename];
29
- }
30
- return null;
31
- }
32
- async upload(file) {
33
- // `inline.json` is the NFT-related metadata. This data is not stable so we'll skip the caching step
34
- if (file.fileName === "inline.json") {
35
- return await this.storageDriver.upload(file);
36
- }
37
- const hash = createHash("sha256").update(file.buffer).digest("base64");
38
- console.info(JSON.stringify({
39
- file: {
40
- name: file.fileName,
41
- disn: file.displayName,
42
- un: file.uniqueName,
43
- },
44
- }));
45
- const uploadedAsset = this.uploadedAsset(file.fileName, { sha256: hash });
46
- if (uploadedAsset) {
47
- console.log(`Asset ${file.fileName} already uploaded at ${uploadedAsset.uri}`);
48
- return uploadedAsset.uri;
49
- }
50
- console.log(`Uploading ${file.fileName}`);
51
- const uri = await this.storageDriver.upload(file);
52
- this.assetManifest.assets[file.fileName] = {
53
- path: file.fileName,
54
- sha256: hash,
55
- uri,
56
- };
57
- await fs.promises.writeFile(`${process.cwd()}/${this.assetManifestPath}`,
58
- // Something is really weird, I can't seem to stringify `this.assetManifest` straight-up. Here be dragons
59
- JSON.stringify({ assets: { ...this.assetManifest.assets } }, null, 2), "utf-8");
60
- return uri;
61
- }
62
- }
63
- // NOTE: this schema version is independent of the publishing JSON schema. It should be updated
64
- // when the AssetManifestSchema or Asset types are updated.
65
- CachedStorageDriver.SCHEMA_VERSION = "0.1";
66
- //# sourceMappingURL=CachedStorageDriver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CachedStorageDriver.js","sourceRoot":"","sources":["../../../src/upload/CachedStorageDriver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,EAAE,UAAU,EAAE,MAAM,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AAG,CAAC;IACb,CAAC;;AApFD,+FAA+F;AAC/F,2DAA2D;AAC3C,kCAAc,GAAG,KAAK,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/upload/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
@@ -1,21 +0,0 @@
1
- import type { Connection } from "@solana/web3.js";
2
- import { Keypair } from "@solana/web3.js";
3
- import debugModule from "debug";
4
- import { Metaplex } from "@metaplex-foundation/js";
5
- export declare class Constants {
6
- static CLI_VERSION: string;
7
- static CONFIG_FILE_NAME: string;
8
- static DEFAULT_RPC_DEVNET: string;
9
- static getConfigFilePath: () => string;
10
- }
11
- export declare const debug: debugModule.Debugger;
12
- export declare const checkForSelfUpdate: () => Promise<void>;
13
- export declare const checkMintedStatus: (conn: Connection, pubAddr: string, appAddr: string, releaseAddr: string) => Promise<void>;
14
- export declare const parseKeypair: (pathToKeypairFile: string) => Keypair | undefined;
15
- export declare const isDevnet: (rpcUrl: string) => boolean;
16
- export declare const isTestnet: (rpcUrl: string) => boolean;
17
- export declare const checkSubmissionNetwork: (rpcUrl: string) => void;
18
- export declare const generateNetworkSuffix: (rpcUrl: string) => string;
19
- export declare const showMessage: (titleMessage?: string, contentMessage?: string, type?: "standard" | "error" | "warning") => string;
20
- export declare const getMetaplexInstance: (connection: Connection, keypair: Keypair) => Metaplex;
21
- //# sourceMappingURL=CliUtils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CliUtils.d.ts","sourceRoot":"","sources":["../../src/CliUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAa,MAAM,iBAAiB,CAAC;AACrD,OAAO,WAAW,MAAM,OAAO,CAAC;AAChC,OAAO,EAAwC,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAOzF,qBAAa,SAAS;IACpB,MAAM,CAAC,WAAW,SAAW;IAC7B,MAAM,CAAC,gBAAgB,SAAiB;IACxC,MAAM,CAAC,kBAAkB,SAAmC;IAE5D,MAAM,CAAC,iBAAiB,eAEtB;CACH;AAED,eAAO,MAAM,KAAK,sBAAqB,CAAC;AAExC,eAAO,MAAM,kBAAkB,qBAU9B,CAAC;AAEF,eAAO,MAAM,iBAAiB,SAAgB,UAAU,WAAW,MAAM,WAAW,MAAM,eAAe,MAAM,kBAW9G,CAAC;AAEF,eAAO,MAAM,YAAY,sBAAuB,MAAM,wBAYrD,CAAC;AAEF,eAAO,MAAM,QAAQ,WAAY,MAAM,KAAG,OAEzC,CAAC;AAEF,eAAO,MAAM,SAAS,WAAY,MAAM,KAAG,OAE1C,CAAC;AAEF,eAAO,MAAM,sBAAsB,WAAY,MAAM,SAIpD,CAAC;AAEF,eAAO,MAAM,qBAAqB,WAAY,MAAM,KAAG,MAYtD,CAAC;AAEF,eAAO,MAAM,WAAW,0DAGhB,UAAU,GAAG,OAAO,GAAG,SAAS,KACrC,MAoBF,CAAC;AAEF,eAAO,MAAM,mBAAmB,eAClB,UAAU,WACb,OAAO,aAoBjB,CAAC"}
@@ -1,6 +0,0 @@
1
- import type { Keypair } from "@solana/web3.js";
2
- export declare const validateCommand: ({ signer, buildToolsPath, }: {
3
- signer: Keypair;
4
- buildToolsPath?: string | undefined;
5
- }) => Promise<void>;
6
- //# sourceMappingURL=ValidateCommand.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ValidateCommand.d.ts","sourceRoot":"","sources":["../../../src/commands/ValidateCommand.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAK/C,eAAO,MAAM,eAAe;YAIlB,OAAO;;mBAmDhB,CAAC"}
@@ -1,12 +0,0 @@
1
- import { Keypair } from "@solana/web3.js";
2
- declare type CreateAppCommandInput = {
3
- publisherMintAddress: string;
4
- signer: Keypair;
5
- url: string;
6
- dryRun?: boolean;
7
- };
8
- export declare const createAppCommand: ({ signer, url, dryRun, publisherMintAddress, }: CreateAppCommandInput) => Promise<{
9
- appAddress: string;
10
- }>;
11
- export {};
12
- //# sourceMappingURL=CreateCliApp.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CreateCliApp.d.ts","sourceRoot":"","sources":["../../../../src/commands/create/CreateCliApp.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,OAAO,EAGR,MAAM,iBAAiB,CAAC;AAiDzB,aAAK,qBAAqB,GAAG;IAC3B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,gBAAgB,mDAK1B,qBAAqB;;EAqBvB,CAAC"}
@@ -1,9 +0,0 @@
1
- import { Keypair } from "@solana/web3.js";
2
- export declare const createPublisherCommand: ({ signer, url, dryRun, }: {
3
- signer: Keypair;
4
- url: string;
5
- dryRun: boolean;
6
- }) => Promise<{
7
- publisherAddress: string;
8
- }>;
9
- //# sourceMappingURL=CreateCliPublisher.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CreateCliPublisher.d.ts","sourceRoot":"","sources":["../../../../src/commands/create/CreateCliPublisher.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,OAAO,EAER,MAAM,iBAAiB,CAAC;AA8CzB,eAAO,MAAM,sBAAsB;YAKzB,OAAO;SACV,MAAM;YACH,OAAO;;;EAmBhB,CAAC"}
@@ -1,13 +0,0 @@
1
- import { Keypair } from "@solana/web3.js";
2
- declare type CreateReleaseCommandInput = {
3
- appMintAddress: string;
4
- buildToolsPath: string;
5
- signer: Keypair;
6
- url: string;
7
- dryRun?: boolean;
8
- };
9
- export declare const createReleaseCommand: ({ appMintAddress, buildToolsPath, signer, url, dryRun, }: CreateReleaseCommandInput) => Promise<{
10
- releaseAddress: string;
11
- } | undefined>;
12
- export {};
13
- //# sourceMappingURL=CreateCliRelease.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CreateCliRelease.d.ts","sourceRoot":"","sources":["../../../../src/commands/create/CreateCliRelease.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,OAAO,EAGR,MAAM,iBAAiB,CAAC;AAMzB,aAAK,yBAAyB,GAAG;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAkDF,eAAO,MAAM,oBAAoB,6DAM9B,yBAAyB;;cAuB3B,CAAC"}
@@ -1,4 +0,0 @@
1
- export * from "./CreateCliPublisher.js";
2
- export * from "./CreateCliApp.js";
3
- export * from "./CreateCliRelease.js";
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/create/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC"}
@@ -1,4 +0,0 @@
1
- export * from "./create/index.js";
2
- export * from "./publish/index.js";
3
- export * from "./ValidateCommand.js";
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
@@ -1,13 +0,0 @@
1
- import { Keypair } from "@solana/web3.js";
2
- declare type PublishRemoveCommandInput = {
3
- appMintAddress: string;
4
- releaseMintAddress: string;
5
- signer: Keypair;
6
- url: string;
7
- dryRun: boolean;
8
- requestorIsAuthorized: boolean;
9
- critical: boolean;
10
- };
11
- export declare const publishRemoveCommand: ({ appMintAddress, releaseMintAddress, signer, url, dryRun, requestorIsAuthorized, critical, }: PublishRemoveCommandInput) => Promise<void>;
12
- export {};
13
- //# sourceMappingURL=PublishCliRemove.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PublishCliRemove.d.ts","sourceRoot":"","sources":["../../../../src/commands/publish/PublishCliRemove.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAOtD,aAAK,yBAAyB,GAAG;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,OAAO,CAAC;IAChB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,oBAAoB,kGAQ9B,yBAAyB,kBAmC3B,CAAC"}
@@ -1,13 +0,0 @@
1
- import { Keypair } from "@solana/web3.js";
2
- declare type PublishSubmitCommandInput = {
3
- appMintAddress: string;
4
- releaseMintAddress: string;
5
- signer: Keypair;
6
- url: string;
7
- dryRun: boolean;
8
- compliesWithSolanaDappStorePolicies: boolean;
9
- requestorIsAuthorized: boolean;
10
- };
11
- export declare const publishSubmitCommand: ({ appMintAddress, releaseMintAddress, signer, url, dryRun, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, }: PublishSubmitCommandInput) => Promise<void>;
12
- export {};
13
- //# sourceMappingURL=PublishCliSubmit.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PublishCliSubmit.d.ts","sourceRoot":"","sources":["../../../../src/commands/publish/PublishCliSubmit.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,OAAO,EAAa,MAAM,iBAAiB,CAAC;AAQ9E,aAAK,yBAAyB,GAAG;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,OAAO,CAAC;IAChB,mCAAmC,EAAE,OAAO,CAAC;IAC7C,qBAAqB,EAAE,OAAO,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,oBAAoB,6HAQ9B,yBAAyB,kBA0C3B,CAAC"}
@@ -1,13 +0,0 @@
1
- import { Keypair } from "@solana/web3.js";
2
- declare type PublishSupportCommandInput = {
3
- appMintAddress: string;
4
- releaseMintAddress: string;
5
- signer: Keypair;
6
- url: string;
7
- dryRun: boolean;
8
- requestorIsAuthorized: boolean;
9
- requestDetails: string;
10
- };
11
- export declare const publishSupportCommand: ({ appMintAddress, releaseMintAddress, signer, url, dryRun, requestorIsAuthorized, requestDetails, }: PublishSupportCommandInput) => Promise<void>;
12
- export {};
13
- //# sourceMappingURL=PublishCliSupport.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PublishCliSupport.d.ts","sourceRoot":"","sources":["../../../../src/commands/publish/PublishCliSupport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAOtD,aAAK,0BAA0B,GAAG;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,OAAO,CAAC;IAChB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,qBAAqB,wGAQ/B,0BAA0B,kBAmC5B,CAAC"}