@expo/xdl
Version:
The Expo Development Library
88 lines (74 loc) • 1.77 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.formatDistCerts = formatDistCerts;
exports.formatPushKeys = formatPushKeys;
function _PKCS12Utils() {
const data = require("../detach/PKCS12Utils");
_PKCS12Utils = function () {
return data;
};
return data;
}
function formatDistCerts(distCerts, options) {
return distCerts.map(({
usedByApps,
userCredentialsId,
certId,
certP12,
certPassword
}) => {
let serialNumber;
try {
serialNumber = (0, _PKCS12Utils().findP12CertSerialNumber)(certP12, certPassword);
} catch (error) {
serialNumber = '------';
}
let name = `Serial number: ${serialNumber}`;
if (certId) {
name = `${name}, Certificate ID: ${certId}`;
}
if (usedByApps) {
name = `Used in apps: ${usedByApps.join(', ')} (${name})`;
}
return {
value: {
distCertSerialNumber: serialNumber,
...(options.provideFullCertificate ? {
certP12,
certId,
certPassword
} : {
userCredentialsId: String(userCredentialsId)
})
},
name
};
});
}
function formatPushKeys(pushKeys, options) {
return pushKeys.map(({
usedByApps,
userCredentialsId,
apnsKeyId,
apnsKeyP8
}) => {
let name = `Key ID: ${apnsKeyId}`;
if (usedByApps) {
name = `Used in apps: ${usedByApps.join(', ')} (${name})`;
}
return {
value: { ...(options.provideFullPushKey ? {
apnsKeyId,
apnsKeyP8
} : {
userCredentialsId: String(userCredentialsId)
})
},
name,
short: apnsKeyId
};
});
}
//# sourceMappingURL=../__sourcemaps__/credentials/IosCredentials.js.map