@solana-mobile/dapp-store-cli 0.1.1-0 → 0.1.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 (43) hide show
  1. package/README.md +27 -25
  2. package/bin/dapp-store.js +1 -1
  3. package/lib/esm/commands/create/release.js +2 -3
  4. package/lib/esm/commands/create/release.js.map +1 -1
  5. package/lib/esm/commands/publish/remove.js +2 -2
  6. package/lib/esm/commands/publish/remove.js.map +1 -1
  7. package/lib/esm/commands/publish/submit.js +2 -2
  8. package/lib/esm/commands/publish/submit.js.map +1 -1
  9. package/lib/esm/commands/publish/support.js +2 -2
  10. package/lib/esm/commands/publish/support.js.map +1 -1
  11. package/lib/esm/commands/publish/update.js +2 -2
  12. package/lib/esm/commands/publish/update.js.map +1 -1
  13. package/lib/esm/config/index.js.map +1 -1
  14. package/lib/esm/config/schema.json +11 -40
  15. package/lib/esm/index.js +133 -123
  16. package/lib/esm/index.js.map +1 -1
  17. package/lib/esm/upload/CachedStorageDriver.js +3 -1
  18. package/lib/esm/upload/CachedStorageDriver.js.map +1 -1
  19. package/lib/esm/utils.js +16 -28
  20. package/lib/esm/utils.js.map +1 -1
  21. package/lib/types/commands/create/release.d.ts +1 -2
  22. package/lib/types/commands/create/release.d.ts.map +1 -1
  23. package/lib/types/commands/publish/remove.d.ts.map +1 -1
  24. package/lib/types/commands/publish/submit.d.ts.map +1 -1
  25. package/lib/types/commands/publish/support.d.ts.map +1 -1
  26. package/lib/types/commands/publish/update.d.ts.map +1 -1
  27. package/lib/types/config/index.d.ts +0 -1
  28. package/lib/types/config/index.d.ts.map +1 -1
  29. package/lib/types/upload/CachedStorageDriver.d.ts +1 -1
  30. package/lib/types/upload/CachedStorageDriver.d.ts.map +1 -1
  31. package/lib/types/utils.d.ts +2 -4
  32. package/lib/types/utils.d.ts.map +1 -1
  33. package/package.json +2 -2
  34. package/src/commands/create/release.ts +1 -4
  35. package/src/commands/publish/remove.ts +5 -2
  36. package/src/commands/publish/submit.ts +2 -1
  37. package/src/commands/publish/support.ts +5 -2
  38. package/src/commands/publish/update.ts +2 -1
  39. package/src/config/index.ts +1 -2
  40. package/src/config/schema.json +11 -40
  41. package/src/index.ts +162 -155
  42. package/src/upload/CachedStorageDriver.ts +4 -1
  43. package/src/utils.ts +21 -54
