@expo/eas-json 7.1.1 → 7.1.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/build/schema.js CHANGED
@@ -14,5 +14,5 @@ exports.EasJsonSchema = joi_1.default.object({
14
14
  promptToConfigurePushNotifications: joi_1.default.boolean(),
15
15
  }),
16
16
  build: joi_1.default.object().pattern(joi_1.default.string(), schema_1.BuildProfileSchema),
17
- submit: joi_1.default.object().pattern(joi_1.default.string(), schema_2.SubmitProfileSchema),
17
+ submit: joi_1.default.object().pattern(joi_1.default.string(), schema_2.UnresolvedSubmitProfileSchema),
18
18
  });
@@ -63,7 +63,7 @@ function mergeProfiles(base, update) {
63
63
  return { ...base, ...update };
64
64
  }
65
65
  function getDefaultProfile(platform) {
66
- const Schema = platform === eas_build_job_1.Platform.ANDROID ? schema_1.AndroidSubmitProfileSchema : schema_1.IosSubmitProfileSchema;
66
+ const Schema = platform === eas_build_job_1.Platform.ANDROID ? schema_1.AndroidSubmitProfileSchema : schema_1.ResolvedIosSubmitProfileSchema;
67
67
  return Schema.validate({}, { allowUnknown: false, abortEarly: false, convert: true }).value;
68
68
  }
69
69
  exports.getDefaultProfile = getDefaultProfile;
@@ -1,4 +1,5 @@
1
1
  import Joi from 'joi';
2
2
  export declare const AndroidSubmitProfileSchema: Joi.ObjectSchema<any>;
3
- export declare const IosSubmitProfileSchema: Joi.ObjectSchema<any>;
4
- export declare const SubmitProfileSchema: Joi.ObjectSchema<any>;
3
+ export declare const UnresolvedIosSubmitProfileSchema: Joi.ObjectSchema<any>;
4
+ export declare const ResolvedIosSubmitProfileSchema: Joi.ObjectSchema<any>;
5
+ export declare const UnresolvedSubmitProfileSchema: Joi.ObjectSchema<any>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SubmitProfileSchema = exports.IosSubmitProfileSchema = exports.AndroidSubmitProfileSchema = void 0;
3
+ exports.UnresolvedSubmitProfileSchema = exports.ResolvedIosSubmitProfileSchema = exports.UnresolvedIosSubmitProfileSchema = exports.AndroidSubmitProfileSchema = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const joi_1 = tslib_1.__importDefault(require("joi"));
6
6
  const types_1 = require("./types");
@@ -20,7 +20,9 @@ exports.AndroidSubmitProfileSchema = joi_1.default.object({
20
20
  otherwise: joi_1.default.forbidden(),
21
21
  }),
22
22
  });
