mlcl 1.0.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 (195) hide show
  1. package/.eslintignore +31 -0
  2. package/.eslintrc.json +54 -0
  3. package/LICENSE +200 -0
  4. package/README.md +101 -0
  5. package/babel.config.json +10 -0
  6. package/build/API/authorization.js +107 -0
  7. package/build/API/client.js +11 -0
  8. package/build/API/index.js +8 -0
  9. package/build/API/molecule/index.js +11 -0
  10. package/build/API/molecule/types.js +6 -0
  11. package/build/API/resource/device/index.js +12 -0
  12. package/build/API/resource/device/types.js +6 -0
  13. package/build/API/resource/device/utilities/confirmSshKey.js +20 -0
  14. package/build/API/resource/device/utilities/index.js +7 -0
  15. package/build/API/resource/device/utilities/sendSshKey.js +64 -0
  16. package/build/API/resource/index.js +10 -0
  17. package/build/API/resource/molecule/index.js +12 -0
  18. package/build/API/resource/molecule/types.js +6 -0
  19. package/build/API/resource/molecule/utilities/getPlan.js +15 -0
  20. package/build/API/resource/molecule/utilities/index.js +6 -0
  21. package/build/API/resource/payment/index.js +9 -0
  22. package/build/API/resource/payment/plans.js +28 -0
  23. package/build/API/resource/payment/platform.js +7 -0
  24. package/build/API/resource/payment/platforms/apple/index.js +21 -0
  25. package/build/API/resource/payment/platforms/apple/plans/appleMonthly.js +17 -0
  26. package/build/API/resource/payment/platforms/apple/plans/appleYearly.js +18 -0
  27. package/build/API/resource/payment/platforms/apple/plans/index.js +7 -0
  28. package/build/API/resource/payment/platforms/google/index.js +21 -0
  29. package/build/API/resource/payment/platforms/google/plans/googleMonthly.js +17 -0
  30. package/build/API/resource/payment/platforms/google/plans/googleYearly.js +18 -0
  31. package/build/API/resource/payment/platforms/google/plans/index.js +7 -0
  32. package/build/API/resource/payment/platforms/index.js +8 -0
  33. package/build/API/resource/payment/platforms/stripe/index.js +25 -0
  34. package/build/API/resource/payment/platforms/stripe/plans/index.js +11 -0
  35. package/build/API/resource/payment/platforms/stripe/plans/stripeBusinessMolecule.js +21 -0
  36. package/build/API/resource/payment/platforms/stripe/plans/stripeMonthly.js +18 -0
  37. package/build/API/resource/payment/platforms/stripe/plans/stripeMonthlyMolecule.js +18 -0
  38. package/build/API/resource/payment/platforms/stripe/plans/stripeSingleUseMolecule.js +19 -0
  39. package/build/API/resource/payment/platforms/stripe/plans/stripeUnlimitedUseMolecule.js +19 -0
  40. package/build/API/resource/payment/platforms/stripe/plans/stripeYearly.js +19 -0
  41. package/build/API/resource/payment/types.js +6 -0
  42. package/build/API/resource/types.js +6 -0
  43. package/build/API/resource/user/index.js +15 -0
  44. package/build/API/resource/user/types.js +6 -0
  45. package/build/API/resource/user/utilities/getPlan.js +12 -0
  46. package/build/API/resource/user/utilities/index.js +7 -0
  47. package/build/API/resource/user/utilities/logIn.js +60 -0
  48. package/build/cli.js +15 -0
  49. package/build/commands/add-ssh-key.js +24 -0
  50. package/build/commands/buy.js +70 -0
  51. package/build/commands/clone.js +329 -0
  52. package/build/commands/index.js +17 -0
  53. package/build/commands/info.js +33 -0
  54. package/build/commands/login.js +20 -0
  55. package/build/commands/logout.js +23 -0
  56. package/build/commands/molecule/index.js +11 -0
  57. package/build/commands/molecule/types.js +6 -0
  58. package/build/commands/remove-ssh-key.js +36 -0
  59. package/build/commands/select.js +98 -0
  60. package/build/commands/set-api-key.js +73 -0
  61. package/build/commands/subscribe.js +74 -0
  62. package/build/commands/unsubscribe.js +59 -0
  63. package/build/commands/utilities/asyncExec.js +6 -0
  64. package/build/commands/utilities/branchExists.js +13 -0
  65. package/build/commands/utilities/branchExistsSync.js +12 -0
  66. package/build/commands/utilities/checkoutSelectionBranch.js +49 -0
  67. package/build/commands/utilities/cherryPick.js +20 -0
  68. package/build/commands/utilities/cloneRepo.js +9 -0
  69. package/build/commands/utilities/convertNpmToYarn.js +60 -0
  70. package/build/commands/utilities/convertTypeDocToJSDoc.js +51 -0
  71. package/build/commands/utilities/convertTypeScriptToJavaScript.js +451 -0
  72. package/build/commands/utilities/enableMergeDrivers.js +50 -0
  73. package/build/commands/utilities/getCurrentBranch.js +11 -0
  74. package/build/commands/utilities/getCurrentBranchSync.js +7 -0
  75. package/build/commands/utilities/getRepoRootPath.js +7 -0
  76. package/build/commands/utilities/getRepoRootPathSync.js +13 -0
  77. package/build/commands/utilities/index.js +16 -0
  78. package/build/commands/utilities/npm-to-yarn.js +41 -0
  79. package/build/commands/utilities/ts-to-js.js +344 -0
  80. package/build/commands/version.js +14 -0
  81. package/build/commands/x-merge-json.js +33 -0
  82. package/build/config.js +5 -0
  83. package/build/environment.js +80 -0
  84. package/build/index.js +23 -0
  85. package/build/logger.js +12 -0
  86. package/build/pkg.js +5 -0
  87. package/build/repoConfig copy.js +5 -0
  88. package/build/repoConfig.js +5 -0
  89. package/build/types/global.js +6 -0
  90. package/build/types/index.js +6 -0
  91. package/build/userConfig.js +5 -0
  92. package/build/utilities/__tests__/getErrorMessage.js +26 -0
  93. package/build/utilities/__tests__/timeAgo.js +39 -0
  94. package/build/utilities/checkVersion.js +29 -0
  95. package/build/utilities/getErrorMessage.js +15 -0
  96. package/build/utilities/index.js +13 -0
  97. package/build/utilities/readConfig.js +19 -0
  98. package/build/utilities/readRepoConfig copy.js +20 -0
  99. package/build/utilities/readRepoConfig.js +19 -0
  100. package/build/utilities/readUserConfig.js +20 -0
  101. package/build/utilities/synchronizeUserConfig.js +25 -0
  102. package/build/utilities/timeAgo.js +42 -0
  103. package/build/utilities/userLoggedIn.js +24 -0
  104. package/build/utilities/writeConfig.js +8 -0
  105. package/build/utilities/writeRepoConfig copy.js +9 -0
  106. package/build/utilities/writeRepoConfig.js +10 -0
  107. package/build/utilities/writeUserConfig.js +11 -0
  108. package/jest.config.json +11 -0
  109. package/package.json +56 -0
  110. package/src/API/authorization.ts +143 -0
  111. package/src/API/client.ts +12 -0
  112. package/src/API/index.ts +10 -0
  113. package/src/API/resource/device/index.ts +27 -0
  114. package/src/API/resource/device/types.ts +80 -0
  115. package/src/API/resource/device/utilities/confirmSshKey.ts +25 -0
  116. package/src/API/resource/device/utilities/index.ts +8 -0
  117. package/src/API/resource/device/utilities/sendSshKey.ts +80 -0
  118. package/src/API/resource/index.ts +12 -0
  119. package/src/API/resource/molecule/index.ts +30 -0
  120. package/src/API/resource/molecule/types.ts +332 -0
  121. package/src/API/resource/molecule/utilities/getPlan.ts +21 -0
  122. package/src/API/resource/molecule/utilities/index.ts +7 -0
  123. package/src/API/resource/payment/index.ts +12 -0
  124. package/src/API/resource/payment/plans.ts +32 -0
  125. package/src/API/resource/payment/platform.ts +11 -0
  126. package/src/API/resource/payment/platforms/apple/index.ts +25 -0
  127. package/src/API/resource/payment/platforms/apple/plans/appleMonthly.ts +19 -0
  128. package/src/API/resource/payment/platforms/apple/plans/appleYearly.ts +20 -0
  129. package/src/API/resource/payment/platforms/apple/plans/index.ts +9 -0
  130. package/src/API/resource/payment/platforms/google/index.ts +25 -0
  131. package/src/API/resource/payment/platforms/google/plans/googleMonthly.ts +19 -0
  132. package/src/API/resource/payment/platforms/google/plans/googleYearly.ts +20 -0
  133. package/src/API/resource/payment/platforms/google/plans/index.ts +9 -0
  134. package/src/API/resource/payment/platforms/index.ts +10 -0
  135. package/src/API/resource/payment/platforms/stripe/index.ts +29 -0
  136. package/src/API/resource/payment/platforms/stripe/plans/index.ts +12 -0
  137. package/src/API/resource/payment/platforms/stripe/plans/stripeBusinessMolecule.ts +23 -0
  138. package/src/API/resource/payment/platforms/stripe/plans/stripeMonthly.ts +20 -0
  139. package/src/API/resource/payment/platforms/stripe/plans/stripeMonthlyMolecule.ts +20 -0
  140. package/src/API/resource/payment/platforms/stripe/plans/stripeSingleUseMolecule.ts +21 -0
  141. package/src/API/resource/payment/platforms/stripe/plans/stripeUnlimitedUseMolecule.ts +21 -0
  142. package/src/API/resource/payment/platforms/stripe/plans/stripeYearly.ts +21 -0
  143. package/src/API/resource/payment/types.ts +201 -0
  144. package/src/API/resource/types.ts +169 -0
  145. package/src/API/resource/user/index.ts +29 -0
  146. package/src/API/resource/user/types.ts +131 -0
  147. package/src/API/resource/user/utilities/getPlan.ts +16 -0
  148. package/src/API/resource/user/utilities/index.ts +8 -0
  149. package/src/API/resource/user/utilities/logIn.ts +71 -0
  150. package/src/commands/add-ssh-key.ts +30 -0
  151. package/src/commands/buy.ts +83 -0
  152. package/src/commands/clone.ts +363 -0
  153. package/src/commands/index.ts +19 -0
  154. package/src/commands/info.ts +40 -0
  155. package/src/commands/login.ts +24 -0
  156. package/src/commands/logout.ts +27 -0
  157. package/src/commands/remove-ssh-key.ts +42 -0
  158. package/src/commands/subscribe.ts +84 -0
  159. package/src/commands/unsubscribe.ts +67 -0
  160. package/src/commands/utilities/asyncExec.ts +7 -0
  161. package/src/commands/utilities/branchExists.ts +15 -0
  162. package/src/commands/utilities/checkoutSelectionBranch.ts +62 -0
  163. package/src/commands/utilities/cherryPick.ts +23 -0
  164. package/src/commands/utilities/cloneRepo.ts +10 -0
  165. package/src/commands/utilities/convertNpmToYarn.ts +71 -0
  166. package/src/commands/utilities/convertTypeDocToJSDoc.ts +55 -0
  167. package/src/commands/utilities/convertTypeScriptToJavaScript.ts +526 -0
  168. package/src/commands/utilities/enableMergeDrivers.ts +55 -0
  169. package/src/commands/utilities/getCurrentBranch.ts +14 -0
  170. package/src/commands/utilities/getRepoRootPathSync.ts +13 -0
  171. package/src/commands/utilities/index.ts +17 -0
  172. package/src/commands/version.ts +22 -0
  173. package/src/commands/x-merge-json.ts +41 -0
  174. package/src/environment.ts +88 -0
  175. package/src/index.ts +30 -0
  176. package/src/logger.ts +29 -0
  177. package/src/pkg.ts +11 -0
  178. package/src/repoConfig.ts +6 -0
  179. package/src/types/global.ts +26 -0
  180. package/src/types/index.ts +53 -0
  181. package/src/types/process.env.d.ts +56 -0
  182. package/src/userConfig.ts +6 -0
  183. package/src/utilities/__tests__/getErrorMessage.ts +32 -0
  184. package/src/utilities/__tests__/timeAgo.ts +46 -0
  185. package/src/utilities/checkVersion.ts +31 -0
  186. package/src/utilities/getErrorMessage.ts +30 -0
  187. package/src/utilities/index.ts +14 -0
  188. package/src/utilities/readRepoConfig.ts +22 -0
  189. package/src/utilities/readUserConfig.ts +24 -0
  190. package/src/utilities/synchronizeUserConfig.ts +26 -0
  191. package/src/utilities/timeAgo.ts +39 -0
  192. package/src/utilities/userLoggedIn.ts +28 -0
  193. package/src/utilities/writeRepoConfig.ts +11 -0
  194. package/src/utilities/writeUserConfig.ts +13 -0
  195. package/tsconfig.json +25 -0