@@ -1 +1 @@
1
- {"version":3,"file":"CachedStorageDriver.d.ts","sourceRoot":"","sources":["../../../src/upload/CachedStorageDriver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG3E,aAAK,GAAG,GAAG,MAAM,CAAC;AAElB,aAAK,KAAK,GAAG;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,GAAG,CAAC;CACV,CAAC;AAEF,oBAAY,mBAAmB,GAAG;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE;QACN,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;KACvB,CAAC;CACH,CAAC;AAGF,qBAAa,mBAAoB,YAAW,aAAa;IACvD,MAAM,CAAC,QAAQ,CAAC,cAAc,WAAW;IACzC,aAAa,EAAE,mBAAmB,CAAC;IACnC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,aAAa,CAAC;gBAG3B,aAAa,EAAE,aAAa,EAC5B,EAAE,iBAAiB,EAAE,EAAE;QAAE,iBAAiB,EAAE,MAAM,CAAA;KAAE;IAWhD,cAAc,CAAC,KAAK,EAAE,MAAM;IAIlC,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS;IAWpE,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE;IAOxD,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;CA0ClD"}
1
+ {"version":3,"file":"CachedStorageDriver.d.ts","sourceRoot":"","sources":["../../../src/upload/CachedStorageDriver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG3E,aAAK,GAAG,GAAG,MAAM,CAAC;AAElB,aAAK,KAAK,GAAG;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,GAAG,CAAC;CACV,CAAC;AAEF,oBAAY,mBAAmB,GAAG;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE;QACN,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;KACvB,CAAC;CACH,CAAC;AAGF,qBAAa,mBAAoB,YAAW,aAAa;IAGvD,MAAM,CAAC,QAAQ,CAAC,cAAc,SAAS;IAEvC,aAAa,EAAE,mBAAmB,CAAC;IACnC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,aAAa,CAAC;gBAG3B,aAAa,EAAE,aAAa,EAC5B,EAAE,iBAAiB,EAAE,EAAE;QAAE,iBAAiB,EAAE,MAAM,CAAA;KAAE;IAWhD,cAAc,CAAC,KAAK,EAAE,MAAM;IAIlC,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS;IAWpE,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE;IAOxD,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;CA0ClD"}
@@ -6,14 +6,12 @@ import debugModule from "debug";
6
6
  import { Metaplex } from "@metaplex-foundation/js";
7
7
  export declare const debug: debugModule.Debugger;
8
8
  export declare const parseKeypair: (pathToKeypairFile: string) => Keypair | undefined;
9
- export declare const getConfigFile: (buildToolsDir?: string | null) => Promise<CLIConfig & {
10
- isValid: boolean;
11
- }>;
9
+ export declare const getConfigFile: (buildToolsDir?: string | null) => Promise<CLIConfig>;
12
10
  export declare const showUserErrorMessage: (msg: string) => void;
13
11
  declare type SaveToConfigArgs = {
14
12
  publisher?: Pick<Publisher, "address">;
15
13
  app?: Pick<App, "address">;
16
- release?: Pick<Release, "address" | "version">;
14
+ release?: Pick<Release, "address">;
17
15
  };
18
16
  export declare const saveToConfig: ({ publisher, app, release, }: SaveToConfigArgs) => Promise<void>;
19
17
  export declare const getMetaplexInstance: (connection: Connection, keypair: Keypair) => Metaplex;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,GAAG,EACH,SAAS,EACT,OAAO,EACR,MAAM,4CAA4C,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,WAAW,MAAM,OAAO,CAAC;AAKhC,OAAO,EAGL,QAAQ,EAET,MAAM,yBAAyB,CAAC;AAQjC,eAAO,MAAM,KAAK,sBAAqB,CAAC;AAExC,eAAO,MAAM,YAAY,sBAAuB,MAAM,wBASrD,CAAC;AAaF,eAAO,MAAM,aAAa,mBACT,MAAM,GAAG,IAAI,KAC3B,QAAQ,SAAS,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CA6F1C,CAAC;AAYF,eAAO,MAAM,oBAAoB,QAAS,MAAM,SAI/C,CAAC;AAoDF,aAAK,gBAAgB,GAAG;IACtB,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACvC,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IAC3B,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,GAAG,SAAS,CAAC,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,YAAY,iCAItB,gBAAgB,kBA2BlB,CAAC;AAEF,eAAO,MAAM,mBAAmB,eAClB,UAAU,WACb,OAAO,aAiBjB,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkB,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,4CAA4C,CAAC;AAC1G,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,WAAW,MAAM,OAAO,CAAC;AAKhC,OAAO,EAAwC,QAAQ,EAAkB,MAAM,yBAAyB,CAAC;AAQzG,eAAO,MAAM,KAAK,sBAAqB,CAAC;AAExC,eAAO,MAAM,YAAY,sBAAuB,MAAM,wBASrD,CAAC;AAaF,eAAO,MAAM,aAAa,mBACT,MAAM,GAAG,IAAI,KAC3B,QAAQ,SAAS,CAmEnB,CAAC;AAYF,eAAO,MAAM,oBAAoB,QAAS,MAAM,SAI/C,CAAC;AAsDF,aAAK,gBAAgB,GAAG;IACtB,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACvC,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IAC3B,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,YAAY,iCAItB,gBAAgB,kBAyBlB,CAAC;AAEF,eAAO,MAAM,mBAAmB,eAClB,UAAU,WACb,OAAO,aAoBjB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana-mobile/dapp-store-cli",
3
- "version": "0.1.1-0",
3
+ "version": "0.1.1",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -31,7 +31,7 @@
31
31
  "shx": "^0.3.4"
32
32
  },
33
33
  "dependencies": {
34
- "@solana-mobile/dapp-store-publishing-tools": "^0.1.0",
34
+ "@solana-mobile/dapp-store-publishing-tools": "0.1.1",
35
35
  "@solana/web3.js": "1.68.0",
36
36
  "ajv": "^8.11.0",
37
37
  "commander": "^9.4.1",
@@ -20,7 +20,6 @@ import {
20
20
 
21
21
  type CreateReleaseCommandInput = {
22
22
  appMintAddress: string;
23
- version: string;
24
23
  buildToolsPath: string;
25
24
  signer: Keypair;
26
25
  url: string;
@@ -75,7 +74,6 @@ const createReleaseNft = async ({
75
74
 
76
75
  export const createReleaseCommand = async ({
77
76
  appMintAddress,
78
- version,
79
77
  buildToolsPath,
80
78
  signer,
81
79
  url,
@@ -92,14 +90,13 @@ export const createReleaseCommand = async ({
92
90
  publisher: signer,
93
91
  releaseDetails: {
94
92
  ...release,
95
- version,
96
93
  },
97
94
  appDetails: app,
98
95
  publisherDetails: publisher,
99
96
  });
100
97
 
101
98
  saveToConfig({
102
- release: { address: releaseAddress, version },
99
+ release: { address: releaseAddress },
103
100
  });
104
101
 
105
102
  return { releaseAddress };
@@ -29,14 +29,17 @@ export const publishRemoveCommand = async ({
29
29
  }
30
30
 
31
31
  const connection = new Connection(url);
32
- const { publisher: publisherDetails } = await getConfigFile();
32
+ const {
33
+ publisher: publisherDetails,
34
+ release: releaseDetails,
35
+ } = await getConfigFile();
33
36
  const sign = ((buf: Buffer) =>
34
37
  nacl.sign(buf, signer.secretKey)) as SignWithPublisherKeypair;
35
38
 
36
39
  await publishRemove(
37
40
  { connection, sign },
38
41
  {
39
- releaseMintAddress,
42
+ releaseMintAddress: releaseMintAddress ?? releaseDetails.address,
40
43
  publisherDetails,
41
44
  requestorIsAuthorized,
42
45
  criticalUpdate: critical,
@@ -36,6 +36,7 @@ export const publishSubmitCommand = async ({
36
36
  const connection = new Connection(url);
37
37
  const {
38
38
  publisher: publisherDetails,
39
+ release: releaseDetails,
39
40
  solana_mobile_dapp_publisher_portal: solanaMobileDappPublisherPortalDetails,
40
41
  } = await getConfigFile();
41
42
  const sign = ((buf: Buffer) =>
@@ -44,7 +45,7 @@ export const publishSubmitCommand = async ({
44
45
  await publishSubmit(
45
46
  { connection, sign },
46
47
  {
47
- releaseMintAddress,
48
+ releaseMintAddress: releaseMintAddress ?? releaseDetails.address,
48
49
  publisherDetails,
49
50
  solanaMobileDappPublisherPortalDetails,
50
51
  compliesWithSolanaDappStorePolicies,
@@ -29,14 +29,17 @@ export const publishSupportCommand = async ({
29
29
  }
30
30
 
31
31
  const connection = new Connection(url);
32
- const { publisher: publisherDetails } = await getConfigFile();
32
+ const {
33
+ publisher: publisherDetails,
34
+ release: releaseDetails,
35
+ } = await getConfigFile();
33
36
  const sign = ((buf: Buffer) =>
34
37
  nacl.sign(buf, signer.secretKey)) as SignWithPublisherKeypair;
35
38
 
36
39
  await publishSupport(
37
40
  { connection, sign },
38
41
  {
39
- releaseMintAddress,
42
+ releaseMintAddress: releaseMintAddress ?? releaseDetails.address,
40
43
  publisherDetails,
41
44
  requestorIsAuthorized,
42
45
  requestDetails,
@@ -38,6 +38,7 @@ export const publishUpdateCommand = async ({
38
38
  const connection = new Connection(url);
39
39
  const {
40
40
  publisher: publisherDetails,
41
+ release: releaseDetails,
41
42
  solana_mobile_dapp_publisher_portal: solanaMobileDappPublisherPortalDetails,
42
43
  } = await getConfigFile();
43
44
  const sign = ((buf: Buffer) =>
@@ -46,7 +47,7 @@ export const publishUpdateCommand = async ({
46
47
  await publishUpdate(
47
48
  { connection, sign },
48
49
  {
49
- releaseMintAddress,
50
+ releaseMintAddress: releaseMintAddress ?? releaseDetails.address,
50
51
  publisherDetails,
51
52
  solanaMobileDappPublisherPortalDetails,
52
53
  compliesWithSolanaDappStorePolicies,
@@ -2,7 +2,7 @@ import type {
2
2
  App,
3
3
  Publisher,
4
4
  Release,
5
- SolanaMobileDappPublisherPortal,
5
+ SolanaMobileDappPublisherPortal
6
6
  } from "@solana-mobile/dapp-store-publishing-tools";
7
7
  import fs from "fs/promises";
8
8
  import { load } from "js-yaml";
@@ -18,7 +18,6 @@ export interface CLIConfig {
18
18
  app: App;
19
19
  release: Release;
20
20
  solana_mobile_dapp_publisher_portal: SolanaMobileDappPublisherPortal;
21
- isValid: boolean;
22
21
  }
23
22
 
24
23
  const ajv = new Ajv({ strictTuples: false });
@@ -27,15 +27,9 @@
27
27
  },
28
28
  "uri": {
29
29
  "type": "string"
30
- },
31
- "width": {
32
- "type": "integer"
33
- },
34
- "height": {
35
- "type": "integer"
36
30
  }
37
31
  },
38
- "required": ["purpose", "uri", "width", "height"]
32
+ "required": ["purpose", "uri"]
39
33
  }
40
34
  ]
41
35
  }
@@ -54,14 +48,6 @@
54
48
  "android_package": {
55
49
  "type": "string"
56
50
  },
57
- "creators": {
58
- "type": "array",
59
- "items": [
60
- {
61
- "type": "string"
62
- }
63
- ]
64
- },
65
51
  "urls": {
66
52
  "type": "object",
67
53
  "properties": {
@@ -96,27 +82,18 @@
96
82
  },
97
83
  "uri": {
98
84
  "type": "string"
99
- },
100
- "width": {
101
- "type": "integer"
102
- },
103
- "height": {
104
- "type": "integer"
105
85
  }
106
86
  },
107
- "required": ["purpose", "uri", "width", "height"]
87
+ "required": ["purpose", "uri"]
108
88
  }
109
89
  ]
110
90
  }
111
91
  },
112
- "required": ["name", "android_package", "creators", "urls", "media"]
92
+ "required": ["name", "android_package", "urls", "media"]
113
93
  },
114
94
  "release": {
115
95
  "type": "object",
116
96
  "properties": {
117
- "version": {
118
- "type": "string"
119
- },
120
97
  "address": {
121
98
  "type": "string"
122
99
  },
@@ -131,15 +108,9 @@
131
108
  },
132
109
  "uri": {
133
110
  "type": "string"
134
- },
135
- "width": {
136
- "type": "integer"
137
- },
138
- "height": {
139
- "type": "integer"
140
111
  }
141
112
  },
142
- "required": ["purpose", "uri", "width", "height"]
113
+ "required": ["purpose", "uri"]
143
114
  }
144
115
  ]
145
116
  },
@@ -172,8 +143,8 @@
172
143
  },
173
144
  "catalog": {
174
145
  "type": "object",
175
- "properties": {
176
- "en-US": {
146
+ "patternProperties": {
147
+ "^[a-zA-Z]{2,8}(-[a-zA-Z0-9]{2,8})*$": {
177
148
  "type": "object",
178
149
  "properties": {
179
150
  "name": {
@@ -188,7 +159,7 @@
188
159
  "new_in_version": {
189
160
  "type": "string"
190
161
  },
191
- "saga_features_localized": {
162
+ "saga_features": {
192
163
  "type": "string"
193
164
  }
194
165
  },
@@ -197,14 +168,14 @@
197
168
  "short_description",
198
169
  "long_description",
199
170
  "new_in_version",
200
- "saga_features_localized"
171
+ "saga_features"
201
172
  ]
202
173
  }
203
174
  },
204
- "required": ["en-US"]
175
+ "additionalProperties": false
205
176
  }
206
177
  },
207
- "required": ["version", "media", "files", "catalog"]
178
+ "required": ["media", "files", "catalog"]
208
179
  },
209
180
  "solana_mobile_dapp_publisher_portal": {
210
181
  "type": "object",
@@ -216,7 +187,7 @@
216
187
  "type": "string"
217
188
  }
218
189
  },
219
- "required": ["google_store_package", "testing_instructions"]
190
+ "required": ["testing_instructions"]
220
191
  }
221
192
  },
222
193
  "required": [