Repository Public
1/**2 * =============================================================================3 * SP BOUCHER | SOFTWARE & RESEARCH4 * ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5 * =============================================================================6 *7 * Project : SP Keyboard8 * File : Scripts/portal/inventory.js9 * Description : Read-only inventory (dry run): App IDs of SP Keyboard,10 * their enabled capabilities and the App Group, as the11 * developer portal reports them. Runs in the owner's12 * signed-in Safari tab; reads no cookie, password or code13 * and changes nothing.14 * Module : Scripts15 * Repository : https://git.spboucher.ai/sp-keyboard16 * Created : 2026-12-0117 * Last Modified : 2026-12-0118 *19 * Author : Simon-Pierre Boucher20 * Position : Professor of Finance21 * Institution : Université du Québec en Outaouais (UQO)22 * Organization : SP Boucher23 * Website : https://spboucher.ai24 * Git : https://git.spboucher.ai25 *26 * Preferred Contact: support@spboucher.ai27 * Development : dev@spboucher.ai28 * Support : support@spboucher.ai29 * Security/Admin : admin@spboucher.ai30 *31 * Copyright (c) 202632 * Simon-Pierre Boucher33 * All rights reserved where applicable. This file is governed by the34 * applicable project license, copyright notices and relevant law.35 * Existing third-party rights and notices remain unaffected.36 *37 * License : None specified (no license file in this repository)38 *39 * Do not embed credentials, private keys, access tokens,40 * certificates or confidential personal information.41 *42 * =============================================================================43 * END OF SP BOUCHER SOURCE HEADER44 * =============================================================================45 */4647async function main(){48 const team='3YM54G49SN';49 const get={'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json, application/json','X-HTTP-Method-Override':'GET','X-Requested-With':'XMLHttpRequest'};50 const l=await (await fetch('/services-account/v1/bundleIds',{method:'POST',credentials:'include',headers:get,body:JSON.stringify({urlEncodedQueryParams:'limit=1000',teamId:team})})).json();51 const out=[];52 for(const b of l.data.filter(d=>/^ai\.spboucher\.keyboard/.test(d.attributes.identifier))){53 const d=await (await fetch('/services-account/v1/bundleIds/'+b.id,{method:'POST',credentials:'include',headers:get,body:JSON.stringify({urlEncodedQueryParams:'include=bundleIdCapabilities,bundleIdCapabilities.capability,bundleIdCapabilities.appGroups',teamId:team})})).json();54 const caps=(d.included||[]).filter(i=>i.type==='bundleIdCapabilities'&&i.attributes.enabled).map(i=>i.relationships.capability.data.id+((i.relationships.appGroups.data||[]).length?'['+i.relationships.appGroups.data.map(g=>g.id).join(',')+']':''));55 out.push({identifier:b.attributes.identifier,name:b.attributes.name,id:b.id,wildcard:b.attributes.wildcard,platform:b.attributes.platform,enabled:caps});56 }57 const form={'Content-Type':'application/x-www-form-urlencoded','Accept':'application/json','X-Requested-With':'XMLHttpRequest'};58 const g=await (await fetch('/services-account/QH65B2/account/ios/identifiers/listApplicationGroups.action',{method:'POST',credentials:'include',headers:form,body:'teamId='+team+'&pageNumber=1&pageSize=500&sort=name%3Dasc'})).json();59 const group=(g.applicationGroupList||[]).filter(x=>x.identifier==='group.ai.spboucher.keyboard').map(x=>({identifier:x.identifier,name:x.name,id:x.applicationGroup}));60 return JSON.stringify({team,appIDs:out,appGroup:group});61}62