@limrun/ui 0.14.0-rc.5 → 0.14.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.
Files changed (115) hide show
  1. package/README.md +9 -26
  2. package/dist/components/remote-control.d.ts +36 -0
  3. package/dist/index.cjs +1 -1
  4. package/dist/index.d.ts +1 -1
  5. package/dist/index.js +1351 -1196
  6. package/package.json +10 -51
  7. package/src/components/remote-control.tsx +414 -2
  8. package/src/index.ts +1 -1
  9. package/vite.config.ts +0 -9
  10. package/dist/app-store-relay/index.cjs +0 -9
  11. package/dist/app-store-relay/index.d.ts +0 -204
  12. package/dist/app-store-relay/index.js +0 -677
  13. package/dist/app-store-relay/react.cjs +0 -1
  14. package/dist/app-store-relay/react.d.ts +0 -15
  15. package/dist/app-store-relay/react.js +0 -69
  16. package/dist/apple-credentials/index.cjs +0 -1
  17. package/dist/apple-credentials/index.d.ts +0 -110
  18. package/dist/apple-credentials/index.js +0 -291
  19. package/dist/browser-storage-BnO-Ma-e.mjs +0 -219
  20. package/dist/browser-storage-DLxIqZk5.js +0 -1
  21. package/dist/client-C9z_sgOf.js +0 -1
  22. package/dist/client-CFDB4mX5.mjs +0 -191
  23. package/dist/core/device-install/apple/client.d.ts +0 -18
  24. package/dist/core/device-install/apple/crypto.d.ts +0 -20
  25. package/dist/core/device-install/apple/gsa-srp.d.ts +0 -26
  26. package/dist/core/device-install/apple/index.d.ts +0 -5
  27. package/dist/core/device-install/apple/provisioning.d.ts +0 -237
  28. package/dist/core/device-install/apple/relay.d.ts +0 -53
  29. package/dist/core/device-install/index.d.ts +0 -4
  30. package/dist/core/device-install/operations/index.d.ts +0 -6
  31. package/dist/core/device-install/operations/limbuild-client.d.ts +0 -43
  32. package/dist/core/device-install/operations/operations.d.ts +0 -47
  33. package/dist/core/device-install/operations/relay-client.d.ts +0 -26
  34. package/dist/core/device-install/operations/relay-protocol.d.ts +0 -27
  35. package/dist/core/device-install/operations/usbmux.d.ts +0 -32
  36. package/dist/core/device-install/operations/webusb.d.ts +0 -21
  37. package/dist/core/device-install/storage/browser-storage.d.ts +0 -56
  38. package/dist/core/device-install/storage/index.d.ts +0 -2
  39. package/dist/core/device-install/storage/secret-store.d.ts +0 -124
  40. package/dist/core/device-install/types.d.ts +0 -57
  41. package/dist/core/errors.d.ts +0 -1
  42. package/dist/core/play-publish/google.d.ts +0 -13
  43. package/dist/core/play-publish/publish.d.ts +0 -34
  44. package/dist/device-build/index.cjs +0 -1
  45. package/dist/device-build/index.d.ts +0 -4
  46. package/dist/device-build/index.js +0 -85
  47. package/dist/device-build/react.cjs +0 -1
  48. package/dist/device-build/react.d.ts +0 -21
  49. package/dist/device-build/react.js +0 -68
  50. package/dist/device-build/signing.d.ts +0 -20
  51. package/dist/device-install/demo/demo.d.ts +0 -0
  52. package/dist/device-install/index.cjs +0 -1
  53. package/dist/device-install/index.d.ts +0 -18
  54. package/dist/device-install/index.js +0 -594
  55. package/dist/device-install/react.cjs +0 -1
  56. package/dist/device-install/react.d.ts +0 -24
  57. package/dist/device-install/react.js +0 -105
  58. package/dist/errors-BSkqS7U-.js +0 -1
  59. package/dist/errors-gy8yQJos.mjs +0 -6
  60. package/dist/gsa-srp-Bme3JLEi.mjs +0 -266
  61. package/dist/gsa-srp-CCIfUz7Y.js +0 -1
  62. package/dist/index-ChhtuQ7e.js +0 -22
  63. package/dist/index-YDu8K9a4.mjs +0 -11279
  64. package/dist/limbuild-client-BagK_FWE.mjs +0 -83
  65. package/dist/limbuild-client-CVDwq54z.js +0 -1
  66. package/dist/play-publish/index.cjs +0 -1
  67. package/dist/play-publish/index.d.ts +0 -2
  68. package/dist/play-publish/index.js +0 -109
  69. package/dist/play-publish/react.cjs +0 -1
  70. package/dist/play-publish/react.d.ts +0 -31
  71. package/dist/play-publish/react.js +0 -91
  72. package/dist/provisioning-CDPvxd1h.mjs +0 -270
  73. package/dist/provisioning-CbC4h--7.js +0 -1
  74. package/src/app-store-relay/index.test.ts +0 -60
  75. package/src/app-store-relay/index.ts +0 -846
  76. package/src/app-store-relay/react.ts +0 -131
  77. package/src/apple-credentials/index.test.ts +0 -180
  78. package/src/apple-credentials/index.ts +0 -388
  79. package/src/core/device-install/apple/client.ts +0 -150
  80. package/src/core/device-install/apple/crypto.ts +0 -205
  81. package/src/core/device-install/apple/gsa-srp.ts +0 -123
  82. package/src/core/device-install/apple/index.ts +0 -5
  83. package/src/core/device-install/apple/provisioning.test.ts +0 -114
  84. package/src/core/device-install/apple/provisioning.ts +0 -419
  85. package/src/core/device-install/apple/relay.ts +0 -202
  86. package/src/core/device-install/index.ts +0 -4
  87. package/src/core/device-install/operations/index.ts +0 -6
  88. package/src/core/device-install/operations/limbuild-client.ts +0 -144
  89. package/src/core/device-install/operations/operations.ts +0 -239
  90. package/src/core/device-install/operations/relay-client.ts +0 -286
  91. package/src/core/device-install/operations/relay-protocol.ts +0 -71
  92. package/src/core/device-install/operations/usbmux.ts +0 -270
  93. package/src/core/device-install/operations/webusb-dom.d.ts +0 -54
  94. package/src/core/device-install/operations/webusb.ts +0 -110
  95. package/src/core/device-install/storage/browser-storage.test.ts +0 -65
  96. package/src/core/device-install/storage/browser-storage.ts +0 -325
  97. package/src/core/device-install/storage/index.ts +0 -2
  98. package/src/core/device-install/storage/secret-store.ts +0 -332
  99. package/src/core/device-install/types.ts +0 -69
  100. package/src/core/errors.ts +0 -3
  101. package/src/core/play-publish/google.ts +0 -113
  102. package/src/core/play-publish/publish.test.ts +0 -68
  103. package/src/core/play-publish/publish.ts +0 -89
  104. package/src/device-build/index.ts +0 -42
  105. package/src/device-build/react.ts +0 -130
  106. package/src/device-build/signing.ts +0 -94
  107. package/src/device-install/README.md +0 -423
  108. package/src/device-install/demo/demo.css +0 -493
  109. package/src/device-install/demo/demo.tsx +0 -1061
  110. package/src/device-install/demo/index.html +0 -12
  111. package/src/device-install/index.ts +0 -50
  112. package/src/device-install/react.ts +0 -195
  113. package/src/play-publish/README.md +0 -66
  114. package/src/play-publish/index.ts +0 -12
  115. package/src/play-publish/react.ts +0 -208
