UNPKG

eas-cli

Version:

EAS command line tool

106 lines (105 loc) 3.3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.provisioningProfileSchema = exports.pushKeySchema = exports.ascApiKeyIssuerIdSchema = exports.ascApiKeyIdSchema = exports.distributionCertificateSchema = exports.getAppLookupParams = void 0; const tslib_1 = require("tslib"); const p12Certificate_1 = require("./utils/p12Certificate"); const provisioningProfile_1 = require("./utils/provisioningProfile"); const log_1 = tslib_1.__importDefault(require("../../log")); function getAppLookupParams(experienceName, bundleIdentifier) { const matchedExperienceName = experienceName.match(/@(.+)\/(.+)/); if (!matchedExperienceName || matchedExperienceName.length < 3) { throw new Error('invalid experience name'); } return { accountName: matchedExperienceName[1], projectName: matchedExperienceName[2], bundleIdentifier, }; } exports.getAppLookupParams = getAppLookupParams; exports.distributionCertificateSchema = { name: 'Apple Distribution Certificate', questions: [ { field: 'certP12', question: 'Path to P12 file:', type: 'file', base64Encode: true, }, { field: 'certPassword', type: 'password', question: 'P12 password:', }, { field: 'teamId', type: 'string', question: 'Apple Team ID:', }, ], transformResultAsync: async (answers) => { try { const distCertSerialNumber = (0, p12Certificate_1.findP12CertSerialNumber)(answers.certP12, answers.certPassword); return { ...answers, distCertSerialNumber }; } catch (error) { log_1.default.warn('Unable to access certificate serial number.'); log_1.default.warn('Make sure that certificate and password are correct.'); log_1.default.warn(error); } return answers; }, }; exports.ascApiKeyIdSchema = { name: 'App Store Connect API Key', questions: [ { field: 'keyId', type: 'string', question: 'Key ID:', }, ], }; exports.ascApiKeyIssuerIdSchema = { name: 'App Store Connect API Key', questions: [ { field: 'issuerId', type: 'string', question: 'Issuer ID:', }, ], }; exports.pushKeySchema = { name: 'Apple Push Notifications service key', questions: [ { field: 'apnsKeyP8', type: 'file', question: 'Path to P8 file:', }, { field: 'apnsKeyId', type: 'string', question: 'Key ID:', }, { field: 'teamId', type: 'string', question: 'Apple Team ID:' }, ], }; exports.provisioningProfileSchema = { name: 'Apple Provisioning Profile', questions: [ { field: 'provisioningProfile', type: 'file', question: 'Path to .mobileprovision file:', base64Encode: true, }, ], transformResultAsync: async (answers) => { return { ...answers, ...(0, provisioningProfile_1.readAppleTeam)(answers.provisioningProfile), }; }, };