@ankhorage/deploy 0.4.0 → 0.5.0

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.
Files changed (210) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +1 -1
  3. package/dist/domain/AndroidDeploymentIntent.d.ts +10 -0
  4. package/dist/domain/AndroidDeploymentIntent.d.ts.map +1 -0
  5. package/dist/domain/AndroidDeploymentIntent.js +3 -0
  6. package/dist/domain/AndroidDeploymentIntent.js.map +1 -0
  7. package/dist/domain/AndroidDeploymentPublication.d.ts +12 -0
  8. package/dist/domain/AndroidDeploymentPublication.d.ts.map +1 -0
  9. package/dist/domain/AndroidDeploymentPublication.js +2 -0
  10. package/dist/domain/AndroidDeploymentPublication.js.map +1 -0
  11. package/dist/index.d.ts +2 -0
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js.map +1 -1
  14. package/dist/project/android/ProjectAndroidDeploymentAccess.d.ts +7 -0
  15. package/dist/project/android/ProjectAndroidDeploymentAccess.d.ts.map +1 -0
  16. package/dist/project/android/ProjectAndroidDeploymentAccess.js +2 -0
  17. package/dist/project/android/ProjectAndroidDeploymentAccess.js.map +1 -0
  18. package/dist/project/android/ProjectAndroidDeploymentExecution.d.ts +12 -0
  19. package/dist/project/android/ProjectAndroidDeploymentExecution.d.ts.map +1 -0
  20. package/dist/project/android/ProjectAndroidDeploymentExecution.js +2 -0
  21. package/dist/project/android/ProjectAndroidDeploymentExecution.js.map +1 -0
  22. package/dist/project/android/ProjectAndroidDeploymentInspection.d.ts +21 -0
  23. package/dist/project/android/ProjectAndroidDeploymentInspection.d.ts.map +1 -0
  24. package/dist/project/android/ProjectAndroidDeploymentInspection.js +2 -0
  25. package/dist/project/android/ProjectAndroidDeploymentInspection.js.map +1 -0
  26. package/dist/project/android/ProjectAndroidDeploymentRuntime.d.ts +13 -0
  27. package/dist/project/android/ProjectAndroidDeploymentRuntime.d.ts.map +1 -0
  28. package/dist/project/android/ProjectAndroidDeploymentRuntime.js +12 -0
  29. package/dist/project/android/ProjectAndroidDeploymentRuntime.js.map +1 -0
  30. package/dist/project/android/ProjectAndroidExecutionState.d.ts +10 -0
  31. package/dist/project/android/ProjectAndroidExecutionState.d.ts.map +1 -0
  32. package/dist/project/android/ProjectAndroidExecutionState.js +2 -0
  33. package/dist/project/android/ProjectAndroidExecutionState.js.map +1 -0
  34. package/dist/project/android/createProjectAndroidDeploymentPlan.d.ts +4 -0
  35. package/dist/project/android/createProjectAndroidDeploymentPlan.d.ts.map +1 -0
  36. package/dist/project/android/createProjectAndroidDeploymentPlan.js +13 -0
  37. package/dist/project/android/createProjectAndroidDeploymentPlan.js.map +1 -0
  38. package/dist/project/android/executeProjectAndroidDeployment.d.ts +12 -0
  39. package/dist/project/android/executeProjectAndroidDeployment.d.ts.map +1 -0
  40. package/dist/project/android/executeProjectAndroidDeployment.js +164 -0
  41. package/dist/project/android/executeProjectAndroidDeployment.js.map +1 -0
  42. package/dist/project/android/executeProjectAndroidStep.d.ts +15 -0
  43. package/dist/project/android/executeProjectAndroidStep.d.ts.map +1 -0
  44. package/dist/project/android/executeProjectAndroidStep.js +124 -0
  45. package/dist/project/android/executeProjectAndroidStep.js.map +1 -0
  46. package/dist/project/android/inspectProjectAndroidDeployment.d.ts +11 -0
  47. package/dist/project/android/inspectProjectAndroidDeployment.d.ts.map +1 -0
  48. package/dist/project/android/inspectProjectAndroidDeployment.js +90 -0
  49. package/dist/project/android/inspectProjectAndroidDeployment.js.map +1 -0
  50. package/dist/project/android/inspectProjectAndroidEasSetup.d.ts +5 -0
  51. package/dist/project/android/inspectProjectAndroidEasSetup.d.ts.map +1 -0
  52. package/dist/project/android/inspectProjectAndroidEasSetup.js +18 -0
  53. package/dist/project/android/inspectProjectAndroidEasSetup.js.map +1 -0
  54. package/dist/project/android/inspectProjectAndroidGooglePlay.d.ts +16 -0
  55. package/dist/project/android/inspectProjectAndroidGooglePlay.d.ts.map +1 -0
  56. package/dist/project/android/inspectProjectAndroidGooglePlay.js +52 -0
  57. package/dist/project/android/inspectProjectAndroidGooglePlay.js.map +1 -0
  58. package/dist/project/android/normalizeProjectAndroidDesired.d.ts +13 -0
  59. package/dist/project/android/normalizeProjectAndroidDesired.d.ts.map +1 -0
  60. package/dist/project/android/normalizeProjectAndroidDesired.js +25 -0
  61. package/dist/project/android/normalizeProjectAndroidDesired.js.map +1 -0
  62. package/dist/project/android/readCurrentProjectAndroidDeployment.d.ts +8 -0
  63. package/dist/project/android/readCurrentProjectAndroidDeployment.d.ts.map +1 -0
  64. package/dist/project/android/readCurrentProjectAndroidDeployment.js +44 -0
  65. package/dist/project/android/readCurrentProjectAndroidDeployment.js.map +1 -0
  66. package/dist/project/android/recordProjectAndroidDeployment.d.ts +21 -0
  67. package/dist/project/android/recordProjectAndroidDeployment.d.ts.map +1 -0
  68. package/dist/project/android/recordProjectAndroidDeployment.js +36 -0
  69. package/dist/project/android/recordProjectAndroidDeployment.js.map +1 -0
  70. package/dist/project/android/resolveProjectAndroidDeploymentAccess.d.ts +9 -0
  71. package/dist/project/android/resolveProjectAndroidDeploymentAccess.d.ts.map +1 -0
  72. package/dist/project/android/resolveProjectAndroidDeploymentAccess.js +7 -0
  73. package/dist/project/android/resolveProjectAndroidDeploymentAccess.js.map +1 -0
  74. package/dist/project/android/scopeProjectAndroidDeploymentAccess.d.ts +3 -0
  75. package/dist/project/android/scopeProjectAndroidDeploymentAccess.d.ts.map +1 -0
  76. package/dist/project/android/scopeProjectAndroidDeploymentAccess.js +7 -0
  77. package/dist/project/android/scopeProjectAndroidDeploymentAccess.js.map +1 -0
  78. package/dist/project/areDeploymentPlansEqual.d.ts +3 -0
  79. package/dist/project/areDeploymentPlansEqual.d.ts.map +1 -0
  80. package/dist/project/areDeploymentPlansEqual.js +4 -0
  81. package/dist/project/areDeploymentPlansEqual.js.map +1 -0
  82. package/dist/project/index.d.ts +6 -0
  83. package/dist/project/index.d.ts.map +1 -1
  84. package/dist/project/index.js +3 -0
  85. package/dist/project/index.js.map +1 -1
  86. package/dist/project/setupBlockingOutcome.d.ts +14 -0
  87. package/dist/project/setupBlockingOutcome.d.ts.map +1 -0
  88. package/dist/project/setupBlockingOutcome.js +38 -0
  89. package/dist/project/setupBlockingOutcome.js.map +1 -0
  90. package/dist/project/web/areDeploymentPlansEqual.d.ts +1 -2
  91. package/dist/project/web/areDeploymentPlansEqual.d.ts.map +1 -1
  92. package/dist/project/web/areDeploymentPlansEqual.js +1 -3
  93. package/dist/project/web/areDeploymentPlansEqual.js.map +1 -1
  94. package/dist/project/web/inspectProjectWebSetup.d.ts.map +1 -1
  95. package/dist/project/web/inspectProjectWebSetup.js +7 -2
  96. package/dist/project/web/inspectProjectWebSetup.js.map +1 -1
  97. package/dist/project/web/setupBlockingOutcome.d.ts.map +1 -1
  98. package/dist/project/web/setupBlockingOutcome.js +9 -31
  99. package/dist/project/web/setupBlockingOutcome.js.map +1 -1
  100. package/dist/providers/eas/android/EasAndroidBuildArtifact.d.ts +8 -0
  101. package/dist/providers/eas/android/EasAndroidBuildArtifact.d.ts.map +1 -0
  102. package/dist/providers/eas/android/EasAndroidBuildArtifact.js +2 -0
  103. package/dist/providers/eas/android/EasAndroidBuildArtifact.js.map +1 -0
  104. package/dist/providers/eas/android/buildAndroidWithEas.d.ts +25 -0
  105. package/dist/providers/eas/android/buildAndroidWithEas.d.ts.map +1 -0
  106. package/dist/providers/eas/android/buildAndroidWithEas.js +58 -0
  107. package/dist/providers/eas/android/buildAndroidWithEas.js.map +1 -0
  108. package/dist/providers/eas/android/generateLocalAndroidFingerprint.d.ts +15 -0
  109. package/dist/providers/eas/android/generateLocalAndroidFingerprint.d.ts.map +1 -0
  110. package/dist/providers/eas/android/generateLocalAndroidFingerprint.js +51 -0
  111. package/dist/providers/eas/android/generateLocalAndroidFingerprint.js.map +1 -0
  112. package/dist/providers/eas/android/inspectEasAndroidConfig.d.ts +28 -0
  113. package/dist/providers/eas/android/inspectEasAndroidConfig.d.ts.map +1 -0
  114. package/dist/providers/eas/android/inspectEasAndroidConfig.js +40 -0
  115. package/dist/providers/eas/android/inspectEasAndroidConfig.js.map +1 -0
  116. package/dist/providers/eas/android/parseEasAndroidBuild.d.ts +3 -0
  117. package/dist/providers/eas/android/parseEasAndroidBuild.d.ts.map +1 -0
  118. package/dist/providers/eas/android/parseEasAndroidBuild.js +45 -0
  119. package/dist/providers/eas/android/parseEasAndroidBuild.js.map +1 -0
  120. package/dist/providers/eas/android/parseEasAndroidConfig.d.ts +3 -0
  121. package/dist/providers/eas/android/parseEasAndroidConfig.d.ts.map +1 -0
  122. package/dist/providers/eas/android/parseEasAndroidConfig.js +59 -0
  123. package/dist/providers/eas/android/parseEasAndroidConfig.js.map +1 -0
  124. package/dist/providers/eas/createEasSetupAdapter.d.ts +13 -0
  125. package/dist/providers/eas/createEasSetupAdapter.d.ts.map +1 -0
  126. package/dist/providers/eas/createEasSetupAdapter.js +72 -0
  127. package/dist/providers/eas/createEasSetupAdapter.js.map +1 -0
  128. package/dist/providers/eas/publishWebToEas.js +1 -1
  129. package/dist/providers/eas/publishWebToEas.js.map +1 -1
  130. package/dist/providers/eas/resolveEasProcessEnvironment.d.ts +2 -0
  131. package/dist/providers/eas/resolveEasProcessEnvironment.d.ts.map +1 -1
  132. package/dist/providers/eas/resolveEasProcessEnvironment.js +15 -14
  133. package/dist/providers/eas/resolveEasProcessEnvironment.js.map +1 -1
  134. package/dist/providers/googlePlay/GooglePlayTokenFactory.d.ts +7 -0
  135. package/dist/providers/googlePlay/GooglePlayTokenFactory.d.ts.map +1 -0
  136. package/dist/providers/googlePlay/GooglePlayTokenFactory.js +14 -0
  137. package/dist/providers/googlePlay/GooglePlayTokenFactory.js.map +1 -0
  138. package/dist/providers/googlePlay/GooglePlayTrackState.d.ts +12 -0
  139. package/dist/providers/googlePlay/GooglePlayTrackState.d.ts.map +1 -0
  140. package/dist/providers/googlePlay/GooglePlayTrackState.js +35 -0
  141. package/dist/providers/googlePlay/GooglePlayTrackState.js.map +1 -0
  142. package/dist/providers/googlePlay/GooglePlayTransport.d.ts +15 -0
  143. package/dist/providers/googlePlay/GooglePlayTransport.d.ts.map +1 -0
  144. package/dist/providers/googlePlay/GooglePlayTransport.js +12 -0
  145. package/dist/providers/googlePlay/GooglePlayTransport.js.map +1 -0
  146. package/dist/providers/googlePlay/commitGooglePlayEdit.d.ts +8 -0
  147. package/dist/providers/googlePlay/commitGooglePlayEdit.d.ts.map +1 -0
  148. package/dist/providers/googlePlay/commitGooglePlayEdit.js +17 -0
  149. package/dist/providers/googlePlay/commitGooglePlayEdit.js.map +1 -0
  150. package/dist/providers/googlePlay/createGooglePlaySetupAdapter.d.ts +6 -0
  151. package/dist/providers/googlePlay/createGooglePlaySetupAdapter.d.ts.map +1 -0
  152. package/dist/providers/googlePlay/createGooglePlaySetupAdapter.js +32 -0
  153. package/dist/providers/googlePlay/createGooglePlaySetupAdapter.js.map +1 -0
  154. package/dist/providers/googlePlay/downloadAndroidArchive.d.ts +9 -0
  155. package/dist/providers/googlePlay/downloadAndroidArchive.d.ts.map +1 -0
  156. package/dist/providers/googlePlay/downloadAndroidArchive.js +28 -0
  157. package/dist/providers/googlePlay/downloadAndroidArchive.js.map +1 -0
  158. package/dist/providers/googlePlay/googlePlayUrls.d.ts +6 -0
  159. package/dist/providers/googlePlay/googlePlayUrls.d.ts.map +1 -0
  160. package/dist/providers/googlePlay/googlePlayUrls.js +18 -0
  161. package/dist/providers/googlePlay/googlePlayUrls.js.map +1 -0
  162. package/dist/providers/googlePlay/insertGooglePlayEdit.d.ts +7 -0
  163. package/dist/providers/googlePlay/insertGooglePlayEdit.d.ts.map +1 -0
  164. package/dist/providers/googlePlay/insertGooglePlayEdit.js +32 -0
  165. package/dist/providers/googlePlay/insertGooglePlayEdit.js.map +1 -0
  166. package/dist/providers/googlePlay/inspectGooglePlayTrack.d.ts +27 -0
  167. package/dist/providers/googlePlay/inspectGooglePlayTrack.d.ts.map +1 -0
  168. package/dist/providers/googlePlay/inspectGooglePlayTrack.js +80 -0
  169. package/dist/providers/googlePlay/inspectGooglePlayTrack.js.map +1 -0
  170. package/dist/providers/googlePlay/publishAndroidToGooglePlay.d.ts +32 -0
  171. package/dist/providers/googlePlay/publishAndroidToGooglePlay.d.ts.map +1 -0
  172. package/dist/providers/googlePlay/publishAndroidToGooglePlay.js +74 -0
  173. package/dist/providers/googlePlay/publishAndroidToGooglePlay.js.map +1 -0
  174. package/dist/providers/googlePlay/resolveGooglePlayAccessToken.d.ts +17 -0
  175. package/dist/providers/googlePlay/resolveGooglePlayAccessToken.d.ts.map +1 -0
  176. package/dist/providers/googlePlay/resolveGooglePlayAccessToken.js +62 -0
  177. package/dist/providers/googlePlay/resolveGooglePlayAccessToken.js.map +1 -0
  178. package/dist/providers/googlePlay/updateGooglePlayTrack.d.ts +12 -0
  179. package/dist/providers/googlePlay/updateGooglePlayTrack.d.ts.map +1 -0
  180. package/dist/providers/googlePlay/updateGooglePlayTrack.js +26 -0
  181. package/dist/providers/googlePlay/updateGooglePlayTrack.js.map +1 -0
  182. package/dist/providers/googlePlay/uploadGooglePlayBundle.d.ts +9 -0
  183. package/dist/providers/googlePlay/uploadGooglePlayBundle.d.ts.map +1 -0
  184. package/dist/providers/googlePlay/uploadGooglePlayBundle.js +34 -0
  185. package/dist/providers/googlePlay/uploadGooglePlayBundle.js.map +1 -0
  186. package/dist/providers/googlePlay/verifyGooglePlayPublication.d.ts +23 -0
  187. package/dist/providers/googlePlay/verifyGooglePlayPublication.d.ts.map +1 -0
  188. package/dist/providers/googlePlay/verifyGooglePlayPublication.js +31 -0
  189. package/dist/providers/googlePlay/verifyGooglePlayPublication.js.map +1 -0
  190. package/dist/targets/android/createAndroidDeploymentRevision.d.ts +3 -0
  191. package/dist/targets/android/createAndroidDeploymentRevision.d.ts.map +1 -0
  192. package/dist/targets/android/createAndroidDeploymentRevision.js +11 -0
  193. package/dist/targets/android/createAndroidDeploymentRevision.js.map +1 -0
  194. package/dist/targets/android/createAndroidTargetPlanContributor.d.ts +3 -0
  195. package/dist/targets/android/createAndroidTargetPlanContributor.d.ts.map +1 -0
  196. package/dist/targets/android/createAndroidTargetPlanContributor.js +26 -0
  197. package/dist/targets/android/createAndroidTargetPlanContributor.js.map +1 -0
  198. package/dist/targets/android/isAndroidDeploymentIntentValid.d.ts +3 -0
  199. package/dist/targets/android/isAndroidDeploymentIntentValid.d.ts.map +1 -0
  200. package/dist/targets/android/isAndroidDeploymentIntentValid.js +7 -0
  201. package/dist/targets/android/isAndroidDeploymentIntentValid.js.map +1 -0
  202. package/dist/targets/android/normalizeAndroidProviders.d.ts +16 -0
  203. package/dist/targets/android/normalizeAndroidProviders.d.ts.map +1 -0
  204. package/dist/targets/android/normalizeAndroidProviders.js +16 -0
  205. package/dist/targets/android/normalizeAndroidProviders.js.map +1 -0
  206. package/package.json +3 -2
  207. package/dist/providers/eas/createEasHostingSetupAdapter.d.ts +0 -7
  208. package/dist/providers/eas/createEasHostingSetupAdapter.d.ts.map +0 -1
  209. package/dist/providers/eas/createEasHostingSetupAdapter.js +0 -76
  210. package/dist/providers/eas/createEasHostingSetupAdapter.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspectEasAndroidConfig.js","sourceRoot":"","sources":["../../../../src/providers/eas/android/inspectEasAndroidConfig.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAYhE,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,OAO7C;IACC,IAAI,OAAO,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,cAAc,EAAE,CAAC;IACtE,MAAM,WAAW,GAAG,MAAM,4BAA4B,CAAC,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IAC1F,IAAI,CAAC,WAAW,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC;IACtF,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC;QACtC,OAAO,EAAE,KAAK;QACd,IAAI,EAAE;YACJ,QAAQ;YACR,YAAY;YACZ,SAAS;YACT,WAAW;YACX,OAAO,CAAC,YAAY;YACpB,QAAQ;YACR,mBAAmB;SACpB;QACD,GAAG,EAAE,OAAO,CAAC,WAAW;QACxB,GAAG,CAAC,WAAW,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,CAAC,GAAG,EAAE,CAAC;KACnE,CAAC,CAAC;IACH,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC;QAAE,OAAO,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACvE,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAC/C,CAAC;IACD,OAAO,qBAAqB,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;AAC5D,CAAC;AAED,SAAS,cAAc;IACrB,OAAO,OAAO,CAAC,+BAA+B,EAAE,mCAAmC,CAAC,CAAC;AACvF,CAAC;AAED,SAAS,OAAO,CACd,IAAY,EACZ,OAAO,GAAG,2DAA2D;IAErE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC;AAC9F,CAAC","sourcesContent":["import type { DeploymentCredentialReference } from '../../../domain/DeploymentCredentialReference';\nimport type { DeploymentFailure } from '../../../domain/DeploymentFailure';\nimport type { DeploymentRequiredAction } from '../../../domain/DeploymentRequiredAction';\nimport type { DeploymentSecretResolver } from '../../../domain/DeploymentSecretResolver';\nimport type { DeploymentProcessRunner } from '../../../runtime/process/DeploymentProcessRunner';\nimport { resolveEasProcessEnvironment } from '../resolveEasProcessEnvironment';\nimport { parseEasAndroidConfig } from './parseEasAndroidConfig';\n\nexport interface EasAndroidConfigSnapshot {\n readonly packageName: string;\n readonly profileEnvironment: Readonly<Record<string, string>>;\n}\n\nexport type EasAndroidConfigResult =\n | { readonly status: 'completed'; readonly config: EasAndroidConfigSnapshot }\n | { readonly status: 'action-required'; readonly action: DeploymentRequiredAction }\n | { readonly status: 'failed'; readonly failure: DeploymentFailure };\n\nexport async function inspectEasAndroidConfig(options: {\n readonly projectRoot: string;\n readonly packageName: string;\n readonly buildProfile: string;\n readonly credentials: readonly DeploymentCredentialReference[];\n readonly resolveSecret: DeploymentSecretResolver;\n readonly runProcess: DeploymentProcessRunner;\n}): Promise<EasAndroidConfigResult> {\n if (options.buildProfile.trim().length === 0) return invalidProfile();\n const environment = await resolveEasProcessEnvironment({ ...options, target: 'android' });\n if (!environment.ok) return { status: 'action-required', action: environment.action };\n const result = await options.runProcess({\n command: 'eas',\n args: [\n 'config',\n '--platform',\n 'android',\n '--profile',\n options.buildProfile,\n '--json',\n '--non-interactive',\n ],\n cwd: options.projectRoot,\n ...(environment.env === undefined ? {} : { env: environment.env }),\n });\n if (result.exitCode !== 0) return failure('EAS_ANDROID_CONFIG_FAILED');\n let parsed: unknown;\n try {\n parsed = JSON.parse(result.stdout);\n } catch {\n return failure('EAS_ANDROID_CONFIG_INVALID');\n }\n return parseEasAndroidConfig(parsed, options.packageName);\n}\n\nfunction invalidProfile(): EasAndroidConfigResult {\n return failure('INVALID_ANDROID_BUILD_PROFILE', 'Android build profile is invalid.');\n}\n\nfunction failure(\n code: string,\n message = 'EAS Android project configuration could not be inspected.',\n): EasAndroidConfigResult {\n return { status: 'failed', failure: { code, message, target: 'android', provider: 'eas' } };\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import type { EasAndroidBuildArtifact } from './EasAndroidBuildArtifact';
2
+ export declare function parseEasAndroidBuild(value: unknown, expectedFingerprint: string, expectedProfile: string): EasAndroidBuildArtifact | null;
3
+ //# sourceMappingURL=parseEasAndroidBuild.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseEasAndroidBuild.d.ts","sourceRoot":"","sources":["../../../../src/providers/eas/android/parseEasAndroidBuild.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEzE,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,EACd,mBAAmB,EAAE,MAAM,EAC3B,eAAe,EAAE,MAAM,GACtB,uBAAuB,GAAG,IAAI,CAgBhC"}
@@ -0,0 +1,45 @@
1
+ export function parseEasAndroidBuild(value, expectedFingerprint, expectedProfile) {
2
+ if (!Array.isArray(value) || value.length !== 1 || !isRecord(value[0]))
3
+ return null;
4
+ const build = value[0];
5
+ if (build.status !== 'FINISHED' || build.platform !== 'ANDROID')
6
+ return null;
7
+ if (!isNonEmptyString(build.id) || build.buildProfile !== expectedProfile)
8
+ return null;
9
+ if (!isRecord(build.fingerprint) || build.fingerprint.hash !== expectedFingerprint)
10
+ return null;
11
+ if (!isRecord(build.artifacts) || !isHttpUrl(build.artifacts.applicationArchiveUrl))
12
+ return null;
13
+ const versionCode = parseVersionCode(build.appBuildVersion);
14
+ if (versionCode === null)
15
+ return null;
16
+ return {
17
+ buildId: build.id,
18
+ buildProfile: expectedProfile,
19
+ fingerprint: expectedFingerprint,
20
+ versionCode,
21
+ archiveUrl: build.artifacts.applicationArchiveUrl,
22
+ };
23
+ }
24
+ function parseVersionCode(value) {
25
+ const parsed = typeof value === 'number' ? value : typeof value === 'string' ? Number(value) : NaN;
26
+ return Number.isSafeInteger(parsed) && parsed > 0 ? parsed : null;
27
+ }
28
+ function isHttpUrl(value) {
29
+ if (!isNonEmptyString(value))
30
+ return false;
31
+ try {
32
+ const parsed = new URL(value);
33
+ return parsed.protocol === 'https:' || parsed.protocol === 'http:';
34
+ }
35
+ catch {
36
+ return false;
37
+ }
38
+ }
39
+ function isRecord(value) {
40
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
41
+ }
42
+ function isNonEmptyString(value) {
43
+ return typeof value === 'string' && value.trim().length > 0;
44
+ }
45
+ //# sourceMappingURL=parseEasAndroidBuild.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseEasAndroidBuild.js","sourceRoot":"","sources":["../../../../src/providers/eas/android/parseEasAndroidBuild.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,oBAAoB,CAClC,KAAc,EACd,mBAA2B,EAC3B,eAAuB;IAEvB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACpF,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACvB,IAAI,KAAK,CAAC,MAAM,KAAK,UAAU,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAC7E,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC,YAAY,KAAK,eAAe;QAAE,OAAO,IAAI,CAAC;IACvF,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,WAAW,CAAC,IAAI,KAAK,mBAAmB;QAAE,OAAO,IAAI,CAAC;IAChG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,qBAAqB,CAAC;QAAE,OAAO,IAAI,CAAC;IACjG,MAAM,WAAW,GAAG,gBAAgB,CAAC,KAAK,CAAC,eA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AC,CAAC;AAC9D,CAAC","sourcesContent":["import type { EasAndroidBuildArtifact } from './EasAndroidBuildArtifact';\n\nexport function parseEasAndroidBuild(\n value: unknown,\n expectedFingerprint: string,\n expectedProfile: string,\n): EasAndroidBuildArtifact | null {\n if (!Array.isArray(value) || value.length !== 1 || !isRecord(value[0])) return null;\n const build = value[0];\n if (build.status !== 'FINISHED' || build.platform !== 'ANDROID') return null;\n if (!isNonEmptyString(build.id) || build.buildProfile !== expectedProfile) return null;\n if (!isRecord(build.fingerprint) || build.fingerprint.hash !== expectedFingerprint) return null;\n if (!isRecord(build.artifacts) || !isHttpUrl(build.artifacts.applicationArchiveUrl)) return null;\n const versionCode = parseVersionCode(build.appBuildVersion);\n if (versionCode === null) return null;\n return {\n buildId: build.id,\n buildProfile: expectedProfile,\n fingerprint: expectedFingerprint,\n versionCode,\n archiveUrl: build.artifacts.applicationArchiveUrl,\n };\n}\n\nfunction parseVersionCode(value: unknown): number | null {\n const parsed =\n typeof value === 'number' ? value : typeof value === 'string' ? Number(value) : NaN;\n return Number.isSafeInteger(parsed) && parsed > 0 ? parsed : null;\n}\n\nfunction isHttpUrl(value: unknown): value is string {\n if (!isNonEmptyString(value)) return false;\n try {\n const parsed = new URL(value);\n return parsed.protocol === 'https:' || parsed.protocol === 'http:';\n } catch {\n return false;\n }\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction isNonEmptyString(value: unknown): value is string {\n return typeof value === 'string' && value.trim().length > 0;\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import type { EasAndroidConfigResult } from './inspectEasAndroidConfig';
2
+ export declare function parseEasAndroidConfig(value: unknown, expectedPackage: string): EasAndroidConfigResult;
3
+ //# sourceMappingURL=parseEasAndroidConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseEasAndroidConfig.d.ts","sourceRoot":"","sources":["../../../../src/providers/eas/android/parseEasAndroidConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAA4B,MAAM,2BAA2B,CAAC;AAElG,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,OAAO,EACd,eAAe,EAAE,MAAM,GACtB,sBAAsB,CA2BxB"}
@@ -0,0 +1,59 @@
1
+ export function parseEasAndroidConfig(value, expectedPackage) {
2
+ if (!isRecord(value) || !isRecord(value.buildProfile) || !isRecord(value.appConfig)) {
3
+ return failure('EAS_ANDROID_CONFIG_INVALID');
4
+ }
5
+ const androidConfig = value.appConfig.android;
6
+ if (!isRecord(androidConfig) || !isNonEmptyString(androidConfig.package)) {
7
+ return failure('EAS_ANDROID_PACKAGE_MISSING');
8
+ }
9
+ if (androidConfig.package !== expectedPackage) {
10
+ return failure('ANDROID_PACKAGE_MISMATCH', 'EAS Android package does not match deployment config.');
11
+ }
12
+ if (!isStoreProfile(value.buildProfile)) {
13
+ return failure('EAS_ANDROID_PROFILE_NOT_STORE_READY', 'EAS Android build profile is not store-ready.');
14
+ }
15
+ const environment = normalizeEnvironment(value.buildProfile.env);
16
+ if (environment === null)
17
+ return failure('EAS_ANDROID_CONFIG_INVALID');
18
+ const config = {
19
+ packageName: androidConfig.package,
20
+ profileEnvironment: environment,
21
+ };
22
+ return { status: 'completed', config };
23
+ }
24
+ function isStoreProfile(profile) {
25
+ if (profile.developmentClient === true || profile.distribution === 'internal')
26
+ return false;
27
+ if (profile.withoutCredentials === true)
28
+ return false;
29
+ if (profile.android === undefined)
30
+ return true;
31
+ if (!isRecord(profile.android))
32
+ return false;
33
+ if (profile.android.distribution === 'internal' || profile.android.withoutCredentials === true) {
34
+ return false;
35
+ }
36
+ if (profile.android.buildType === 'apk')
37
+ return false;
38
+ return profile.android.gradleCommand === undefined;
39
+ }
40
+ function normalizeEnvironment(value) {
41
+ if (value === undefined)
42
+ return {};
43
+ if (!isRecord(value))
44
+ return null;
45
+ const entries = Object.entries(value);
46
+ if (entries.some(([, item]) => typeof item !== 'string'))
47
+ return null;
48
+ return Object.fromEntries(entries);
49
+ }
50
+ function failure(code, message = 'EAS Android configuration is invalid.') {
51
+ return { status: 'failed', failure: { code, message, target: 'android', provider: 'eas' } };
52
+ }
53
+ function isRecord(value) {
54
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
55
+ }
56
+ function isNonEmptyString(value) {
57
+ return typeof value === 'string' && value.trim().length > 0;
58
+ }
59
+ //# sourceMappingURL=parseEasAndroidConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseEasAndroidConfig.js","sourceRoot":"","sources":["../../../../src/providers/eas/android/parseEasAndroidConfig.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,qBAAqB,CACnC,KAAc,EACd,eAAuB;IAEvB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC;QACpF,OAAO,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAC/C,CAAC;IACD,MAAM,aAAa,GAAG,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC;IAC9C,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;QACzE,OAAO,OAAO,CAAC,6BAA6B,CAAC,CAAC;IAChD,CAAC;IACD,IAAI,aAAa,CAAC,OAAO,KAAK,eAAe,EAAE,CAAC;QAC9C,OAAO,OAAO,CACZ,0BAA0B,EAC1B,uDAAuD,CACxD,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC;QACxC,OAAO,OAAO,CACZ,qCAAqC,EACrC,+CAA+C,CAChD,CAAC;IACJ,CAAC;IACD,MAAM,WAAW,GAAG,oBAAoB,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IACjE,IAA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OAAO,IAAI,CAAC;IACtE,OAAO,MAAM,CAAC,WAAW,CAAC,OAAO,CAAqC,CAAC;AACzE,CAAC;AAED,SAAS,OAAO,CACd,IAAY,EACZ,OAAO,GAAG,uCAAuC;IAEjD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC;AAC9F,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAc;IACtC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;AAC9D,CAAC","sourcesContent":["import type { EasAndroidConfigResult, EasAndroidConfigSnapshot } from './inspectEasAndroidConfig';\n\nexport function parseEasAndroidConfig(\n value: unknown,\n expectedPackage: string,\n): EasAndroidConfigResult {\n if (!isRecord(value) || !isRecord(value.buildProfile) || !isRecord(value.appConfig)) {\n return failure('EAS_ANDROID_CONFIG_INVALID');\n }\n const androidConfig = value.appConfig.android;\n if (!isRecord(androidConfig) || !isNonEmptyString(androidConfig.package)) {\n return failure('EAS_ANDROID_PACKAGE_MISSING');\n }\n if (androidConfig.package !== expectedPackage) {\n return failure(\n 'ANDROID_PACKAGE_MISMATCH',\n 'EAS Android package does not match deployment config.',\n );\n }\n if (!isStoreProfile(value.buildProfile)) {\n return failure(\n 'EAS_ANDROID_PROFILE_NOT_STORE_READY',\n 'EAS Android build profile is not store-ready.',\n );\n }\n const environment = normalizeEnvironment(value.buildProfile.env);\n if (environment === null) return failure('EAS_ANDROID_CONFIG_INVALID');\n const config: EasAndroidConfigSnapshot = {\n packageName: androidConfig.package,\n profileEnvironment: environment,\n };\n return { status: 'completed', config };\n}\n\nfunction isStoreProfile(profile: Record<string, unknown>): boolean {\n if (profile.developmentClient === true || profile.distribution === 'internal') return false;\n if (profile.withoutCredentials === true) return false;\n if (profile.android === undefined) return true;\n if (!isRecord(profile.android)) return false;\n if (profile.android.distribution === 'internal' || profile.android.withoutCredentials === true) {\n return false;\n }\n if (profile.android.buildType === 'apk') return false;\n return profile.android.gradleCommand === undefined;\n}\n\nfunction normalizeEnvironment(value: unknown): Readonly<Record<string, string>> | null {\n if (value === undefined) return {};\n if (!isRecord(value)) return null;\n const entries = Object.entries(value);\n if (entries.some(([, item]) => typeof item !== 'string')) return null;\n return Object.fromEntries(entries) as Readonly<Record<string, string>>;\n}\n\nfunction failure(\n code: string,\n message = 'EAS Android configuration is invalid.',\n): EasAndroidConfigResult {\n return { status: 'failed', failure: { code, message, target: 'android', provider: 'eas' } };\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction isNonEmptyString(value: unknown): value is string {\n return typeof value === 'string' && value.trim().length > 0;\n}\n"]}
@@ -0,0 +1,13 @@
1
+ import type { AppDeployTargetId } from '@ankhorage/contracts/deploy';
2
+ import type { DeploymentCapability } from '../../domain/DeploymentCapability';
3
+ import type { DeploymentProviderSetupAdapter } from '../../domain/DeploymentProviderSetupAdapter';
4
+ import type { DeploymentProcessRunner } from '../../runtime/process/DeploymentProcessRunner';
5
+ interface EasSetupOptions {
6
+ readonly projectRoot: string;
7
+ readonly runProcess: DeploymentProcessRunner;
8
+ readonly target: AppDeployTargetId;
9
+ readonly capability: DeploymentCapability;
10
+ }
11
+ export declare function createEasSetupAdapter(options: EasSetupOptions): DeploymentProviderSetupAdapter;
12
+ export {};
13
+ //# sourceMappingURL=createEasSetupAdapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createEasSetupAdapter.d.ts","sourceRoot":"","sources":["../../../src/providers/eas/createEasSetupAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAErE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAIlG,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AAG7F,UAAU,eAAe;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,uBAAuB,CAAC;IAC7C,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,UAAU,EAAE,oBAAoB,CAAC;CAC3C;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,eAAe,GAAG,8BAA8B,CAK9F"}
@@ -0,0 +1,72 @@
1
+ import { resolveEasProcessEnvironment } from './resolveEasProcessEnvironment';
2
+ export function createEasSetupAdapter(options) {
3
+ return {
4
+ provider: 'eas',
5
+ inspectSetup: (context) => inspectEasSetup(options, context),
6
+ };
7
+ }
8
+ async function inspectEasSetup(options, context) {
9
+ const environment = await resolveEasProcessEnvironment({ ...context, target: options.target });
10
+ if (!environment.ok)
11
+ return authenticationRequired(options, environment.action);
12
+ const processOptions = environment.env === undefined ? {} : { env: environment.env };
13
+ const account = await options.runProcess({
14
+ command: 'eas',
15
+ args: ['account:view'],
16
+ cwd: options.projectRoot,
17
+ ...processOptions,
18
+ });
19
+ if (account.exitCode !== 0)
20
+ return authenticationRequired(options, authenticationAction(options));
21
+ const project = await options.runProcess({
22
+ command: 'eas',
23
+ args: ['project:info'],
24
+ cwd: options.projectRoot,
25
+ ...processOptions,
26
+ });
27
+ return project.exitCode === 0 ? ready(options) : projectLinkRequired(options);
28
+ }
29
+ function authenticationAction(options) {
30
+ return {
31
+ type: 'authentication',
32
+ provider: 'eas',
33
+ target: options.target,
34
+ code: 'EAS_AUTHENTICATION_REQUIRED',
35
+ message: `EAS authentication is required for ${options.target} deployment.`,
36
+ };
37
+ }
38
+ function authenticationRequired(options, action) {
39
+ return {
40
+ provider: 'eas',
41
+ authentication: { status: 'required', action },
42
+ capabilities: [unavailable(options, 'Authentication required.')],
43
+ provisioning: [{ type: 'authentication', action }],
44
+ };
45
+ }
46
+ function ready(options) {
47
+ return {
48
+ provider: 'eas',
49
+ authentication: { status: 'authenticated' },
50
+ capabilities: [{ capability: options.capability, status: 'available' }],
51
+ provisioning: [],
52
+ };
53
+ }
54
+ function projectLinkRequired(options) {
55
+ const action = {
56
+ type: 'manual-action',
57
+ target: options.target,
58
+ provider: 'eas',
59
+ code: 'EAS_PROJECT_LINK_REQUIRED',
60
+ message: 'Link the Expo project to an EAS project before deployment.',
61
+ };
62
+ return {
63
+ provider: 'eas',
64
+ authentication: { status: 'authenticated' },
65
+ capabilities: [unavailable(options, 'EAS project link required.')],
66
+ provisioning: [{ type: 'manual-action', action }],
67
+ };
68
+ }
69
+ function unavailable(options, reason) {
70
+ return { capability: options.capability, status: 'unavailable', reason };
71
+ }
72
+ //# sourceMappingURL=createEasSetupAdapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createEasSetupAdapter.js","sourceRoot":"","sources":["../../../src/providers/eas/createEasSetupAdapter.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAS9E,MAAM,UAAU,qBAAqB,CAAC,OAAwB;IAC5D,OAAO;QACL,QAAQ,EAAE,KAAK;QACf,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC;KAC7D,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,eAAe,CAC5B,OAAwB,EACxB,OAAuC;IAEvC,MAAM,WAAW,GAAG,MAAM,4BAA4B,CAAC,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;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EAAE,UAAU,EAAE,MAAM,EAAE;QAC9C,YAAY,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,0BAA0B,CAAC,CAAC;QAChE,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,CAAC;KACnD,CAAC;AACJ,CAAC;AAED,SAAS,KAAK,CAAC,OAAwB;IACrC,OAAO;QACL,QAAQ,EAAE,KAAK;QACf,cAAc,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE;QAC3C,YAAY,EAAE,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;QACvE,YAAY,EAAE,EAAE;KACjB,CAAC;AACJ,CAAC;AAED,SAAS,mBAAmB,CAAC,OAAwB;IACnD,MAAM,MAAM,GAAG;QACb,IAAI,EAAE,eAAwB;QAC9B,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,2BAA2B;QACjC,OAAO,EAAE,4DAA4D;KACtE,CAAC;IACF,OAAO;QACL,QAAQ,EAAE,KAAK;QACf,cAAc,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE;QAC3C,YAAY,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,4BAA4B,CAAC,CAAC;QAClE,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,CAAC;KAClD,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,OAAwB,EAAE,MAAc;IAC3D,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,aAAsB,EAAE,MAAM,EAAE,CAAC;AACpF,CAAC","sourcesContent":["import type { AppDeployTargetId } from '@ankhorage/contracts/deploy';\n\nimport type { DeploymentCapability } from '../../domain/DeploymentCapability';\nimport type { DeploymentProviderSetupAdapter } from '../../domain/DeploymentProviderSetupAdapter';\nimport type { DeploymentProviderSetupContext } from '../../domain/DeploymentProviderSetupContext';\nimport type { DeploymentProviderSetupInspection } from '../../domain/DeploymentProviderSetupInspection';\nimport type { DeploymentAuthenticationRequiredAction } from '../../domain/DeploymentRequiredAction';\nimport type { DeploymentProcessRunner } from '../../runtime/process/DeploymentProcessRunner';\nimport { resolveEasProcessEnvironment } from './resolveEasProcessEnvironment';\n\ninterface EasSetupOptions {\n readonly projectRoot: string;\n readonly runProcess: DeploymentProcessRunner;\n readonly target: AppDeployTargetId;\n readonly capability: DeploymentCapability;\n}\n\nexport function createEasSetupAdapter(options: EasSetupOptions): DeploymentProviderSetupAdapter {\n return {\n provider: 'eas',\n inspectSetup: (context) => inspectEasSetup(options, context),\n };\n}\n\nasync function inspectEasSetup(\n options: EasSetupOptions,\n context: DeploymentProviderSetupContext,\n): Promise<DeploymentProviderSetupInspection> {\n const environment = await resolveEasProcessEnvironment({ ...context, target: options.target });\n if (!environment.ok) return authenticationRequired(options, environment.action);\n const processOptions = environment.env === undefined ? {} : { env: environment.env };\n const account = await options.runProcess({\n command: 'eas',\n args: ['account:view'],\n cwd: options.projectRoot,\n ...processOptions,\n });\n if (account.exitCode !== 0) return authenticationRequired(options, authenticationAction(options));\n const project = await options.runProcess({\n command: 'eas',\n args: ['project:info'],\n cwd: options.projectRoot,\n ...processOptions,\n });\n return project.exitCode === 0 ? ready(options) : projectLinkRequired(options);\n}\n\nfunction authenticationAction(options: EasSetupOptions): DeploymentAuthenticationRequiredAction {\n return {\n type: 'authentication',\n provider: 'eas',\n target: options.target,\n code: 'EAS_AUTHENTICATION_REQUIRED',\n message: `EAS authentication is required for ${options.target} deployment.`,\n };\n}\n\nfunction authenticationRequired(\n options: EasSetupOptions,\n action: DeploymentAuthenticationRequiredAction,\n): DeploymentProviderSetupInspection {\n return {\n provider: 'eas',\n authentication: { status: 'required', action },\n capabilities: [unavailable(options, 'Authentication required.')],\n provisioning: [{ type: 'authentication', action }],\n };\n}\n\nfunction ready(options: EasSetupOptions): DeploymentProviderSetupInspection {\n return {\n provider: 'eas',\n authentication: { status: 'authenticated' },\n capabilities: [{ capability: options.capability, status: 'available' }],\n provisioning: [],\n };\n}\n\nfunction projectLinkRequired(options: EasSetupOptions): DeploymentProviderSetupInspection {\n const action = {\n type: 'manual-action' as const,\n target: options.target,\n provider: 'eas',\n code: 'EAS_PROJECT_LINK_REQUIRED',\n message: 'Link the Expo project to an EAS project before deployment.',\n };\n return {\n provider: 'eas',\n authentication: { status: 'authenticated' },\n capabilities: [unavailable(options, 'EAS project link required.')],\n provisioning: [{ type: 'manual-action', action }],\n };\n}\n\nfunction unavailable(options: EasSetupOptions, reason: string) {\n return { capability: options.capability, status: 'unavailable' as const, reason };\n}\n"]}
@@ -3,7 +3,7 @@ import { resolveEasProcessEnvironment } from './resolveEasProcessEnvironment';
3
3
  export async function publishWebToEas(options) {
4
4
  if (!isValidIntent(options.intent))
5
5
  return invalidIntentFailure();
6
- const environment = await resolveEasProcessEnvironment(options);
6
+ const environment = await resolveEasProcessEnvironment({ ...options, target: 'web' });
7
7
  if (!environment.ok)
8
8
  return { status: 'action-required', action: environment.action };
9
9
  const result = await options.runProcess({
@@ -1 +1 @@
1
- {"version":3,"file":"publishWebToEas.js","sourceRoot":"","sources":["../../../src/providers/eas/publishWebToEas.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAO9E,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAQrC;IACC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC;QAAE,OAAO,oBAAoB,EAAE,CAAC;IAClE,MAAM,WAAW,GAAG,MAAM,4BAA4B,CAAC,OAAO,CAAC,CAAC;IAChE,IAAI,CAAC,WAAW,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC;IAEtF,MA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AC,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IACnE,IAAI,MAAM,CAAC,WAAW,KAAK,SAAS;QAAE,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IACrF,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,aAAa,CAAC,MAAkC;IACvD,OAAO,CACL,CAAC,MAAM,CAAC,KAAK,KAAK,SAAS,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;QAC9D,CAAC,MAAM,CAAC,WAAW,KAAK,SAAS,IAAI,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAC3E,CAAC;AACJ,CAAC;AAED,SAAS,oBAAoB;IAC3B,OAAO,eAAe,CAAC,4BAA4B,EAAE,gCAAgC,CAAC,CAAC;AACzF,CAAC;AAED,SAAS,eAAe,CACtB,IAAI,GAAG,wBAAwB,EAC/B,OAAO,GAAG,iCAAiC;IAE3C,OAAO;QACL,MAAM,EAAE,QAAQ;QAChB,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE;KAC3D,CAAC;AACJ,CAAC","sourcesContent":["import type { DeploymentCredentialReference } from '../../domain/DeploymentCredentialReference';\nimport type { DeploymentFailure } from '../../domain/DeploymentFailure';\nimport type { DeploymentRequiredAction } from '../../domain/DeploymentRequiredAction';\nimport type { DeploymentSecretResolver } from '../../domain/DeploymentSecretResolver';\nimport type { WebDeploymentPublication } from '../../domain/WebDeploymentPublication';\nimport type { WebDeploymentPublishIntent } from '../../domain/WebDeploymentPublishIntent';\nimport type { DeploymentProcessRunner } from '../../runtime/process/DeploymentProcessRunner';\nimport { parseEasWebPublication } from './parseEasWebPublication';\nimport { resolveEasProcessEnvironment } from './resolveEasProcessEnvironment';\n\nexport type EasWebPublishResult =\n | { readonly status: 'completed'; readonly publication: WebDeploymentPublication }\n | { readonly status: 'action-required'; readonly action: DeploymentRequiredAction }\n | { readonly status: 'failed'; readonly failure: DeploymentFailure };\n\nexport async function publishWebToEas(options: {\n readonly projectRoot: string;\n readonly exportDirectory: string;\n readonly revision: string;\n readonly intent: WebDeploymentPublishIntent;\n readonly credentials: readonly DeploymentCredentialReference[];\n readonly resolveSecret: DeploymentSecretResolver;\n readonly runProcess: DeploymentProcessRunner;\n}): Promise<EasWebPublishResult> {\n if (!isValidIntent(options.intent)) return invalidIntentFailure();\n const environment = await resolveEasProcessEnvironment(options);\n if (!environment.ok) return { status: 'action-required', action: environment.action };\n\n const result = await options.runProcess({\n command: 'eas',\n args: createDeployArgs(options.exportDirectory, options.intent),\n cwd: options.projectRoot,\n ...(environment.env === undefined ? {} : { env: environment.env }),\n });\n if (result.exitCode !== 0) return providerFailure();\n\n let parsed: unknown;\n try {\n parsed = JSON.parse(result.stdout);\n } catch {\n return providerFailure('EAS_WEB_INVALID_RESULT', 'EAS Hosting returned an invalid result.');\n }\n const publication = parseEasWebPublication(\n parsed,\n options.revision,\n options.intent.mode === 'production',\n );\n return publication === null\n ? providerFailure('EAS_WEB_INVALID_RESULT', 'EAS Hosting returned an invalid result.')\n : { status: 'completed', publication };\n}\n\nfunction createDeployArgs(\n exportDirectory: string,\n intent: WebDeploymentPublishIntent,\n): readonly string[] {\n const args = ['deploy', '--json', '--non-interactive', '--export-dir', exportDirectory];\n if (intent.mode === 'production') args.push('--prod');\n if (intent.alias !== undefined) args.push('--alias', intent.alias);\n if (intent.environment !== undefined) args.push('--environment', intent.environment);\n return args;\n}\n\nfunction isValidIntent(intent: WebDeploymentPublishIntent): boolean {\n return (\n (intent.alias === undefined || intent.alias.trim().length > 0) &&\n (intent.environment === undefined || intent.environment.trim().length > 0)\n );\n}\n\nfunction invalidIntentFailure(): EasWebPublishResult {\n return providerFailure('INVALID_WEB_PUBLISH_INTENT', 'Web publish intent is invalid.');\n}\n\nfunction providerFailure(\n code = 'EAS_WEB_PUBLISH_FAILED',\n message = 'EAS Hosting publication failed.',\n): EasWebPublishResult {\n return {\n status: 'failed',\n failure: { code, message, target: 'web', provider: 'eas' },\n };\n}\n"]}
1
+ {"version":3,"file":"publishWebToEas.js","sourceRoot":"","sources":["../../../src/providers/eas/publishWebToEas.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAO9E,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAQrC;IACC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC;QAAE,OAAO,oBAAoB,EAAE,CAAC;IAClE,MAAM,WAAW,GAAG,MAAM,4BAA4B,CAAC,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IACtF,IAAI,CAAC,WAAW,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC;IAEtF,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC;QACtC,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,gBAAgB,CAAC,OAAO,CAAC,eAAe,EAAE,OAAO,CAAC,MAAM,CAAC;QAC/D,GAAG,EAAE,OAAO,CAAC,WAAW;QACxB,GAAG,CAAC,WAAW,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,CAAC,GAAG,EAAE,CAAC;KACnE,CAAC,CAAC;IACH,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC;QAAE,OAAO,eAAe,EAAE,CAAC;IAEpD,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACr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C,4BAA4B,EAAE,gCAAgC,CAAC,CAAC;AACzF,CAAC;AAED,SAAS,eAAe,CACtB,IAAI,GAAG,wBAAwB,EAC/B,OAAO,GAAG,iCAAiC;IAE3C,OAAO;QACL,MAAM,EAAE,QAAQ;QAChB,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE;KAC3D,CAAC;AACJ,CAAC","sourcesContent":["import type { DeploymentCredentialReference } from '../../domain/DeploymentCredentialReference';\nimport type { DeploymentFailure } from '../../domain/DeploymentFailure';\nimport type { DeploymentRequiredAction } from '../../domain/DeploymentRequiredAction';\nimport type { DeploymentSecretResolver } from '../../domain/DeploymentSecretResolver';\nimport type { WebDeploymentPublication } from '../../domain/WebDeploymentPublication';\nimport type { WebDeploymentPublishIntent } from '../../domain/WebDeploymentPublishIntent';\nimport type { DeploymentProcessRunner } from '../../runtime/process/DeploymentProcessRunner';\nimport { parseEasWebPublication } from './parseEasWebPublication';\nimport { resolveEasProcessEnvironment } from './resolveEasProcessEnvironment';\n\nexport type EasWebPublishResult =\n | { readonly status: 'completed'; readonly publication: WebDeploymentPublication }\n | { readonly status: 'action-required'; readonly action: DeploymentRequiredAction }\n | { readonly status: 'failed'; readonly failure: DeploymentFailure };\n\nexport async function publishWebToEas(options: {\n readonly projectRoot: string;\n readonly exportDirectory: string;\n readonly revision: string;\n readonly intent: WebDeploymentPublishIntent;\n readonly credentials: readonly DeploymentCredentialReference[];\n readonly resolveSecret: DeploymentSecretResolver;\n readonly runProcess: DeploymentProcessRunner;\n}): Promise<EasWebPublishResult> {\n if (!isValidIntent(options.intent)) return invalidIntentFailure();\n const environment = await resolveEasProcessEnvironment({ ...options, target: 'web' });\n if (!environment.ok) return { status: 'action-required', action: environment.action };\n\n const result = await options.runProcess({\n command: 'eas',\n args: createDeployArgs(options.exportDirectory, options.intent),\n cwd: options.projectRoot,\n ...(environment.env === undefined ? {} : { env: environment.env }),\n });\n if (result.exitCode !== 0) return providerFailure();\n\n let parsed: unknown;\n try {\n parsed = JSON.parse(result.stdout);\n } catch {\n return providerFailure('EAS_WEB_INVALID_RESULT', 'EAS Hosting returned an invalid result.');\n }\n const publication = parseEasWebPublication(\n parsed,\n options.revision,\n options.intent.mode === 'production',\n );\n return publication === null\n ? providerFailure('EAS_WEB_INVALID_RESULT', 'EAS Hosting returned an invalid result.')\n : { status: 'completed', publication };\n}\n\nfunction createDeployArgs(\n exportDirectory: string,\n intent: WebDeploymentPublishIntent,\n): readonly string[] {\n const args = ['deploy', '--json', '--non-interactive', '--export-dir', exportDirectory];\n if (intent.mode === 'production') args.push('--prod');\n if (intent.alias !== undefined) args.push('--alias', intent.alias);\n if (intent.environment !== undefined) args.push('--environment', intent.environment);\n return args;\n}\n\nfunction isValidIntent(intent: WebDeploymentPublishIntent): boolean {\n return (\n (intent.alias === undefined || intent.alias.trim().length > 0) &&\n (intent.environment === undefined || intent.environment.trim().length > 0)\n );\n}\n\nfunction invalidIntentFailure(): EasWebPublishResult {\n return providerFailure('INVALID_WEB_PUBLISH_INTENT', 'Web publish intent is invalid.');\n}\n\nfunction providerFailure(\n code = 'EAS_WEB_PUBLISH_FAILED',\n message = 'EAS Hosting publication failed.',\n): EasWebPublishResult {\n return {\n status: 'failed',\n failure: { code, message, target: 'web', provider: 'eas' },\n };\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import type { AppDeployTargetId } from '@ankhorage/contracts/deploy';
1
2
  import type { DeploymentCredentialReference } from '../../domain/DeploymentCredentialReference';
2
3
  import type { DeploymentAuthenticationRequiredAction } from '../../domain/DeploymentRequiredAction';
3
4
  import type { DeploymentSecretResolver } from '../../domain/DeploymentSecretResolver';
@@ -9,6 +10,7 @@ export type EasProcessEnvironmentResult = {
9
10
  readonly action: DeploymentAuthenticationRequiredAction;
10
11
  };
11
12
  export declare function resolveEasProcessEnvironment(options: {
13
+ readonly target: AppDeployTargetId;
12
14
  readonly credentials: readonly DeploymentCredentialReference[];
13
15
  readonly resolveSecret: DeploymentSecretResolver;
14
16
  }): Promise<EasProcessEnvironmentResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"resolveEasProcessEnvironment.d.ts","sourceRoot":"","sources":["../../../src/providers/eas/resolveEasProcessEnvironment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,4CAA4C,CAAC;AAChG,OAAO,KAAK,EAAE,sCAAsC,EAAE,MAAM,uCAAuC,CAAC;AACpG,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AAEtF,MAAM,MAAM,2BAA2B,GACnC;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CAAE,GACtE;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,sCAAsC,CAAA;CAAE,CAAC;AAEpF,wBAAsB,4BAA4B,CAAC,OAAO,EAAE;IAC1D,QAAQ,CAAC,WAAW,EAAE,SAAS,6BAA6B,EAAE,CAAC;IAC/D,QAAQ,CAAC,aAAa,EAAE,wBAAwB,CAAC;CAClD,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAyBvC"}
1
+ {"version":3,"file":"resolveEasProcessEnvironment.d.ts","sourceRoot":"","sources":["../../../src/providers/eas/resolveEasProcessEnvironment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAErE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,4CAA4C,CAAC;AAChG,OAAO,KAAK,EAAE,sCAAsC,EAAE,MAAM,uCAAuC,CAAC;AACpG,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AAEtF,MAAM,MAAM,2BAA2B,GACnC;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CAAE,GACtE;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,sCAAsC,CAAA;CAAE,CAAC;AAEpF,wBAAsB,4BAA4B,CAAC,OAAO,EAAE;IAC1D,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,WAAW,EAAE,SAAS,6BAA6B,EAAE,CAAC;IAC/D,QAAQ,CAAC,aAAa,EAAE,wBAAwB,CAAC;CAClD,GAAG,OAAO,CAAC,2BAA2B,CAAC,CASvC"}
@@ -2,25 +2,26 @@ export async function resolveEasProcessEnvironment(options) {
2
2
  const reference = options.credentials.find((credential) => credential.provider === 'eas' && credential.kind === 'expo-token');
3
3
  if (reference === undefined)
4
4
  return { ok: true };
5
- let token;
5
+ const token = await safelyResolveToken(options.resolveSecret, reference);
6
+ if (token !== null && token.length > 0)
7
+ return { ok: true, env: { EXPO_TOKEN: token } };
8
+ return { ok: false, action: authenticationAction(options.target) };
9
+ }
10
+ async function safelyResolveToken(resolveSecret, reference) {
6
11
  try {
7
- token = await options.resolveSecret(reference);
12
+ return await resolveSecret(reference);
8
13
  }
9
14
  catch {
10
- token = null;
11
- }
12
- if (token !== null && token.length > 0) {
13
- return { ok: true, env: { EXPO_TOKEN: token } };
15
+ return null;
14
16
  }
17
+ }
18
+ function authenticationAction(target) {
15
19
  return {
16
- ok: false,
17
- action: {
18
- type: 'authentication',
19
- provider: 'eas',
20
- target: 'web',
21
- code: 'EAS_AUTHENTICATION_REQUIRED',
22
- message: 'EAS authentication is required for Web deployment.',
23
- },
20
+ type: 'authentication',
21
+ provider: 'eas',
22
+ target,
23
+ code: 'EAS_AUTHENTICATION_REQUIRED',
24
+ message: `EAS authentication is required for ${target} deployment.`,
24
25
  };
25
26
  }
26
27
  //# sourceMappingURL=resolveEasProcessEnvironment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolveEasProcessEnvironment.js","sourceRoot":"","sources":["../../../src/providers/eas/resolveEasProcessEnvironment.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAAC,OAGlD;IACC,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CACxC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,KAAK,KAAK,IAAI,UAAU,CAAC,IAAI,KAAK,YAAY,CAClF,CAAC;IACF,IAAI,SAAS,KAAK,SAAS;QAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;IAEjD,IAAI,KAAoB,CAAC;IACzB,IAAI,CAAC;QACH,KAAK,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IACjD,CAAC;IAAC,MAAM,CAAC;QACP,KAAK,GAAG,IAAI,CAAC;IACf,CAAC;IACD,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvC,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,CAAC;IAClD,CAAC;IACD,OAAO;QACL,EAAE,EAAE,KAAK;QACT,MAAM,EAAE;YACN,IAAI,EAAE,gBAAgB;YACtB,QAAQ,EAAE,KAAK;YACf,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,6BAA6B;YACnC,OAAO,EAAE,oDAAoD;SAC9D;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { DeploymentCredentialReference } from '../../domain/DeploymentCredentialReference';\nimport type { DeploymentAuthenticationRequiredAction } from '../../domain/DeploymentRequiredAction';\nimport type { DeploymentSecretResolver } from '../../domain/DeploymentSecretResolver';\n\nexport type EasProcessEnvironmentResult =\n | { readonly ok: true; readonly env?: Readonly<Record<string, string>> }\n | { readonly ok: false; readonly action: DeploymentAuthenticationRequiredAction };\n\nexport async function resolveEasProcessEnvironment(options: {\n readonly credentials: readonly DeploymentCredentialReference[];\n readonly resolveSecret: DeploymentSecretResolver;\n}): Promise<EasProcessEnvironmentResult> {\n const reference = options.credentials.find(\n (credential) => credential.provider === 'eas' && credential.kind === 'expo-token',\n );\n if (reference === undefined) return { ok: true };\n\n let token: string | null;\n try {\n token = await options.resolveSecret(reference);\n } catch {\n token = null;\n }\n if (token !== null && token.length > 0) {\n return { ok: true, env: { EXPO_TOKEN: token } };\n }\n return {\n ok: false,\n action: {\n type: 'authentication',\n provider: 'eas',\n target: 'web',\n code: 'EAS_AUTHENTICATION_REQUIRED',\n message: 'EAS authentication is required for Web deployment.',\n },\n };\n}\n"]}
1
+ {"version":3,"file":"resolveEasProcessEnvironment.js","sourceRoot":"","sources":["../../../src/providers/eas/resolveEasProcessEnvironment.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAAC,OAIlD;IACC,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CACxC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,KAAK,KAAK,IAAI,UAAU,CAAC,IAAI,KAAK,YAAY,CAClF,CAAC;IACF,IAAI,SAAS,KAAK,SAAS;QAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;IAEjD,MAAM,KAAK,GAAG,MAAM,kBAAkB,CAAC,OAAO,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;IACzE,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,CAAC;IACxF,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,oBAAoB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;AACrE,CAAC;AAED,KAAK,UAAU,kBAAkB,CAC/B,aAAuC,EACvC,SAAwC;IAExC,IAAI,CAAC;QACH,OAAO,MAAM,aAAa,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAS,oBAAoB,CAAC,MAAyB;IACrD,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,QAAQ,EAAE,KAAK;QACf,MAAM;QACN,IAAI,EAAE,6BAA6B;QACnC,OAAO,EAAE,sCAAsC,MAAM,cAAc;KACpE,CAAC;AACJ,CAAC","sourcesContent":["import type { AppDeployTargetId } from '@ankhorage/contracts/deploy';\n\nimport type { DeploymentCredentialReference } from '../../domain/DeploymentCredentialReference';\nimport type { DeploymentAuthenticationRequiredAction } from '../../domain/DeploymentRequiredAction';\nimport type { DeploymentSecretResolver } from '../../domain/DeploymentSecretResolver';\n\nexport type EasProcessEnvironmentResult =\n | { readonly ok: true; readonly env?: Readonly<Record<string, string>> }\n | { readonly ok: false; readonly action: DeploymentAuthenticationRequiredAction };\n\nexport async function resolveEasProcessEnvironment(options: {\n readonly target: AppDeployTargetId;\n readonly credentials: readonly DeploymentCredentialReference[];\n readonly resolveSecret: DeploymentSecretResolver;\n}): Promise<EasProcessEnvironmentResult> {\n const reference = options.credentials.find(\n (credential) => credential.provider === 'eas' && credential.kind === 'expo-token',\n );\n if (reference === undefined) return { ok: true };\n\n const token = await safelyResolveToken(options.resolveSecret, reference);\n if (token !== null && token.length > 0) return { ok: true, env: { EXPO_TOKEN: token } };\n return { ok: false, action: authenticationAction(options.target) };\n}\n\nasync function safelyResolveToken(\n resolveSecret: DeploymentSecretResolver,\n reference: DeploymentCredentialReference,\n): Promise<string | null> {\n try {\n return await resolveSecret(reference);\n } catch {\n return null;\n }\n}\n\nfunction authenticationAction(target: AppDeployTargetId): DeploymentAuthenticationRequiredAction {\n return {\n type: 'authentication',\n provider: 'eas',\n target,\n code: 'EAS_AUTHENTICATION_REQUIRED',\n message: `EAS authentication is required for ${target} deployment.`,\n };\n}\n"]}
@@ -0,0 +1,7 @@
1
+ export interface GooglePlayServiceAccountCredentials {
2
+ readonly clientEmail: string;
3
+ readonly privateKey: string;
4
+ }
5
+ export type GooglePlayTokenFactory = (credentials: GooglePlayServiceAccountCredentials) => Promise<string | null>;
6
+ export declare const createGooglePlayAccessToken: GooglePlayTokenFactory;
7
+ //# sourceMappingURL=GooglePlayTokenFactory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GooglePlayTokenFactory.d.ts","sourceRoot":"","sources":["../../../src/providers/googlePlay/GooglePlayTokenFactory.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,mCAAmC;IAClD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,MAAM,sBAAsB,GAAG,CACnC,WAAW,EAAE,mCAAmC,KAC7C,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;AAE5B,eAAO,MAAM,2BAA2B,EAAE,sBAUzC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { GoogleAuth } from 'google-auth-library';
2
+ const GOOGLE_PLAY_SCOPE = 'https://www.googleapis.com/auth/androidpublisher';
3
+ export const createGooglePlayAccessToken = async (credentials) => {
4
+ const auth = new GoogleAuth({
5
+ credentials: {
6
+ client_email: credentials.clientEmail,
7
+ private_key: credentials.privateKey,
8
+ },
9
+ scopes: [GOOGLE_PLAY_SCOPE],
10
+ });
11
+ const token = await auth.getAccessToken();
12
+ return typeof token === 'string' && token.length > 0 ? token : null;
13
+ };
14
+ //# sourceMappingURL=GooglePlayTokenFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GooglePlayTokenFactory.js","sourceRoot":"","sources":["../../../src/providers/googlePlay/GooglePlayTokenFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,MAAM,iBAAiB,GAAG,kDAAkD,CAAC;AAW7E,MAAM,CAAC,MAAM,2BAA2B,GAA2B,KAAK,EAAE,WAAW,EAAE,EAAE;IACvF,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC;QAC1B,WAAW,EAAE;YACX,YAAY,EAAE,WAAW,CAAC,WAAW;YACrC,WAAW,EAAE,WAAW,CAAC,UAAU;SACpC;QACD,MAAM,EAAE,CAAC,iBAAiB,CAAC;KAC5B,CAAC,CAAC;IACH,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;IAC1C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AACtE,CAAC,CAAC","sourcesContent":["import { GoogleAuth } from 'google-auth-library';\n\nconst GOOGLE_PLAY_SCOPE = 'https://www.googleapis.com/auth/androidpublisher';\n\nexport interface GooglePlayServiceAccountCredentials {\n readonly clientEmail: string;\n readonly privateKey: string;\n}\n\nexport type GooglePlayTokenFactory = (\n credentials: GooglePlayServiceAccountCredentials,\n) => Promise<string | null>;\n\nexport const createGooglePlayAccessToken: GooglePlayTokenFactory = async (credentials) => {\n const auth = new GoogleAuth({\n credentials: {\n client_email: credentials.clientEmail,\n private_key: credentials.privateKey,\n },\n scopes: [GOOGLE_PLAY_SCOPE],\n });\n const token = await auth.getAccessToken();\n return typeof token === 'string' && token.length > 0 ? token : null;\n};\n"]}
@@ -0,0 +1,12 @@
1
+ import type { AndroidDeploymentTrack } from '../../domain/AndroidDeploymentIntent';
2
+ interface GooglePlayReleaseState {
3
+ readonly lifecycle: string;
4
+ readonly versionCodes: readonly number[];
5
+ }
6
+ export interface GooglePlayTrackState {
7
+ readonly track: AndroidDeploymentTrack;
8
+ readonly releases: readonly GooglePlayReleaseState[];
9
+ }
10
+ export declare function parseGooglePlayTrackState(value: unknown, track: AndroidDeploymentTrack): GooglePlayTrackState | null;
11
+ export {};
12
+ //# sourceMappingURL=GooglePlayTrackState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GooglePlayTrackState.d.ts","sourceRoot":"","sources":["../../../src/providers/googlePlay/GooglePlayTrackState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAEnF,UAAU,sBAAsB;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,sBAAsB,CAAC;IACvC,QAAQ,CAAC,QAAQ,EAAE,SAAS,sBAAsB,EAAE,CAAC;CACtD;AAED,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,sBAAsB,GAC5B,oBAAoB,GAAG,IAAI,CAS7B"}
@@ -0,0 +1,35 @@
1
+ export function parseGooglePlayTrackState(value, track) {
2
+ if (!isRecord(value) || !Array.isArray(value.releases))
3
+ return null;
4
+ const releases = [];
5
+ for (const release of value.releases) {
6
+ const parsed = parseRelease(release);
7
+ if (parsed === null)
8
+ return null;
9
+ releases.push(parsed);
10
+ }
11
+ return { track, releases };
12
+ }
13
+ function parseRelease(value) {
14
+ if (!isRecord(value) || !isNonEmptyString(value.releaseLifecycleState))
15
+ return null;
16
+ if (!Array.isArray(value.activeArtifacts))
17
+ return null;
18
+ const versionCodes = [];
19
+ for (const artifact of value.activeArtifacts) {
20
+ if (!isRecord(artifact) || !isVersionCode(artifact.versionCode))
21
+ return null;
22
+ versionCodes.push(artifact.versionCode);
23
+ }
24
+ return { lifecycle: value.releaseLifecycleState, versionCodes };
25
+ }
26
+ function isVersionCode(value) {
27
+ return typeof value === 'number' && Number.isSafeInteger(value) && value > 0;
28
+ }
29
+ function isRecord(value) {
30
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
31
+ }
32
+ function isNonEmptyString(value) {
33
+ return typeof value === 'string' && value.trim().length > 0;
34
+ }
35
+ //# sourceMappingURL=GooglePlayTrackState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GooglePlayTrackState.js","sourceRoot":"","sources":["../../../src/providers/googlePlay/GooglePlayTrackState.ts"],"names":[],"mappings":"AAYA,MAAM,UAAU,yBAAyB,CACvC,KAAc,EACd,KAA6B;IAE7B,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC;QAAE,OAAO,IAAI,CAAC;IACpE,MAAM,QAAQ,GAA6B,EAAE,CAAC;IAC9C,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;QACrC,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;QACrC,IAAI,MAAM,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC;QACjC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AAC7B,CAAC;AAED,SAAS,YAAY,CAAC,KAAc;IAClC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,qBAAqB,CAAC;QAAE,OAAO,IAAI,CAAC;IACpF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC;QAAE,OAAO,IAAI,CAAC;IACvD,MAAM,YAAY,GAAa,EAAE,CAAC;IAClC,KAAK,MAAM,QAAQ,IAAI,KAAK,CAAC,eAAe,EAAE,CAAC;QAC7C,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,WAAW,CAAC;YAAE,OAAO,IAAI,CAAC;QAC7E,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,EAAE,SAAS,EAAE,KAAK,CAAC,qBAAqB,EAAE,YAAY,EAAE,CAAC;AAClE,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC;AAC/E,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAc;IACtC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;AAC9D,CAAC","sourcesContent":["import type { AndroidDeploymentTrack } from '../../domain/AndroidDeploymentIntent';\n\ninterface GooglePlayReleaseState {\n readonly lifecycle: string;\n readonly versionCodes: readonly number[];\n}\n\nexport interface GooglePlayTrackState {\n readonly track: AndroidDeploymentTrack;\n readonly releases: readonly GooglePlayReleaseState[];\n}\n\nexport function parseGooglePlayTrackState(\n value: unknown,\n track: AndroidDeploymentTrack,\n): GooglePlayTrackState | null {\n if (!isRecord(value) || !Array.isArray(value.releases)) return null;\n const releases: GooglePlayReleaseState[] = [];\n for (const release of value.releases) {\n const parsed = parseRelease(release);\n if (parsed === null) return null;\n releases.push(parsed);\n }\n return { track, releases };\n}\n\nfunction parseRelease(value: unknown): GooglePlayReleaseState | null {\n if (!isRecord(value) || !isNonEmptyString(value.releaseLifecycleState)) return null;\n if (!Array.isArray(value.activeArtifacts)) return null;\n const versionCodes: number[] = [];\n for (const artifact of value.activeArtifacts) {\n if (!isRecord(artifact) || !isVersionCode(artifact.versionCode)) return null;\n versionCodes.push(artifact.versionCode);\n }\n return { lifecycle: value.releaseLifecycleState, versionCodes };\n}\n\nfunction isVersionCode(value: unknown): value is number {\n return typeof value === 'number' && Number.isSafeInteger(value) && value > 0;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction isNonEmptyString(value: unknown): value is string {\n return typeof value === 'string' && value.trim().length > 0;\n}\n"]}
@@ -0,0 +1,15 @@
1
+ export interface GooglePlayRequest {
2
+ readonly method: 'GET' | 'POST' | 'PUT';
3
+ readonly url: string;
4
+ readonly token: string;
5
+ readonly contentType?: string;
6
+ readonly body?: string | Blob;
7
+ }
8
+ interface GooglePlayResponse {
9
+ readonly status: number;
10
+ readonly body: string;
11
+ }
12
+ export type GooglePlayTransport = (request: GooglePlayRequest) => Promise<GooglePlayResponse>;
13
+ export declare const fetchGooglePlay: GooglePlayTransport;
14
+ export {};
15
+ //# sourceMappingURL=GooglePlayTransport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GooglePlayTransport.d.ts","sourceRoot":"","sources":["../../../src/providers/googlePlay/GooglePlayTransport.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC;IACxC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAE9F,eAAO,MAAM,eAAe,EAAE,mBAS7B,CAAC"}
@@ -0,0 +1,12 @@
1
+ export const fetchGooglePlay = async (request) => {
2
+ const headers = { Authorization: `Bearer ${request.token}` };
3
+ if (request.contentType !== undefined)
4
+ headers['Content-Type'] = request.contentType;
5
+ const response = await fetch(request.url, {
6
+ method: request.method,
7
+ headers,
8
+ ...(request.body === undefined ? {} : { body: request.body }),
9
+ });
10
+ return { status: response.status, body: await response.text() };
11
+ };
12
+ //# sourceMappingURL=GooglePlayTransport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GooglePlayTransport.js","sourceRoot":"","sources":["../../../src/providers/googlePlay/GooglePlayTransport.ts"],"names":[],"mappings":"AAeA,MAAM,CAAC,MAAM,eAAe,GAAwB,KAAK,EAAE,OAAO,EAAE,EAAE;IACpE,MAAM,OAAO,GAA2B,EAAE,aAAa,EAAE,UAAU,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;IACrF,IAAI,OAAO,CAAC,WAAW,KAAK,SAAS;QAAE,OAAO,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC;IACrF,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACxC,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,OAAO;QACP,GAAG,CAAC,OAAO,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;KAC9D,CAAC,CAAC;IACH,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;AAClE,CAAC,CAAC","sourcesContent":["export interface GooglePlayRequest {\n readonly method: 'GET' | 'POST' | 'PUT';\n readonly url: string;\n readonly token: string;\n readonly contentType?: string;\n readonly body?: string | Blob;\n}\n\ninterface GooglePlayResponse {\n readonly status: number;\n readonly body: string;\n}\n\nexport type GooglePlayTransport = (request: GooglePlayRequest) => Promise<GooglePlayResponse>;\n\nexport const fetchGooglePlay: GooglePlayTransport = async (request) => {\n const headers: Record<string, string> = { Authorization: `Bearer ${request.token}` };\n if (request.contentType !== undefined) headers['Content-Type'] = request.contentType;\n const response = await fetch(request.url, {\n method: request.method,\n headers,\n ...(request.body === undefined ? {} : { body: request.body }),\n });\n return { status: response.status, body: await response.text() };\n};\n"]}
@@ -0,0 +1,8 @@
1
+ import type { GooglePlayTransport } from './GooglePlayTransport';
2
+ export declare function commitGooglePlayEdit(options: {
3
+ readonly packageName: string;
4
+ readonly editId: string;
5
+ readonly token: string;
6
+ readonly request: GooglePlayTransport;
7
+ }): Promise<boolean>;
8
+ //# sourceMappingURL=commitGooglePlayEdit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commitGooglePlayEdit.d.ts","sourceRoot":"","sources":["../../../src/providers/googlePlay/commitGooglePlayEdit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAGjE,wBAAsB,oBAAoB,CAAC,OAAO,EAAE;IAClD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;CACvC,GAAG,OAAO,CAAC,OAAO,CAAC,CAanB"}
@@ -0,0 +1,17 @@
1
+ import { googlePlayCommitEditUrl } from './googlePlayUrls';
2
+ export async function commitGooglePlayEdit(options) {
3
+ try {
4
+ const response = await options.request({
5
+ method: 'POST',
6
+ url: googlePlayCommitEditUrl(options.packageName, options.editId),
7
+ token: options.token,
8
+ contentType: 'application/json',
9
+ body: '{}',
10
+ });
11
+ return response.status >= 200 && response.status < 300;
12
+ }
13
+ catch {
14
+ return false;
15
+ }
16
+ }
17
+ //# sourceMappingURL=commitGooglePlayEdit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commitGooglePlayEdit.js","sourceRoot":"","sources":["../../../src/providers/googlePlay/commitGooglePlayEdit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,OAK1C;IACC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC;YACrC,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,uBAAuB,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC;YACjE,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,WAAW,EAAE,kBAAkB;YAC/B,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,MAAM,GAAG,GAAG,CAAC;IACzD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC","sourcesContent":["import type { GooglePlayTransport } from './GooglePlayTransport';\nimport { googlePlayCommitEditUrl } from './googlePlayUrls';\n\nexport async function commitGooglePlayEdit(options: {\n readonly packageName: string;\n readonly editId: string;\n readonly token: string;\n readonly request: GooglePlayTransport;\n}): Promise<boolean> {\n try {\n const response = await options.request({\n method: 'POST',\n url: googlePlayCommitEditUrl(options.packageName, options.editId),\n token: options.token,\n contentType: 'application/json',\n body: '{}',\n });\n return response.status >= 200 && response.status < 300;\n } catch {\n return false;\n }\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import type { DeploymentProviderSetupAdapter } from '../../domain/DeploymentProviderSetupAdapter';
2
+ import type { GooglePlayTokenFactory } from './GooglePlayTokenFactory';
3
+ export declare function createGooglePlaySetupAdapter(options: {
4
+ readonly createToken: GooglePlayTokenFactory;
5
+ }): DeploymentProviderSetupAdapter;
6
+ //# sourceMappingURL=createGooglePlaySetupAdapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createGooglePlaySetupAdapter.d.ts","sourceRoot":"","sources":["../../../src/providers/googlePlay/createGooglePlaySetupAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAElG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGvE,wBAAgB,4BAA4B,CAAC,OAAO,EAAE;IACpD,QAAQ,CAAC,WAAW,EAAE,sBAAsB,CAAC;CAC9C,GAAG,8BAA8B,CAWjC"}
@@ -0,0 +1,32 @@
1
+ import { resolveGooglePlayAccessToken } from './resolveGooglePlayAccessToken';
2
+ export function createGooglePlaySetupAdapter(options) {
3
+ return {
4
+ provider: 'google-play',
5
+ inspectSetup: async (context) => {
6
+ const access = await resolveGooglePlayAccessToken({
7
+ ...context,
8
+ createToken: options.createToken,
9
+ });
10
+ return access.ok ? ready() : required(access.action);
11
+ },
12
+ };
13
+ }
14
+ function ready() {
15
+ return {
16
+ provider: 'google-play',
17
+ authentication: { status: 'authenticated' },
18
+ capabilities: [{ capability: 'publish', status: 'available' }],
19
+ provisioning: [],
20
+ };
21
+ }
22
+ function required(action) {
23
+ return {
24
+ provider: 'google-play',
25
+ authentication: { status: 'required', action },
26
+ capabilities: [
27
+ { capability: 'publish', status: 'unavailable', reason: 'Authentication required.' },
28
+ ],
29
+ provisioning: [{ type: 'authentication', action }],
30
+ };
31
+ }
32
+ //# sourceMappingURL=createGooglePlaySetupAdapter.js.map