@hubspot/cli 7.5.3-beta.0 → 7.5.3-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/app/migrate.js
CHANGED
|
@@ -236,9 +236,21 @@ async function beginMigration(derivedAccountId, appId, platformVersion) {
|
|
|
236
236
|
if (Object.values(componentsRequiringUids).length !== 0) {
|
|
237
237
|
for (const [componentId, component] of Object.entries(componentsRequiringUids)) {
|
|
238
238
|
const { componentHint, componentType } = component;
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
239
|
+
// Extract the internal ID from the base64-encoded ComponentExternalId
|
|
240
|
+
let internalId;
|
|
241
|
+
try {
|
|
242
|
+
const decoded = Buffer.from(componentId, 'base64').toString('utf8');
|
|
243
|
+
const parts = decoded.split('$$');
|
|
244
|
+
internalId = parts[1] || componentId;
|
|
245
|
+
}
|
|
246
|
+
catch {
|
|
247
|
+
// If decoding fails, use the componentId as the internalId
|
|
248
|
+
internalId = componentId;
|
|
249
|
+
}
|
|
250
|
+
const promptText = componentHint
|
|
251
|
+
? `${(0, transform_1.mapToUserFacingType)(componentType)} '${componentHint}' (ID: ${internalId})`
|
|
252
|
+
: `${(0, transform_1.mapToUserFacingType)(componentType)} (ID: ${internalId})`;
|
|
253
|
+
uidMap[componentId] = await (0, promptUtils_1.inputPrompt)(en_1.lib.migrate.prompt.uidForComponent(promptText), {
|
|
242
254
|
validate: (uid) => {
|
|
243
255
|
const result = (0, project_parsing_lib_1.validateUid)(uid);
|
|
244
256
|
return result === undefined ? true : result;
|
|
@@ -141,7 +141,7 @@ class AppDevModeInterface {
|
|
|
141
141
|
}
|
|
142
142
|
async checkTestAccountAppInstallation() {
|
|
143
143
|
if (!this.appNode || !this.appData) {
|
|
144
|
-
return;
|
|
144
|
+
return {};
|
|
145
145
|
}
|
|
146
146
|
const { data: { isInstalledWithScopeGroups, previouslyAuthorizedScopeGroups }, } = await (0, localDevAuth_1.fetchAppInstallationData)(this.localDevState.targetTestingAccountId, this.localDevState.projectId, this.appNode.uid, this.appNode.config.auth.requiredScopes, this.appNode.config.auth.optionalScopes);
|
|
147
147
|
const isReinstall = previouslyAuthorizedScopeGroups.length > 0;
|
|
@@ -157,9 +157,7 @@ class AppDevModeInterface {
|
|
|
157
157
|
installationState: constants_1.APP_INSTALLATION_STATES.INSTALLED_WITH_OUTDATED_SCOPES,
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
|
-
|
|
161
|
-
await this.installAppOrOpenInstallUrl(isReinstall);
|
|
162
|
-
}
|
|
160
|
+
return { needsInstall: !isInstalledWithScopeGroups, isReinstall };
|
|
163
161
|
}
|
|
164
162
|
setUpLocalDevServerMessageListeners() {
|
|
165
163
|
this.localDevState.addListener('devServerMessage', message => {
|
|
@@ -179,7 +177,10 @@ class AppDevModeInterface {
|
|
|
179
177
|
if (this.appNode.config.distribution === constants_1.APP_DISTRIBUTION_TYPES.MARKETPLACE) {
|
|
180
178
|
await this.checkMarketplaceAppInstalls();
|
|
181
179
|
}
|
|
182
|
-
await this.checkTestAccountAppInstallation();
|
|
180
|
+
const { needsInstall, isReinstall } = await this.checkTestAccountAppInstallation();
|
|
181
|
+
if (needsInstall) {
|
|
182
|
+
await this.installAppOrOpenInstallUrl(isReinstall || false);
|
|
183
|
+
}
|
|
183
184
|
}
|
|
184
185
|
catch (e) {
|
|
185
186
|
(0, index_1.logError)(e);
|