@contrail/flexplm 1.6.1-alpha.75cfe7f → 1.6.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.
|
@@ -227,25 +227,28 @@ class UploadCommand {
|
|
|
227
227
|
await this.commitToGit([tsAbsPath, absPath], uploadedFile.id, options);
|
|
228
228
|
}
|
|
229
229
|
if (options.updateConfig) {
|
|
230
|
-
|
|
231
|
-
entityName: 'app-org',
|
|
232
|
-
criteria: { appId: app.id },
|
|
233
|
-
});
|
|
234
|
-
if (!appOrgs || appOrgs.length === 0) {
|
|
235
|
-
throw new Error(`Failed to set the file onto the app config for "${appIdentifier}" because it is not installed in org "${orgName}". Install it via the admin console before using --update-config. You can paste the uploaded file's ID into the app config without needing to re-run this command.`);
|
|
236
|
-
}
|
|
237
|
-
if (appOrgs.length > 1) {
|
|
238
|
-
throw new Error(`Failed to set the file onto the app config for "${appIdentifier}" in org "${orgName}" because ${appOrgs.length} installations were identified. Expected one. Please contact customer support for assistance.`);
|
|
239
|
-
}
|
|
240
|
-
const appOrg = appOrgs[0];
|
|
241
|
-
const nextAppConfig = { ...(appOrg.appConfig || {}), transformMapFile: uploadedFile.id };
|
|
242
|
-
await new sdk_1.Entities().update({
|
|
243
|
-
entityName: 'app-org',
|
|
244
|
-
id: appOrg.id,
|
|
245
|
-
object: { appConfig: nextAppConfig },
|
|
246
|
-
});
|
|
247
|
-
console.log(`Successfully set "appConfig.transformMapFile" for installed "${appIdentifier}" to new FILE ID: "${uploadedFile.id}" on org "${orgName}"`);
|
|
230
|
+
await this.setTransformMapFileOnAppOrg(app.id, appIdentifier, orgName, uploadedFile.id);
|
|
248
231
|
}
|
|
249
232
|
}
|
|
233
|
+
async setTransformMapFileOnAppOrg(appId, appIdentifier, orgName, fileId) {
|
|
234
|
+
const appOrgs = await new sdk_1.Entities().get({
|
|
235
|
+
entityName: 'app-org',
|
|
236
|
+
criteria: { appId },
|
|
237
|
+
});
|
|
238
|
+
if (!appOrgs || appOrgs.length === 0) {
|
|
239
|
+
throw new Error(`Failed to set the file onto the app config for "${appIdentifier}" because it is not installed in org "${orgName}". Install it via the admin console before using --update-config. You can paste the uploaded file's ID into the app config without needing to re-run this command.`);
|
|
240
|
+
}
|
|
241
|
+
if (appOrgs.length > 1) {
|
|
242
|
+
throw new Error(`Failed to set the file onto the app config for "${appIdentifier}" in org "${orgName}" because ${appOrgs.length} installations were identified. Expected one. Please contact customer support for assistance.`);
|
|
243
|
+
}
|
|
244
|
+
const appOrg = appOrgs[0];
|
|
245
|
+
const nextAppConfig = { ...(appOrg.appConfig || {}), transformMapFile: fileId };
|
|
246
|
+
await new sdk_1.Entities().update({
|
|
247
|
+
entityName: 'app-org',
|
|
248
|
+
id: appOrg.id,
|
|
249
|
+
object: { appConfig: nextAppConfig },
|
|
250
|
+
});
|
|
251
|
+
console.log(`Successfully set "appConfig.transformMapFile" for installed "${appIdentifier}" to new FILE ID: "${fileId}" on org "${orgName}"`);
|
|
252
|
+
}
|
|
250
253
|
}
|
|
251
254
|
exports.UploadCommand = UploadCommand;
|