23
- exports.IosSubmitProfileSchema = joi_1.default.object({
23
+ // it is less strict submission schema allowing for magic syntax like "$ASC_API_KEY_PATH"
24
+ // to read value from environment variable later on
25
+ exports.UnresolvedIosSubmitProfileSchema = joi_1.default.object({
24
26
  ascApiKeyPath: joi_1.default.string(),
25
27
  ascApiKeyId: joi_1.default.string(),
26
28
  ascApiKeyIssuerId: joi_1.default.string(),
@@ -34,8 +36,35 @@ exports.IosSubmitProfileSchema = joi_1.default.object({
34
36
  bundleIdentifier: joi_1.default.string(),
35
37
  metadataPath: joi_1.default.string(),
36
38
  });
37
- exports.SubmitProfileSchema = joi_1.default.object({
39
+ // more strict version after resolving all of the values
40
+ exports.ResolvedIosSubmitProfileSchema = joi_1.default.object({
41
+ ascApiKeyPath: joi_1.default.string(),
42
+ ascApiKeyId: joi_1.default.string()
43
+ .regex(/^[\dA-Z]+$/)
44
+ .message('Invalid Apple App Store Connect API Key ID ("ascApiKeyId") was specified. It should consist of uppercase letters or digits. Example: "AB32CZE81F". Learn more: https://expo.fyi/creating-asc-api-key.')
45
+ .max(30), // I didn't find any docs about it, but all of the ones I've seen are 10 characters long so 30 characters limit should be enough
46
+ ascApiKeyIssuerId: joi_1.default.string()
47
+ .uuid() // All of the issuer IDs I've seen are UUIDs, but again, I didn't find any docs about it
48
+ .message('Invalid Apple App Store Connect API Key Issuer ID ("ascApiKeyIssuerId") was specified. It should be a valid UUID. Example: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx". Learn more: https://expo.fyi/creating-asc-api-key.'),
49
+ appleId: joi_1.default.string()
50
+ .email()
51
+ .message('Invalid Apple ID was specified. It should be a valid email address. Example: "name@example.com".'),
52
+ ascAppId: joi_1.default.string()
53
+ .regex(/^\d+$/)
54
+ .message('Invalid Apple App Store Connect App ID ("ascAppId") was specified. It should consist only of digits. Example: "1234567891". Learn more: https://expo.fyi/asc-app-id.')
55
+ .max(30), // I didn't find any docs about it, but the longest app ID I've seen is 10 digits long so 30 characters limit should be enough
56
+ appleTeamId: joi_1.default.string()
57
+ .regex(/^[\dA-Z]{10}$/) // Apple says that it always has to be 10 characters long https://developer.apple.com/help/account/manage-your-team/locate-your-team-id/
58
+ .message('Invalid Apple Team ID was specified. It should consist of 10 uppercase letters or digits. Example: "AB32CZE81F".'),
59
+ sku: joi_1.default.string(),
60
+ language: joi_1.default.string().default('en-US'),
61
+ companyName: joi_1.default.string(),
62
+ appName: joi_1.default.string(),
63
+ bundleIdentifier: joi_1.default.string(),
64
+ metadataPath: joi_1.default.string(),
65
+ });
66
+ exports.UnresolvedSubmitProfileSchema = joi_1.default.object({
38
67
  extends: joi_1.default.string(),
39
68
  android: exports.AndroidSubmitProfileSchema,
40
- ios: exports.IosSubmitProfileSchema,
69
+ ios: exports.UnresolvedIosSubmitProfileSchema,
41
70
  });
package/build/utils.js CHANGED
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EasJsonUtils = void 0;
4
+ const eas_build_job_1 = require("@expo/eas-build-job");
4
5
  const resolver_1 = require("./build/resolver");
5
6
  const errors_1 = require("./errors");
6
7
  const resolver_2 = require("./submit/resolver");
8
+ const schema_1 = require("./submit/schema");
7
9
  class EasJsonUtils {
8
10
  static async getBuildProfileNamesAsync(accessor) {
9
11
  var _a;
@@ -66,7 +68,17 @@ class EasJsonUtils {
66
68
  }
67
69
  static async getSubmitProfileAsync(accessor, platform, profileName) {
68
70
  const easJson = await accessor.readAsync();
69
- return (0, resolver_2.resolveSubmitProfile)({ easJson, platform, profileName });
71
+ const profile = (0, resolver_2.resolveSubmitProfile)({ easJson, platform, profileName });
72
+ const Schema = platform === eas_build_job_1.Platform.ANDROID ? schema_1.AndroidSubmitProfileSchema : schema_1.ResolvedIosSubmitProfileSchema;
73
+ const { value, error } = Schema.validate(profile, {
74
+ allowUnknown: false,
75
+ abortEarly: false,
76
+ convert: true,
77
+ });
78
+ if (error) {
79
+ throw error;
80
+ }
81
+ return value;
70
82
  }
71
83
  }
72
84
  exports.EasJsonUtils = EasJsonUtils;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@expo/eas-json",
3
3
  "description": "A library for interacting with eas.json",
4
- "version": "7.1.1",
4
+ "version": "7.1.2",
5
5
  "author": "Expo <support@expo.dev>",
6
6
  "bugs": "https://github.com/expo/eas-cli/issues",
7
7
  "dependencies": {
@@ -53,5 +53,5 @@
53
53
  "node": "20.11.0",
54
54
  "yarn": "1.22.21"
55
55
  },
56
- "gitHead": "92c1256e8b186d366ed027148d6ebbb814965edb"
56
+ "gitHead": "e8e5eb622cf6a433d62b03754d0db5f1e688de9c"
57
57
  }