{"_id":"@byterm/agc-sdk","_rev":"14-8c69557b91daa5957c87b3cbfe4f8bc2","name":"@byterm/agc-sdk","dist-tags":{"latest":"0.8.1"},"versions":{"0.1.2":{"name":"@byterm/agc-sdk","version":"0.1.2","keywords":["appgallery","appgallery-connect","agc","huawei","harmonyos","api","sdk"],"author":"Term","license":"MIT","_id":"@byterm/agc-sdk@0.1.2","maintainers":[{"name":"number11","email":"term@const.net"}],"homepage":"https://gitcode.com/term-app/agc-ts#readme","bugs":"https://gitcode.com/term-app/agc-ts/issues","dist":{"shasum":"6c2f4e02047b988da6abcde4236a6c946d7b6a36","tarball":"https://registry.npmjs.org/@byterm/agc-sdk/-/agc-sdk-0.1.2.tgz","fileCount":59,"integrity":"sha512-ibkawenjKuPqhYNLHDD2BY3yMxUQ3N1GU86eLijg3dkMr3c66MJ2+x9FeBETjhAozpidJfgqO7dRYRrsuAkIdQ==","signatures":[{"sig":"MEUCIB8INK/Yo2rx2UREUWGFbOlL6FPr6R+JrKBxGcQLsLQaAiEA/v0YIcfrlztsGx3tYWo2meuU1kH6A34gLZrpVWCDMlg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":127591},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18"},"scripts":{"build":"tsc -p tsconfig.json","clean":"rm -rf dist","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"number11","email":"term@const.net"},"repository":{"url":"git+https://gitcode.com/term-app/agc-ts.git","type":"git","directory":"packages/sdk"},"description":"AppGallery Connect API SDK for Node.js (Service Account auth)","directories":{},"sideEffects":false,"_nodeVersion":"24.2.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^7.0.2","@types/node":"^26.1.1"},"_npmOperationalInternal":{"tmp":"tmp/agc-sdk_0.1.2_1784296719088_0.2899550668320463","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@byterm/agc-sdk","version":"0.2.0","keywords":["appgallery","appgallery-connect","agc","huawei","harmonyos","api","sdk"],"author":"Term","license":"MIT","_id":"@byterm/agc-sdk@0.2.0","maintainers":[{"name":"number11","email":"term@const.net"}],"homepage":"https://gitcode.com/term-app/agc-ts#readme","bugs":"https://gitcode.com/term-app/agc-ts/issues","dist":{"shasum":"3f5c0b62b89c5e254479365937441759ad04f493","tarball":"https://registry.npmjs.org/@byterm/agc-sdk/-/agc-sdk-0.2.0.tgz","fileCount":59,"integrity":"sha512-bktHXg4rVQr0NoCCb0xvF1oYBFhJGBX330Ju+xWVvH+lhJzGJsvmoGIFXgJxQvGJ7T4aBksBUSyC3JDt44IxeA==","signatures":[{"sig":"MEUCIExnFenN7h6jkFsMB3HjewdodhKD7A6V/9Q675PKgX2RAiEA9Qg/S2yY8b/jxpddZ6S2QZlgbMDlAZ6a4avb/HOi3fA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":127591},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18"},"scripts":{"build":"tsc -p tsconfig.json","clean":"rm -rf dist","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"number11","email":"term@const.net"},"repository":{"url":"git+https://gitcode.com/term-app/agc-ts.git","type":"git","directory":"packages/sdk"},"description":"AppGallery Connect API SDK for Node.js (Service Account auth)","directories":{},"sideEffects":false,"_nodeVersion":"24.2.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^7.0.2","@types/node":"^26.1.1"},"_npmOperationalInternal":{"tmp":"tmp/agc-sdk_0.2.0_1784373186474_0.2426497493300488","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@byterm/agc-sdk","version":"0.3.0","keywords":["appgallery","appgallery-connect","agc","huawei","harmonyos","api","sdk"],"author":"Term","license":"MIT","_id":"@byterm/agc-sdk@0.3.0","maintainers":[{"name":"number11","email":"term@const.net"}],"homepage":"https://gitcode.com/term-app/agc-ts#readme","bugs":"https://gitcode.com/term-app/agc-ts/issues","dist":{"shasum":"8601ee6e8fb99de15f948010fb8260f5c6447e2f","tarball":"https://registry.npmjs.org/@byterm/agc-sdk/-/agc-sdk-0.3.0.tgz","fileCount":59,"integrity":"sha512-7faMJaJoV1/6eHTXW+KWIfxy80zYwakM5ZULEu4xy2kyk6SDVASdUtVfylSEGj3bDSoyIssgV+rHOLwoz5t7zw==","signatures":[{"sig":"MEQCID4CDNT+JV9NYSBrIBDAUsqM5wWOORloA26CB90odnMbAiAmIKX96H+Q7ajNE6PRz4ZymJBJ0i3FNnYEMpJU69md6Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":127591},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18"},"scripts":{"build":"tsc -p tsconfig.json","clean":"rm -rf dist","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"number11","email":"term@const.net"},"repository":{"url":"git+https://gitcode.com/term-app/agc-ts.git","type":"git","directory":"packages/sdk"},"description":"AppGallery Connect API SDK for Node.js (Service Account auth)","directories":{},"sideEffects":false,"_nodeVersion":"24.2.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^7.0.2","@types/node":"^26.1.1"},"_npmOperationalInternal":{"tmp":"tmp/agc-sdk_0.3.0_1784989354922_0.730441660040656","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@byterm/agc-sdk","version":"0.4.0","keywords":["appgallery","appgallery-connect","agc","huawei","harmonyos","api","sdk"],"author":"Term","license":"MIT","_id":"@byterm/agc-sdk@0.4.0","maintainers":[{"name":"number11","email":"term@const.net"}],"homepage":"https://gitcode.com/term-app/agc-ts#readme","bugs":"https://gitcode.com/term-app/agc-ts/issues","dist":{"shasum":"13578f2d12c488d4b45d856363bcb5f502304ecb","tarball":"https://registry.npmjs.org/@byterm/agc-sdk/-/agc-sdk-0.4.0.tgz","fileCount":59,"integrity":"sha512-O5RWgBhcau60eCdXeW/Rz/8yY3ZYgysGX9gvOHeIFAHw/qXzIzLUog2ZKaLqsjQDS13lDltveXFp2LEMZvN7kg==","signatures":[{"sig":"MEUCIQCFHSt10XPVPtYZfPcWcajuwKxNcNffgvhFJPrhX2/p0AIgbsYQ7/eQbRZt1nGDaxyZRhtkdX6DOi/QlvSknQ1XnRM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":127591},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18"},"scripts":{"build":"tsc -p tsconfig.json","clean":"rm -rf dist","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"number11","email":"term@const.net"},"repository":{"url":"git+https://gitcode.com/term-app/agc-ts.git","type":"git","directory":"packages/sdk"},"description":"AppGallery Connect API SDK for Node.js (Service Account auth)","directories":{},"sideEffects":false,"_nodeVersion":"24.2.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^7.0.2","@types/node":"^26.1.1"},"_npmOperationalInternal":{"tmp":"tmp/agc-sdk_0.4.0_1785923825153_0.540571182635788","host":"s3://npm-registry-packages-npm-production"}},"0.4.1":{"name":"@byterm/agc-sdk","version":"0.4.1","keywords":["appgallery","appgallery-connect","agc","huawei","harmonyos","api","sdk"],"author":"Term","license":"MIT","_id":"@byterm/agc-sdk@0.4.1","maintainers":[{"name":"number11","email":"term@const.net"}],"homepage":"https://gitcode.com/term-app/agc-ts#readme","bugs":"https://gitcode.com/term-app/agc-ts/issues","dist":{"shasum":"5c0011219cfc4d52fa6e71a7103a3554251a5cee","tarball":"https://registry.npmjs.org/@byterm/agc-sdk/-/agc-sdk-0.4.1.tgz","fileCount":59,"integrity":"sha512-R7X6rDBbCPESiCx1xMHb8eFjeJdRkz1N26dhD1b5hU5RFdRyawQLyI1aeLGk+HVPAEcZc4ga+6zuBOi1a/yNPQ==","signatures":[{"sig":"MEUCIQC91tt9MNpPc1DVc75ln1S3orFBq3mJSOnNvvjr66NcKAIgRiltL0UMsm/4HegCwfRgJ3QWV534/c3FW2MAn6NUh8Q=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":127591},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18"},"scripts":{"build":"tsc -p tsconfig.json","clean":"rm -rf dist","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"number11","email":"term@const.net"},"repository":{"url":"git+https://gitcode.com/term-app/agc-ts.git","type":"git","directory":"packages/sdk"},"description":"AppGallery Connect API SDK for Node.js (Service Account auth)","directories":{},"sideEffects":false,"_nodeVersion":"24.2.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^7.0.2","@types/node":"^26.1.1"},"_npmOperationalInternal":{"tmp":"tmp/agc-sdk_0.4.1_1786007991379_0.2228119822149206","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@byterm/agc-sdk","version":"0.5.0","keywords":["appgallery","appgallery-connect","agc","huawei","harmonyos","api","sdk"],"author":"Term","license":"MIT","_id":"@byterm/agc-sdk@0.5.0","maintainers":[{"name":"number11","email":"term@const.net"}],"homepage":"https://gitcode.com/term-app/agc-ts#readme","bugs":"https://gitcode.com/term-app/agc-ts/issues","dist":{"shasum":"5ac440b66800cd08d84281d67900b82bd82985c9","tarball":"https://registry.npmjs.org/@byterm/agc-sdk/-/agc-sdk-0.5.0.tgz","fileCount":59,"integrity":"sha512-01FaQaYLEOP40ivFyLt6+Rj7t3FyOmTdiU4THv3ArpPQvvgbntYYttyljwqAH91pVr14r+i4l8O+fEjSwH5htQ==","signatures":[{"sig":"MEUCIDMdWIimbb9edJHbqFPfxfi1fUzczIHLdXHWV/aOMsmZAiEAvvxdS6RrFQD+GAJh5n/YMI5WujNUnWH61qZAElDpVGY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":133527},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18"},"scripts":{"build":"tsc -p tsconfig.json","clean":"rm -rf dist","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"number11","email":"term@const.net"},"repository":{"url":"git+https://gitcode.com/term-app/agc-ts.git","type":"git","directory":"packages/sdk"},"description":"AppGallery Connect API SDK for Node.js (Service Account auth)","directories":{},"sideEffects":false,"_nodeVersion":"24.2.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^7.0.2","@types/node":"^26.1.1"},"_npmOperationalInternal":{"tmp":"tmp/agc-sdk_0.5.0_1787207742865_0.6262059929191395","host":"s3://npm-registry-packages-npm-production"}},"0.6.0":{"name":"@byterm/agc-sdk","version":"0.6.0","keywords":["appgallery","appgallery-connect","agc","huawei","harmonyos","api","sdk"],"author":"Term","license":"MIT","_id":"@byterm/agc-sdk@0.6.0","maintainers":[{"name":"number11","email":"term@const.net"}],"homepage":"https://gitcode.com/term-app/agc-ts#readme","bugs":"https://gitcode.com/term-app/agc-ts/issues","dist":{"shasum":"b707db63e9b1967d2e3a90549a061ff0824dfb85","tarball":"https://registry.npmjs.org/@byterm/agc-sdk/-/agc-sdk-0.6.0.tgz","fileCount":59,"integrity":"sha512-OUYmDR02338h05Hlgq4YS2PD5X8uRaXctlhgVs0Dxe9Q4H625BJ5GsInMWXx1QVNKbrBfechpV0JmQAIacNIUQ==","signatures":[{"sig":"MEQCIElpB+nWI/eohVS/Hy/P2rumOeArE/v6vcHWLGhmWlf6AiBeQkuJMZfppHacdIMVAbEM+Px0SMskXi1BhtSFH6Tsmw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":133527},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18"},"scripts":{"build":"tsc -p tsconfig.json","clean":"rm -rf dist","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"number11","email":"term@const.net"},"repository":{"url":"git+https://gitcode.com/term-app/agc-ts.git","type":"git","directory":"packages/sdk"},"description":"AppGallery Connect API SDK for Node.js (Service Account auth)","directories":{},"sideEffects":false,"_nodeVersion":"24.2.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^7.0.2","@types/node":"^26.1.1"},"_npmOperationalInternal":{"tmp":"tmp/agc-sdk_0.6.0_1787212614102_0.1106775854899249","host":"s3://npm-registry-packages-npm-production"}},"0.7.0":{"name":"@byterm/agc-sdk","version":"0.7.0","keywords":["appgallery","appgallery-connect","agc","huawei","harmonyos","api","sdk"],"author":"Term","license":"MIT","_id":"@byterm/agc-sdk@0.7.0","maintainers":[{"name":"number11","email":"term@const.net"}],"homepage":"https://gitcode.com/term-app/agc-ts#readme","bugs":"https://gitcode.com/term-app/agc-ts/issues","dist":{"shasum":"5804cc2702686e23d6238dfde0dc71ce1d3e755a","tarball":"https://registry.npmjs.org/@byterm/agc-sdk/-/agc-sdk-0.7.0.tgz","fileCount":59,"integrity":"sha512-YWiUfQ14zPp9RKoeauMIzOVDuLTaAzS/Bf5bcK7i7blxzux9KjN7gtWMzZcgxuLn9ureuQbc6n+eeqT8jSLK0w==","signatures":[{"sig":"MEUCIEscDG3oA+zfF/7+OpdbChTYds+7FTsMeiEc6o1R9YNfAiEAv9gzx/cFxfSStjNgRbkVL1777wes/X0to9zB/4UXHJA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":151748},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18"},"scripts":{"build":"tsc -p tsconfig.json","clean":"rm -rf dist","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"number11","email":"term@const.net"},"repository":{"url":"git+https://gitcode.com/term-app/agc-ts.git","type":"git","directory":"packages/sdk"},"description":"AppGallery Connect API SDK for Node.js (Service Account auth)","directories":{},"sideEffects":false,"_nodeVersion":"24.2.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^7.0.2","@types/node":"^26.1.1"},"_npmOperationalInternal":{"tmp":"tmp/agc-sdk_0.7.0_1787414771090_0.06852934613218253","host":"s3://npm-registry-packages-npm-production"}},"0.8.0":{"name":"@byterm/agc-sdk","version":"0.8.0","keywords":["appgallery","appgallery-connect","agc","huawei","harmonyos","api","sdk"],"author":"Term","license":"MIT","_id":"@byterm/agc-sdk@0.8.0","maintainers":[{"name":"number11","email":"term@const.net"}],"homepage":"https://gitcode.com/term-app/agc-ts#readme","bugs":"https://gitcode.com/term-app/agc-ts/issues","dist":{"shasum":"98a5781d430ae8670d9d0c1ad2a3f0e046d1943d","tarball":"https://registry.npmjs.org/@byterm/agc-sdk/-/agc-sdk-0.8.0.tgz","fileCount":67,"integrity":"sha512-kC2ruE9C+n7a6Z1r2kEtes2PZi2w3rWqeH+U+SYg8ChHGXuiGwxTsMU7Ous7ryAqMFyCqWyab1h30pxzoMAcmg==","signatures":[{"sig":"MEQCIDwD9AEKVTUebHYKOzqAVvTendREJU2tGR3MK63FRU10AiArn9YXc9/sCZPvpY+DgUwKKtqqnM76E5MHzqg1Fy2OwQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":234952},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18"},"scripts":{"build":"tsc -p tsconfig.json","clean":"rm -rf dist","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"number11","email":"term@const.net"},"repository":{"url":"git+https://gitcode.com/term-app/agc-ts.git","type":"git","directory":"packages/sdk"},"description":"AppGallery Connect API SDK for Node.js (Service Account auth)","directories":{},"sideEffects":false,"_nodeVersion":"24.2.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^7.0.2","@types/node":"^26.1.1"},"_npmOperationalInternal":{"tmp":"tmp/agc-sdk_0.8.0_1789631004739_0.8997943361266729","host":"s3://npm-registry-packages-npm-production"}},"0.8.1":{"name":"@byterm/agc-sdk","version":"0.8.1","description":"AppGallery Connect API SDK for Node.js (Service Account auth)","keywords":["appgallery","appgallery-connect","agc","huawei","harmonyos","api","sdk"],"license":"MIT","author":"Term","repository":{"type":"git","url":"git+https://gitcode.com/term-app/agc-ts.git","directory":"packages/sdk"},"homepage":"https://gitcode.com/term-app/agc-ts#readme","bugs":"https://gitcode.com/term-app/agc-ts/issues","main":"dist/index.js","types":"dist/index.d.ts","sideEffects":false,"devDependencies":{"@types/node":"^26.1.1","typescript":"^7.0.2"},"publishConfig":{"access":"public"},"engines":{"node":">=18"},"scripts":{"build":"tsc -p tsconfig.json","clean":"rm -rf dist","typecheck":"tsc -p tsconfig.json --noEmit"},"_nodeVersion":"24.2.0","_id":"@byterm/agc-sdk@0.8.1","dist":{"integrity":"sha512-WV2i4Opzyxekj/7ywsTRxWuOHzm6+YtHIirMJq9fx2wmG2AzuiHUsBOG3uNgQmbu75xxtxSZ/C6ITJjkbiuWKQ==","shasum":"6a838668078dc59eff3e8c4ef714b1fc420fc872","tarball":"https://registry.npmjs.org/@byterm/agc-sdk/-/agc-sdk-0.8.1.tgz","fileCount":71,"unpackedSize":250576,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCKYHi5sOT8h/7VJhkuwZpM2vTeIwMa8CmksHm46rmtfgIhAP5L0joZtuk6yHe8CRqgk0qWj9jgsG8+Y6nLaSOm0eHU"}]},"_npmUser":{"name":"number11","email":"term@const.net"},"directories":{},"maintainers":[{"name":"number11","email":"term@const.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/agc-sdk_0.8.1_1789633145571_0.5370313204740231"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-17T13:58:38.903Z","modified":"2026-09-17T08:19:05.913Z","0.1.0":"2026-07-17T03:54:20.553Z","0.1.1":"2026-07-17T10:38:40.776Z","0.1.2":"2026-07-17T13:58:39.243Z","0.2.0":"2026-07-18T11:13:06.640Z","0.3.0":"2026-07-25T14:22:35.047Z","0.4.0":"2026-08-05T09:57:05.542Z","0.4.1":"2026-08-06T09:19:51.526Z","0.5.0":"2026-08-20T06:35:43.019Z","0.6.0":"2026-08-20T07:56:54.287Z","0.7.0":"2026-08-22T16:06:11.267Z","0.8.0":"2026-09-17T07:43:24.864Z","0.8.1":"2026-09-17T08:19:05.719Z"},"bugs":"https://gitcode.com/term-app/agc-ts/issues","author":"Term","license":"MIT","homepage":"https://gitcode.com/term-app/agc-ts#readme","keywords":["appgallery","appgallery-connect","agc","huawei","harmonyos","api","sdk"],"repository":{"type":"git","url":"git+https://gitcode.com/term-app/agc-ts.git","directory":"packages/sdk"},"description":"AppGallery Connect API SDK for Node.js (Service Account auth)","maintainers":[{"name":"number11","email":"term@const.net"}],"readme":"# @byterm/agc-sdk\n\nA typed Node.js + TypeScript client for the **AppGallery Connect (AGC) API**,\nusing **Service Account** authentication. Part of the\n[`agc-ts`](https://gitcode.com/term-app/agc-ts) monorepo — see also\n[`@byterm/agc-cli`](https://www.npmjs.com/package/@byterm/agc-cli) for the\ncommand-line tool.\n\n## Requirements\n\n- Node.js >= 18 (uses the built-in `fetch` and WebCrypto)\n\n## Install\n\n```bash\nnpm i @byterm/agc-sdk\n```\n\n## Authentication (Service Account + API Client for PMS)\n\n1. In AGC → **Users and permissions → API key → Connect API → Service Account**,\n   create a **developer-level** Service Account and download the\n   `*.private.json` credential file.\n2. Pass that file to `AgcClient.fromFile(...)`.\n\nThe SDK signs a **PS256 JWT** (`RSASSA-PSS`, SHA-256) from `key_id`,\n`sub_account` and `private_key`, and sends it directly as\n`Authorization: Bearer <jwt>`. Tokens are cached and refreshed automatically\n(1 h lifetime, refreshed ~5 min early). There is **no** separate token-exchange\nstep for Service Account auth.\n\n**PMS is the exception**: it rejects Service Account JWTs (401) and requires an\n**API Client** (OAuth2 `client_credentials` exchange against\n`/api/oauth2/v1/token`, ~48 h tokens). The API Client must be **team-level\n(project = N/A)** with an **administrator** role — a project-scoped client gets\n403 on every PMS call. Pass it via `new AgcClient({ credentials, apiClient })`\nor `AgcClient.fromApiClientFile(path)`.\n\n> Keep the credential file secret — never commit it.\n\n## Usage\n\n```ts\nimport { AgcClient } from '@byterm/agc-sdk';\n\nconst agc = AgcClient.fromFile('./my-key.private.json', { site: 'CN' });\n\nconst res = await agc.publishing.getAppInfo({ appId: '1234567890', lang: 'zh-CN' });\nconsole.log(res.appInfo?.versionNumber);\n\n// Upload a package and bind it\nconst { objectId } = await agc.upload.uploadFile({ appId: '1234567890', filePath: './app.app' });\nawait agc.publishing.updatePackageInfo('1234567890', { fileName: 'app.app', objectId });\nawait agc.publishing.submitPublish({ appId: '1234567890' });\n```\n\nErrors are typed: `AgcCredentialsError`, `AgcHttpError` (transport/non-2xx),\n`AgcApiError` (2xx with non-zero `ret.code`). The client automatically checks\nthe `ret` envelope and throws `AgcApiError` on business failures.\n\n## Resource coverage\n\n`agc.publishing`, `agc.provisioning`, `agc.testing`, `agc.reports`,\n`agc.upload`, `agc.domain`, `agc.pms` — covering the Publishing, Provisioning, Testing,\nReports, Upload Management, Domain Management and PMS (digital product\nmanagement) API groups. Method names map\n1:1 to AGC endpoints. For anything not yet wrapped, drop to the raw client:\n`agc.http.get(...)` / `.post(...)` etc., which still applies auth and the\n`ret` check.\n\nPMS uses the `{ error: { errorCode, errorMsg } }` envelope instead of `ret`\n(non-zero `errorCode` throws `AgcApiError`) and requires **API Client auth**\n(see Authentication above) — every request carries `Authorization: Bearer\n<access_token>` plus `client_id` (the API Client's id) and `appId` headers.\n\n## Region sites\n\n| Site | Domain |\n| --- | --- |\n| CN | `connect-api.cloud.huawei.com` |\n| DE | `connect-api-dre.cloud.huawei.com` |\n| SG | `connect-api-dra.cloud.huawei.com` |\n| RU | `connect-api-drru.cloud.huawei.com` |\n\nThe site must match the project's configured data-processing location.\n\n## License\n\nMIT © Term\n","readmeFilename":""}