@@ -0,0 +1,131 @@
1
+ /**
2
+ * User type definitions.
3
+ *
4
+ * @module
5
+ */
6
+
7
+ import * as resourceTypes from '../types.js'
8
+ import { PlanKey } from '../payment/types.js'
9
+
10
+ // Internal reference for easier default type arguments within this module.
11
+ type UserProps = Props
12
+
13
+ /**
14
+ * The user's properties returned by the API.
15
+ */
16
+ export interface Props extends resourceTypes.Props {
17
+ /**
18
+ * An alphanumeric username.
19
+ */
20
+ username: string
21
+ /**
22
+ * The user's given name.
23
+ */
24
+ name?: string
25
+ /**
26
+ * The user's email address.
27
+ */
28
+ email?: string
29
+ /**
30
+ * The user's phone number.
31
+ */
32
+ phone?: string
33
+ /**
34
+ * True when 2FA is enabled.
35
+ */
36
+ twoFactorEnabled?: boolean
37
+ /**
38
+ * The OAuth server used to authenticate the user.
39
+ */
40
+ oauthServer?: OAuthServer
41
+ /**
42
+ * Unique identifier for the user retrieved from the OAuth server.
43
+ */
44
+ oauthId?: string
45
+ /**
46
+ * User data retrieved from the OAuth server.
47
+ *
48
+ * Varies depending on the server.
49
+ */
50
+ oauthData?: JSONObject
51
+ /**
52
+ * The user's current plan (key).
53
+ */
54
+ planKey?: PlanKey
55
+ /**
56
+ * When the plan expires.
57
+ *
58
+ * Usually an ISO 8061 timestamp.
59
+ */
60
+ planExpiresAt?: string
61
+ /**
62
+ * True if the plan will automatically renew.
63
+ */
64
+ planAutoRenews?: boolean
65
+ }
66
+
67
+ /**
68
+ * The available OAuth servers.
69
+ */
70
+ export type OAuthServer = undefined
71
+ | `github`
72
+ | `gitlab`
73
+ | `google`
74
+ | `twitter`
75
+
76
+ /**
77
+ * The properties when logging in via the CLI.
78
+ */
79
+ export interface LogInCLIProps {
80
+ token?: string
81
+ deviceIds?: string[]
82
+ deviceName?: string
83
+ }
84
+
85
+ /**
86
+ * The successful user resource response returning either a token when initiating or user props when logged in.
87
+ */
88
+ export type LogInCLIResponse<Props = UserProps> = {
89
+ /**
90
+ * HTTP status code.
91
+ */
92
+ statusCode: 200 | 201
93
+ /**
94
+ * The response body.
95
+ */
96
+ data: {
97
+ /**
98
+ * Response data will contain a `token` when initiating.
99
+ */
100
+ token?: string
101
+ /**
102
+ * Response data will contain `props` when logged in.
103
+ */
104
+ props?: Props
105
+ }
106
+ }
107
+
108
+ /**
109
+ * The successful user resource response.
110
+ */
111
+ export type SuccessResponse<Props = UserProps> = resourceTypes.SuccessResponse<Props>
112
+
113
+ /**
114
+ * The successful user resource response returning partial props.
115
+ */
116
+ export type SuccessPartialResponse<Props = UserProps> = resourceTypes.SuccessPartialResponse<Props>
117
+
118
+ /**
119
+ * Generic response with an optional body.
120
+ */
121
+ export type GenericResponse = resourceTypes.GenericResponse
122
+
123
+ /**
124
+ * The response containing a message.
125
+ */
126
+ export type MessageResponse = resourceTypes.MessageResponse
127
+
128
+ /**
129
+ * The response when an error has occurred when handling a user resource request.
130
+ */
131
+ export type ErrorResponse = resourceTypes.ErrorResponse
@@ -0,0 +1,16 @@
1
+ import * as types from '../types.js'
2
+ import { plans } from '../../payment/plans.js'
3
+
4
+ /**
5
+ * Gets a user's current `plan`.
6
+ */
7
+ export const getPlan = (user: types.Props) => {
8
+ const planKey = user.planKey || ``
9
+ const planExpiresTime = (user.planExpiresAt && new Date(String(user.planExpiresAt)).getTime()) || 0
10
+
11
+ if (plans[planKey] && Date.now() < planExpiresTime) {
12
+ return plans[planKey]
13
+ }
14
+
15
+ return plans['']
16
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * User resource utilities.
3
+ *
4
+ * @module
5
+ */
6
+
7
+ export * from './getPlan.js'
8
+ export * from './logIn.js'
@@ -0,0 +1,71 @@
1
+ import os from 'os'
2
+ import open from 'open'
3
+ import { logInCLI } from '../index.js'
4
+ import { getUserIdsToDeviceIds } from '../../../authorization.js'
5
+ import { logger } from '../../../../logger.js'
6
+ import { getErrorMessage } from '../../../../utilities/getErrorMessage.js'
7
+ import { userConfig } from '../../../../userConfig.js'
8
+ import { writeUserConfig } from '../../../../utilities/writeUserConfig.js'
9
+
10
+ const CHECK_AFTER = 3000 // 3 seconds
11
+ const MAX_TRIES = 20
12
+
13
+ export const logIn = async () => {
14
+ const deviceIds = Object.values(getUserIdsToDeviceIds())
15
+ const deviceName = `CLI (${os.platform()})`
16
+ let token = ``
17
+
18
+ try {
19
+ token = (await logInCLI({ deviceIds, deviceName })).data.token || ``
20
+
21
+ if (!token) {
22
+ logger.warn(`No token was returned by the API.`)
23
+ return
24
+ }
25
+ } catch (error) {
26
+ logger.warn(`Error fetching token: ${getErrorMessage(error)}`)
27
+ return
28
+ }
29
+
30
+ logger.info(`Opening your browser and waiting for your allowance...`)
31
+
32
+ const url = `${process.env.WEB_ORIGIN}/#/allow-auth-token?token=${encodeURIComponent(token)}`
33
+
34
+ const childProcess = await open(url)
35
+
36
+ childProcess.on(`error`, error => {
37
+ logger.warn(`Error opening the auth URL: ${getErrorMessage(error)}`)
38
+ logger.warn(`If your browser didn't open on its own, visit the following URL to continue logging in: ${url}`)
39
+ })
40
+
41
+ childProcess.on(`close`, code => {
42
+ if (code !== 0) {
43
+ logger.warn(`If your browser didn't open on its own, visit the following URL to continue logging in: ${url}`)
44
+ }
45
+ })
46
+
47
+ const check = async (tryCount = 0) => {
48
+ if (tryCount >= MAX_TRIES) {
49
+ logger.info(`Reached maximum number of tries.`)
50
+ return
51
+ }
52
+
53
+ try {
54
+ await new Promise(resolve => setTimeout(resolve, CHECK_AFTER))
55
+
56
+ const user = (await logInCLI({ token, deviceIds, deviceName })).data.props
57
+
58
+ if (user) {
59
+ logger.info(`Hello, ${user.name || user.username}!`)
60
+ userConfig.user = user
61
+ writeUserConfig()
62
+ } else {
63
+ await check(tryCount + 1)
64
+ }
65
+ } catch (error) {
66
+ await check(tryCount + 1)
67
+ }
68
+ }
69
+
70
+ await check()
71
+ }
@@ -0,0 +1,30 @@
1
+ import { Command } from 'commander'
2
+ import { userConfig } from '../userConfig.js'
3
+ import { userLoggedIn } from '../utilities/userLoggedIn.js'
4
+ import * as API from '../API/index.js'
5
+ import { logger } from '../logger.js'
6
+
7
+ /**
8
+ * Adds the `add-ssh-key` command to the program.
9
+ */
10
+ export const addSshKey = (program: Command) => {
11
+ program.command(`add-ssh-key`)
12
+ .description(`finds or creates \`~/.ssh/id_*.pub\` (using \`ssh-keygen\`) and adds it to your Molecule.dev account for your current CLI device`)
13
+ .argument(`[path]`, `specify the location of the SSH key`)
14
+ .action(async (sshKeyPath = ``) => {
15
+ const user = await userLoggedIn()
16
+
17
+ if (!user) {
18
+ return
19
+ }
20
+
21
+ const deviceId = userConfig.userIdsToDeviceIds?.[user.id] || ``
22
+
23
+ if (!deviceId) {
24
+ logger.warn(`No device ID for the current user. Try logging out and in again.`)
25
+ return
26
+ }
27
+
28
+ await API.resource.device.utilities.sendSshKey(deviceId, user.username, sshKeyPath)
29
+ })
30
+ }
@@ -0,0 +1,83 @@
1
+ import open from 'open'
2
+ import { Command, Argument } from 'commander'
3
+ import { userLoggedIn } from '../utilities/userLoggedIn.js'
4
+ import { repoConfig } from '../repoConfig.js'
5
+ import * as API from '../API/index.js'
6
+ import { logger } from '../logger.js'
7
+ import { getErrorMessage } from '../utilities/getErrorMessage.js'
8
+ import { plans } from '../API/resource/payment/plans.js'
9
+ import { PlanKey } from '../API/resource/payment/types.js'
10
+
11
+ /**
12
+ * Adds the `buy` command to the program.
13
+ */
14
+ export const buy = (program: Command) => {
15
+ program.command(`buy`)
16
+ .description(`purchase a license for your Molecule`)
17
+ .addArgument(new Argument(`[license]`, `the type of license`).choices([`single`, `unlimited`, `business`]))
18
+ .addArgument(new Argument(`[quantity]`, `the quantity for the business license (at least ${plans.stripeBusinessMolecule.minimumQuantity})`))
19
+ .action(async (license?: `single` | `unlimited` | `business`, quantity = 1) => {
20
+ if (!license) {
21
+ logger.info(`Usage:`)
22
+ logger.info(` mlcl buy single - one app with this Molecule`)
23
+ logger.info(` mlcl buy unlimited - unlimited apps with this Molecule`)
24
+ logger.info(` mlcl buy business <quantity> - at least 10 apps with any Molecule`)
25
+ return
26
+ }
27
+
28
+ const user = await userLoggedIn()
29
+
30
+ if (!user) {
31
+ return
32
+ }
33
+
34
+ if (!repoConfig?.id) {
35
+ logger.warn(`Not within a Molecule repository or \`.mlclrc.json\` not found.`)
36
+ return
37
+ }
38
+
39
+ const planKey = ({
40
+ single: `stripeSingleUseMolecule`,
41
+ unlimited: `stripeUnlimitedUseMolecule`,
42
+ business: `stripeBusinessMolecule`,
43
+ })[license || ``] as PlanKey
44
+
45
+ if (!planKey || !plans[planKey]) {
46
+ logger.warn(`Unknown license option.`)
47
+ return
48
+ }
49
+
50
+ try {
51
+ quantity = Math.max(plans[planKey]?.minimumQuantity || 1, Math.round(Number(quantity) || 1))
52
+
53
+ const molecule = (await API.resource.molecule.read(repoConfig.id)).data.props
54
+
55
+ if (!molecule) {
56
+ throw new Error(`Failed to fetch Molecule by ID ${repoConfig.id}.`)
57
+ }
58
+
59
+ const { checkoutUrl } = (await API.resource.molecule.updatePlan(molecule.id, { planKey, quantity })).data
60
+
61
+ if (checkoutUrl) {
62
+ logger.info(`Opening your browser to complete checkout via Stripe...`)
63
+
64
+ const childProcess = await open(checkoutUrl)
65
+
66
+ childProcess.on(`error`, error => {
67
+ logger.warn(`Error opening the checkout URL: ${getErrorMessage(error)}`)
68
+ logger.warn(`If your browser didn't open on its own, visit the following URL: ${checkoutUrl}`)
69
+ })
70
+
71
+ childProcess.on(`close`, code => {
72
+ if (code !== 0) {
73
+ logger.warn(`If your browser didn't open on its own, visit the following URL: ${checkoutUrl}`)
74
+ }
75
+ })
76
+ } else {
77
+ throw new Error(`Unexpected response. Please contact developer-support@molecule.dev so we can fix this.`)
78
+ }
79
+ } catch (error) {
80
+ logger.warn(`Something went wrong. ${getErrorMessage(error)}`)
81
+ }
82
+ })
83
+ }