@@ -1,9 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../client-C9z_sgOf.js"),f=require("../index-ChhtuQ7e.js"),B=require("../gsa-srp-CCIfUz7Y.js"),a=require("../provisioning-CbC4h--7.js"),T={name:"RSASSA-PKCS1-v1_5",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:"SHA-256"};async function K(e){if(!crypto.subtle)throw new Error("WebCrypto is not available in this browser.");const t=await crypto.subtle.generateKey(T,!0,["sign","verify"]),r=new Uint8Array(await crypto.subtle.exportKey("spki",t.publicKey)),n=A(U(0),$(e),r,x(0,new Uint8Array)),o=new Uint8Array(await crypto.subtle.sign("RSASSA-PKCS1-v1_5",t.privateKey,M(n))),i=A(n,A(C("1.2.840.113549.1.1.11"),L()),N(o)),p=new Uint8Array(await crypto.subtle.exportKey("pkcs8",t.privateKey));return{privateKey:t.privateKey,privateKeyPKCS8Base64:w(p),publicKeySPKIBase64:w(r),csrPEM:V("CERTIFICATE REQUEST",i),csrBase64:w(i)}}function E(e){if(!e.certificateBase64&&!e.certificatePEM)throw new Error("certificateBase64 or certificatePEM is required.");const t=f.forge.pki.privateKeyFromPem(H("PRIVATE KEY",e.privateKeyPKCS8Base64)),r=e.certificatePEM?f.forge.pki.certificateFromPem(e.certificatePEM):f.forge.pki.certificateFromAsn1(f.forge.asn1.fromDer(f.forge.util.createBuffer(G(e.certificateBase64)))),n=f.forge.pkcs12.toPkcs12Asn1(t,[r],e.password,{algorithm:"3des",friendlyName:e.friendlyName}),o=f.forge.asn1.toDer(n).getBytes();return W(o)}function $(e){const t=[D("2.5.4.3",O(e.commonName))];return e.emailAddress&&t.push(D("1.2.840.113549.1.9.1",F(e.emailAddress))),A(...t)}function D(e,t){return k(A(C(e),t))}function A(...e){return u(48,b(...e))}function k(...e){return u(49,b(...e))}function x(e,t){return u(160+e,t)}function U(e){return u(2,new Uint8Array([e]))}function L(){return new Uint8Array([5,0])}function O(e){return u(12,new TextEncoder().encode(e))}function F(e){return u(22,new TextEncoder().encode(e))}function N(e){return u(3,b(new Uint8Array([0]),e))}function C(e){const t=e.split(".").map(n=>parseInt(n,10));if(t.length<2||t.some(n=>!Number.isFinite(n)))throw new Error(`Invalid OID: ${e}`);const r=[t[0]*40+t[1]];for(const n of t.slice(2)){const o=[n&127];let i=n>>7;for(;i>0;)o.unshift(i&127|128),i>>=7;r.push(...o)}return u(6,new Uint8Array(r))}function u(e,t){return b(new Uint8Array([e]),z(t.byteLength),t)}function z(e){if(e<128)return new Uint8Array([e]);const t=[];let r=e;for(;r>0;)t.unshift(r&255),r>>=8;return new Uint8Array([128|t.length,...t])}function b(...e){const t=e.reduce((o,i)=>o+i.byteLength,0),r=new Uint8Array(t);let n=0;for(const o of e)r.set(o,n),n+=o.byteLength;return r}function V(e,t){const n=w(t).match(/.{1,64}/g)??[];return`-----BEGIN ${e}-----
2
- ${n.join(`
3
- `)}
4
- -----END ${e}-----
5
- `}function H(e,t){const r=t.match(/.{1,64}/g)??[];return`-----BEGIN ${e}-----
6
- ${r.join(`
7
- `)}
8
- -----END ${e}-----
9
- `}function w(e){let t="";for(const r of e)t+=String.fromCharCode(r);return btoa(t)}function W(e){return btoa(e)}function G(e){return atob(e)}function M(e){const t=new Uint8Array(e.byteLength);return t.set(e),t.buffer}async function c({relay:e,request:t,label:r="Apple Developer Portal request",validatePortalResponse:n=!0,mapBody:o}){const i=await s.proxyProvisioningRequest(e,t);return n&&q(i.body,r),o?o(i.body,i):i}async function _(e){return c({...e,request:a.listTeamsRequest(),label:"Apple Developer team list",mapBody:t=>Ae([...t?.teams??[],...t?.availableProviders??[],...t?.provider?[t.provider]:[]])})}async function j({certificateKind:e="development",teamId:t="",...r}){return c({...r,request:e==="distribution"?a.findDistributionCertificatesRequest(t):a.findDevelopmentCertificatesRequest(t),label:"Apple Developer certificate list",mapBody:n=>n?.certRequests??[]})}async function Q({certificateKind:e="development",teamId:t="",csrPEM:r,...n}){return c({...n,request:e==="distribution"?a.submitDistributionCSRRequest({csrPEM:r,teamID:t}):a.submitDevelopmentCSRRequest({csrPEM:r,teamID:t}),label:e==="distribution"?"Apple Distribution certificate creation":"Apple Development certificate creation",mapBody:o=>o?.certRequest})}async function J({certificateKind:e="development",certificateId:t,teamId:r="",...n}){return c({...n,request:e==="distribution"?a.downloadDistributionCertificateRequest(t,r):a.downloadCertificateRequest(t,r),label:"Apple certificate download",validatePortalResponse:!1,mapBody:(o,i)=>i})}async function X({certificateKind:e="development",certificateId:t,teamId:r="",...n}){return c({...n,request:{method:"POST",path:"/account/ios/certificate/revokeCertificate.action",payload:{teamId:r,certificateId:t,type:e==="distribution"?"WXV89964HE":"83Q87W3TGH"}},label:"Apple certificate deletion",mapBody:o=>o})}async function Y({teamId:e="",search:t="",...r}){const n=t.trim().toLowerCase();return c({...r,request:a.findBundleIDRequest({bundleID:t,teamID:e}),label:"Apple bundle ID list",mapBody:o=>{const i=o?.appIds??[];return n?i.filter(p=>[p.identifier,p.bundleId,p.name].some(l=>typeof l=="string"&&l.toLowerCase().includes(n))):i}})}async function Z({teamId:e="",bundleId:t,name:r,...n}){return c({...n,request:a.createBundleIDRequest({bundleID:t,teamID:e,name:r}),label:"Apple bundle ID creation",mapBody:o=>o?.appId})}async function ee({teamId:e="",appIdId:t,bundleId:r,name:n,...o}){return c({...o,request:{method:"POST",path:"/account/ios/identifiers/updateAppId.action",payload:{teamId:e,appIdId:t,...r?{identifier:r}:{},...n?{name:n}:{}}},label:"Apple bundle ID update",mapBody:i=>i?.appId})}async function te({teamId:e="",appIdId:t,...r}){return c({...r,request:{method:"POST",path:"/account/ios/identifiers/deleteAppId.action",payload:{teamId:e,appIdId:t}},label:"Apple bundle ID deletion",mapBody:n=>n})}async function re({teamId:e="",deviceUDID:t="",...r}){const n=I(t);return c({...r,request:a.findDeviceRequest({deviceUDID:t,teamID:e}),label:"Apple device list",mapBody:o=>{const i=o?.devices??[];return n?i.filter(p=>I(p.deviceNumber)===n):i}})}function I(e){return(e??"").replace(/-/g,"").replace(/[^a-fA-F0-9]/g,"").toUpperCase()}async function ne({teamId:e="",deviceUDID:t,name:r,...n}){return c({...n,request:a.registerDeviceRequest({deviceUDID:t,teamID:e,name:r}),label:"Apple device registration",mapBody:o=>o?.device})}async function oe({teamId:e="",deviceId:t,name:r,...n}){return c({...n,request:{method:"POST",path:"/account/ios/device/updateDevice.action",payload:{teamId:e,deviceId:t,...r?{name:r}:{}}},label:"Apple device update",mapBody:o=>o?.device})}async function ie({teamId:e="",deviceId:t,...r}){return c({...r,request:{method:"POST",path:"/account/ios/device/deleteDevice.action",payload:{teamId:e,deviceId:t}},label:"Apple device deletion",mapBody:n=>n})}async function pe({profileKind:e="development",teamId:t="",bundleId:r="",...n}){return c({...n,request:e==="adhoc"?a.findAdHocProfilesRequest({bundleID:r,teamID:t}):e==="appstore"?a.findAppStoreProfilesRequest({bundleID:r,teamID:t}):a.findDevelopmentProfilesRequest({bundleID:r,teamID:t}),label:"Apple provisioning profile list",mapBody:o=>o?.provisioningProfiles??[]})}async function ae({profileKind:e="development",teamId:t="",bundleId:r,appIdId:n,certificateIds:o,deviceIds:i=[],name:p,...l}){const[d]=o;if(!d)throw new Error("At least one certificate ID is required to create an Apple provisioning profile.");let v;if(e==="appstore"){if(!p)throw new Error("An explicit name is required to create an App Store provisioning profile.");v=a.createAppStoreProfileRequest({teamID:t,appIDID:n,certificateID:d,name:p})}else e==="adhoc"?v=a.createAdHocProfileRequest({bundleID:r,teamID:t,appIDID:n,certificateID:d,deviceIDs:i,name:p}):v=a.createDevelopmentProfileRequest({bundleID:r,teamID:t,appIDID:n,certificateID:d,deviceIDs:i,name:p});return c({...l,request:v,label:"Apple provisioning profile creation",mapBody:R=>R?.provisioningProfile})}async function se({teamId:e="",profileId:t,...r}){return c({...r,request:a.downloadProfileRequest(t,e),label:"Apple provisioning profile download",validatePortalResponse:!1,mapBody:(n,o)=>o})}async function ce({teamId:e="",profileId:t,...r}){return c({...r,request:{method:"POST",path:"/account/ios/profile/deleteProvisioningProfile.action",payload:{teamId:e,provisioningProfileId:t}},label:"Apple provisioning profile deletion",mapBody:n=>n})}async function le({relay:e,providerId:t}){const r=Number(t),n=await s.proxyAppStoreConnectRequest(e,{method:"POST",path:"/olympus/v1/session",payload:{provider:{providerId:Number.isNaN(r)?t:r}}});if(n.status<200||n.status>=300)throw new Error(`App Store Connect provider switch failed: HTTP ${n.status} ${n.rawBody??""}`.trim());return n}async function ue({relay:e}){const t=await s.proxyAppStoreConnectRequest(e,{path:"/iris/v1/apiKeys"});return y(t,"App Store Connect API key list"),h(t.body?.data)}async function de({relay:e,nickname:t,roles:r=["APP_MANAGER"],allAppsVisible:n=!0}){if(!t)throw new Error("A nickname is required to create an App Store Connect API key.");const o=await s.proxyAppStoreConnectRequest(e,{method:"POST",path:"/iris/v1/apiKeys",payload:{data:{type:"apiKeys",attributes:{nickname:t,allAppsVisible:n,keyType:"PUBLIC_API",roles:r}}}});y(o,"App Store Connect API key creation");const i=m(o.body?.data);if(!i?.id)throw new Error("App Store Connect API key creation did not return a key ID.");return i}async function fe({relay:e,keyId:t}){const r=await s.proxyAppStoreConnectRequest(e,{path:`/iris/v1/apiKeys/${encodeURIComponent(t)}`,query:{"fields[apiKeys]":"privateKey",include:"provider"}});y(r,"App Store Connect API key download");const n=m(r.body?.data),o=S(n?.attributes,"privateKey");if(!o)throw new Error(`App Store Connect API key ${t} returned no private key. Apple serves it only once; revoke the key and create a new one.`);const i=(r.body?.included??[]).find(l=>l.type==="providers"),p=S(i?.attributes,"publicProviderId")??S(n?.attributes,"issuerId")??i?.id;return{privateKeyPem:o,issuerId:p}}async function P({relay:e,bundleId:t}){const r=await s.proxyAppStoreConnectRequest(e,{path:"/iris/v1/apps",query:{"filter[bundleId]":t}});return y(r,"App Store Connect app lookup"),h(r.body?.data).find(n=>S(n.attributes,"bundleId")===t)}async function g({relay:e,bundleId:t,name:r,sku:n,primaryLocale:o="en-US",versionString:i="1.0"}){if(!r)throw new Error("An app name is required to create an App Store Connect app record.");const p="IOS",l=await s.proxyAppStoreConnectRequest(e,{method:"POST",path:"/iris/v1/apps",payload:{data:{type:"apps",attributes:{sku:n||t,primaryLocale:o,bundleId:t},relationships:{appStoreVersions:{data:[{type:"appStoreVersions",id:`\${store-version-${p}}`}]},appInfos:{data:[{type:"appInfos",id:"${new-appInfo-id}"}]}}},included:[{type:"appInfos",id:"${new-appInfo-id}",relationships:{appInfoLocalizations:{data:[{type:"appInfoLocalizations",id:"${new-appInfoLocalization-id}"}]}}},{type:"appInfoLocalizations",id:"${new-appInfoLocalization-id}",attributes:{locale:o,name:r}},{type:"appStoreVersions",id:`\${store-version-${p}}`,attributes:{platform:p,versionString:i},relationships:{appStoreVersionLocalizations:{data:[{type:"appStoreVersionLocalizations",id:`\${new-${p}VersionLocalization-id}`}]}}},{type:"appStoreVersionLocalizations",id:`\${new-${p}VersionLocalization-id}`,attributes:{locale:o}}]}});y(l,"App Store Connect app creation");const d=m(l.body?.data);if(!d?.id)throw new Error("App Store Connect app creation did not return an app ID.");return d}async function ye(e){const t=await P({relay:e.relay,bundleId:e.bundleId});return t?{app:t,created:!1}:{app:await g(e),created:!0}}function y(e,t){const r=e.body?.errors;if(r&&r.length>0){const n=r.map(o=>o.detail??o.title??o.code??o.status).filter(Boolean).join("; ");throw new Error(`${t} failed: ${n||`HTTP ${e.status}`}`)}if(e.status<200||e.status>=300)throw new Error(`${t} failed: HTTP ${e.status} ${e.rawBody??""}`.trim())}function h(e){return e?Array.isArray(e)?e:[e]:[]}function m(e){if(e)return Array.isArray(e)?e[0]:e}function S(e,t){const r=e?.[t];return typeof r=="string"&&r!==""?r:void 0}function q(e,t){if(!e)throw new Error(`${t} returned an empty response.`);if(e.resultCode!==void 0&&e.resultCode!==0)throw new Error(`${t} failed: ${e.userString??e.resultString??e.resultCode}`)}function Ae(e){const t=new Set,r=[];for(const n of e){const o=String(n.teamId??n.providerId??n.publicProviderId??n.name??JSON.stringify(n));t.has(o)||(t.add(o),r.push(n))}return r}exports.AppleRelayWebSocketClient=s.AppleRelayWebSocketClient;exports.fetchAppleAccountSession=s.fetchAppleAccountSession;exports.openAppleRelayWebSocket=s.openAppleRelayWebSocket;exports.proxyAppStoreConnectRequest=s.proxyAppStoreConnectRequest;exports.proxyPhoneTwoFactorCode=s.proxyPhoneTwoFactorCode;exports.proxySrpComplete=s.proxySrpComplete;exports.proxySrpInit=s.proxySrpInit;exports.proxyTwoFactorCode=s.proxyTwoFactorCode;exports.startBrowserOwnedAppleIDLogin=s.startBrowserOwnedAppleIDLogin;exports.triggerPhoneTwoFactor=s.triggerPhoneTwoFactor;exports.triggerTrustedDeviceTwoFactor=s.triggerTrustedDeviceTwoFactor;exports.AppleGsaSrpClient=B.AppleGsaSrpClient;exports.assertAppStoreConnectResponseOK=y;exports.assertAppleDeveloperPortalResponseOK=q;exports.createAppStoreConnectApiKey=de;exports.createAppStoreConnectApp=g;exports.createAppleBundleID=Z;exports.createAppleCertificate=Q;exports.createAppleProfile=ae;exports.deleteAppleBundleID=te;exports.deleteAppleCertificate=X;exports.deleteAppleDevice=ie;exports.deleteAppleProfile=ce;exports.downloadAppStoreConnectApiKeyPrivateKey=fe;exports.downloadAppleCertificate=J;exports.downloadAppleProfile=se;exports.ensureAppStoreConnectApp=ye;exports.exportAppleCertificateP12=E;exports.findAppStoreConnectApp=P;exports.generateAppleSigningKeyAndCSR=K;exports.listAppStoreConnectApiKeys=ue;exports.listAppleBundleIDs=Y;exports.listAppleCertificates=j;exports.listAppleDevices=re;exports.listAppleProfiles=pe;exports.listAppleTeams=_;exports.registerAppleDevice=ne;exports.requestAppleProvisioning=c;exports.switchAppStoreConnectProvider=le;exports.updateAppleBundleID=ee;exports.updateAppleDevice=oe;
@@ -1,204 +0,0 @@
1
- import { AppleDeveloperPortalAppID, AppleDeveloperPortalDevice, AppleDeveloperPortalResponse, AppleDeveloperPortalTeam, AppleProvisioningRequest, AppleRelayResponse, AppleRelayWebSocketClient } from '../core/device-install/apple';
2
- export * from '../core/device-install/apple/client';
3
- export * from '../core/device-install/apple/crypto';
4
- export * from '../core/device-install/apple/gsa-srp';
5
- export type { AppleDeveloperPortalAppID, AppleDeveloperPortalDevice, AppleDeveloperPortalResponse, AppleDeveloperPortalTeam, AppleProvisioningRequest, AppleRelayResponse, AppStoreConnectRequest, } from '../core/device-install/apple';
6
- export { AppleRelayWebSocketClient, fetchAppleAccountSession, openAppleRelayWebSocket, proxyAppStoreConnectRequest, proxyPhoneTwoFactorCode, proxySrpComplete, proxySrpInit, proxyTwoFactorCode, triggerPhoneTwoFactor, triggerTrustedDeviceTwoFactor, } from '../core/device-install/apple';
7
- export type AppleRelayClientOptions = {
8
- relay: AppleRelayWebSocketClient;
9
- };
10
- export type AppleTeamScopedOptions = AppleRelayClientOptions & {
11
- teamId?: string;
12
- };
13
- export type AppleCertificateKind = 'development' | 'distribution';
14
- export type AppleProfileKind = 'development' | 'adhoc' | 'appstore';
15
- export type RequestAppleProvisioningOptions<T = unknown> = AppleRelayClientOptions & {
16
- request: AppleProvisioningRequest;
17
- label?: string;
18
- validatePortalResponse?: boolean;
19
- mapBody?: (body: AppleDeveloperPortalResponse | undefined, response: AppleRelayResponse<T>) => T;
20
- };
21
- export type MappedAppleProvisioningOptions<T> = RequestAppleProvisioningOptions<T> & {
22
- mapBody: (body: AppleDeveloperPortalResponse | undefined, response: AppleRelayResponse<T>) => T;
23
- };
24
- export type ListAppleCertificatesOptions = AppleTeamScopedOptions & {
25
- certificateKind?: AppleCertificateKind;
26
- };
27
- export type CreateAppleCertificateOptions = AppleTeamScopedOptions & {
28
- certificateKind?: AppleCertificateKind;
29
- csrPEM: string;
30
- };
31
- export type DownloadAppleCertificateOptions = AppleTeamScopedOptions & {
32
- certificateKind?: AppleCertificateKind;
33
- certificateId: string;
34
- };
35
- export type DeleteAppleCertificateOptions = DownloadAppleCertificateOptions;
36
- export type ListAppleBundleIDsOptions = AppleTeamScopedOptions & {
37
- search?: string;
38
- };
39
- export type CreateAppleBundleIDOptions = AppleTeamScopedOptions & {
40
- bundleId: string;
41
- name?: string;
42
- };
43
- export type UpdateAppleBundleIDOptions = AppleTeamScopedOptions & {
44
- appIdId: string;
45
- bundleId?: string;
46
- name?: string;
47
- };
48
- export type DeleteAppleBundleIDOptions = AppleTeamScopedOptions & {
49
- appIdId: string;
50
- };
51
- export type ListAppleDevicesOptions = AppleTeamScopedOptions & {
52
- deviceUDID?: string;
53
- };
54
- export type RegisterAppleDeviceOptions = AppleTeamScopedOptions & {
55
- deviceUDID: string;
56
- name?: string;
57
- };
58
- export type UpdateAppleDeviceOptions = AppleTeamScopedOptions & {
59
- deviceId: string;
60
- name?: string;
61
- };
62
- export type DeleteAppleDeviceOptions = AppleTeamScopedOptions & {
63
- deviceId: string;
64
- };
65
- export type ListAppleProfilesOptions = AppleTeamScopedOptions & {
66
- profileKind?: AppleProfileKind;
67
- bundleId?: string;
68
- };
69
- export type CreateAppleProfileOptions = AppleTeamScopedOptions & {
70
- profileKind?: AppleProfileKind;
71
- bundleId: string;
72
- appIdId: string;
73
- certificateIds: string[];
74
- /** Devices the profile binds. Ignored for App Store profiles, which bind none. */
75
- deviceIds?: string[];
76
- /** Profile name. Required for App Store profiles; there is no default. */
77
- name?: string;
78
- };
79
- export type DownloadAppleProfileOptions = AppleTeamScopedOptions & {
80
- profileId: string;
81
- };
82
- export type DeleteAppleProfileOptions = DownloadAppleProfileOptions;
83
- export declare function requestAppleProvisioning<T>(options: MappedAppleProvisioningOptions<T>): Promise<T>;
84
- export declare function requestAppleProvisioning<T = AppleDeveloperPortalResponse>(options: RequestAppleProvisioningOptions<T>): Promise<AppleRelayResponse<T>>;
85
- export declare function listAppleTeams(options: AppleRelayClientOptions): Promise<AppleDeveloperPortalTeam[]>;
86
- export declare function listAppleCertificates({ certificateKind, teamId, ...options }: ListAppleCertificatesOptions): Promise<Record<string, unknown>[]>;
87
- export declare function createAppleCertificate({ certificateKind, teamId, csrPEM, ...options }: CreateAppleCertificateOptions): Promise<Record<string, unknown> | undefined>;
88
- export declare function downloadAppleCertificate({ certificateKind, certificateId, teamId, ...options }: DownloadAppleCertificateOptions): Promise<AppleRelayResponse>;
89
- export declare function deleteAppleCertificate({ certificateKind, certificateId, teamId, ...options }: DeleteAppleCertificateOptions): Promise<AppleDeveloperPortalResponse | undefined>;
90
- export declare function listAppleBundleIDs({ teamId, search, ...options }: ListAppleBundleIDsOptions): Promise<AppleDeveloperPortalAppID[]>;
91
- export declare function createAppleBundleID({ teamId, bundleId, name, ...options }: CreateAppleBundleIDOptions): Promise<Record<string, unknown> | undefined>;
92
- export declare function updateAppleBundleID({ teamId, appIdId, bundleId, name, ...options }: UpdateAppleBundleIDOptions): Promise<Record<string, unknown> | undefined>;
93
- export declare function deleteAppleBundleID({ teamId, appIdId, ...options }: DeleteAppleBundleIDOptions): Promise<AppleDeveloperPortalResponse | undefined>;
94
- export declare function listAppleDevices({ teamId, deviceUDID, ...options }: ListAppleDevicesOptions): Promise<AppleDeveloperPortalDevice[]>;
95
- export declare function registerAppleDevice({ teamId, deviceUDID, name, ...options }: RegisterAppleDeviceOptions): Promise<Record<string, unknown> | undefined>;
96
- export declare function updateAppleDevice({ teamId, deviceId, name, ...options }: UpdateAppleDeviceOptions): Promise<Record<string, unknown> | undefined>;
97
- export declare function deleteAppleDevice({ teamId, deviceId, ...options }: DeleteAppleDeviceOptions): Promise<AppleDeveloperPortalResponse | undefined>;
98
- export declare function listAppleProfiles({ profileKind, teamId, bundleId, ...options }: ListAppleProfilesOptions): Promise<Record<string, unknown>[]>;
99
- export declare function createAppleProfile({ profileKind, teamId, bundleId, appIdId, certificateIds, deviceIds, name, ...options }: CreateAppleProfileOptions): Promise<Record<string, unknown> | undefined>;
100
- export declare function downloadAppleProfile({ teamId, profileId, ...options }: DownloadAppleProfileOptions): Promise<AppleRelayResponse>;
101
- export declare function deleteAppleProfile({ teamId, profileId, ...options }: DeleteAppleProfileOptions): Promise<AppleDeveloperPortalResponse | undefined>;
102
- /**
103
- * A JSON:API resource returned by the session-authenticated App Store
104
- * Connect API. Kept loose on purpose: the endpoint is not a public contract
105
- * and Apple adds attributes freely.
106
- */
107
- export type AppStoreConnectResource = {
108
- type?: string;
109
- id?: string;
110
- attributes?: Record<string, unknown>;
111
- relationships?: Record<string, unknown>;
112
- };
113
- type AppStoreConnectEnvelope = {
114
- data?: AppStoreConnectResource | AppStoreConnectResource[];
115
- included?: AppStoreConnectResource[];
116
- errors?: Array<{
117
- status?: string;
118
- code?: string;
119
- title?: string;
120
- detail?: string;
121
- }>;
122
- };
123
- export type SwitchAppStoreConnectProviderOptions = AppleRelayClientOptions & {
124
- /** The numeric provider ID of the team, from the team list's providerId. */
125
- providerId: string | number;
126
- };
127
- /**
128
- * Points the App Store Connect session at the given team (provider). Must
129
- * run before any other App Store Connect call when the account belongs to
130
- * multiple teams, because the session carries an active provider.
131
- */
132
- export declare function switchAppStoreConnectProvider({ relay, providerId, }: SwitchAppStoreConnectProviderOptions): Promise<AppleRelayResponse<Record<string, unknown>>>;
133
- /**
134
- * Roles Apple accepts on App Store Connect API keys. APP_MANAGER is enough
135
- * to upload builds and manage TestFlight, which is why it is the default
136
- * for keys minted by ensureAppStoreConnectApiKeySecret.
137
- */
138
- export type AppStoreConnectApiKeyRole = 'ADMIN' | 'APP_MANAGER' | 'CUSTOMER_SUPPORT' | 'DEVELOPER' | 'FINANCE' | 'MARKETING' | 'SALES';
139
- export type ListAppStoreConnectApiKeysOptions = AppleRelayClientOptions;
140
- /** Lists the team's App Store Connect API keys. Requires an Admin session. */
141
- export declare function listAppStoreConnectApiKeys({ relay }: ListAppStoreConnectApiKeysOptions): Promise<AppStoreConnectResource[]>;
142
- export type CreateAppStoreConnectApiKeyOptions = AppleRelayClientOptions & {
143
- /** Display name of the key. Required; implementors brand keys themselves. */
144
- nickname: string;
145
- roles?: AppStoreConnectApiKeyRole[];
146
- allAppsVisible?: boolean;
147
- };
148
- /**
149
- * Creates a team App Store Connect API key through the logged-in session,
150
- * the same way the App Store Connect website does. The session user must
151
- * be a team Admin. The private key is NOT part of the response; download
152
- * it once with downloadAppStoreConnectApiKeyPrivateKey.
153
- */
154
- export declare function createAppStoreConnectApiKey({ relay, nickname, roles, allAppsVisible, }: CreateAppStoreConnectApiKeyOptions): Promise<AppStoreConnectResource>;
155
- export type DownloadAppStoreConnectApiKeyOptions = AppleRelayClientOptions & {
156
- keyId: string;
157
- };
158
- export type DownloadedAppStoreConnectApiKey = {
159
- /** PEM contents of the .p8 private key. */
160
- privateKeyPem: string;
161
- /** Issuer ID for JWTs signed with this key, when Apple returned it. */
162
- issuerId?: string;
163
- };
164
- /**
165
- * Downloads the private half of an App Store Connect API key. Apple serves
166
- * it exactly once per key; afterwards the sparse fieldset comes back empty
167
- * and the key must be revoked and re-minted.
168
- */
169
- export declare function downloadAppStoreConnectApiKeyPrivateKey({ relay, keyId, }: DownloadAppStoreConnectApiKeyOptions): Promise<DownloadedAppStoreConnectApiKey>;
170
- export type FindAppStoreConnectAppOptions = AppleRelayClientOptions & {
171
- bundleId: string;
172
- };
173
- /** Looks up the App Store Connect app record for a bundle ID, if any. */
174
- export declare function findAppStoreConnectApp({ relay, bundleId }: FindAppStoreConnectAppOptions): Promise<AppStoreConnectResource | undefined>;
175
- export type CreateAppStoreConnectAppOptions = AppleRelayClientOptions & {
176
- bundleId: string;
177
- /** App name shown on the App Store. Required; there is no default. */
178
- name: string;
179
- /** Unique internal identifier. Defaults to the bundle ID. */
180
- sku?: string;
181
- /** Primary App Store locale. Defaults to en-US. */
182
- primaryLocale?: string;
183
- /** Version string of the first App Store version. Defaults to 1.0. */
184
- versionString?: string;
185
- };
186
- /**
187
- * Creates the App Store Connect app record for a bundle ID. Only the
188
- * session-authenticated API can create app records (the key-authenticated
189
- * public API cannot), which is why this goes through the relay. The body
190
- * mirrors what the App Store Connect website and fastlane's produce send.
191
- */
192
- export declare function createAppStoreConnectApp({ relay, bundleId, name, sku, primaryLocale, versionString, }: CreateAppStoreConnectAppOptions): Promise<AppStoreConnectResource>;
193
- export type EnsureAppStoreConnectAppOptions = CreateAppStoreConnectAppOptions;
194
- /**
195
- * Returns the App Store Connect app record for the bundle ID, creating it
196
- * when it does not exist yet. A first-time IPA upload fails without an app
197
- * record, so run this before the first publish of a new bundle ID.
198
- */
199
- export declare function ensureAppStoreConnectApp(options: EnsureAppStoreConnectAppOptions): Promise<{
200
- app: AppStoreConnectResource;
201
- created: boolean;
202
- }>;
203
- export declare function assertAppStoreConnectResponseOK(response: AppleRelayResponse<AppStoreConnectEnvelope>, label: string): void;
204
- export declare function assertAppleDeveloperPortalResponseOK(response: AppleDeveloperPortalResponse | undefined, label: string): void;